From: Niklas Cassel <cassel@kernel.org>
To: Damien Le Moal <dlemoal@kernel.org>
Cc: linux-ide@vger.kernel.org
Subject: Re: [PATCH v2 2/3] ata: libata-eh: Remove ata_do_eh()
Date: Tue, 8 Jul 2025 14:46:57 +0200 [thread overview]
Message-ID: <aG0TQabGtX-JrGwp@ryzen> (raw)
In-Reply-To: <aG0QRvgIt4R3ZNFi@ryzen>
On Tue, Jul 08, 2025 at 02:34:14PM +0200, Niklas Cassel wrote:
> On Tue, Jul 08, 2025 at 04:36:47PM +0900, Damien Le Moal wrote:
>
> I think it would be nicer to just do:
>
> if ((hardreset == sata_std_hardreset ||
> hardreset == sata_sff_hardreset) && !sata_scr_valid(&ap->link))
> link->flags |= ATA_LFLAG_NO_HRST;
>
> since ata_eh_reset() will already do
> hardreset = NULL; if that flag is set.
>
> This way, we can also simplify the function signature of ata_eh_recover() to:
>
> int ata_eh_recover(struct ata_port *ap, bool use_pmp_ops,
> struct ata_link **r_failed_link)
>
> and ata_eh_reset() to:
>
> int ata_eh_reset(struct ata_link *link, int classify, bool use_pmp_ops)
Even nicer would be create a new:
ata_reset_port_ops {
ata_prereset_fn_t prereset;
ata_reset_fn_t softreset;
ata_reset_fn_t hardreset;
ata_postreset_fn_t postreset;
}
And then modify:
struct ata_port_operations {
...
struct ata_reset_port_ops *reset_port_ops;
struct ata_reset_port_ops *reset_port_pmp_ops;
...
}
and then modify ata_eh_recover() to:
int ata_eh_recover(struct ata_port *ap, struct ata_reset_port_ops *ops,
struct ata_link **r_failed_link)
and then modify ata_eh_reset() to:
int ata_eh_reset(struct ata_link *link, int classify, struct ata_reset_port_ops *ops)
Kind regards,
Niklas
next prev parent reply other threads:[~2025-07-08 12:47 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-08 7:36 [PATCH v2 0/3] libata-eh cleanups Damien Le Moal
2025-07-08 7:36 ` [PATCH v2 1/3] ata: libata-eh: Make ata_eh_followup_srst_needed() return a bool Damien Le Moal
2025-07-08 7:50 ` Hannes Reinecke
2025-07-08 12:02 ` Niklas Cassel
2025-07-08 7:36 ` [PATCH v2 2/3] ata: libata-eh: Remove ata_do_eh() Damien Le Moal
2025-07-08 7:51 ` Hannes Reinecke
2025-07-08 12:34 ` Niklas Cassel
2025-07-08 12:38 ` Niklas Cassel
2025-07-08 12:46 ` Niklas Cassel [this message]
2025-07-08 7:36 ` [PATCH v2 3/3] Documentation: driver-api: Update libata error handler information Damien Le Moal
2025-07-08 7:52 ` Hannes Reinecke
2025-07-08 12:02 ` Niklas Cassel
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=aG0TQabGtX-JrGwp@ryzen \
--to=cassel@kernel.org \
--cc=dlemoal@kernel.org \
--cc=linux-ide@vger.kernel.org \
/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