From: John Garry <john.g.garry@oracle.com>
To: Niklas Cassel <nks@flawful.org>, Damien Le Moal <dlemoal@kernel.org>
Cc: Hannes Reinecke <hare@suse.com>,
linux-ide@vger.kernel.org, linux-scsi@vger.kernel.org,
Hannes Reinecke <hare@suse.de>,
Niklas Cassel <niklas.cassel@wdc.com>
Subject: Re: [PATCH v2 1/8] ata: remove reference to non-existing error_handler()
Date: Thu, 20 Jul 2023 09:47:08 +0100 [thread overview]
Message-ID: <917fcfe7-8306-0d23-253d-cb43353520be@oracle.com> (raw)
In-Reply-To: <20230720004257.307031-2-nks@flawful.org>
On 20/07/2023 01:42, Niklas Cassel wrote:
> From: Hannes Reinecke <hare@suse.de>
>
> With commit 65a15d6560df ("scsi: ipr: Remove SATA support") all
> libata drivers now have the error_handler() callback provided,
> so we can stop checking for non-existing error_handler callback.
>
> Signed-off-by: Hannes Reinecke <hare@suse.de>
> [niklas: fixed review comments, rebased, solved conflicts during rebase,
> fixed bug that unconditionally dumped all QCs, removed the now unused
> function ata_dump_status(), removed the now unreachable failure paths in
> atapi_qc_complete(), removed the non-EH function to request ATAPI sense]
> Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
ata_qc_from_tag() still has a ap->ops->error_handler check, right?
> ---
> drivers/ata/libata-core.c | 209 +++++++++++++++-----------------------
> drivers/ata/libata-eh.c | 150 ++++++++++++---------------
> drivers/ata/libata-sata.c | 7 +-
> drivers/ata/libata-scsi.c | 142 ++------------------------
> drivers/ata/libata-sff.c | 30 ++----
> 5 files changed, 166 insertions(+), 372 deletions(-)
>
...
>
> /*
> - * For new EH, all qcs are finished in one of three ways -
> + * For EH, all qcs are finished in one of three ways -
> * normal completion, error completion, and SCSI timeout.
> * Both completions can race against SCSI timeout. When normal
> * completion wins, the qc never reaches EH. When error
> @@ -659,94 +656,89 @@ EXPORT_SYMBOL(ata_scsi_cmd_error_handler);
> void ata_scsi_port_error_handler(struct Scsi_Host *host, struct ata_port *ap)
> {
> unsigned long flags;
> + struct ata_link *link;
>
> /* invoke error handler */
Is this comment only really relevant when we may not previously invoked
the error handler?
> - if (ap->ops->error_handler) {
> - struct ata_link *link;
>
> - /* acquire EH ownership */
> - ata_eh_acquire(ap);
> + /* acquire EH ownership */
> + ata_eh_acquire(ap);
> repeat:
> - /* kill fast drain timer */
> - del_timer_sync(&ap->fastdrain_timer);
> + /* kill fast drain timer */
> + del_timer_sync(&ap->fastdrain_timer);
>
> - /* process port resume request */
> - ata_eh_handle_port_resume(ap);
> + /* process port resume request */
> + ata_eh_handle_port_resume(ap);
>
> - /* fetch & clear EH info */
> - spin_lock_irqsave(ap->lock, flags);
> + /* fetch & clear EH info */
> + spin_lock_irqsave(ap->lock, flags);
...
> * ata_to_sense_error - convert ATA error to SCSI error
> * @id: ATA device number
> @@ -904,7 +863,6 @@ static void ata_gen_passthru_sense(struct ata_queued_cmd *qc)
> struct ata_taskfile *tf = &qc->result_tf;
> unsigned char *sb = cmd->sense_buffer;
> unsigned char *desc = sb + 8;
> - int verbose = qc->ap->ops->error_handler == NULL;
> u8 sense_key, asc, ascq;
>
> memset(sb, 0, SCSI_SENSE_BUFFERSIZE);
> @@ -916,7 +874,7 @@ static void ata_gen_passthru_sense(struct ata_queued_cmd *qc)
> if (qc->err_mask ||
> tf->status & (ATA_BUSY | ATA_DF | ATA_ERR | ATA_DRQ)) {
> ata_to_sense_error(qc->ap->print_id, tf->status, tf->error,
> - &sense_key, &asc, &ascq, verbose);
> + &sense_key, &asc, &ascq, false);
> ata_scsi_set_sense(qc->dev, cmd, sense_key, asc, ascq);
> } else {
> /*
> @@ -999,7 +957,6 @@ static void ata_gen_ata_sense(struct ata_queued_cmd *qc)
> struct scsi_cmnd *cmd = qc->scsicmd;
> struct ata_taskfile *tf = &qc->result_tf;
> unsigned char *sb = cmd->sense_buffer;
> - int verbose = qc->ap->ops->error_handler == NULL;
> u64 block;
> u8 sense_key, asc, ascq;
>
> @@ -1017,7 +974,7 @@ static void ata_gen_ata_sense(struct ata_queued_cmd *qc)
> if (qc->err_mask ||
> tf->status & (ATA_BUSY | ATA_DF | ATA_ERR | ATA_DRQ)) {
> ata_to_sense_error(qc->ap->print_id, tf->status, tf->error,
> - &sense_key, &asc, &ascq, verbose);
> + &sense_key, &asc, &ascq, false);
Please check this - AFAICS, we only ever pass false for @verbose arg now
(so it would not be needed, and ata_to_sense_error() may be simplified)
> ata_scsi_set_sense(dev, cmd, sense_key, asc, ascq);
> } else {
> /* Could not decode error */
> @@ -1179,9 +1136,6 @@ void ata_scsi_slave_destroy(struct scsi_device *sdev)
> unsigned long flags;
> struct ata_device *dev;
>
> - if (!ap->ops->error_handler)
next prev parent reply other threads:[~2023-07-20 8:58 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-20 0:42 [PATCH v2 0/8] libata: remove references to 'old' error handler Niklas Cassel
2023-07-20 0:42 ` [PATCH v2 1/8] ata: remove reference to non-existing error_handler() Niklas Cassel
2023-07-20 8:47 ` John Garry [this message]
2023-07-21 13:19 ` Niklas Cassel
2023-07-20 0:42 ` [PATCH v2 2/8] ata,scsi: remove ata_sas_port_{start,stop} callbacks Niklas Cassel
2023-07-20 1:45 ` Jason Yan
2023-07-20 0:42 ` [PATCH v2 3/8] ata,scsi: remove ata_sas_port_destroy() Niklas Cassel
2023-07-20 8:57 ` John Garry
2023-07-21 13:33 ` Niklas Cassel
2023-07-25 7:34 ` John Garry
2023-07-20 0:42 ` [PATCH v2 4/8] ata: remove ata_sas_sync_probe() Niklas Cassel
2023-07-20 1:53 ` Jason Yan
2023-07-20 0:42 ` [PATCH v2 5/8] ata: inline ata_port_probe() Niklas Cassel
2023-07-20 1:53 ` Jason Yan
2023-07-20 0:42 ` [PATCH v2 6/8] ata,scsi: cleanup ata_port_probe() Niklas Cassel
2023-07-20 1:55 ` Jason Yan
2023-07-20 8:27 ` John Garry
2023-07-21 13:43 ` Niklas Cassel
2023-07-20 0:42 ` [PATCH v2 7/8] ata: sata_sx4: drop already completed TODO Niklas Cassel
2023-07-20 1:56 ` Jason Yan
2023-07-20 5:49 ` Hannes Reinecke
2023-07-20 0:42 ` [PATCH v2 8/8] ata: remove ata_bus_probe() Niklas Cassel
2023-07-20 1:56 ` Jason Yan
2023-07-20 5:49 ` Hannes Reinecke
2023-07-20 8:12 ` John Garry
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=917fcfe7-8306-0d23-253d-cb43353520be@oracle.com \
--to=john.g.garry@oracle.com \
--cc=dlemoal@kernel.org \
--cc=hare@suse.com \
--cc=hare@suse.de \
--cc=linux-ide@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=niklas.cassel@wdc.com \
--cc=nks@flawful.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