public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Steffen Maier <maier@linux.ibm.com>
To: Hannes Reinecke <hare@suse.de>,
	"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>,
	James Bottomley <james.bottomley@hansenpartnership.com>,
	linux-scsi@vger.kernel.org, Hannes Reinecke <hare@suse.com>,
	Johannes Thumshirn <johannes.thumshirn@wdc.com>,
	Saurav Kashyap <skashyap@marvell.com>
Subject: Re: [PATCH 06/16] qedf: use fc rport as argument for qedf_initiate_tmf()
Date: Tue, 24 May 2022 13:16:18 +0200	[thread overview]
Message-ID: <8e50ff48-7ad1-29a3-23ee-48559fa79919@linux.ibm.com> (raw)
In-Reply-To: <20220524061602.86760-7-hare@suse.de>

On 5/24/22 08:15, Hannes Reinecke wrote:
> When sending a TMF we're only concerned with the rport and the LUN ID,
> so use struct fc_rport as argument for qedf_initiate_tmf().
> 
> Signed-off-by: Hannes Reinecke <hare@suse.com>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
> Cc: Saurav Kashyap <skashyap@marvell.com>
> ---
>   drivers/scsi/qedf/qedf.h      |  3 +-
>   drivers/scsi/qedf/qedf_io.c   | 69 ++++++++++-------------------------
>   drivers/scsi/qedf/qedf_main.c | 19 +++++-----
>   3 files changed, 31 insertions(+), 60 deletions(-)


> @@ -2432,33 +2425,10 @@ int qedf_initiate_tmf(struct scsi_cmnd *sc_cmd, u8 tm_flags)
>   		 (tm_flags == FCP_TMF_TGT_RESET) ? "TARGET RESET" :
>   		 "LUN RESET");
> 
> -	if (qedf_priv(sc_cmd)->io_req) {
> -		io_req = qedf_priv(sc_cmd)->io_req;
> -		ref_cnt = kref_read(&io_req->refcount);
> -		QEDF_ERR(NULL,
> -			 "orig io_req = %p xid = 0x%x ref_cnt = %d.\n",
> -			 io_req, io_req->xid, ref_cnt);
> -	}
> -
> -	rval = fc_remote_port_chkready(rport);
> -	if (rval) {
> -		QEDF_ERR(NULL, "device_reset rport not ready\n");
> -		rc = FAILED;
> -		goto tmf_err;
> -	}
> -
> -	rc = fc_block_scsi_eh(sc_cmd);
> +	rc = fc_block_rport(rport);


> diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c
> index 18dc68d577b6..85ccfbc5cd26 100644
> --- a/drivers/scsi/qedf/qedf_main.c
> +++ b/drivers/scsi/qedf/qedf_main.c
> @@ -773,7 +773,7 @@ static int qedf_eh_abort(struct scsi_cmnd *sc_cmd)
>   		goto drop_rdata_kref;
>   	}
> 
> -	rc = fc_block_scsi_eh(sc_cmd);
> +	rc = fc_block_rport(rport);
>   	if (rc)
>   		goto drop_rdata_kref;
> 

Why replace the fc_block helper here in the abort handler?
Isn't the scope of the abort hander exactly the one scsi_cmnd?
The description of this patch is about changes to TMF (so I understand the 
change in qedf_initiate_tmf() above for device or target reset), i.e. not abort.
Admittedly, it shouldn't be a problem functional-wise, as fc_block_scsi_eh() 
delegates internally to fc_block_rport(), but it looks odd to me nonetheless.

This change seems inconsistent with the other patches in this series.
You don't plan to get rid of fc_block_scsi_eh(), do you?

Oh, later in patch 09 you write:
"Use fc_block_rport() instead of fc_block_scsi_eh() as the latter
will be deprecated."

Why?
Then all FCP HBA abort handlers need to convert their scsi_cmnd to fc_rport 
themselves.
E.g. zfcp_scsi_eh_abort_handler() does not deal with fc_rport so far as there 
was no need. From what I've seen you haven't touched that part in
[PATCH v2 03/24] zfcp: open-code fc_block_scsi_eh() for host reset
when zfcp was still part of the series, so I smell an inconsistency.

Haven't seen that coming. Did I miss this having been announced explicitly 
somewhere else earlier? If not, I would find it interesting to being made 
explicit. In retrospectice, I found some hints hidden in individual patches of 
earlier version in this series, but I had completely missed it.
Also, it seems a separate topic, not necessarily related to changing the 
scsi_eh callback API for dev/target/bus/host reset to get rid of their 
unsuitable argument scsi_cmnd.

-- 
Mit freundlichen Gruessen / Kind regards
Steffen Maier

Linux on IBM Z and LinuxONE

https://www.ibm.com/privacy/us/en/
IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Gregor Pillen
Geschaeftsfuehrung: David Faller
Sitz der Gesellschaft: Boeblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294

  reply	other threads:[~2022-05-24 11:18 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-24  6:15 [PATCHv4 00/16] scsi: EH rework prep patches, part 1 Hannes Reinecke
2022-05-24  6:15 ` [PATCH 01/16] csiostor: use fc_block_rport() Hannes Reinecke
2022-05-24  6:15 ` [PATCH 02/16] fc_fcp: " Hannes Reinecke
2022-05-24  6:15 ` [PATCH 03/16] mptfc: simplify mpt_fc_block_error_handler() Hannes Reinecke
2022-05-24  6:15 ` [PATCH 04/16] mptfusion: correct definitions for mptscsih_dev_reset() Hannes Reinecke
2022-05-24  6:15 ` [PATCH 05/16] mptfc: open-code mptfc_block_error_handler() for bus reset Hannes Reinecke
2022-05-24  6:15 ` [PATCH 06/16] qedf: use fc rport as argument for qedf_initiate_tmf() Hannes Reinecke
2022-05-24 11:16   ` Steffen Maier [this message]
2022-05-24 11:26     ` Hannes Reinecke
2022-05-24  6:15 ` [PATCH 07/16] bnx2fc: Do not rely on a scsi command for lun or target reset Hannes Reinecke
2022-05-24  6:15 ` [PATCH 08/16] ibmvfc: open-code reset loop for " Hannes Reinecke
2022-05-24  6:15 ` [PATCH 09/16] ibmvfc: use fc_block_rport() Hannes Reinecke
2022-05-24  6:15 ` [PATCH 10/16] fnic: use fc_block_rport() correctly Hannes Reinecke
2022-05-24  6:15 ` [PATCH 11/16] aic7xxx: make BUILD_SCSIID() a function Hannes Reinecke
2022-05-24  6:15 ` [PATCH 12/16] aic79xx: " Hannes Reinecke
2022-05-24  6:15 ` [PATCH 13/16] aic7xxx: do not reference scsi command when resetting device Hannes Reinecke
2022-05-24  6:16 ` [PATCH 14/16] aic79xx: " Hannes Reinecke
2022-05-24  6:16 ` [PATCH 15/16] ips: Do not try to abort command from host reset Hannes Reinecke
2022-05-24  6:16 ` [PATCH 16/16] megaraid: pass in NULL scb for " Hannes Reinecke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8e50ff48-7ad1-29a3-23ee-48559fa79919@linux.ibm.com \
    --to=maier@linux.ibm.com \
    --cc=hare@suse.com \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=james.bottomley@hansenpartnership.com \
    --cc=johannes.thumshirn@wdc.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=skashyap@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox