]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/scsi/nsp32.c
Merge master.kernel.org:/pub/scm/linux/kernel/git/acme/net-2.6
[linux-2.6-omap-h63xx.git] / drivers / scsi / nsp32.c
index 029cef4ad69451ad34bceda848b1ce24fe60795f..6367f009cd74b5d70ce32b47041b0c59896ce474 100644 (file)
@@ -2719,9 +2719,7 @@ static int nsp32_detect(Scsi_Host_Template *sht)
        host->unique_id = data->BaseAddress;
        host->n_io_port = data->NumAddress;
        host->base      = (unsigned long)data->MmioAddress;
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,63))
-       scsi_set_device(host, &PCIDEV->dev);
-#else
+#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,63))
        scsi_set_pci_device(host, PCIDEV);
 #endif
 
@@ -2987,6 +2985,8 @@ static int nsp32_eh_bus_reset(struct scsi_cmnd *SCpnt)
        nsp32_hw_data *data = (nsp32_hw_data *)SCpnt->device->host->hostdata;
        unsigned int   base = SCpnt->device->host->io_port;
 
+       spin_lock_irq(SCpnt->device->host->host_lock);
+
        nsp32_msg(KERN_INFO, "Bus Reset");      
        nsp32_dbg(NSP32_DEBUG_BUSRESET, "SCpnt=0x%x", SCpnt);
 
@@ -2994,6 +2994,7 @@ static int nsp32_eh_bus_reset(struct scsi_cmnd *SCpnt)
        nsp32_do_bus_reset(data);
        nsp32_write2(base, IRQ_CONTROL, 0);
 
+       spin_unlock_irq(SCpnt->device->host->host_lock);
        return SUCCESS; /* SCSI bus reset is succeeded at any time. */
 }
 
@@ -3048,11 +3049,14 @@ static int nsp32_eh_host_reset(struct scsi_cmnd *SCpnt)
        nsp32_msg(KERN_INFO, "Host Reset");     
        nsp32_dbg(NSP32_DEBUG_BUSRESET, "SCpnt=0x%x", SCpnt);
 
+       spin_lock_irq(SCpnt->device->host->host_lock);
+
        nsp32hw_init(data);
        nsp32_write2(base, IRQ_CONTROL, IRQ_CONTROL_ALL_IRQ_MASK);
        nsp32_do_bus_reset(data);
        nsp32_write2(base, IRQ_CONTROL, 0);
 
+       spin_unlock_irq(SCpnt->device->host->host_lock);
        return SUCCESS; /* Host reset is succeeded at any time. */
 }