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

[SCSI] aic79xx: 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
4065a413 6d5e9fd1

+14 -23
+14 -23
drivers/scsi/aic7xxx/aic79xx_osm.c
··· 436 436 { 437 437 struct ahd_softc *ahd; 438 438 struct ahd_linux_device *dev = scsi_transport_device_data(cmd->device); 439 + int rtn = SCSI_MLQUEUE_HOST_BUSY; 440 + unsigned long flags; 439 441 440 442 ahd = *(struct ahd_softc **)cmd->device->host->hostdata; 441 443 442 - /* 443 - * Close the race of a command that was in the process of 444 - * being queued to us just as our simq was frozen. Let 445 - * DV commands through so long as we are only frozen to 446 - * perform DV. 447 - */ 448 - if (ahd->platform_data->qfrozen != 0) { 449 - printf("%s: queue frozen\n", ahd_name(ahd)); 444 + ahd_lock(ahd, &flags); 445 + if (ahd->platform_data->qfrozen == 0) { 446 + cmd->scsi_done = scsi_done; 447 + cmd->result = CAM_REQ_INPROG << 16; 448 + rtn = ahd_linux_run_command(ahd, dev, cmd); 450 449 451 - return SCSI_MLQUEUE_HOST_BUSY; 452 450 } 453 - 454 - /* 455 - * Save the callback on completion function. 456 - */ 457 - cmd->scsi_done = scsi_done; 458 - 459 - cmd->result = CAM_REQ_INPROG << 16; 460 - 461 - return ahd_linux_run_command(ahd, dev, cmd); 451 + ahd_unlock(ahd, &flags); 452 + return rtn; 462 453 } 463 454 464 455 static inline struct scsi_target ** ··· 1072 1081 1073 1082 *((struct ahd_softc **)host->hostdata) = ahd; 1074 1083 ahd_lock(ahd, &s); 1075 - scsi_assign_lock(host, &ahd->platform_data->spin_lock); 1076 1084 ahd->platform_data->host = host; 1077 1085 host->can_queue = AHD_MAX_QUEUE; 1078 1086 host->cmd_per_lun = 2; ··· 2052 2062 int wait; 2053 2063 int disconnected; 2054 2064 ahd_mode_state saved_modes; 2065 + unsigned long flags; 2055 2066 2056 2067 pending_scb = NULL; 2057 2068 paused = FALSE; ··· 2068 2077 printf(" 0x%x", cmd->cmnd[cdb_byte]); 2069 2078 printf("\n"); 2070 2079 2071 - spin_lock_irq(&ahd->platform_data->spin_lock); 2080 + ahd_lock(ahd, &flags); 2072 2081 2073 2082 /* 2074 2083 * First determine if we currently own this command. ··· 2282 2291 int ret; 2283 2292 2284 2293 ahd->platform_data->flags |= AHD_SCB_UP_EH_SEM; 2285 - spin_unlock_irq(&ahd->platform_data->spin_lock); 2294 + ahd_unlock(ahd, &flags); 2295 + 2286 2296 init_timer(&timer); 2287 2297 timer.data = (u_long)ahd; 2288 2298 timer.expires = jiffies + (5 * HZ); ··· 2297 2305 printf("Timer Expired\n"); 2298 2306 retval = FAILED; 2299 2307 } 2300 - spin_lock_irq(&ahd->platform_data->spin_lock); 2301 2308 } 2302 - spin_unlock_irq(&ahd->platform_data->spin_lock); 2309 + ahd_unlock(ahd, &flags); 2303 2310 return (retval); 2304 2311 } 2305 2312