Commit b2e88c97 authored by Hannes Reinecke's avatar Hannes Reinecke Committed by Martin K. Petersen

scsi: fdomain: Drop last argument to fdomain_finish_cmd()

Set the SCSI host status before calling fdomain_finish_cmd() and drop the
last argument to that function.

Link: https://lore.kernel.org/r/20210427083046.31620-36-hare@suse.deSigned-off-by: default avatarHannes Reinecke <hare@suse.de>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent a87afe28
...@@ -202,11 +202,10 @@ static int fdomain_select(struct Scsi_Host *sh, int target) ...@@ -202,11 +202,10 @@ static int fdomain_select(struct Scsi_Host *sh, int target)
return 1; return 1;
} }
static void fdomain_finish_cmd(struct fdomain *fd, int result) static void fdomain_finish_cmd(struct fdomain *fd)
{ {
outb(0, fd->base + REG_ICTL); outb(0, fd->base + REG_ICTL);
fdomain_make_bus_idle(fd); fdomain_make_bus_idle(fd);
fd->cur_cmd->result = result;
fd->cur_cmd->scsi_done(fd->cur_cmd); fd->cur_cmd->scsi_done(fd->cur_cmd);
fd->cur_cmd = NULL; fd->cur_cmd = NULL;
} }
...@@ -273,7 +272,8 @@ static void fdomain_work(struct work_struct *work) ...@@ -273,7 +272,8 @@ static void fdomain_work(struct work_struct *work)
if (cmd->SCp.phase & in_arbitration) { if (cmd->SCp.phase & in_arbitration) {
status = inb(fd->base + REG_ASTAT); status = inb(fd->base + REG_ASTAT);
if (!(status & ASTAT_ARB)) { if (!(status & ASTAT_ARB)) {
fdomain_finish_cmd(fd, DID_BUS_BUSY << 16); set_host_byte(cmd, DID_BUS_BUSY);
fdomain_finish_cmd(fd);
goto out; goto out;
} }
cmd->SCp.phase = in_selection; cmd->SCp.phase = in_selection;
...@@ -290,7 +290,8 @@ static void fdomain_work(struct work_struct *work) ...@@ -290,7 +290,8 @@ static void fdomain_work(struct work_struct *work)
if (!(status & BSTAT_BSY)) { if (!(status & BSTAT_BSY)) {
/* Try again, for slow devices */ /* Try again, for slow devices */
if (fdomain_select(cmd->device->host, scmd_id(cmd))) { if (fdomain_select(cmd->device->host, scmd_id(cmd))) {
fdomain_finish_cmd(fd, DID_NO_CONNECT << 16); set_host_byte(cmd, DID_NO_CONNECT);
fdomain_finish_cmd(fd);
goto out; goto out;
} }
/* Stop arbitration and enable parity */ /* Stop arbitration and enable parity */
...@@ -333,7 +334,7 @@ static void fdomain_work(struct work_struct *work) ...@@ -333,7 +334,7 @@ static void fdomain_work(struct work_struct *work)
break; break;
case BSTAT_MSG | BSTAT_CMD | BSTAT_IO: /* MESSAGE IN */ case BSTAT_MSG | BSTAT_CMD | BSTAT_IO: /* MESSAGE IN */
cmd->SCp.Message = inb(fd->base + REG_SCSI_DATA); cmd->SCp.Message = inb(fd->base + REG_SCSI_DATA);
if (!cmd->SCp.Message) if (cmd->SCp.Message == COMMAND_COMPLETE)
++done; ++done;
break; break;
} }
...@@ -359,9 +360,10 @@ static void fdomain_work(struct work_struct *work) ...@@ -359,9 +360,10 @@ static void fdomain_work(struct work_struct *work)
fdomain_read_data(cmd); fdomain_read_data(cmd);
if (done) { if (done) {
fdomain_finish_cmd(fd, (cmd->SCp.Status & 0xff) | set_status_byte(cmd, cmd->SCp.Status);
((cmd->SCp.Message & 0xff) << 8) | set_msg_byte(cmd, cmd->SCp.Message);
(DID_OK << 16)); set_host_byte(cmd, DID_OK);
fdomain_finish_cmd(fd);
} else { } else {
if (cmd->SCp.phase & disconnect) { if (cmd->SCp.phase & disconnect) {
outb(ICTL_FIFO | ICTL_SEL | ICTL_REQ | FIFO_COUNT, outb(ICTL_FIFO | ICTL_SEL | ICTL_REQ | FIFO_COUNT,
...@@ -439,10 +441,10 @@ static int fdomain_abort(struct scsi_cmnd *cmd) ...@@ -439,10 +441,10 @@ static int fdomain_abort(struct scsi_cmnd *cmd)
fdomain_make_bus_idle(fd); fdomain_make_bus_idle(fd);
fd->cur_cmd->SCp.phase |= aborted; fd->cur_cmd->SCp.phase |= aborted;
fd->cur_cmd->result = DID_ABORT << 16;
/* Aborts are not done well. . . */ /* Aborts are not done well. . . */
fdomain_finish_cmd(fd, DID_ABORT << 16); set_host_byte(fd->cur_cmd, DID_ABORT);
fdomain_finish_cmd(fd);
spin_unlock_irqrestore(sh->host_lock, flags); spin_unlock_irqrestore(sh->host_lock, flags);
return SUCCESS; return SUCCESS;
} }
......
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