scsi uodate to remove io_request_lock
PATCH 1/1 scsi uodate to remove io_request_lock
Hello, Jens Axboe, Linus Torvalds and other linux kernel hackers.
Here is patch against 2.5.3-pre5 which removes io_request_lock. But unfortunnually here is 1 file (drivers/scsi/3w-xxxx.c), which still use spinning locks with io_request_lock because of detect() method, in which we cann't send Scsi_Host pointer. So this file must be corrected in some other way.
Also ./drivers/mtd/mtdblock_ro.c file still use this lock.
So, please check and apply.
Thanks in advance for answers and suggestions.
Evgeniy Polyakov ( s0mbre ).
Only in ./linux/drivers/scsi/: .depend
linux/drivers/scsi/3w-xxxx.c renamed from linux.orig/drivers/scsi/3w-xxxx.c +6 -6
@@ -1326,7 +1326,7 @@TW_Command *command_packet;if (test_and_set_bit (TW_IN_INTR , &tw_dev->flags))return ; -spin_lock_irqsave (&io_request_lock, flags); +spin_lock_irqsave (&tw_dev->host->host_lock, flags);if (tw_dev->tw_pci_dev->irq == irq) {spin_lock (&tw_dev->tw_lock);
@@ -1475,7 +1475,7 @@ }spin_unlock (&tw_dev->tw_lock); } -spin_unlock_irqrestore (&io_request_lock, flags); +spin_unlock_irqrestore (&tw_dev->host->host_lock, flags);clear_bit (TW_IN_INTR , &tw_dev->flags); }/* End tw_interrupt() */
@@ -1929,9 +1929,9 @@ }/* We have to let AEN requests through before the reset */ -spin_unlock_irq (&io_request_lock); +spin_unlock_irq (&tw_dev->host->host_lock);mdelay (TW_AEN_WAIT_TIME ); -spin_lock_irq (&io_request_lock); +spin_lock_irq (&tw_dev->host->host_lock);spin_lock (&tw_dev->tw_lock); tw_dev->num_aborts++;
@@ -1993,9 +1993,9 @@ }/* We have to let AEN requests through before the reset */ -spin_unlock_irq (&io_request_lock); +spin_unlock_irq (&tw_dev->host->host_lock);mdelay (TW_AEN_WAIT_TIME ); -spin_lock_irq (&io_request_lock); +spin_lock_irq (&tw_dev->host->host_lock);spin_lock (&tw_dev->tw_lock); tw_dev->num_resets++;
Only in ./linux/drivers/scsi/: 3w-xxxx.c~
linux/drivers/scsi/53c7,8xx.c renamed from linux.orig/drivers/scsi/53c7,8xx.c +6 -4
@@ -1108,9 +1108,9 @@if (!search) {#ifdef __powerpc__ -if (request_irq (host->irq, do_NCR53c7x0_intr,SA_SHIRQ ,"53c7,8xx" ,NULL )) +if (request_irq (host->irq, do_NCR53c7x0_intr,SA_SHIRQ ,"53c7,8xx" , host)) #else - if (request_irq(host->irq, do_NCR53c7x0_intr, SA_INTERRUPT, "53c7,8xx", NULL)) + if (request_irq(host->irq, do_NCR53c7x0_intr, SA_INTERRUPT, "53c7,8xx", host))#endif {
@@ -4360,9 +4360,11 @@ do_NCR53c7x0_intr(int irq, void *dev_id, struct pt_regs * regs) { unsigned long flags; -spin_lock_irqsave (&io_request_lock, flags); +struct Scsi_Host *dev = dev_id; + +spin_lock_irqsave (&dev->host_lock, flags);NCR53c7x0_intr (irq, dev_id, regs); -spin_unlock_irqrestore (&io_request_lock, flags); +spin_unlock_irqrestore (&dev->host_lock, flags); }/*
Only in ./linux/drivers/scsi/: 53c7,8xx.c~
linux/drivers/scsi/53c700.c renamed from linux.orig/drivers/scsi/53c700.c +2 -13
@@ -1508,18 +1508,7 @@__u8 pun =0xff , lun =0xff ;unsigned long flags; -/* Unfortunately, we have to take the io_request_lock here -* rather than the host lock hostdata->lock because we're -* looking to exclude queuecommand from messing with the -* registers while we're processing the interrupt. Since -* queuecommand is called holding io_request_lock, and we have -* to take io_request_lock before we call the command -* scsi_done, we would get a deadlock if we took -* hostdata->lock here and in queuecommand (because the order -* of locking in queuecommand: 1) io_request_lock then 2) -* hostdata->lock would be the reverse of taking it in this -* routine */ -spin_lock_irqsave (&io_request_lock, flags); +spin_lock_irqsave (&host->host_lock, flags);if ((istat =NCR_700_readb (host,ISTAT_REG )) & (SCSI_INT_PENDING |DMA_INT_PENDING )) {__u32 dsps;
@@ -1764,7 +1753,7 @@ } } out_unlock: -spin_unlock_irqrestore (&io_request_lock, flags); +spin_unlock_irqrestore (&host->host_lock, flags); }/* FIXME: Need to put some proc information in and plumb it
Only in ./linux/drivers/scsi/: 53c700.c~
linux/drivers/scsi/AM53C974.c renamed from linux.orig/drivers/scsi/AM53C974.c +4 -3
@@ -1021,10 +1021,11 @@static void do_AM53C974_intr (int irq,void *dev_id,struct pt_regs *regs) {unsigned long flags; - -spin_lock_irqsave (&io_request_lock, flags); +struct Scsi_Host *dev = dev_id; + +spin_lock_irqsave (&dev->hpst_lock, flags);AM53C974_intr (irq, dev_id, regs); -spin_unlock_irqrestore (&io_request_lock, flags); +spin_unlock_irqrestore (&dev->host_lock, flags); }/************************************************************************
Only in ./linux/drivers/scsi/: AM53C974.c~
linux/drivers/scsi/NCR5380.c renamed from linux.orig/drivers/scsi/NCR5380.c +18 -16
@@ -692,9 +692,9 @@ }restore_flags (flags); -spin_lock_irqsave (&io_request_lock, flags); +spin_lock_irqsave (&instance->host_lock, flags);run_main (); -spin_unlock_irqrestore (&io_request_lock, flags); +spin_unlock_irqrestore (&instance->host_lock, flags); }#endif /* def USLEEP */
@@ -745,7 +745,7 @@NCR5380_setup (instance);for (trying_irqs = i =0 , mask =1 ; i <16 ; ++i, mask <<=1 ) -if ((mask & possible) && (request_irq (i, &probe_intr,SA_INTERRUPT ,"NCR-probe" ,NULL ) +if ((mask & possible) && (request_irq (i, &probe_intr,SA_INTERRUPT ,"NCR-probe" , instance) ==0 )) trying_irqs |= mask;
@@ -1271,7 +1271,7 @@* this should prevent any race conditions. */ -spin_unlock_irq (&io_request_lock); +spin_unlock_irq (&instance->host_lock);save_flags (flags);
@@ -1424,7 +1424,7 @@break ; }/* for instance */ }while (!done); -spin_lock_irq (&io_request_lock); +spin_lock_irq (&instance->host_lock);/* cli();*/ main_running =0 ; }
@@ -1521,10 +1521,10 @@ {unsigned long timeout = jiffies +NCR_TIMEOUT ; -spin_unlock_irq (&io_request_lock); +spin_unlock_irq (&instance->host_lock);while (NCR5380_read (BUS_AND_STATUS_REG ) &BASR_ACK &&time_before (jiffies, timeout)); -spin_lock_irq (&io_request_lock); +spin_lock_irq (&instance->host_lock);if (time_after_eq (jiffies, timeout) ) printk("scsi%d: timeout at NCR5380.c:%d\n",
@@ -1554,10 +1554,12 @@static void do_NCR5380_intr (int irq,void *dev_id,struct pt_regs *regs) {unsigned long flags; - -spin_lock_irqsave (&io_request_lock, flags); + +struct Scsi_Host *dev = dev_id; + +spin_lock_irqsave (&dev->host_lock, flags);NCR5380_intr (irq, dev_id, regs); -spin_unlock_irqrestore (&io_request_lock, flags); +spin_unlock_irqrestore (&dev->host_lock, flags); }#endif
@@ -1669,12 +1671,12 @@ {unsigned long timeout = jiffies +2 *NCR_TIMEOUT ; -spin_unlock_irq (&io_request_lock); +spin_unlock_irq (&instance->host_lock);while (!(NCR5380_read (INITIATOR_COMMAND_REG ) &ICR_ARBITRATION_PROGRESS ) &&time_before (jiffies,timeout)); -spin_lock_irq (&io_request_lock); +spin_lock_irq (&instance->host_lock);if (time_after_eq (jiffies,timeout)) {printk ("scsi: arbitration timeout at %d\n" , __LINE__);
@@ -1834,10 +1836,10 @@ hostdata->selecting =0 ;/* clear this pointer, because we passed the waiting period */ #else -spin_unlock_irq (&io_request_lock); +spin_unlock_irq (&instance->host_lock);while (time_before (jiffies, timeout) && !(NCR5380_read (STATUS_REG ) & (SR_BSY |SR_IO ))); -spin_lock_irq (&io_request_lock); +spin_lock_irq (&instance->host_lock);#endif if ((NCR5380_read (STATUS_REG ) & (SR_SEL |SR_IO )) == (SR_SEL |SR_IO )) {
@@ -1905,9 +1907,9 @@ {unsigned long timeout = jiffies +NCR_TIMEOUT ; -spin_unlock_irq (&io_request_lock); +spin_unlock_irq (&instance->host_lock);while (!(NCR5380_read (STATUS_REG ) &SR_REQ ) &&time_before (jiffies, timeout)); -spin_lock_irq (&io_request_lock); +spin_lock_irq (&instance->host_lock);if (time_after_eq (jiffies, timeout)) {printk ("scsi%d: timeout at NCR5380.c:%d\n" , instance->host_no, __LINE__);
Only in ./linux/drivers/scsi/: NCR5380.c~
linux/drivers/scsi/NCR53C9x.c renamed from linux.orig/drivers/scsi/NCR53C9x.c +7 -5
@@ -3546,9 +3546,10 @@struct NCR_ESP *esp;unsigned long flags;int again; +struct Scsi_Host *dev = dev_id;/* Handle all ESP interrupts showing at this IRQ level. */ -spin_lock_irqsave (&io_request_lock, flags); +spin_lock_irqsave (&dev->host_lock, flags); repeat: again =0 ;for_each_esp (esp) {
@@ -3572,7 +3573,7 @@ }if (again) goto repeat; -spin_unlock_irqrestore (&io_request_lock, flags); +spin_unlock_irqrestore (&dev->host_lock, flags); }#else /* For SMP we only service one ESP on the list list at our IRQ level! */
@@ -3580,9 +3581,10 @@ {struct NCR_ESP *esp;unsigned long flags; - +struct Scsi_Host *dev = dev_id; +/* Handle all ESP interrupts showing at this IRQ level. */ -spin_lock_irqsave (&io_request_lock, flags); +spin_lock_irqsave (&dev->host_lock, flags);for_each_esp (esp) {if (((esp)->irq &0xf ) == irq) {if (esp->dma_irq_p (esp)) {
@@ -3599,7 +3601,7 @@ } } out: -spin_unlock_irqrestore (&io_request_lock, flags); +spin_unlock_irqrestore (&dev->host_lock, flags); }#endif
Only in ./linux/drivers/scsi/: NCR53C9x.c~
linux/drivers/scsi/NCR53c406a.c renamed from linux.orig/drivers/scsi/NCR53c406a.c +5 -4
@@ -537,7 +537,7 @@DEB (printk ("NCR53c406a: using port_base %x\n" , port_base));if (irq_level >0 ) { -if (request_irq (irq_level, do_NCR53c406a_intr,0 ,"NCR53c406a" ,NULL )){ +if (request_irq (irq_level, do_NCR53c406a_intr,0 ,"NCR53c406a" , shpnt)){printk ("NCR53c406a: unable to allocate IRQ %d\n" , irq_level); goto err_release; }
@@ -780,10 +780,11 @@static void do_NCR53c406a_intr (int unused,void *dev_id,struct pt_regs *regs){unsigned long flags; - -spin_lock_irqsave (&io_request_lock, flags); +struct Scsi_Host * dev = dev_id; + +spin_lock_irqsave (&dev->host_lock, flags);NCR53c406a_intr (0 , dev_id, regs); -spin_unlock_irqrestore (&io_request_lock, flags); +spin_unlock_irqrestore (&dev->host_lock, flags); } static void
Only in ./linux/drivers/scsi/: NCR53c406a.c~
linux/drivers/scsi/a2091.c renamed from linux.orig/drivers/scsi/a2091.c +2 -2
@@ -40,9 +40,9 @@continue ;if (status &ISTR_INTS ) { -spin_lock_irqsave (&io_request_lock, flags); +spin_lock_irqsave (&instance->host_lock, flags);wd33c93_intr (instance); -spin_unlock_irqrestore (&io_request_lock, flags); +spin_unlock_irqrestore (&instance->host_lock, flags); } } }
Only in ./linux/drivers/scsi/: a2091.c~
linux/drivers/scsi/a3000.c renamed from linux.orig/drivers/scsi/a3000.c +4 -3
@@ -30,14 +30,15 @@ {unsigned long flags;unsigned int status =DMA (a3000_host)->ISTR; - +struct Scsi_Host *dev = dummy; +if (!(status &ISTR_INT_P ))return ;if (status &ISTR_INTS ) { -spin_lock_irqsave (&io_request_lock, flags); +spin_lock_irqsave (&dev->host_lock, flags);wd33c93_intr (a3000_host); -spin_unlock_irqrestore (&io_request_lock, flags); +spin_unlock_irqrestore (&dev->host_lock, flags); }else printk ("Non-serviced A3000 SCSI-interrupt? ISTR = %02x\n" , status);
Only in ./linux/drivers/scsi/: a3000.c~ Only in ./linux/drivers/scsi/aic7xxx: .depend
linux/drivers/scsi/atp870u.c renamed from linux.orig/drivers/scsi/atp870u.c +2 -2
@@ -433,7 +433,7 @@/* * Complete the command */ -spin_lock_irqsave (&io_request_lock, flags); +spin_lock_irqsave (&workrequ->host->host_lock, flags); (*workrequ->scsi_done) (workrequ);/*
@@ -441,7 +441,7 @@*/ dev->id[target_id].curr_req =0 ; dev->working--; -spin_unlock_irqrestore (&io_request_lock, flags); +spin_unlock_irqrestore (&workrequ->host->host_lock, flags);/* * Take it back wide */
Only in ./linux/drivers/scsi/: atp870u.c~
linux/drivers/scsi/blz1230.c renamed from linux.orig/drivers/scsi/blz1230.c +1 -1
@@ -137,7 +137,7 @@ esp->irq =IRQ_AMIGA_PORTS ; esp->slot = board+REAL_BLZ1230_ESP_ADDR ;if (request_irq (IRQ_AMIGA_PORTS , esp_intr,SA_SHIRQ , -"Blizzard 1230 SCSI IV" , esp_intr)) +"Blizzard 1230 SCSI IV" , esp->ehost)) goto err_out;/* Figure out our scsi ID on the bus */
Only in ./linux/drivers/scsi/: blz1230.c~
linux/drivers/scsi/blz2060.c renamed from linux.orig/drivers/scsi/blz2060.c +1 -1
@@ -115,7 +115,7 @@ esp->irq =IRQ_AMIGA_PORTS ;request_irq (IRQ_AMIGA_PORTS , esp_intr,SA_SHIRQ , -"Blizzard 2060 SCSI" , esp_intr); +"Blizzard 2060 SCSI" , esp->ehost);/* Figure out our scsi ID on the bus */ esp->scsi_id =7 ;
Only in ./linux/drivers/scsi/: blz2060.c~
linux/drivers/scsi/cyberstorm.c renamed from linux.orig/drivers/scsi/cyberstorm.c +1 -1
@@ -136,7 +136,7 @@ esp->irq =IRQ_AMIGA_PORTS ;request_irq (IRQ_AMIGA_PORTS , esp_intr,SA_SHIRQ , -"CyberStorm SCSI" , esp_intr); +"CyberStorm SCSI" , esp->ehost);/* Figure out our scsi ID on the bus */ /* The DMA cond flag contains a hardcoded jumper bit * which can be used to select host number 6 or 7.
Only in ./linux/drivers/scsi/: cyberstorm.c~
linux/drivers/scsi/cyberstormII.c renamed from linux.orig/drivers/scsi/cyberstormII.c +1 -1
@@ -130,7 +130,7 @@ esp->irq =IRQ_AMIGA_PORTS ;request_irq (IRQ_AMIGA_PORTS , esp_intr,SA_SHIRQ , -"CyberStorm SCSI Mk II" , esp_intr); +"CyberStorm SCSI Mk II" , esp->ehost);/* Figure out our scsi ID on the bus */ esp->scsi_id =7 ;
Only in ./linux/drivers/scsi/: cyberstormII.c~
linux/drivers/scsi/dec_esp.c renamed from linux.orig/drivers/scsi/dec_esp.c +3 -3
@@ -189,10 +189,10 @@esp_initialize (esp);if (request_irq (esp->irq, esp_intr,SA_INTERRUPT , -"NCR 53C94 SCSI" ,NULL )) +"NCR 53C94 SCSI" , esp->ehost)) goto err_dealloc;if (request_irq (SCSI_DMA_INT , scsi_dma_int,SA_INTERRUPT , -"JUNKIO SCSI DMA" ,NULL )) +"JUNKIO SCSI DMA" , esp->ehost)) goto err_free_irq; }
@@ -253,7 +253,7 @@ esp->dma_advance_sg =0 ;if (request_irq (esp->irq, esp_intr,SA_INTERRUPT , -"PMAZ_AA" ,NULL )) { +"PMAZ_AA" , esp->ehost)) {esp_deallocate (esp);release_tc_card (slot);continue ;
Only in ./linux/drivers/scsi/: dec_esp.c~
linux/drivers/scsi/dtc.c renamed from linux.orig/drivers/scsi/dtc.c +1 -1
@@ -259,7 +259,7 @@/* With interrupts enabled, it will sometimes hang when doing heavy * reads. So better not enable them until I finger it out. */ if (instance->irq !=IRQ_NONE ) -if (request_irq (instance->irq, do_dtc_intr,SA_INTERRUPT ,"dtc" )) { +if (request_irq (instance->irq, do_dtc_intr,SA_INTERRUPT ,"dtc" , instance)) {printk ("scsi%d : IRQ%d not free, interrupts disabled\n" , instance->host_no, instance->irq); instance->irq =IRQ_NONE ;
Only in ./linux/drivers/scsi/: dtc.c~
linux/drivers/scsi/eata_dma.c renamed from linux.orig/drivers/scsi/eata_dma.c +5 -4
@@ -229,10 +229,11 @@void do_eata_int_handler (int irq,void *dev_id,struct pt_regs * regs) {unsigned long flags; - -spin_lock_irqsave (&io_request_lock, flags); +struct Scsi_Host *dev = dev_id; + +spin_lock_irqsave (&dev->host_lock, flags);eata_int_handler (irq, dev_id, regs); -spin_unlock_irqrestore (&io_request_lock, flags); +spin_unlock_irqrestore (&dev->host_lock, flags); }void eata_int_handler (int irq,void *dev_id,struct pt_regs * regs)
@@ -1503,7 +1504,7 @@if (reg_IRQ[i] >=1 ){/* exchange the interrupt handler which */ free_irq (i,NULL );/* we used for probing with the real one */ request_irq (i, (void *)(do_eata_int_handler),SA_INTERRUPT |SA_SHIRQ , -"eata_dma" ,NULL ); +"eata_dma" , first_HBA);/* Check it */ } }
Only in ./linux/drivers/scsi/: eata_dma.c~
linux/drivers/scsi/eata_pio.c renamed from linux.orig/drivers/scsi/eata_pio.c +18 -15
@@ -110,10 +110,11 @@void do_eata_pio_int_handler (int irq,void *dev_id,struct pt_regs * regs) {unsigned long flags; - -spin_lock_irqsave (&io_request_lock, flags); +struct Scsi_Host *dev = dev_id; + +spin_lock_irqsave (&dev->host_lock, flags);eata_pio_int_handler (irq, dev_id, regs); -spin_unlock_irqrestore (&io_request_lock, flags); +spin_unlock_irqrestore (&dev->host_lock, flags); }void eata_pio_int_handler (int irq,void *dev_id,struct pt_regs * regs)
@@ -704,34 +705,36 @@return (FALSE); } +request_region (base,8 ,"eata_pio" ); + + size =sizeof (hostdata) + (sizeof (struct eata_ccb ) *ntohs (gc->queuesiz)); + + sh =scsi_register (tpnt, size); +if (sh ==NULL ) + { +release_region (base,8 ); +return FALSE; + } +if (!reg_IRQ[gc->IRQ]) {/* Interrupt already registered ? */ if (!request_irq (gc->IRQ, do_eata_pio_int_handler,SA_INTERRUPT , -"EATA-PIO" ,NULL )){ +"EATA-PIO" , sh)){ reg_IRQ[gc->IRQ]++;if (!gc->IRQ_TR) reg_IRQL[gc->IRQ] = TRUE;/* IRQ is edge triggered */ }else {printk ("Couldn't allocate IRQ %d, Sorry.\n" , gc->IRQ); +release_region (base,8 );return (FALSE); } }else {/* More than one HBA on this IRQ */ if (reg_IRQL[gc->IRQ] == TRUE) {printk ("Can't support more than one HBA on this IRQ,\n" " if the IRQ is edge triggered. Sorry.\n" ); +release_region (base,8 );return (FALSE); }else reg_IRQ[gc->IRQ]++; - } - -request_region (base,8 ,"eata_pio" ); - - size =sizeof (hostdata) + (sizeof (struct eata_ccb ) *ntohs (gc->queuesiz)); - - sh =scsi_register (tpnt, size); -if (sh ==NULL ) - { -release_region (base,8 ); -return FALSE; } hd =SD (sh);
Only in ./linux/drivers/scsi/: eata_pio.c~
linux/drivers/scsi/esp.c renamed from linux.orig/drivers/scsi/esp.c +1 -1
@@ -813,7 +813,7 @@* sanely maintain. */ if (request_irq (esp->ehost->irq, esp_intr, -SA_SHIRQ ,"ESP SCSI" , esp)) { +SA_SHIRQ ,"ESP SCSI" , esp->ehost)) {printk ("esp%d: Cannot acquire irq line\n" , esp->esp_id);return -1 ;
Only in ./linux/drivers/scsi/: esp.c~
linux/drivers/scsi/fastlane.c renamed from linux.orig/drivers/scsi/fastlane.c +1 -1
@@ -167,7 +167,7 @@ esp->irq =IRQ_AMIGA_PORTS ; esp->slot = board+FASTLANE_ESP_ADDR ;if (request_irq (IRQ_AMIGA_PORTS , esp_intr,SA_SHIRQ , -"Fastlane SCSI" , esp_intr)) { +"Fastlane SCSI" , esp->ehost)) {printk (KERN_WARNING "Fastlane: Could not get IRQ%d, aborting.\n" ,IRQ_AMIGA_PORTS ); goto err_unmap; }
Only in ./linux/drivers/scsi/: fastlane.c~
linux/drivers/scsi/fd_mcs.c renamed from linux.orig/drivers/scsi/fd_mcs.c +8 -8
@@ -740,9 +740,9 @@#if EVERY_ACCESS printk (" AFAIL " );#endif -spin_lock_irqsave (&io_request_lock, flags); +spin_lock_irqsave (&shpnt->host_lock, flags);my_done ( shpnt,DID_BUS_BUSY <<16 ); -spin_unlock_irqrestore (&io_request_lock, flags); +spin_unlock_irqrestore (&shpnt->host_lock, flags);return ; } current_SC->SCp.phase = in_selection;
@@ -766,9 +766,9 @@#if EVERY_ACCESS printk (" SFAIL " );#endif -spin_lock_irqsave (&io_request_lock, flags); +spin_lock_irqsave (&shpnt->host_lock, flags);my_done ( shpnt,DID_NO_CONNECT <<16 ); -spin_unlock_irqrestore (&io_request_lock, flags); +spin_unlock_irqrestore (&shpnt->host_lock, flags);return ; }else {#if EVERY_ACCESS
@@ -1117,11 +1117,11 @@#if EVERY_ACCESS printk ("BEFORE MY_DONE. . ." );#endif -spin_lock_irqsave (&io_request_lock, flags); +spin_lock_irqsave (&shpnt->host_lock, flags);my_done ( shpnt, (current_SC->SCp.Status &0xff ) | ((current_SC->SCp.Message &0xff ) <<8 ) | (DID_OK <<16 ) ); -spin_unlock_irqrestore (&io_request_lock, flags); +spin_unlock_irqrestore (&shpnt->host_lock, flags);#if EVERY_ACCESS printk ("RETURNING.\n" );#endif
@@ -1342,9 +1342,9 @@restore_flags ( flags );/* Aborts are not done well. . . */ -spin_lock_irqsave (&io_request_lock, flags); +spin_lock_irqsave (&shpnt->host_lock, flags);my_done ( shpnt,DID_ABORT <<16 ); -spin_unlock_irqrestore (&io_request_lock, flags); +spin_unlock_irqrestore (&shpnt->host_lock, flags);return SCSI_ABORT_SUCCESS ; }
Only in ./linux/drivers/scsi/: fd_mcs.c~
linux/drivers/scsi/gdth.c renamed from linux.orig/drivers/scsi/gdth.c +10 -10
@@ -629,19 +629,19 @@#define GDTH_LOCK_HA (ha,flags) spin_lock_irqsave(&(ha)->smp_lock,flags)#define GDTH_UNLOCK_HA (ha,flags) spin_unlock_irqrestore(&(ha)->smp_lock,flags) -#define GDTH_LOCK_SCSI_DONE (flags) spin_lock_irqsave(&io_request_lock,flags) -#define GDTH_UNLOCK_SCSI_DONE (flags) spin_unlock_irqrestore(&io_request_lock,flags) -#define GDTH_LOCK_SCSI_DOCMD () spin_lock_irq(&io_request_lock) -#define GDTH_UNLOCK_SCSI_DOCMD () spin_unlock_irq(&io_request_lock) +#define GDTH_LOCK_SCSI_DONE (dev, flags) spin_lock_irqsave(&((struct Scsi_Host *)dev)->host_lock,flags) +#define GDTH_UNLOCK_SCSI_DONE (flags) spin_unlock_irqrestore(&((struct Scsi_Host *)dev)->host_lock,flags) +#define GDTH_LOCK_SCSI_DOCMD (dev) spin_lock_irq(&((struct Scsi_Host *)dev)->host_lock) +#define GDTH_UNLOCK_SCSI_DOCMD (dev) spin_unlock_irq(&((struct Scsi_Host *)dev)->host_lock)#else #define GDTH_INIT_LOCK_HA (ha) do {} while (0)#define GDTH_LOCK_HA (ha,flags) do {save_flags(flags); cli();} while (0)#define GDTH_UNLOCK_HA (ha,flags) do {restore_flags(flags);} while (0) -#define GDTH_LOCK_SCSI_DONE (flags) do {} while (0) -#define GDTH_UNLOCK_SCSI_DONE (flags) do {} while (0) -#define GDTH_LOCK_SCSI_DOCMD () do {} while (0) -#define GDTH_UNLOCK_SCSI_DOCMD () do {} while (0) +#define GDTH_LOCK_SCSI_DONE (dev, flags) do {} while (0) +#define GDTH_UNLOCK_SCSI_DONE (dev, flags) do {} while (0) +#define GDTH_LOCK_SCSI_DOCMD (dev) do {} while (0) +#define GDTH_UNLOCK_SCSI_DOCMD (dev) do {} while (0)#endif /* LILO and modprobe/insmod parameters */
@@ -3339,9 +3339,9 @@if (rval ==2 ) {gdth_putq (hanum,scp,scp->SCp.this_residual); }else if (rval ==1 ) { -GDTH_LOCK_SCSI_DONE (flags); +GDTH_LOCK_SCSI_DONE (scp->host, flags); scp->scsi_done (scp); -GDTH_UNLOCK_SCSI_DONE (flags); +GDTH_UNLOCK_SCSI_DONE (scp->host,flags); }gdth_next (hanum); }
Only in ./linux/drivers/scsi/: gdth.c~
linux/drivers/scsi/gvp11.c renamed from linux.orig/drivers/scsi/gvp11.c +2 -2
@@ -40,9 +40,9 @@if (!(status &GVP11_DMAC_INT_PENDING ))continue ; -spin_lock_irqsave (&io_request_lock, flags); +spin_lock_irqsave (&instance->host_lock, flags);wd33c93_intr (instance); -spin_unlock_irqrestore (&io_request_lock, flags); +spin_unlock_irqrestore (&instance->host_lock, flags); } }
Only in ./linux/drivers/scsi/: gvp11.c~
linux/drivers/scsi/ibmmca.c renamed from linux.orig/drivers/scsi/ibmmca.c +32 -32
216 lines not on this page · raw message
Only in ./linux/drivers/scsi/: ibmmca.c~
linux/drivers/scsi/ini9100u.c renamed from linux.orig/drivers/scsi/ini9100u.c +32 -24
145 lines not on this page · raw message
Only in ./linux/drivers/scsi/: ini9100u.c~
linux/drivers/scsi/inia100.c renamed from linux.orig/drivers/scsi/inia100.c +12 -12
@@ -717,19 +717,19 @@ } -static void subIntr (ORC_HCS * pHCB,int irqno) +static void subIntr (ORC_HCS * pHCB,int irqno,struct Scsi_Host *dev) {unsigned long flags; -spin_lock_irqsave (&io_request_lock, flags); +spin_lock_irqsave (&dev->host_lock, flags);if (pHCB->HCS_Intr != irqno) { -spin_unlock_irqrestore (&io_request_lock, flags); +spin_unlock_irqrestore (&dev->host_lock, flags);return ; }orc_interrupt (pHCB); -spin_unlock_irqrestore (&io_request_lock, flags); +spin_unlock_irqrestore (&dev->host_lock, flags); }/*
@@ -737,42 +737,42 @@*/ static void inia100_intr0 (int irqno,void *dev_id,struct pt_regs *regs) { -subIntr (&orc_hcs[0 ], irqno); +subIntr (&orc_hcs[0 ], irqno, dev_id); }static void inia100_intr1 (int irqno,void *dev_id,struct pt_regs *regs) { -subIntr (&orc_hcs[1 ], irqno); +subIntr (&orc_hcs[1 ], irqno, dev_id); }static void inia100_intr2 (int irqno,void *dev_id,struct pt_regs *regs) { -subIntr (&orc_hcs[2 ], irqno); +subIntr (&orc_hcs[2 ], irqno, dev_id); }static void inia100_intr3 (int irqno,void *dev_id,struct pt_regs *regs) { -subIntr (&orc_hcs[3 ], irqno); +subIntr (&orc_hcs[3 ], irqno, dev_id); }static void inia100_intr4 (int irqno,void *dev_id,struct pt_regs *regs) { -subIntr (&orc_hcs[4 ], irqno); +subIntr (&orc_hcs[4 ], irqno, dev_id); }static void inia100_intr5 (int irqno,void *dev_id,struct pt_regs *regs) { -subIntr (&orc_hcs[5 ], irqno); +subIntr (&orc_hcs[5 ], irqno, dev_id); }static void inia100_intr6 (int irqno,void *dev_id,struct pt_regs *regs) { -subIntr (&orc_hcs[6 ], irqno); +subIntr (&orc_hcs[6 ], irqno, dev_id); }static void inia100_intr7 (int irqno,void *dev_id,struct pt_regs *regs) { -subIntr (&orc_hcs[7 ], irqno); +subIntr (&orc_hcs[7 ], irqno, dev_id); }/*
Only in ./linux/drivers/scsi/: inia100.c~
linux/drivers/scsi/jazz_esp.c renamed from linux.orig/drivers/scsi/jazz_esp.c +1 -1
@@ -120,7 +120,7 @@ esp->irq =JAZZ_SCSI_IRQ ;request_irq (JAZZ_SCSI_IRQ , esp_intr,SA_INTERRUPT ,"JAZZ SCSI" , -NULL ); + esp->ehost);/* * FIXME, look if the scsi id is availabe from NVRAM
Only in ./linux/drivers/scsi/: jazz_esp.c~
linux/drivers/scsi/mac53c94.c renamed from linux.orig/drivers/scsi/mac53c94.c +4 -3
@@ -292,10 +292,11 @@ do_mac53c94_interrupt(int irq, void *dev_id, struct pt_regs *ptregs) { unsigned long flags; - -spin_lock_irqsave (&io_request_lock, flags); +struct Scsi_Host *dev = ((struct fsc_state *) dev_id)->current_req->host; + +spin_lock_irqsave (&dev->host_lock, flags);mac53c94_interrupt (irq, dev_id, ptregs); -spin_unlock_irqrestore (&io_request_lock, flags); +spin_unlock_irqrestore (&dev->host_lock, flags); } static void
Only in ./linux/drivers/scsi/: mac53c94.c~
linux/drivers/scsi/mac_esp.c renamed from linux.orig/drivers/scsi/mac_esp.c +3 -3
@@ -417,9 +417,9 @@ esp->irq =IRQ_MAC_SCSI ; -request_irq (IRQ_MAC_SCSI , esp_intr,0 ,"Mac ESP SCSI" , esp); +request_irq (IRQ_MAC_SCSI , esp_intr,0 ,"Mac ESP SCSI" , esp->ehost);#if 0 /* conflicts with IOP ADB */ -request_irq (IRQ_MAC_SCSIDRQ , fake_drq,0 ,"Mac ESP DRQ" , esp); +request_irq (IRQ_MAC_SCSIDRQ , fake_drq,0 ,"Mac ESP DRQ" , esp->ehost);#endif if (macintosh_config->scsi_type ==MAC_SCSI_QUADRA ) {
@@ -433,7 +433,7 @@ esp->irq =IRQ_MAC_SCSIDRQ ;#if 0 /* conflicts with IOP ADB */ -request_irq (IRQ_MAC_SCSIDRQ , esp_intr,0 ,"Mac ESP SCSI 2" , esp); +request_irq (IRQ_MAC_SCSIDRQ , esp_intr,0 ,"Mac ESP SCSI 2" , esp->ehost);#endif esp->cfreq =25000000 ;
Only in ./linux/drivers/scsi/: mac_esp.c~
linux/drivers/scsi/mca_53c9x.c renamed from linux.orig/drivers/scsi/mca_53c9x.c +1 -1
@@ -153,7 +153,7 @@ esp->slot = slot;if (request_irq (esp->irq, esp_intr,0 , -"NCR 53c9x SCSI" , esp_intr)) +"NCR 53c9x SCSI" , esp->ehost)) {printk ("Unable to request IRQ %d.\n" , esp->irq);esp_deallocate (esp);
Only in ./linux/drivers/scsi/: mca_53c9x.c~
linux/drivers/scsi/megaraid.c renamed from linux.orig/drivers/scsi/megaraid.c +2 -2
@@ -614,8 +614,8 @@#define DRIVER_LOCK (p)#define DRIVER_UNLOCK (p)#define IO_LOCK_T unsigned long io_flags = 0 -#define IO_LOCK (host) spin_lock_irqsave(&io_request_lock,io_flags); -#define IO_UNLOCK (host) spin_unlock_irqrestore(&io_request_lock,io_flags); +#define IO_LOCK (host) spin_lock_irqsave(&host->host_lock,io_flags); +#define IO_UNLOCK (host) spin_unlock_irqrestore(&host->host_lock,io_flags);#define pci_free_consistent (a,b,c,d)#define pci_unmap_single (a,b,c,d)
Only in ./linux/drivers/scsi/: megaraid.c~
linux/drivers/scsi/mesh.c renamed from linux.orig/drivers/scsi/mesh.c +7 -6
@@ -795,15 +795,15 @@unsigned long flags;for (;;) { -spin_lock_irqsave (&io_request_lock, flags); +spin_lock_irqsave (&ms->host->host_lock, flags); cmd = ms->completed_q;if (cmd ==NULL ) { -spin_unlock_irqrestore (&io_request_lock, flags); +spin_unlock_irqrestore (&ms->host->host_lock, flags);break ; } ms->completed_q = (Scsi_Cmnd *) cmd->host_scribble; (*cmd->scsi_done)(cmd); -spin_unlock_irqrestore (&io_request_lock, flags); +spin_unlock_irqrestore (&ms->host->host_lock, flags); } }#endif /* MESH_NEW_STYLE_EH */
@@ -1458,10 +1458,11 @@ do_mesh_interrupt(int irq, void *dev_id, struct pt_regs *ptregs) { unsigned long flags; - -spin_lock_irqsave (&io_request_lock, flags); +struct Scsi_Host *dev = ((struct mech_state *)dev_id)->host; + +spin_lock_irqsave (&dev->host_lock, flags);mesh_interrupt (irq, dev_id, ptregs); -spin_unlock_irqrestore (&io_request_lock, flags); +spin_unlock_irqrestore (&dev->host_lock, flags); }static void handle_error (struct mesh_state *ms)
Only in ./linux/drivers/scsi/: mesh.c~
linux/drivers/scsi/oktagon_esp.c renamed from linux.orig/drivers/scsi/oktagon_esp.c +1 -1
@@ -198,7 +198,7 @@ esp->irq =IRQ_AMIGA_PORTS ;request_irq (IRQ_AMIGA_PORTS , esp_intr,SA_SHIRQ , -"BSC Oktagon SCSI" , esp_intr); +"BSC Oktagon SCSI" , esp->ehost);/* Figure out our scsi ID on the bus */ esp->scsi_id =7 ;
Only in ./linux/drivers/scsi/: oktagon_esp.c~
linux/drivers/scsi/pas16.c renamed from linux.orig/drivers/scsi/pas16.c +1 -1
@@ -451,7 +451,7 @@ instance->irq =NCR5380_probe_irq (instance,PAS16_IRQS );if (instance->irq !=IRQ_NONE ) -if (request_irq (instance->irq, do_pas16_intr,SA_INTERRUPT ,"pas16" ,NULL )) { +if (request_irq (instance->irq, do_pas16_intr,SA_INTERRUPT ,"pas16" , instance)) {printk ("scsi%d : IRQ%d not free, interrupts disabled\n" , instance->host_no, instance->irq); instance->irq =IRQ_NONE ;
Only in ./linux/drivers/scsi/: pas16.c~ Only in ./linux/drivers/scsi/pcmcia: .depend
linux/drivers/scsi/ppa.c renamed from linux.orig/drivers/scsi/ppa.c +5 -7
@@ -119,7 +119,6 @@* unlock to allow the lowlevel parport driver to probe * the irqs */ -spin_unlock_irq (&io_request_lock); pb =parport_enumerate ();printk ("ppa: Version %s\n" ,PPA_VERSION );
@@ -128,7 +127,6 @@if (!pb) {printk ("ppa: parport reports no devices.\n" ); -spin_lock_irq (&io_request_lock);return 0 ; } retry_entry:
@@ -154,7 +152,7 @@"pardevice is owning the port for too longtime!\n" , i);parport_unregister_device (ppa_hosts[i].dev); -spin_lock_irq (&io_request_lock); +spin_lock_irq (&ppa_hosts[i].cur_cmd->host->host_lock);return 0 ; } }
@@ -223,13 +221,13 @@printk (" supported by the imm (ZIP Plus) driver. If the\n" );printk (" cable is marked with \"AutoDetect\", this is what has\n" );printk (" happened.\n" ); -spin_lock_irq (&io_request_lock); +spin_lock_irq (&hreg->host_lock);return 0 ; } try_again =1 ; goto retry_entry; }else { -spin_lock_irq (&io_request_lock); +spin_lock_irq (&hreg->host_lock);return 1 ;/* return number of hosts detected */ } }
@@ -847,9 +845,9 @@ tmp->cur_cmd =0 ; -spin_lock_irqsave (&io_request_lock, flags); +spin_lock_irqsave (&cmd->host->host_lock, flags); cmd->scsi_done (cmd); -spin_unlock_irqrestore (&io_request_lock, flags); +spin_unlock_irqrestore (&cmd->host->host_lock, flags);return ; }
Only in ./linux/drivers/scsi/: ppa.c~
linux/drivers/scsi/psi240i.c renamed from linux.orig/drivers/scsi/psi240i.c +5 -4
@@ -370,10 +370,11 @@static void do_Irq_Handler (int irq,void *dev_id,struct pt_regs *regs) {unsigned long flags; - -spin_lock_irqsave (&io_request_lock, flags); +struct Scsi_Host *dev = dev_id; + +spin_lock_irqsave (&dev->host_lock, flags);Irq_Handler (irq, dev_id, regs); -spin_unlock_irqrestore (&io_request_lock, flags); +spin_unlock_irqrestore (&dev->host_lock, flags); }/**************************************************************** * Name: Psi240i_QueueCommand
@@ -602,7 +603,7 @@save_flags (flags);cli (); -if (request_irq (chipConfig.irq, do_Irq_Handler,0 ,"psi240i" ,NULL ) ) +if (request_irq (chipConfig.irq, do_Irq_Handler,0 ,"psi240i" , pshost) ) {printk ("Unable to allocate IRQ for PSI-240I controller.\n" );restore_flags (flags);
Only in ./linux/drivers/scsi/: psi240i.c~
linux/drivers/scsi/qla1280.c renamed from linux.orig/drivers/scsi/qla1280.c +5 -5
@@ -1523,11 +1523,11 @@return ; }#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,1 ,95 ) -spin_lock_irqsave (&io_request_lock, cpu_flags); +spin_lock_irqsave (&ha->host->host_lock, cpu_flags);if (test_and_set_bit (QLA1280_IN_ISR_BIT , &ha->flags)) { COMTRACE('X') -spin_unlock_irqrestore (&io_request_lock, cpu_flags); +spin_unlock_irqrestore (&ha->host->host_lock, cpu_flags);return ; } ha->isr_count++;
@@ -1548,7 +1548,7 @@qla1280_done (ha, (srb_t **)&ha->done_q_first, (srb_t **)&ha->done_q_last);clear_bit (QLA1280_IN_ISR_BIT , &ha->flags); -spin_unlock_irqrestore (&io_request_lock, cpu_flags); +spin_unlock_irqrestore (&ha->host->host_lock, cpu_flags);#else /* LINUX_VERSION_CODE < KERNEL_VERSION(2,1,95) */ if (test_bit (QLA1280_IN_ISR_BIT , (int *)&ha->flags) )
@@ -1619,7 +1619,7 @@ COMTRACE('p')#if LINUX_VERSION_CODE >KERNEL_VERSION (2 ,1 ,95 ) -spin_lock_irqsave (&io_request_lock, cpu_flags); +spin_lock_irqsave (&ha->host->host_lock, cpu_flags);#endif if (ha->flags.isp_abort_needed)qla1280_abort_isp (ha);
@@ -1631,7 +1631,7 @@qla1280_done (ha, (srb_t **)&ha->done_q_first, (srb_t **)&ha->done_q_last); ha->flags.dpc_sched = FALSE;#if LINUX_VERSION_CODE >KERNEL_VERSION (2 ,1 ,95 ) -spin_unlock_irqrestore (&io_request_lock, cpu_flags); +spin_unlock_irqrestore (&ha->host->host_lock, cpu_flags);#endif }
Only in ./linux/drivers/scsi/: qla1280.c~
linux/drivers/scsi/seagate.c renamed from linux.orig/drivers/scsi/seagate.c +5 -4
@@ -503,7 +503,7 @@ hostno = instance->host_no;if (request_irq (irq, do_seagate_reconnect_intr,SA_INTERRUPT , (controller_type ==SEAGATE ) ?"seagate" :"tmc-8xx" , -NULL )) { + instance)) {printk ("scsi%d : unable to allocate IRQ%d\n" , hostno, irq);return 0 ; }
@@ -629,10 +629,11 @@static void do_seagate_reconnect_intr (int irq,void *dev_id,struct pt_regs *regs) {unsigned long flags; - -spin_lock_irqsave (&io_request_lock, flags); +struct Scsi_Host *dev = dev_id; + +spin_lock_irqsave (&dev->host_lock, flags);seagate_reconnect_intr (irq, dev_id, regs); -spin_unlock_irqrestore (&io_request_lock, flags); +spin_unlock_irqrestore (&dev->host_lock, flags); }static void seagate_reconnect_intr (int irq,void *dev_id,struct pt_regs *regs)
Only in ./linux/drivers/scsi/: seagate.c~
linux/drivers/scsi/sgiwd93.c renamed from linux.orig/drivers/scsi/sgiwd93.c +4 -3
@@ -66,10 +66,11 @@static void sgiwd93_intr (int irq,void *dev_id,struct pt_regs *regs) {unsigned long flags; - -spin_lock_irqsave (&io_request_lock, flags); +struct Scsi_Host *dev = dev_id; + +spin_lock_irqsave (&dev->host_lock, flags);wd33c93_intr ((struct Scsi_Host *) dev_id); -spin_unlock_irqrestore (&io_request_lock, flags); +spin_unlock_irqrestore (&dev->host_lock, flags); }#undef DEBUG_DMA
Only in ./linux/drivers/scsi/: sgiwd93.c~
linux/drivers/scsi/sun3x_esp.c renamed from linux.orig/drivers/scsi/sun3x_esp.c +1 -1
@@ -112,7 +112,7 @@ esp->irq =2 ;if (request_irq (esp->irq, esp_intr,SA_INTERRUPT , -"SUN3X SCSI" ,NULL )) { +"SUN3X SCSI" , esp->ehost)) {esp_deallocate (esp);return 0 ; }
Only in ./linux/drivers/scsi/: sun3x_esp.c~
linux/drivers/scsi/sym53c416.c renamed from linux.orig/drivers/scsi/sym53c416.c +16 -15
@@ -337,6 +337,7 @@static void sym53c416_intr_handle (int irq,void *dev_id,struct pt_regs *regs) { +struct Scsi_Host *dev = dev_id;int base =0 ;int i;unsigned long flags =0 ;
@@ -359,11 +360,11 @@ }/* Now we have the base address and we can start handling the interrupt */ -spin_lock_irqsave (&io_request_lock,flags); +spin_lock_irqsave (&dev->host_lock,flags); status_reg =inb (base +STATUS_REG ); pio_int_reg =inb (base +PIO_INT_REG ); int_reg =inb (base +INT_REG ); -spin_unlock_irqrestore (&io_request_lock, flags); +spin_unlock_irqrestore (&dev->host_lock, flags);/* First, we handle error conditions */ if (int_reg &SCI )/* SCSI Reset */
@@ -371,9 +372,9 @@printk (KERN_DEBUG "sym53c416: Reset received\n" ); current_command->SCp.phase = idle; current_command->result =DID_RESET <<16 ; -spin_lock_irqsave (&io_request_lock, flags); +spin_lock_irqsave (&dev->host_lock, flags); current_command->scsi_done (current_command); -spin_unlock_irqrestore (&io_request_lock, flags); +spin_unlock_irqrestore (&dev->host_lock, flags);return ; }if (int_reg &ILCMD )/* Illegal Command */
@@ -381,9 +382,9 @@printk (KERN_WARNING "sym53c416: Illegal Command: 0x%02x.\n" ,inb (base +COMMAND_REG )); current_command->SCp.phase = idle; current_command->result =DID_ERROR <<16 ; -spin_lock_irqsave (&io_request_lock, flags); +spin_lock_irqsave (&dev->host_lock, flags); current_command->scsi_done (current_command); -spin_unlock_irqrestore (&io_request_lock, flags); +spin_unlock_irqrestore (&dev->host_lock, flags);return ; }if (status_reg &GE )/* Gross Error */
@@ -391,9 +392,9 @@printk (KERN_WARNING "sym53c416: Controller reports gross error.\n" ); current_command->SCp.phase = idle; current_command->result =DID_ERROR <<16 ; -spin_lock_irqsave (&io_request_lock, flags); +spin_lock_irqsave (&dev->host_lock, flags); current_command->scsi_done (current_command); -spin_unlock_irqrestore (&io_request_lock, flags); +spin_unlock_irqrestore (&dev->host_lock, flags);return ; }if (status_reg &PE )/* Parity Error */
@@ -401,9 +402,9 @@printk (KERN_WARNING "sym53c416:SCSI parity error.\n" ); current_command->SCp.phase = idle; current_command->result =DID_PARITY <<16 ; -spin_lock_irqsave (&io_request_lock, flags); +spin_lock_irqsave (&dev->host_lock, flags); current_command->scsi_done (current_command); -spin_unlock_irqrestore (&io_request_lock, flags); +spin_unlock_irqrestore (&dev->host_lock, flags);return ; }if (pio_int_reg & (CE |OUE ))
@@ -411,9 +412,9 @@printk (KERN_WARNING "sym53c416: PIO interrupt error.\n" ); current_command->SCp.phase = idle; current_command->result =DID_ERROR <<16 ; -spin_lock_irqsave (&io_request_lock, flags); +spin_lock_irqsave (&dev->host_lock, flags); current_command->scsi_done (current_command); -spin_unlock_irqrestore (&io_request_lock, flags); +spin_unlock_irqrestore (&dev->host_lock, flags);return ; }if (int_reg &DIS )/* Disconnect */
@@ -423,9 +424,9 @@else current_command->result = (current_command->SCp.Status &0xFF ) | ((current_command->SCp.Message &0xFF ) <<8 ) | (DID_OK <<16 ); current_command->SCp.phase = idle; -spin_lock_irqsave (&io_request_lock, flags); +spin_lock_irqsave (&dev->host_lock, flags); current_command->scsi_done (current_command); -spin_unlock_irqrestore (&io_request_lock, flags); +spin_unlock_irqrestore (&dev->host_lock, flags);return ; }/* Now we handle SCSI phases */
@@ -719,7 +720,7 @@cli ();/* FIXME: Request_irq with CLI is not safe */ /* Request for specified IRQ */ -if (request_irq (hosts[i].irq, sym53c416_intr_handle,0 ,ID ,NULL )) +if (request_irq (hosts[i].irq, sym53c416_intr_handle,0 ,ID , shpnt)) {restore_flags (flags);printk (KERN_ERR "sym53c416: Unable to assign IRQ %d\n" , hosts[i].irq);
Only in ./linux/drivers/scsi/: sym53c416.c~ Only in ./linux/drivers/scsi/sym53c8xx_2: .depend
linux/drivers/scsi/t128.c renamed from linux.orig/drivers/scsi/t128.c +1 -1
@@ -248,7 +248,7 @@ instance->irq =NCR5380_probe_irq (instance,T128_IRQS );if (instance->irq !=IRQ_NONE ) -if (request_irq (instance->irq, do_t128_intr,SA_INTERRUPT ,"t128" ,NULL )) { +if (request_irq (instance->irq, do_t128_intr,SA_INTERRUPT ,"t128" , instance)) {printk ("scsi%d : IRQ%d not free, interrupts disabled\n" , instance->host_no, instance->irq); instance->irq =IRQ_NONE ;
Only in ./linux/drivers/scsi/: t128.c~
linux/drivers/scsi/tmscsim.c renamed from linux.orig/drivers/scsi/tmscsim.c +20 -20
@@ -304,8 +304,8 @@# define DC390_IFLAGS unsigned long iflags;# define DC390_DFLAGS unsigned long dflags; -# define DC390_LOCK_IO spin_lock_irqsave (&io_request_lock, iflags) -# define DC390_UNLOCK_IO spin_unlock_irqrestore (&io_request_lock, iflags) +# define DC390_LOCK_IO spin_lock_irqsave (&((struct Scsi_Host *)dev)->host_lock, iflags) +# define DC390_UNLOCK_IO spin_unlock_irqrestore (&((struct Scsi_Host *)dev)->host_lock, iflags)# define DC390_LOCK_DRV spin_lock_irqsave (&dc390_drvlock, dflags)# define DC390_UNLOCK_DRV spin_unlock_irqrestore (&dc390_drvlock, dflags)
@@ -331,8 +331,8 @@# define DC390_AFLAGS unsigned long aflags;# define DC390_IFLAGS # define DC390_DFLAGS unsigned long dflags; -# define DC390_LOCK_IO /* spin_lock_irqsave (&io_request_lock, iflags) */ -# define DC390_UNLOCK_IO /* spin_unlock_irqrestore (&io_request_lock, iflags) */ +# define DC390_LOCK_IO (dev)/* spin_lock_irqsave (&io_request_lock, iflags) */ +# define DC390_UNLOCK_IO (dev)/* spin_unlock_irqrestore (&io_request_lock, iflags) */ # define DC390_LOCK_DRV spin_lock_irqsave (&dc390_drvlock, dflags)# define DC390_UNLOCK_DRV spin_unlock_irqrestore (&dc390_drvlock, dflags)# define DC390_LOCK_DRV_NI spin_lock (&dc390_drvlock)
@@ -349,8 +349,8 @@# define DC390_IFLAGS unsigned long iflags;# define DC390_DFLAGS unsigned long dflags;spinlock_t dc390_drvlock =SPIN_LOCK_UNLOCKED ; -# define DC390_LOCK_IO spin_lock_irqsave (&io_request_lock, iflags) -# define DC390_UNLOCK_IO spin_unlock_irqrestore (&io_request_lock, iflags) +# define DC390_LOCK_IO (dev) spin_lock_irqsave (&((struct Scsi_Host *)dev)->host_lock, iflags) +# define DC390_UNLOCK_IO (dev) spin_unlock_irqrestore (&((struct Scsi_Host *)dev)->host_lock, iflags)# define DC390_LOCK_DRV spin_lock_irqsave (&dc390_drvlock, dflags)# define DC390_UNLOCK_DRV spin_unlock_irqrestore (&dc390_drvlock, dflags)# define DC390_LOCK_DRV_NI spin_lock (&dc390_drvlock)
@@ -1074,11 +1074,11 @@DC390_IFLAGS DC390_AFLAGS DEBUG0(printk ("DC390: Debug: Waiting queue woken up by timer!\n");) -DC390_LOCK_IO ; +DC390_LOCK_IO (pACB.pScsiHost);DC390_LOCK_ACB ;dc390_Waiting_process (pACB);DC390_UNLOCK_ACB ; -DC390_UNLOCK_IO ; +DC390_UNLOCK_IO (pACB.pScsiHost); }/***********************************************************************
@@ -2558,7 +2558,7 @@DC390_AFLAGS pos[length] =0 ; -DC390_LOCK_IO ; +DC390_LOCK_IO (pACB.pScsiHost);DC390_LOCK_ACB ;/* UPPERCASE */ /* Don't use kernel toupper, because of 2.0.x bug: ctmp unexported */
@@ -2726,7 +2726,7 @@DC390_UNLOCK_ACB ;if (needs_inquiry) {dc390_updateDCB (pACB, pDCB);dc390_inquiry (pACB, pDCB); }; -DC390_UNLOCK_IO ; +DC390_UNLOCK_IO (pACB.pScsiHost);return (length); einv2:
@@ -2734,7 +2734,7 @@ einv:/* spin_unlock (strtok_lock); */ DC390_UNLOCK_ACB ; -DC390_UNLOCK_IO ; +DC390_UNLOCK_IO (pACB.pScsiHost);printk (KERN_WARNING "DC390: parse error near \"%s\"\n" , (pos? pos:"NULL" ));return (-EINVAL );
@@ -2744,7 +2744,7 @@printk (KERN_WARNING "DC390: Driver reset requested!\n" );DC390_UNLOCK_ACB ;DC390_reset (&cmd,0 ); -DC390_UNLOCK_IO ; +DC390_UNLOCK_IO (pACB.pScsiHost); };return (length);
@@ -2752,7 +2752,7 @@ {dc390_dumpinfo (pACB,0 ,0 );DC390_UNLOCK_ACB ; -DC390_UNLOCK_IO ; +DC390_UNLOCK_IO (pACB.pScsiHost); }return (length);
@@ -2766,7 +2766,7 @@ dev, pDCB->TargetID, pDCB->TargetLUN);DC390_UNLOCK_ACB ;dc390_inquiry (pACB, pDCB); -DC390_UNLOCK_IO ; +DC390_UNLOCK_IO (pACB.pScsiHost); };return (length);
@@ -2781,7 +2781,7 @@/* TO DO: We should make sure no pending commands are left */ dc390_remove_dev (pACB, pDCB);DC390_UNLOCK_ACB ; -DC390_UNLOCK_IO ; +DC390_UNLOCK_IO (pACB.pScsiHost); };return (length);
@@ -2796,7 +2796,7 @@dc390_initDCB (pACB, &pDCB, id, lun);DC390_UNLOCK_ACB ;dc390_inquiry (pACB, pDCB); -DC390_UNLOCK_IO ; +DC390_UNLOCK_IO (pACB.pScsiHost); };return (length);
@@ -2812,7 +2812,7 @@DC390_UNLOCK_ACB ;dc390_sendstart (pACB, pDCB);dc390_inquiry (pACB, pDCB); -DC390_UNLOCK_IO ; +DC390_UNLOCK_IO (pACB.pScsiHost); };return (length);
@@ -2820,7 +2820,7 @@printk (KERN_WARNING "DC390: Ignore cmnd to illegal Dev(Idx) %i. Valid range: 0 - %i.\n" , dev, pACB->DCBCnt -1 );DC390_UNLOCK_ACB ; -DC390_UNLOCK_IO ; +DC390_UNLOCK_IO (pACB.pScsiHost);return (-EINVAL );
@@ -3041,7 +3041,7 @@ DC390_AFLAGS DC390_IFLAGSPACB pACB = (PACB )(host->hostdata); -DC390_LOCK_IO ; +DC390_LOCK_IO (host);DC390_LOCK_ACB ;/* TO DO: We should check for outstanding commands first. */
@@ -3056,7 +3056,7 @@release_region (host->io_port,host->n_io_port);dc390_freeDCBs (host);DC390_UNLOCK_ACB ; -DC390_UNLOCK_IO ; +DC390_UNLOCK_IO (host); return( 1 ); }#endif /* def MODULE */
drivers/scsi/ultrastor.c renamed from drivers/scsi/ultrastor.c~ +17 -10
@@ -500,7 +500,11 @@ config.mscp_free = ~0 ;#endif -if (request_irq (config.interrupt, do_ultrastor_interrupt,0 ,"Ultrastor" ,NULL )) { +/* +* Brrr, &config.mscp[0].SCint->host) it is something magical.... +* XXX and FIXME +*/ +if (request_irq (config.interrupt, do_ultrastor_interrupt,0 ,"Ultrastor" , &config.mscp[0 ].SCint->host)) {printk ("Unable to allocate IRQ%u for UltraStor controller.\n" , config.interrupt);return FALSE;
@@ -570,12 +574,7 @@printk ("U24F: invalid IRQ\n" );return FALSE; } -if (request_irq (config.interrupt, do_ultrastor_interrupt,0 ,"Ultrastor" ,NULL )) - { -printk ("Unable to allocate IRQ%u for UltraStor controller.\n" , - config.interrupt); -return FALSE; - } +/* BIOS addr set */ /* base port set */ config.port_address = addr;
@@ -605,6 +604,13 @@free_irq (config.interrupt, do_ultrastor_interrupt);return FALSE; } + +if (request_irq (config.interrupt, do_ultrastor_interrupt,0 ,"Ultrastor" , shpnt)) + { +printk ("Unable to allocate IRQ%u for UltraStor controller.\n" , + config.interrupt); +return FALSE; + } shpnt->irq = config.interrupt; shpnt->dma_channel = config.dma_channel;
@@ -1159,10 +1165,11 @@static void do_ultrastor_interrupt (int irq,void *dev_id,struct pt_regs *regs) {unsigned long flags; - -spin_lock_irqsave (&io_request_lock, flags); +struct Scsi_Host *dev = dev_id; + +spin_lock_irqsave (&dev->host_lock, flags);ultrastor_interrupt (irq, dev_id, regs); -spin_unlock_irqrestore (&io_request_lock, flags); +spin_unlock_irqrestore (&dev->host_lock, flags); }MODULE_LICENSE ("GPL" );
Quoted 3 lines · Evgeniy Polyakov
Hello, Jens Axboe, Linus Torvalds and other linux kernel hackers.
Here is patch against 2.5.3-pre5 which removes
io_request_lock.
You seem to be using &host->host_lock, which isn't quite right. SCSI adapters pass down a preferred lock with scsi_assign_lock, and host_lock _points_ to that lock. So you need to be using host->host_lock. A compile should have caught this error (build SMP, of course).
Quoted 4 lines
But unfortunnually here is 1 file (
drivers/scsi/3w-xxxx.c), which still use spinning locks withio_request_lockbecause ofdetect()method, in which we cann't sendScsi_Hostpointer. So this file must be corrected in some other way.
->detect() is not called with the lock held anymore...
Quoted 1 line
So, please check and apply.
You still have a bit of work to do :-)
Signature · 1 line
Jens Axboe