]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/s390/scsi/zfcp_erp.c
pci: hotplug: pciehp: fix error code path in hpc_power_off_slot
[linux-2.6-omap-h63xx.git] / drivers / s390 / scsi / zfcp_erp.c
index 07fa824d179f203e3f9bbbf6b099e94206140e5a..2dc8110ebf74d7a5e5e3a37bcbb6e1883e1523c6 100644 (file)
@@ -131,7 +131,7 @@ static void zfcp_close_qdio(struct zfcp_adapter *adapter)
        debug_text_event(adapter->erp_dbf, 3, "qdio_down2a");
        while (qdio_shutdown(adapter->ccw_device,
                             QDIO_FLAG_CLEANUP_USING_CLEAR) == -EINPROGRESS)
-               msleep(1000);
+               ssleep(1);
        debug_text_event(adapter->erp_dbf, 3, "qdio_down2b");
 
        /* cleanup used outbound sbals */
@@ -456,7 +456,7 @@ zfcp_test_link(struct zfcp_port *port)
 
        zfcp_port_get(port);
        retval = zfcp_erp_adisc(port);
-       if (retval != 0) {
+       if (retval != 0 && retval != -EBUSY) {
                zfcp_port_put(port);
                ZFCP_LOG_NORMAL("reopen needed for port 0x%016Lx "
                                "on adapter %s\n ", port->wwpn,
@@ -846,7 +846,8 @@ zfcp_erp_strategy_check_fsfreq(struct zfcp_erp_action *erp_action)
        if (erp_action->fsf_req) {
                /* take lock to ensure that request is not deleted meanwhile */
                spin_lock(&adapter->req_list_lock);
-               if (zfcp_reqlist_find(adapter, erp_action->fsf_req->req_id)) {
+               if (zfcp_reqlist_find_safe(adapter, erp_action->fsf_req) &&
+                   erp_action->fsf_req->erp_action == erp_action) {
                        /* fsf_req still exists */
                        debug_text_event(adapter->erp_dbf, 3, "a_ca_req");
                        debug_event(adapter->erp_dbf, 3, &erp_action->fsf_req,
@@ -1285,7 +1286,7 @@ zfcp_erp_strategy_do_action(struct zfcp_erp_action *erp_action)
         * note: no lock in subsequent strategy routines
         * (this allows these routine to call schedule, e.g.
         * kmalloc with such flags or qdio_initialize & friends)
-        * Note: in case of timeout, the seperate strategies will fail
+        * Note: in case of timeout, the separate strategies will fail
         * anyhow. No need for a special action. Even worse, a nameserver
         * failure would not wake up waiting ports without the call.
         */
@@ -1609,7 +1610,6 @@ static void zfcp_erp_scsi_scan(struct work_struct *work)
        scsi_scan_target(&rport->dev, 0, rport->scsi_target_id,
                         unit->scsi_lun, 0);
        atomic_clear_mask(ZFCP_STATUS_UNIT_SCSI_WORK_PENDING, &unit->status);
-       wake_up(&unit->scsi_scan_wq);
        zfcp_unit_put(unit);
        kfree(p);
 }
@@ -1900,7 +1900,7 @@ zfcp_erp_adapter_strategy(struct zfcp_erp_action *erp_action)
                ZFCP_LOG_INFO("Waiting to allow the adapter %s "
                              "to recover itself\n",
                              zfcp_get_busid_by_adapter(adapter));
-               msleep(jiffies_to_msecs(ZFCP_TYPE2_RECOVERY_TIME));
+               ssleep(ZFCP_TYPE2_RECOVERY_TIME);
        }
 
        return retval;
@@ -2080,7 +2080,7 @@ zfcp_erp_adapter_strategy_open_qdio(struct zfcp_erp_action *erp_action)
        debug_text_event(adapter->erp_dbf, 3, "qdio_down1a");
        while (qdio_shutdown(adapter->ccw_device,
                             QDIO_FLAG_CLEANUP_USING_CLEAR) == -EINPROGRESS)
-               msleep(1000);
+               ssleep(1);
        debug_text_event(adapter->erp_dbf, 3, "qdio_down1b");
 
  failed_qdio_establish:
@@ -2165,7 +2165,7 @@ zfcp_erp_adapter_strategy_open_fsf_xconfig(struct zfcp_erp_action *erp_action)
                ZFCP_LOG_DEBUG("host connection still initialising... "
                               "waiting and retrying...\n");
                /* sleep a little bit before retry */
-               msleep(jiffies_to_msecs(sleep));
+               ssleep(sleep);
                sleep *= 2;
        }