linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: "Martin K . Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org, Jaegeuk Kim <jaegeuk@kernel.org>,
	Bart Van Assche <bvanassche@acm.org>,
	Jens Axboe <axboe@kernel.dk>, Hannes Reinecke <hare@suse.de>,
	Ming Lei <ming.lei@redhat.com>,
	John Garry <john.garry@huawei.com>
Subject: [PATCH 05/21] ata: Stop clearing host_eh_scheduled from error handlers
Date: Thu,  1 Jul 2021 14:12:08 -0700	[thread overview]
Message-ID: <20210701211224.17070-6-bvanassche@acm.org> (raw)
In-Reply-To: <20210701211224.17070-1-bvanassche@acm.org>

Now that the caller of sas_ata_strategy_handler() clears host_eh_scheduled,
remove the code from the ATA core that that clears host_eh_scheduled.

Cc: Jens Axboe <axboe@kernel.dk>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Ming Lei <ming.lei@redhat.com>
Cc: John Garry <john.garry@huawei.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/ata/libata-core.c |  2 --
 drivers/ata/libata-eh.c   | 30 +++---------------------------
 include/linux/libata.h    |  1 -
 3 files changed, 3 insertions(+), 30 deletions(-)

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 61c762961ca8..b26fb305a56f 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -69,7 +69,6 @@ const struct ata_port_operations ata_base_port_ops = {
 	.postreset		= ata_std_postreset,
 	.error_handler		= ata_std_error_handler,
 	.sched_eh		= ata_std_sched_eh,
-	.end_eh			= ata_std_end_eh,
 };
 
 const struct ata_port_operations sata_port_ops = {
@@ -6419,7 +6418,6 @@ struct ata_port_operations ata_dummy_port_ops = {
 	.qc_issue		= ata_dummy_qc_issue,
 	.error_handler		= ata_dummy_error_handler,
 	.sched_eh		= ata_std_sched_eh,
-	.end_eh			= ata_std_end_eh,
 };
 EXPORT_SYMBOL_GPL(ata_dummy_port_ops);
 
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index bb3637762985..e88ffbe31a36 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -724,12 +724,9 @@ void ata_scsi_port_error_handler(struct Scsi_Host *host, struct ata_port *ap)
 		ata_for_each_link(link, ap, HOST_FIRST)
 			memset(&link->eh_info, 0, sizeof(link->eh_info));
 
-		/* end eh (clear host_eh_scheduled) while holding
-		 * ap->lock such that if exception occurs after this
-		 * point but before EH completion, SCSI midlayer will
-		 * re-initiate EH.
-		 */
-		ap->ops->end_eh(ap);
+		/* end eh while holding ap->lock */
+		if (ap->ops->end_eh)
+			ap->ops->end_eh(ap);
 
 		spin_unlock_irqrestore(ap->lock, flags);
 		ata_eh_release(ap);
@@ -936,27 +933,6 @@ void ata_std_sched_eh(struct ata_port *ap)
 }
 EXPORT_SYMBOL_GPL(ata_std_sched_eh);
 
