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

scsi: fas216: Kill scmd->tag

The driver is attempting to allocate a tag internally which is a no-go with
blk-mq. Switch the driver to use the request tag and kill usage of
scmd->tag and scmd->device->current_tag.

[jpg: Change to use scsi_cmd_to_rq()]

Link: https://lore.kernel.org/r/1631696835-136198-2-git-send-email-john.garry@huawei.comSigned-off-by: default avatarHannes Reinecke <hare@suse.de>
Signed-off-by: default avatarJohn Garry <john.garry@huawei.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 5f857903
...@@ -77,7 +77,6 @@ ...@@ -77,7 +77,6 @@
* I was thinking that this was a good chip until I found this restriction ;( * I was thinking that this was a good chip until I found this restriction ;(
*/ */
#define SCSI2_SYNC #define SCSI2_SYNC
#undef SCSI2_TAG
#undef DEBUG_CONNECT #undef DEBUG_CONNECT
#undef DEBUG_MESSAGES #undef DEBUG_MESSAGES
...@@ -990,7 +989,7 @@ fas216_reselected_intr(FAS216_Info *info) ...@@ -990,7 +989,7 @@ fas216_reselected_intr(FAS216_Info *info)
info->scsi.disconnectable = 0; info->scsi.disconnectable = 0;
if (info->SCpnt->device->id == target && if (info->SCpnt->device->id == target &&
info->SCpnt->device->lun == lun && info->SCpnt->device->lun == lun &&
info->SCpnt->tag == tag) { scsi_cmd_to_rq(info->SCpnt)->tag == tag) {
fas216_log(info, LOG_CONNECT, "reconnected previously executing command"); fas216_log(info, LOG_CONNECT, "reconnected previously executing command");
} else { } else {
queue_add_cmd_tail(&info->queues.disconnected, info->SCpnt); queue_add_cmd_tail(&info->queues.disconnected, info->SCpnt);
...@@ -1791,8 +1790,9 @@ static void fas216_start_command(FAS216_Info *info, struct scsi_cmnd *SCpnt) ...@@ -1791,8 +1790,9 @@ static void fas216_start_command(FAS216_Info *info, struct scsi_cmnd *SCpnt)
/* /*
* add tag message if required * add tag message if required
*/ */
if (SCpnt->tag) if (SCpnt->device->simple_tags)
msgqueue_addmsg(&info->scsi.msgs, 2, SIMPLE_QUEUE_TAG, SCpnt->tag); msgqueue_addmsg(&info->scsi.msgs, 2, SIMPLE_QUEUE_TAG,
scsi_cmd_to_rq(SCpnt)->tag);
do { do {
#ifdef SCSI2_SYNC #ifdef SCSI2_SYNC
...@@ -1815,20 +1815,8 @@ static void fas216_start_command(FAS216_Info *info, struct scsi_cmnd *SCpnt) ...@@ -1815,20 +1815,8 @@ static void fas216_start_command(FAS216_Info *info, struct scsi_cmnd *SCpnt)
static void fas216_allocate_tag(FAS216_Info *info, struct scsi_cmnd *SCpnt) static void fas216_allocate_tag(FAS216_Info *info, struct scsi_cmnd *SCpnt)
{ {
#ifdef SCSI2_TAG set_bit(SCpnt->device->id * 8 +
/* (u8)(SCpnt->device->lun & 0x7), info->busyluns);
* tagged queuing - allocate a new tag to this command
*/
if (SCpnt->device->simple_tags && SCpnt->cmnd[0] != REQUEST_SENSE &&
SCpnt->cmnd[0] != INQUIRY) {
SCpnt->device->current_tag += 1;
if (SCpnt->device->current_tag == 0)
SCpnt->device->current_tag = 1;
SCpnt->tag = SCpnt->device->current_tag;
} else
#endif
set_bit(SCpnt->device->id * 8 +
(u8)(SCpnt->device->lun & 0x7), info->busyluns);
info->stats.removes += 1; info->stats.removes += 1;
switch (SCpnt->cmnd[0]) { switch (SCpnt->cmnd[0]) {
...@@ -2117,7 +2105,6 @@ fas216_std_done(FAS216_Info *info, struct scsi_cmnd *SCpnt, unsigned int result) ...@@ -2117,7 +2105,6 @@ fas216_std_done(FAS216_Info *info, struct scsi_cmnd *SCpnt, unsigned int result)
init_SCp(SCpnt); init_SCp(SCpnt);
SCpnt->SCp.Message = 0; SCpnt->SCp.Message = 0;
SCpnt->SCp.Status = 0; SCpnt->SCp.Status = 0;
SCpnt->tag = 0;
SCpnt->host_scribble = (void *)fas216_rq_sns_done; SCpnt->host_scribble = (void *)fas216_rq_sns_done;
/* /*
...@@ -2223,7 +2210,6 @@ static int fas216_queue_command_lck(struct scsi_cmnd *SCpnt, ...@@ -2223,7 +2210,6 @@ static int fas216_queue_command_lck(struct scsi_cmnd *SCpnt,
init_SCp(SCpnt); init_SCp(SCpnt);
info->stats.queues += 1; info->stats.queues += 1;
SCpnt->tag = 0;
spin_lock(&info->host_lock); spin_lock(&info->host_lock);
...@@ -3003,9 +2989,8 @@ void fas216_print_devices(FAS216_Info *info, struct seq_file *m) ...@@ -3003,9 +2989,8 @@ void fas216_print_devices(FAS216_Info *info, struct seq_file *m)
dev = &info->device[scd->id]; dev = &info->device[scd->id];
seq_printf(m, " %d/%llu ", scd->id, scd->lun); seq_printf(m, " %d/%llu ", scd->id, scd->lun);
if (scd->tagged_supported) if (scd->tagged_supported)
seq_printf(m, "%3sabled(%3d) ", seq_printf(m, "%3sabled ",
scd->simple_tags ? "en" : "dis", scd->simple_tags ? "en" : "dis");
scd->current_tag);
else else
seq_puts(m, "unsupported "); seq_puts(m, "unsupported ");
......
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