summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/NCR5380.c
diff options
context:
space:
mode:
authorFinn Thain <fthain@telegraphics.com.au>2018-09-27 11:17:11 +1000
committerMartin K. Petersen <martin.petersen@oracle.com>2018-09-28 02:18:41 -0400
commit7c8ed783c2faa1e3f741844ffac41340338ea0f4 (patch)
tree7f667dd4bf85933573e1355056d262ee6e4055df /drivers/scsi/NCR5380.c
parentdad8261e643849ea134c7cd5c8e794e31d93b9eb (diff)
downloadlinux-stable-7c8ed783c2faa1e3f741844ffac41340338ea0f4.tar.gz
linux-stable-7c8ed783c2faa1e3f741844ffac41340338ea0f4.tar.bz2
linux-stable-7c8ed783c2faa1e3f741844ffac41340338ea0f4.zip
scsi: NCR5380: Withhold disconnect privilege for REQUEST SENSE
This is mostly needed because an AztecMonster II target has been observed disconnecting REQUEST SENSE commands and then failing to reselect properly. Suggested-by: Michael Schmitz <schmitzmic@gmail.com> Tested-by: Michael Schmitz <schmitzmic@gmail.com> Signed-off-by: Finn Thain <fthain@telegraphics.com.au> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/NCR5380.c')
-rw-r--r--drivers/scsi/NCR5380.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c
index 7be1ba2b9e4e..5226164cfa65 100644
--- a/drivers/scsi/NCR5380.c
+++ b/drivers/scsi/NCR5380.c
@@ -936,6 +936,8 @@ static bool NCR5380_select(struct Scsi_Host *instance, struct scsi_cmnd *cmd)
int len;
int err;
bool ret = true;
+ bool can_disconnect = instance->irq != NO_IRQ &&
+ cmd->cmnd[0] != REQUEST_SENSE;
NCR5380_dprint(NDEBUG_ARBITRATION, instance);
dsprintk(NDEBUG_ARBITRATION, instance, "starting arbitration, id = %d\n",
@@ -1159,7 +1161,7 @@ static bool NCR5380_select(struct Scsi_Host *instance, struct scsi_cmnd *cmd)
dsprintk(NDEBUG_SELECTION, instance, "target %d selected, going into MESSAGE OUT phase.\n",
scmd_id(cmd));
- tmp[0] = IDENTIFY(((instance->irq == NO_IRQ) ? 0 : 1), cmd->device->lun);
+ tmp[0] = IDENTIFY(can_disconnect, cmd->device->lun);
len = 1;
data = tmp;