linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Niklas Cassel <nks@flawful.org>
To: Damien Le Moal <dlemoal@kernel.org>
Cc: linux-ide@vger.kernel.org, Niklas Cassel <cassel@kernel.org>,
	linux-scsi@vger.kernel.org,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	John Garry <john.g.garry@oracle.com>,
	Jason Yan <yanaijie@huawei.com>
Subject: Re: [PATCH v4 1/3] ata: libata-eh: Remove ata_do_eh()
Date: Mon, 14 Jul 2025 11:12:46 +0200	[thread overview]
Message-ID: <aHTKDlu2pXGlnHA3@flawful.org> (raw)
In-Reply-To: <20250714005454.35802-2-dlemoal@kernel.org>

On Mon, Jul 14, 2025 at 09:54:52AM +0900, Damien Le Moal wrote:
> The only reason for ata_do_eh() to exist is that the two caller sites,
> ata_std_error_handler() and ata_sff_error_handler() may pass it a
> NULL hardreset operation so that the built-in (generic) hardreset
> operation for a driver is ignored if the adapter SCR access is not
> available.
> 
> However, ata_std_error_handler() and ata_sff_error_handler()
> modifications of the hardreset port operation can easily be combined as
> they are mutually exclusive. That is, a driver using sata_std_hardreset()
> as its hardreset operation cannot use sata_sff_hardreset() and
> vice-versa.
> 
> With this observation, ata_do_eh() can be removed and its code moved to
> ata_std_error_handler(). The condition used to ignore the built-in
> hardreset port operation is modified to be the one that was used in
> ata_sff_error_handler(). This requires defining a stub for the function
> sata_sff_hardreset() to avoid compilation errors when CONFIG_ATA_SFF is
> not enabled. Furthermore, instead of modifying the local hardreset
> operation definition, set the ATA_LFLAG_NO_HRST link flag to prevent
> the use of built-in hardreset methods for ports without a valid scr_read
> function. This flag is checked in ata_eh_reset() and if set, the
> hardreset method is ignored.
> 
> This change simplifies ata_sff_error_handler() as this function now only
> needs to call ata_std_error_handler().
> 
> No functional changes.
> 
> Signed-off-by: Damien Le Moal <dlemoal@kernel.org>

Reviewed-by: Niklas Cassel <cassel@kernel.org>

  reply	other threads:[~2025-07-14  9:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-14  0:54 [PATCH v4 0/3] libata-eh cleanups Damien Le Moal
2025-07-14  0:54 ` [PATCH v4 1/3] ata: libata-eh: Remove ata_do_eh() Damien Le Moal
2025-07-14  9:12   ` Niklas Cassel [this message]
2025-07-14  0:54 ` [PATCH v4 2/3] ata: libata-eh: Simplify reset operation management Damien Le Moal
2025-07-14  7:56   ` Niklas Cassel
2025-07-14  7:58     ` Damien Le Moal
2025-07-14  9:38   ` Niklas Cassel
2025-07-14  0:54 ` [PATCH v4 3/3] Documentation: driver-api: Update libata error handler information Damien Le Moal
2025-07-14 16:45 ` [PATCH v4 0/3] libata-eh cleanups Martin K. Petersen

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=aHTKDlu2pXGlnHA3@flawful.org \
    --to=nks@flawful.org \
    --cc=cassel@kernel.org \
    --cc=dlemoal@kernel.org \
    --cc=john.g.garry@oracle.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=yanaijie@huawei.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).