]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/s390/cio/chsc.c
[S390] cio: Fix race for "fast" path gone/path back situations.
[linux-2.6-omap-h63xx.git] / drivers / s390 / cio / chsc.c
index 007aaeb4f53214533f7dc8c6b8bca62922d28442..b6a40c20780d824aeee4074dfae55ac5c0bb7baa 100644 (file)
@@ -217,6 +217,8 @@ void chsc_chp_offline(struct chp_id chpid)
 
        if (chp_get_status(chpid) <= 0)
                return;
+       /* Wait until previous actions have settled. */
+       css_wait_for_slow_path();
        for_each_subchannel_staged(s390_subchannel_remove_chpid, NULL, &chpid);
 }
 
@@ -303,7 +305,8 @@ static void s390_process_res_acc (struct res_acc_data *res_data)
                sprintf(dbf_txt, "fla%x", res_data->fla);
                CIO_TRACE_EVENT( 2, dbf_txt);
        }
-
+       /* Wait until previous actions have settled. */
+       css_wait_for_slow_path();
        /*
         * I/O resources may have become accessible.
         * Scan through all subchannels that may be concerned and
@@ -561,9 +564,12 @@ void chsc_chp_online(struct chp_id chpid)
        sprintf(dbf_txt, "cadd%x.%02x", chpid.cssid, chpid.id);
        CIO_TRACE_EVENT(2, dbf_txt);
 
-       if (chp_get_status(chpid) != 0)
+       if (chp_get_status(chpid) != 0) {
+               /* Wait until previous actions have settled. */
+               css_wait_for_slow_path();
                for_each_subchannel_staged(__chp_add, __chp_add_new_sch,
                                           &chpid);
+       }
 }
 
 static void __s390_subchannel_vary_chpid(struct subchannel *sch,
@@ -650,6 +656,8 @@ __s390_vary_chpid_on(struct subchannel_id schid, void *data)
  */
 int chsc_chp_vary(struct chp_id chpid, int on)
 {
+       /* Wait until previous actions have settled. */
+       css_wait_for_slow_path();
        /*
         * Redo PathVerification on the devices the chpid connects to
         */