Skip to content

Commit 87c58ef

Browse files
Finn Thainmartinkpetersen
authored andcommitted
scsi: esp_scsi: Grant disconnect privilege for untagged commands
A SCSI device is not granted disconnect privilege by an esp_scsi host unless that device has its simple_tags flag set. However, a device may support disconnect/reselect and not support command queueing. Allow such devices to disconnect and thereby improve bus utilization. Drop the redundant 'lp' check. The mid-layer invokes .slave_alloc and .slave_destroy in such a way that we may rely on scmd->device->hostdata for as long as scmd belongs to the low-level driver. Tested-by: Stan Johnson <[email protected]> Signed-off-by: Finn Thain <[email protected]> Tested-by: Michael Schmitz <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent fd47d91 commit 87c58ef

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

drivers/scsi/esp_scsi.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,6 @@ static struct esp_cmd_entry *find_and_prep_issuable_command(struct esp *esp)
736736
static void esp_maybe_execute_command(struct esp *esp)
737737
{
738738
struct esp_target_data *tp;
739-
struct esp_lun_data *lp;
740739
struct scsi_device *dev;
741740
struct scsi_cmnd *cmd;
742741
struct esp_cmd_entry *ent;
@@ -762,7 +761,6 @@ static void esp_maybe_execute_command(struct esp *esp)
762761
tgt = dev->id;
763762
lun = dev->lun;
764763
tp = &esp->target[tgt];
765-
lp = dev->hostdata;
766764

767765
list_move(&ent->list, &esp->active_cmds);
768766

@@ -818,14 +816,7 @@ static void esp_maybe_execute_command(struct esp *esp)
818816
}
819817

820818
build_identify:
821-
/* If we don't have a lun-data struct yet, we're probing
822-
* so do not disconnect. Also, do not disconnect unless
823-
* we have a tag on this command.
824-
*/
825-
if (lp && (tp->flags & ESP_TGT_DISCONNECT) && ent->tag[0])
826-
*p++ = IDENTIFY(1, lun);
827-
else
828-
*p++ = IDENTIFY(0, lun);
819+
*p++ = IDENTIFY(tp->flags & ESP_TGT_DISCONNECT, lun);
829820

830821
if (ent->tag[0] && esp->rev == ESP100) {
831822
/* ESP100 lacks select w/atn3 command, use select

0 commit comments

Comments
 (0)