Commit 4065a413 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by James Bottomley

[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: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 6d5e9fd1
...@@ -436,29 +436,20 @@ ahd_linux_queue(struct scsi_cmnd * cmd, void (*scsi_done) (struct scsi_cmnd *)) ...@@ -436,29 +436,20 @@ ahd_linux_queue(struct scsi_cmnd * cmd, void (*scsi_done) (struct scsi_cmnd *))
{ {
struct ahd_softc *ahd; struct ahd_softc *ahd;
struct ahd_linux_device *dev = scsi_transport_device_data(cmd->device); struct ahd_linux_device *dev = scsi_transport_device_data(cmd->device);
int rtn = SCSI_MLQUEUE_HOST_BUSY;
unsigned long flags;
ahd = *(struct ahd_softc **)cmd->device->host->hostdata; ahd = *(struct ahd_softc **)cmd->device->host->hostdata;
/* ahd_lock(ahd, &flags);
* Close the race of a command that was in the process of if (ahd->platform_data->qfrozen == 0) {
* being queued to us just as our simq was frozen. Let cmd->scsi_done = scsi_done;
* DV commands through so long as we are only frozen to cmd->result = CAM_REQ_INPROG << 16;
* perform DV. rtn = ahd_linux_run_command(ahd, dev, cmd);
*/
if (ahd->platform_data->qfrozen != 0) {
printf("%s: queue frozen\n", ahd_name(ahd));
return SCSI_MLQUEUE_HOST_BUSY;
} }
ahd_unlock(ahd, &flags);
/* return rtn;
* Save the callback on completion function.
*/
cmd->scsi_done = scsi_done;
cmd->result = CAM_REQ_INPROG << 16;
return ahd_linux_run_command(ahd, dev, cmd);
} }
static inline struct scsi_target ** static inline struct scsi_target **
...@@ -1081,7 +1072,6 @@ ahd_linux_register_host(struct ahd_softc *ahd, struct scsi_host_template *templa ...@@ -1081,7 +1072,6 @@ ahd_linux_register_host(struct ahd_softc *ahd, struct scsi_host_template *templa
*((struct ahd_softc **)host->hostdata) = ahd; *((struct ahd_softc **)host->hostdata) = ahd;
ahd_lock(ahd, &s); ahd_lock(ahd, &s);
scsi_assign_lock(host, &ahd->platform_data->spin_lock);
ahd->platform_data->host = host; ahd->platform_data->host = host;
host->can_queue = AHD_MAX_QUEUE; host->can_queue = AHD_MAX_QUEUE;
host->cmd_per_lun = 2; host->cmd_per_lun = 2;
...@@ -2062,6 +2052,7 @@ ahd_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag) ...@@ -2062,6 +2052,7 @@ ahd_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag)
int wait; int wait;
int disconnected; int disconnected;
ahd_mode_state saved_modes; ahd_mode_state saved_modes;
unsigned long flags;
pending_scb = NULL; pending_scb = NULL;
paused = FALSE; paused = FALSE;
...@@ -2077,7 +2068,7 @@ ahd_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag) ...@@ -2077,7 +2068,7 @@ ahd_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag)
printf(" 0x%x", cmd->cmnd[cdb_byte]); printf(" 0x%x", cmd->cmnd[cdb_byte]);
printf("\n"); printf("\n");
spin_lock_irq(&ahd->platform_data->spin_lock); ahd_lock(ahd, &flags);
/* /*
* First determine if we currently own this command. * First determine if we currently own this command.
...@@ -2291,7 +2282,8 @@ ahd_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag) ...@@ -2291,7 +2282,8 @@ ahd_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag)
int ret; int ret;
ahd->platform_data->flags |= AHD_SCB_UP_EH_SEM; ahd->platform_data->flags |= AHD_SCB_UP_EH_SEM;
spin_unlock_irq(&ahd->platform_data->spin_lock); ahd_unlock(ahd, &flags);
init_timer(&timer); init_timer(&timer);
timer.data = (u_long)ahd; timer.data = (u_long)ahd;
timer.expires = jiffies + (5 * HZ); timer.expires = jiffies + (5 * HZ);
...@@ -2305,9 +2297,8 @@ ahd_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag) ...@@ -2305,9 +2297,8 @@ ahd_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag)
printf("Timer Expired\n"); printf("Timer Expired\n");
retval = FAILED; retval = FAILED;
} }
spin_lock_irq(&ahd->platform_data->spin_lock);
} }
spin_unlock_irq(&ahd->platform_data->spin_lock); ahd_unlock(ahd, &flags);
return (retval); return (retval);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment