Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / drivers / scsi / wd7000.c
index 553a5f1..fb54a87 100644 (file)
@@ -589,7 +589,7 @@ typedef union icb {
 
 #ifdef MODULE
 static char *wd7000;
-MODULE_PARM(wd7000, "s");
+module_param(wd7000, charp, 0);
 #endif
 
 /*
@@ -1429,16 +1429,16 @@ static int wd7000_detect(struct scsi_host_template *tpnt)
                                                break;
 
                                if (i == pass) {
-                                       void *biosaddr = ioremap(wd7000_biosaddr[biosaddr_ptr] + signatures[sig_ptr].ofs,
+                                       void __iomem *biosaddr = ioremap(wd7000_biosaddr[biosaddr_ptr] + signatures[sig_ptr].ofs,
                                                                 signatures[sig_ptr].len);
-                                       short bios_match = 0;
+                                       short bios_match = 1;
 
                                        if (biosaddr)
-                                               bios_match = memcmp((char *) biosaddr, signatures[sig_ptr].sig, signatures[sig_ptr].len);
+                                               bios_match = check_signature(biosaddr, signatures[sig_ptr].sig, signatures[sig_ptr].len);
 
                                        iounmap(biosaddr);
 
-                                       if (!bios_match)
+                                       if (bios_match)
                                                goto bios_matched;
                                }
                        }
@@ -1473,8 +1473,7 @@ static int wd7000_detect(struct scsi_host_template *tpnt)
                         * ASC reset...
                         */
                        outb(ASC_RES, iobase + ASC_CONTROL);
-                       set_current_state(TASK_UNINTERRUPTIBLE);
-                       schedule_timeout(HZ / 100);
+                       msleep(10);
                        outb(0, iobase + ASC_CONTROL);
 
                        if (WAIT(iobase + ASC_STAT, ASC_STATMASK, CMD_RDY, 0)) {
@@ -1587,9 +1586,16 @@ static int wd7000_host_reset(struct scsi_cmnd *SCpnt)
 {
        Adapter *host = (Adapter *) SCpnt->device->host->hostdata;
 
-       if (wd7000_adapter_reset(host) < 0)
+       spin_unlock_irq(SCpnt->device->host->host_lock);
+
+       if (wd7000_adapter_reset(host) < 0) {
+               spin_unlock_irq(SCpnt->device->host->host_lock);
                return FAILED;
+       }
+
        wd7000_enable_intr(host);
+
+       spin_unlock_irq(SCpnt->device->host->host_lock);
        return SUCCESS;
 }