]> git.hungrycats.org Git - linux/commitdiff
[PATCH] move scsi_add_host back to where it belongs in aacraid
authorChristoph Hellwig <hch@lst.de>
Mon, 20 Sep 2004 17:17:07 +0000 (13:17 -0400)
committerChristoph Hellwig <hch@lst.de>
Mon, 20 Sep 2004 17:17:07 +0000 (13:17 -0400)
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 <James.Bottomley@SteelEye.com>
drivers/scsi/aacraid/linit.c

index 214ebb454283ff23b23da14ce15dfa1be80a9e13..197cc4f0e3e11b026586a81b0906ba300647b406 100644 (file)
@@ -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);