linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: ibmvfc: Stop using scsi_cmnd.tag
@ 2021-08-17 13:43 John Garry
  2021-08-18  2:31 ` Martin K. Petersen
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: John Garry @ 2021-08-17 13:43 UTC (permalink / raw)
  To: tyreld, mpe, benh, paulus, jejb, martin.petersen
  Cc: linux-scsi, linuxppc-dev, linux-kernel, hare, bvanassche, hch,
	linux-next, sfr, John Garry

Use scsi_cmd_to_rq(scsi_cmnd)->tag in preference to scsi_cmnd.tag.

Signed-off-by: John Garry <john.garry@huawei.com>
---
This patch was missed in a series to remove scsi_cmnd.tag, which caused
a build error on Martin's SCSI staging tree:
https://lore.kernel.org/linux-scsi/yq14kbppa42.fsf@ca-mkp.ca.oracle.com/T/#mb47909f38f35837686734369600051b278d124af

I note that scsi_cmnd.tag is/was an unsigned char, and I could not find
anywhere in the driver which limits scsi_host.can_queue to 255, so using
scsi_cmnd.tag looks odd to me.

diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c
index 7fa5e64e38c3..ba7150cb226a 100644
--- a/drivers/scsi/ibmvscsi/ibmvfc.c
+++ b/drivers/scsi/ibmvscsi/ibmvfc.c
@@ -1956,7 +1956,7 @@ static int ibmvfc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *cmnd)
 	memcpy(iu->cdb, cmnd->cmnd, cmnd->cmd_len);
 
 	if (cmnd->flags & SCMD_TAGGED) {
-		vfc_cmd->task_tag = cpu_to_be64(cmnd->tag);
+		vfc_cmd->task_tag = cpu_to_be64(scsi_cmd_to_rq(cmnd)->tag);
 		iu->pri_task_attr = IBMVFC_SIMPLE_TASK;
 	}
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] scsi: ibmvfc: Stop using scsi_cmnd.tag
  2021-08-17 13:43 [PATCH] scsi: ibmvfc: Stop using scsi_cmnd.tag John Garry
@ 2021-08-18  2:31 ` Martin K. Petersen
  2021-08-18 11:29   ` John Garry
  2021-08-18  3:04 ` Bart Van Assche
  2021-08-24  4:03 ` Martin K. Petersen
  2 siblings, 1 reply; 5+ messages in thread
From: Martin K. Petersen @ 2021-08-18  2:31 UTC (permalink / raw)
  To: John Garry
  Cc: tyreld, mpe, benh, paulus, jejb, martin.petersen, linux-scsi,
	linuxppc-dev, linux-kernel, hare, bvanassche, hch, linux-next,
	sfr


John,

> Use scsi_cmd_to_rq(scsi_cmnd)->tag in preference to scsi_cmnd.tag.

Applied to 5.15/scsi-staging and rebased for bisectability.

Just to be picky it looks like there's another scsi_cmmd tag lurking in
qla1280.c but it's sitting behind an #ifdef DEBUG_QLA1280.

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] scsi: ibmvfc: Stop using scsi_cmnd.tag
  2021-08-17 13:43 [PATCH] scsi: ibmvfc: Stop using scsi_cmnd.tag John Garry
  2021-08-18  2:31 ` Martin K. Petersen
@ 2021-08-18  3:04 ` Bart Van Assche
  2021-08-24  4:03 ` Martin K. Petersen
  2 siblings, 0 replies; 5+ messages in thread
From: Bart Van Assche @ 2021-08-18  3:04 UTC (permalink / raw)
  To: John Garry, tyreld, mpe, benh, paulus, jejb, martin.petersen
  Cc: linux-scsi, linuxppc-dev, linux-kernel, hare, hch, linux-next, sfr

On 8/17/21 6:43 AM, John Garry wrote:
> Use scsi_cmd_to_rq(scsi_cmnd)->tag in preference to scsi_cmnd.tag.

Reviewed-by: Bart Van Assche <bvanassche@acm.org>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] scsi: ibmvfc: Stop using scsi_cmnd.tag
  2021-08-18  2:31 ` Martin K. Petersen
@ 2021-08-18 11:29   ` John Garry
  0 siblings, 0 replies; 5+ messages in thread
From: John Garry @ 2021-08-18 11:29 UTC (permalink / raw)
  To: Martin K. Petersen
  Cc: tyreld, mpe, benh, paulus, jejb, linux-scsi, linuxppc-dev,
	linux-kernel, hare, bvanassche, hch, linux-next, sfr

Hi Martin,

> 
>> Use scsi_cmd_to_rq(scsi_cmnd)->tag in preference to scsi_cmnd.tag.
> 
> Applied to 5.15/scsi-staging and rebased for bisectability.
> 

Thanks, and sorry for the hassle. But I would still like the maintainers 
to have a look, as I was curious about current usage of scsi_cmnd.tag in 
that driver.

> Just to be picky it looks like there's another scsi_cmmd tag lurking in
> qla1280.c but it's sitting behind an #ifdef DEBUG_QLA1280.
> 

That driver does not even compile with DEBUG_QLA1280 set beforehand. 
I'll fix that up and send as separate patches in case you want to 
shuffle the tag patch in earlier, which is prob not worth the effort.

I've done a good few more x86 randconfigs and tried to audit the code 
for more references, so hopefully that's the last.

Thanks

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] scsi: ibmvfc: Stop using scsi_cmnd.tag
  2021-08-17 13:43 [PATCH] scsi: ibmvfc: Stop using scsi_cmnd.tag John Garry
  2021-08-18  2:31 ` Martin K. Petersen
  2021-08-18  3:04 ` Bart Van Assche
@ 2021-08-24  4:03 ` Martin K. Petersen
  2 siblings, 0 replies; 5+ messages in thread
From: Martin K. Petersen @ 2021-08-24  4:03 UTC (permalink / raw)
  To: benh, paulus, tyreld, jejb, mpe, John Garry
  Cc: Martin K . Petersen, linux-kernel, linux-next, bvanassche,
	linuxppc-dev, linux-scsi, sfr, hch, hare

On Tue, 17 Aug 2021 21:43:37 +0800, John Garry wrote:

> Use scsi_cmd_to_rq(scsi_cmnd)->tag in preference to scsi_cmnd.tag.
> 
> 
> 
> 

Applied to 5.15/scsi-queue, thanks!

[1/1] scsi: ibmvfc: Stop using scsi_cmnd.tag
      https://git.kernel.org/mkp/scsi/c/6a036ce0e25c

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-08-24  4:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-17 13:43 [PATCH] scsi: ibmvfc: Stop using scsi_cmnd.tag John Garry
2021-08-18  2:31 ` Martin K. Petersen
2021-08-18 11:29   ` John Garry
2021-08-18  3:04 ` Bart Van Assche
2021-08-24  4:03 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).