-/**
- * ata_std_end_eh - non-libsas ata_ports complete eh with this common routine
- * @ap: ATA port to end EH for
- *
- * In the libata object model there is a 1:1 mapping of ata_port to
- * shost, so host fields can be directly manipulated under ap->lock, in
- * the libsas case we need to hold a lock at the ha->level to coordinate
- * these events.
- *
- *	LOCKING:
- *	spin_lock_irqsave(host lock)
- */
-void ata_std_end_eh(struct ata_port *ap)
-{
-	struct Scsi_Host *host = ap->scsi_host;
-
-	host->host_eh_scheduled = 0;
-}
-EXPORT_SYMBOL(ata_std_end_eh);
-
-
 /**
  *	ata_port_schedule_eh - schedule error handling without a qc
  *	@ap: ATA port to schedule EH for
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 5f550eb27f81..88f4f7e466fb 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -1356,7 +1356,6 @@ extern void ata_do_eh(struct ata_port *ap, ata_prereset_fn_t prereset,
 		      ata_postreset_fn_t postreset);
 extern void ata_std_error_handler(struct ata_port *ap);
 extern void ata_std_sched_eh(struct ata_port *ap);
-extern void ata_std_end_eh(struct ata_port *ap);
 extern int ata_link_nr_enabled(struct ata_link *link);
 
 /*

  parent reply	other threads:[~2021-07-01 21:12 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-01 21:12 [PATCH 00/21] UFS patches for kernel v5.15 Bart Van Assche
2021-07-01 21:12 ` [PATCH 01/21] Fix the documentation of the scsi_execute() time parameter Bart Van Assche
2021-07-05  5:51   ` Avri Altman
2021-07-01 21:12 ` [PATCH 02/21] libsas: Only abort commands from inside the error handler Bart Van Assche
2021-07-03  2:32   ` Jason Yan
2021-07-04 23:52     ` Bart Van Assche
2021-07-05  7:16     ` Hannes Reinecke
2021-07-01 21:12 ` [PATCH 03/21] Clear host_eh_scheduled from inside the SCSI " Bart Van Assche
2021-07-01 21:12 ` [PATCH 04/21] libsas: Stop clearing host_eh_scheduled from the " Bart Van Assche
2021-07-01 21:12 ` Bart Van Assche [this message]
2021-07-01 21:12 ` [PATCH 06/21] ufs: Reduce power management code duplication Bart Van Assche
2021-07-05  6:18   ` Avri Altman
2021-07-01 21:12 ` [PATCH 07/21] ufs: Only include power management code if necessary Bart Van Assche
2021-07-05  6:33   ` Avri Altman
2021-07-07 20:44     ` Bart Van Assche
2021-07-08  5:50   ` Avri Altman
2021-07-01 21:12 ` [PATCH 08/21] ufs: Rename the second ufshcd_probe_hba() argument Bart Van Assche
2021-07-01 21:12 ` [PATCH 09/21] ufs: Use DECLARE_COMPLETION_ONSTACK() where appropriate Bart Van Assche
2021-07-05  6:38   ` Avri Altman
2021-07-01 21:12 ` [PATCH 10/21] ufs: Remove ufshcd_valid_tag() Bart Van Assche
2021-07-05  6:46   ` Avri Altman
2021-07-05 18:08     ` Bart Van Assche
2021-07-05 19:01       ` Avri Altman
2021-07-05 19:02   ` Avri Altman
2021-07-01 21:12 ` [PATCH 11/21] ufs: Verify UIC locking requirements at runtime Bart Van Assche
2021-07-05  6:52   ` Avri Altman
2021-07-01 21:12 ` [PATCH 12/21] ufs: Improve static type checking for the host controller state Bart Van Assche
2021-07-01 21:12 ` [PATCH 13/21] ufs: Remove several wmb() calls Bart Van Assche
2021-07-01 22:26   ` Asutosh Das (asd)
2021-07-01 22:52     ` Bart Van Assche
2021-07-01 21:12 ` [PATCH 14/21] ufs: Inline ufshcd_outstanding_req_clear() Bart Van Assche
2021-07-05  7:03   ` Avri Altman
2021-07-01 21:12 ` [PATCH 15/21] ufs: Rename __ufshcd_transfer_req_compl() Bart Van Assche
2021-07-01 21:12 ` [PATCH 16/21] ufs: Fix the SCSI abort handler Bart Van Assche
2021-07-01 21:12 ` [PATCH 17/21] ufs: Fix a race in the completion path Bart Van Assche
2021-07-01 21:12 ` [PATCH 18/21] ufs: Use the doorbell register instead of the UTRLCNR register Bart Van Assche
2021-07-01 21:12 ` [PATCH 19/21] ufs: Request sense data asynchronously Bart Van Assche
2021-07-01 21:12 ` [PATCH 20/21] ufs: Synchronize SCSI and UFS error handling Bart Van Assche
2021-07-01 21:12 ` [PATCH 21/21] ufs: Retry aborted SCSI commands instead of completing these successfully Bart Van Assche

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=20210701211224.17070-6-bvanassche@acm.org \
    --to=bvanassche@acm.org \
    --cc=axboe@kernel.dk \
    --cc=hare@suse.de \
    --cc=jaegeuk@kernel.org \
    --cc=john.garry@huawei.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=ming.lei@redhat.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;
as well as URLs for NNTP newsgroup(s).