Commit 87b79a53 authored by Moger, Babu's avatar Moger, Babu Committed by James Bottomley

[SCSI] scsi_dh_rdac: move the init code from rdac_activate to rdac_bus_attach

Moving the initialization code from rdac_activate to rdac_bus_attach which is
more efficient.  We don't have to collect all the information during every
activate.
Signed-off-by: default avatarBabu Moger <babu.moger@lsi.com>
Reviewed-by: default avatarVijay Chauhan <vijay.chauhan@lsi.com>
Reviewed-by: default avatarBob Stankey <Robert.stankey@lsi.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent e71044ee
...@@ -525,17 +525,6 @@ static int rdac_activate(struct scsi_device *sdev) ...@@ -525,17 +525,6 @@ static int rdac_activate(struct scsi_device *sdev)
if (err != SCSI_DH_OK) if (err != SCSI_DH_OK)
goto done; goto done;
if (!h->ctlr) {
err = initialize_controller(sdev, h);
if (err != SCSI_DH_OK)
goto done;
}
if (h->ctlr->use_ms10 == -1) {
err = set_mode_select(sdev, h);
if (err != SCSI_DH_OK)
goto done;
}
if (h->lun_state == RDAC_LUN_UNOWNED) if (h->lun_state == RDAC_LUN_UNOWNED)
err = send_mode_select(sdev, h); err = send_mode_select(sdev, h);
done: done:
...@@ -681,12 +670,20 @@ static int rdac_bus_attach(struct scsi_device *sdev) ...@@ -681,12 +670,20 @@ static int rdac_bus_attach(struct scsi_device *sdev)
if (err != SCSI_DH_OK) if (err != SCSI_DH_OK)
goto failed; goto failed;
err = check_ownership(sdev, h); err = initialize_controller(sdev, h);
if (err != SCSI_DH_OK) if (err != SCSI_DH_OK)
goto failed; goto failed;
err = check_ownership(sdev, h);
if (err != SCSI_DH_OK)
goto clean_ctlr;
err = set_mode_select(sdev, h);
if (err != SCSI_DH_OK)
goto clean_ctlr;
if (!try_module_get(THIS_MODULE)) if (!try_module_get(THIS_MODULE))
goto failed; goto clean_ctlr;
spin_lock_irqsave(sdev->request_queue->queue_lock, flags); spin_lock_irqsave(sdev->request_queue->queue_lock, flags);
sdev->scsi_dh_data = scsi_dh_data; sdev->scsi_dh_data = scsi_dh_data;
...@@ -698,6 +695,9 @@ static int rdac_bus_attach(struct scsi_device *sdev) ...@@ -698,6 +695,9 @@ static int rdac_bus_attach(struct scsi_device *sdev)
return 0; return 0;
clean_ctlr:
kref_put(&h->ctlr->kref, release_controller);
failed: failed:
kfree(scsi_dh_data); kfree(scsi_dh_data);
sdev_printk(KERN_ERR, sdev, "%s: not attached\n", sdev_printk(KERN_ERR, sdev, "%s: not attached\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment