All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Hannes Reinecke <hare@suse.de>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>,
	Christoph Hellwig <hch@lst.de>,
	James Bottomley <james.bottomley@hansenpartnership.com>,
	linux-scsi@vger.kernel.org, Hannes Reinecke <hare@suse.com>,
	James Smart <james.smart@broadcom.com>
Subject: Re: [PATCH 08/35] lpfc: drop lpfc_no_handler and lpfc_bus_reset_handler()
Date: Wed, 28 Jun 2017 01:57:12 +0200	[thread overview]
Message-ID: <20170627235712.GI13988@lst.de> (raw)
In-Reply-To: <1498222975-71858-9-git-send-email-hare@suse.de>

On Fri, Jun 23, 2017 at 03:02:28PM +0200, Hannes Reinecke wrote:
> lpfc_bus_reset_handler() is really just a loop calling
> lpfc_target_reset_handler() over all targets, which is what
> the error handler will be doing anyway.
> And lpfc_no_handler() will return FAILED, just like SCSI EH
> does if no handler is present.

Looks sensible, but I'd really like to see James looking over this..

> 
> So drop both.
> 
> Signed-off-by: Hannes Reinecke <hare@suse.com>
> ---
>  drivers/scsi/lpfc/lpfc_scsi.c | 99 -------------------------------------------
>  1 file changed, 99 deletions(-)
> 
> diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
> index cfe1d01..19b1202 100644
> --- a/drivers/scsi/lpfc/lpfc_scsi.c
> +++ b/drivers/scsi/lpfc/lpfc_scsi.c
> @@ -5294,93 +5294,6 @@ void lpfc_poll_timeout(unsigned long ptr)
>  }
>  
>  /**
> - * lpfc_bus_reset_handler - scsi_host_template eh_bus_reset_handler entry point
> - * @cmnd: Pointer to scsi_cmnd data structure.
> - *
> - * This routine does target reset to all targets on @cmnd->device->host.
> - * This emulates Parallel SCSI Bus Reset Semantics.
> - *
> - * Return code :
> - *  0x2003 - Error
> - *  0x2002 - Success
> - **/
> -static int
> -lpfc_bus_reset_handler(struct scsi_cmnd *cmnd)
> -{
> -	struct Scsi_Host  *shost = cmnd->device->host;
> -	struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
> -	struct lpfc_nodelist *ndlp = NULL;
> -	struct lpfc_scsi_event_header scsi_event;
> -	int match;
> -	int ret = SUCCESS, status, i;
> -
> -	scsi_event.event_type = FC_REG_SCSI_EVENT;
> -	scsi_event.subcategory = LPFC_EVENT_BUSRESET;
> -	scsi_event.lun = 0;
> -	memcpy(scsi_event.wwpn, &vport->fc_portname, sizeof(struct lpfc_name));
> -	memcpy(scsi_event.wwnn, &vport->fc_nodename, sizeof(struct lpfc_name));
> -
> -	fc_host_post_vendor_event(shost, fc_get_event_number(),
> -		sizeof(scsi_event), (char *)&scsi_event, LPFC_NL_VENDOR_ID);
> -
> -	status = fc_block_scsi_eh(cmnd);
> -	if (status != 0 && status != SUCCESS)
> -		return status;
> -
> -	/*
> -	 * Since the driver manages a single bus device, reset all
> -	 * targets known to the driver.  Should any target reset
> -	 * fail, this routine returns failure to the midlayer.
> -	 */
> -	for (i = 0; i < LPFC_MAX_TARGET; i++) {
> -		/* Search for mapped node by target ID */
> -		match = 0;
> -		spin_lock_irq(shost->host_lock);
> -		list_for_each_entry(ndlp, &vport->fc_nodes, nlp_listp) {
> -			if (!NLP_CHK_NODE_ACT(ndlp))
> -				continue;
> -			if (vport->phba->cfg_fcp2_no_tgt_reset &&
> -			    (ndlp->nlp_fcp_info & NLP_FCP_2_DEVICE))
> -				continue;
> -			if (ndlp->nlp_state == NLP_STE_MAPPED_NODE &&
> -			    ndlp->nlp_sid == i &&
> -			    ndlp->rport &&
> -			    ndlp->nlp_type & NLP_FCP_TARGET) {
> -				match = 1;
> -				break;
> -			}
> -		}
> -		spin_unlock_irq(shost->host_lock);
> -		if (!match)
> -			continue;
> -
> -		status = lpfc_send_taskmgmt(vport, cmnd,
> -					i, 0, FCP_TARGET_RESET);
> -
> -		if (status != SUCCESS) {
> -			lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
> -					 "0700 Bus Reset on target %d failed\n",
> -					 i);
> -			ret = FAILED;
> -		}
> -	}
> -	/*
> -	 * We have to clean up i/o as : they may be orphaned by the TMFs
> -	 * above; or if any of the TMFs failed, they may be in an
> -	 * indeterminate state.
> -	 * We will report success if all the i/o aborts successfully.
> -	 */
> -
> -	status = lpfc_reset_flush_io_context(vport, 0, 0, LPFC_CTX_HOST);
> -	if (status != SUCCESS)
> -		ret = FAILED;
> -
> -	lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
> -			 "0714 SCSI layer issued Bus Reset Data: x%x\n", ret);
> -	return ret;
> -}
> -
> -/**
>   * lpfc_host_reset_handler - scsi_host_template eh_host_reset_handler entry pt
>   * @cmnd: Pointer to scsi_cmnd data structure.
>   *
> @@ -5926,11 +5839,6 @@ struct lpfc_device_data*
>  	return SCSI_MLQUEUE_HOST_BUSY;
>  }
>  
> -static int
> -lpfc_no_handler(struct scsi_cmnd *cmnd)
> -{
> -	return FAILED;
> -}
>  
>  static int
>  lpfc_no_slave(struct scsi_device *sdev)
> @@ -5944,11 +5852,6 @@ struct scsi_host_template lpfc_template_nvme = {
>  	.proc_name		= LPFC_DRIVER_NAME,
>  	.info			= lpfc_info,
>  	.queuecommand		= lpfc_no_command,
> -	.eh_abort_handler	= lpfc_no_handler,
> -	.eh_device_reset_handler = lpfc_no_handler,
> -	.eh_target_reset_handler = lpfc_no_handler,
> -	.eh_bus_reset_handler	= lpfc_no_handler,
> -	.eh_host_reset_handler  = lpfc_no_handler,
>  	.slave_alloc		= lpfc_no_slave,
>  	.slave_configure	= lpfc_no_slave,
>  	.scan_finished		= lpfc_scan_finished,
> @@ -5972,7 +5875,6 @@ struct scsi_host_template lpfc_template_no_hr = {
>  	.eh_abort_handler	= lpfc_abort_handler,
>  	.eh_device_reset_handler = lpfc_device_reset_handler,
>  	.eh_target_reset_handler = lpfc_target_reset_handler,
> -	.eh_bus_reset_handler	= lpfc_bus_reset_handler,
>  	.slave_alloc		= lpfc_slave_alloc,
>  	.slave_configure	= lpfc_slave_configure,
>  	.slave_destroy		= lpfc_slave_destroy,
> @@ -5998,7 +5900,6 @@ struct scsi_host_template lpfc_template = {
>  	.eh_abort_handler	= lpfc_abort_handler,
>  	.eh_device_reset_handler = lpfc_device_reset_handler,
>  	.eh_target_reset_handler = lpfc_target_reset_handler,
> -	.eh_bus_reset_handler	= lpfc_bus_reset_handler,
>  	.eh_host_reset_handler  = lpfc_host_reset_handler,
>  	.slave_alloc		= lpfc_slave_alloc,
>  	.slave_configure	= lpfc_slave_configure,
> -- 
> 1.8.5.6
---end quoted text---

  reply	other threads:[~2017-06-27 23:57 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-23 13:02 [RFC PATCH 00/35] SCSI EH argument reshuffling Hannes Reinecke
2017-06-23 13:02 ` [PATCH 01/35] scsi: fix comment in scsi_device_set_state() Hannes Reinecke
2017-06-23 15:56   ` Bart Van Assche
2017-06-27 23:54   ` Christoph Hellwig
2017-06-23 13:02 ` [PATCH 02/35] mptfc: Do not call fc_block_scsi_eh() on host reset Hannes Reinecke
2017-06-27 23:55   ` Christoph Hellwig
2017-06-23 13:02 ` [PATCH 03/35] ibmvfc: " Hannes Reinecke
2017-06-27 23:55   ` Christoph Hellwig
2017-06-23 13:02 ` [PATCH 04/35] fc_fcp: do not call fc_block_scsi_eh() from " Hannes Reinecke
2017-06-27 23:55   ` Christoph Hellwig
2017-06-23 13:02 ` [PATCH 05/35] fnic: do not call host reset from command abort Hannes Reinecke
2017-06-27 23:55   ` Christoph Hellwig
2017-06-23 13:02 ` [PATCH 06/35] visorhba: sanitze private device data allocation Hannes Reinecke
2017-06-27 23:56   ` Christoph Hellwig
2017-06-23 13:02 ` [PATCH 07/35] uas: move eh_bus_reset_handler to eh_device_reset_handler Hannes Reinecke
2017-06-27 23:56   ` Christoph Hellwig
2017-06-23 13:02 ` [PATCH 08/35] lpfc: drop lpfc_no_handler and lpfc_bus_reset_handler() Hannes Reinecke
2017-06-27 23:57   ` Christoph Hellwig [this message]
2017-06-23 13:02 ` [PATCH 09/35] libsas: move bus_reset_handler() to target_reset_handler() Hannes Reinecke
2017-06-27 23:57   ` Christoph Hellwig
2017-06-23 13:02 ` [PATCH 10/35] bfa: move bus reset to target reset Hannes Reinecke
2017-06-27 23:57   ` Christoph Hellwig
2017-06-23 13:02 ` [PATCH 11/35] hptiop: Simplify reset handling Hannes Reinecke
2017-06-27 23:59   ` Christoph Hellwig
2017-06-23 13:02 ` [PATCH 12/35] fdomain: move bus reset to host reset Hannes Reinecke
2017-06-23 23:49   ` kbuild test robot
2017-06-23 13:02 ` [PATCH 13/35] scsi: drop bus reset for wd33c93-compatible boards Hannes Reinecke
2017-06-28  0:00   ` Christoph Hellwig
2017-06-23 13:02 ` [PATCH 14/35] rtsx: drop bus reset function Hannes Reinecke
2017-06-28  0:00   ` Christoph Hellwig
2017-06-23 13:02 ` [PATCH 15/35] qlogicpti: move bus reset to host reset Hannes Reinecke
2017-06-28  0:01   ` Christoph Hellwig
2017-06-23 13:02 ` [PATCH 16/35] acornscsi: " Hannes Reinecke
2017-06-28  0:01   ` Christoph Hellwig
2017-06-23 13:02 ` [PATCH 17/35] NCR5380: Move " Hannes Reinecke
2017-06-24  7:24   ` Finn Thain
2017-06-25  8:57     ` Hannes Reinecke
2017-06-23 13:02 ` [PATCH 18/35] qlogicfas: move bus_reset to host_reset Hannes Reinecke
2017-06-28  0:01   ` Christoph Hellwig
2017-06-23 13:02 ` [PATCH 19/35] aacraid: split off lun reset function Hannes Reinecke
2017-06-23 16:46   ` Dave Carroll
2017-06-23 13:02 ` [PATCH 20/35] sym53c8xx_2: split off bus reset from host reset Hannes Reinecke
2017-06-23 13:02 ` [PATCH 21/35] zfcp: open-code fc_block_scsi_eh() for " Hannes Reinecke
2017-06-23 13:02 ` [PATCH 22/35] scsi: Use Scsi_Host as argument for eh_host_reset_handler Hannes Reinecke
2017-06-23 16:32   ` Bart Van Assche
2017-06-23 23:51   ` kbuild test robot
2017-06-24  0:38   ` kbuild test robot
2017-06-23 13:02 ` [PATCH 23/35] qedf: drop bus reset handler Hannes Reinecke
2017-06-28  0:05   ` Christoph Hellwig
2017-06-23 13:02 ` [PATCH 24/35] scsi_transport_fc: Use fc_rport as argument for fc_block_scsi_eh Hannes Reinecke
2017-06-23 13:02 ` [PATCH 25/35] mptfc: simplify mpt_fc_block_error_handler() Hannes Reinecke
2017-06-23 13:02 ` [PATCH 26/35] mptfusion: correct definitions for mptscsih_dev_reset() Hannes Reinecke
2017-06-23 13:02 ` [PATCH 27/35] scsi: Use Scsi_Host and channel number as argument for eh_bus_reset_handler() Hannes Reinecke
2017-06-24  0:00   ` kbuild test robot
2017-06-24  0:06   ` kbuild test robot
2017-06-23 13:02 ` [PATCH 28/35] libiscsi: use cls_session as argument for target and session reset Hannes Reinecke
2017-06-23 13:02 ` [PATCH 29/35] bnx2fc: remove obsolete bnx2fc_eh_host_reset() definition Hannes Reinecke
2017-06-28  0:05   ` Christoph Hellwig
2017-06-23 13:02 ` [PATCH 30/35] bnx2fc: Do not rely on a scsi command when issueing lun or target reset Hannes Reinecke
2017-06-23 13:02 ` [PATCH 31/35] zfcp: do not rely on scsi command for debugging message Hannes Reinecke
2017-06-23 13:02 ` [PATCH 32/35] zfcp: use scsi device as argument for zfcp_task_mgmt_function() Hannes Reinecke
2017-06-23 16:48   ` Bart Van Assche
2017-06-23 13:02 ` [PATCH 33/35] scsi: Use scsi_target as argument for eh_target_reset_handler() Hannes Reinecke
2017-06-23 18:34   ` Bart Van Assche
2017-06-24  0:59   ` kbuild test robot
2017-06-23 13:02 ` [PATCH 34/35] scsi: Move eh_device_reset_handler() to use scsi_device as argument Hannes Reinecke
2017-06-23 18:44   ` Bart Van Assche
2017-06-24  0:46   ` kbuild test robot
2017-06-24  1:10   ` kbuild test robot
2017-06-24  7:07   ` Christoph Hellwig
2017-06-23 13:02 ` [PATCH 35/35] scsi: Do not allocate scsi command in scsi_ioctl_reset() Hannes Reinecke
2017-06-23 17:49   ` Bart Van Assche
2017-06-24  7:09   ` Christoph Hellwig
2017-06-27 23:54 ` [RFC PATCH 00/35] SCSI EH argument reshuffling Christoph Hellwig

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=20170627235712.GI13988@lst.de \
    --to=hch@lst.de \
    --cc=hare@suse.com \
    --cc=hare@suse.de \
    --cc=james.bottomley@hansenpartnership.com \
    --cc=james.smart@broadcom.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.