[SCSI] zfcp: register with SCSI layer on ccw registration
authorSwen Schillig <swen@vnet.ibm.com>
Fri, 19 Dec 2008 15:56:53 +0000 (16:56 +0100)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Mon, 29 Dec 2008 17:24:35 +0000 (11:24 -0600)
Synchronize the registration and de-registration with the SCSI layer
at CCW registration, de-registration. Before we registered with the
SCSI layer on adapter activation. This way the reg and de-reg process
is in balance.

Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
drivers/s390/scsi/zfcp_aux.c
drivers/s390/scsi/zfcp_ccw.c

index e529b55b3ce9b486d1bfb55101c7de6981989998..f0f49feaa34f0a6e3b205c15101b1509952a74de 100644 (file)
@@ -534,7 +534,8 @@ int zfcp_adapter_enqueue(struct ccw_device *ccw_device)
 
        zfcp_fc_nameserver_init(adapter);
 
-       return 0;
+       if (!zfcp_adapter_scsi_register(adapter))
+               return 0;
 
 sysfs_failed:
        zfcp_adapter_debug_unregister(adapter);
index 728147131e1d426801198bde6ca10cda10141a9c..285881f076485bb47b6641a2d91c57f335a59f19 100644 (file)
@@ -106,10 +106,6 @@ static int zfcp_ccw_set_online(struct ccw_device *ccw_device)
        if (retval)
                goto out;
 
-       retval = zfcp_adapter_scsi_register(adapter);
-       if (retval)
-               goto out_scsi_register;
-
        /* initialize request counter */
        BUG_ON(!zfcp_reqlist_isempty(adapter));
        adapter->req_no = 0;
@@ -123,8 +119,6 @@ static int zfcp_ccw_set_online(struct ccw_device *ccw_device)
        flush_work(&adapter->scan_work);
        return 0;
 
- out_scsi_register:
-       zfcp_erp_thread_kill(adapter);
  out:
        up(&zfcp_data.config_sema);
        return retval;