From 15dbed6ce25a3d72addf51e957358344d657b441 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Mon, 20 Sep 2004 13:17:07 -0400 Subject: [PATCH] [PATCH] move scsi_add_host back to where it belongs in aacraid looks like you applied a premature version of the last aacraid patch. This one moves the scsi_add_host back so it's not called before the driver is ready to accept queued commands. Signed-off-by: James Bottomley --- drivers/scsi/aacraid/linit.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c index 214ebb454283f..197cc4f0e3e11 100644 --- a/drivers/scsi/aacraid/linit.c +++ b/drivers/scsi/aacraid/linit.c @@ -579,10 +579,6 @@ static int __devinit aac_probe_one(struct pci_dev *pdev, for (container = 0; container < MAXIMUM_NUM_CONTAINERS; container++) fsa_dev_ptr->devname[container][0] = '\0'; - error = scsi_add_host(shost, &pdev->dev); - if (error) - goto out_free_fibs; - if ((*aac_drivers[index].init)(aac)) goto out_free_fibs; @@ -619,12 +615,25 @@ static int __devinit aac_probe_one(struct pci_dev *pdev, shost->max_lun = AAC_MAX_LUN; pci_set_drvdata(pdev, shost); + + error = scsi_add_host(shost, &pdev->dev); + if (error) + goto out_deinit; scsi_scan_host(shost); return 0; +out_deinit: + kill_proc(aac->thread_pid, SIGKILL, 0); + wait_for_completion(&aac->aif_completion); + + aac_send_shutdown(aac); + fib_map_free(aac); + pci_free_consistent(aac->pdev, aac->comm_size, aac->comm_addr, aac->comm_phys); + kfree(aac->queues); + free_irq(pdev->irq, aac); + iounmap((void * )aac->regs.sa); out_free_fibs: - scsi_remove_host(shost); kfree(aac->fibs); out_free_host: scsi_host_put(shost); -- 2.53.0