Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[SCSI] aic7xxx: remove scsi_assign_lock usage

just take the internal lock in queuecommand instead. also switch
the only direct use of the internal lock to the wrappers used elsewhere.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>

authored by

Christoph Hellwig and committed by
James Bottomley
6d5e9fd1 cb0258a2

+16 -23
+16 -23
drivers/scsi/aic7xxx/aic7xxx_osm.c
··· 476 476 { 477 477 struct ahc_softc *ahc; 478 478 struct ahc_linux_device *dev = scsi_transport_device_data(cmd->device); 479 + int rtn = SCSI_MLQUEUE_HOST_BUSY; 480 + unsigned long flags; 479 481 480 482 ahc = *(struct ahc_softc **)cmd->device->host->hostdata; 481 483 482 - /* 483 - * Save the callback on completion function. 484 - */ 485 - cmd->scsi_done = scsi_done; 484 + ahc_lock(ahc, &flags); 485 + if (ahc->platform_data->qfrozen == 0) { 486 + cmd->scsi_done = scsi_done; 487 + cmd->result = CAM_REQ_INPROG << 16; 488 + rtn = ahc_linux_run_command(ahc, dev, cmd); 489 + } 490 + ahc_unlock(ahc, &flags); 486 491 487 - /* 488 - * Close the race of a command that was in the process of 489 - * being queued to us just as our simq was frozen. Let 490 - * DV commands through so long as we are only frozen to 491 - * perform DV. 492 - */ 493 - if (ahc->platform_data->qfrozen != 0) 494 - return SCSI_MLQUEUE_HOST_BUSY; 495 - 496 - cmd->result = CAM_REQ_INPROG << 16; 497 - 498 - return ahc_linux_run_command(ahc, dev, cmd); 492 + return rtn; 499 493 } 500 494 501 495 static inline struct scsi_target ** ··· 1073 1079 1074 1080 *((struct ahc_softc **)host->hostdata) = ahc; 1075 1081 ahc_lock(ahc, &s); 1076 - scsi_assign_lock(host, &ahc->platform_data->spin_lock); 1077 1082 ahc->platform_data->host = host; 1078 1083 host->can_queue = AHC_MAX_QUEUE; 1079 1084 host->cmd_per_lun = 2; ··· 2104 2111 int paused; 2105 2112 int wait; 2106 2113 int disconnected; 2114 + unsigned long flags; 2107 2115 2108 2116 pending_scb = NULL; 2109 2117 paused = FALSE; ··· 2119 2125 printf(" 0x%x", cmd->cmnd[cdb_byte]); 2120 2126 printf("\n"); 2121 2127 2122 - spin_lock_irq(&ahc->platform_data->spin_lock); 2128 + ahc_lock(ahc, &flags); 2123 2129 2124 2130 /* 2125 2131 * First determine if we currently own this command. ··· 2351 2357 int ret; 2352 2358 2353 2359 ahc->platform_data->flags |= AHC_UP_EH_SEMAPHORE; 2354 - spin_unlock_irq(&ahc->platform_data->spin_lock); 2360 + ahc_unlock(ahc, &flags); 2361 + 2355 2362 init_timer(&timer); 2356 2363 timer.data = (u_long)ahc; 2357 2364 timer.expires = jiffies + (5 * HZ); ··· 2366 2371 printf("Timer Expired\n"); 2367 2372 retval = FAILED; 2368 2373 } 2369 - spin_lock_irq(&ahc->platform_data->spin_lock); 2370 - } 2371 - 2372 - spin_unlock_irq(&ahc->platform_data->spin_lock); 2374 + } else 2375 + ahc_unlock(ahc, &flags); 2373 2376 return (retval); 2374 2377 } 2375 2378