public inbox for linux-ide@vger.kernel.org
 help / color / mirror / Atom feed
From: Niklas Cassel <Niklas.Cassel@wdc.com>
To: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Cc: "john.garry@huawei.com" <john.garry@huawei.com>,
	"linux-ide@vger.kernel.org" <linux-ide@vger.kernel.org>
Subject: Re: [PATCH 4/4] ata: libata-core: do not retry reading the log on timeout
Date: Fri, 7 Oct 2022 23:47:50 +0000	[thread overview]
Message-ID: <Y0C6pUSjHqIZF0Hg@x1-carbon> (raw)
In-Reply-To: <ac65e0db-05a8-65a1-4439-c1021e23d022@opensource.wdc.com>

On Sat, Oct 08, 2022 at 07:33:54AM +0900, Damien Le Moal wrote:
> On 10/7/22 22:23, Niklas Cassel wrote:
> > ata_read_log_page() first tries to read the log using READ LOG DMA EXT.
> > If that fails it will instead try to read the log using READ LOG EXT.
> > 
> > ata_exec_internal_sg() is synchronous, so it will wait for the command to
> > finish. If we actually got an error back from the device, it is correct
> > to retry. However, if the command timed out, ata_exec_internal_sg() will
> > freeze the port.
> > 
> > There is no point in retrying if the port is frozen, as
> > ata_exec_internal_sg() will return AC_ERR_SYSTEM on a frozen port,
> > without ever sending the command down to the drive.
> > 
> > Therefore, avoid retrying if the first command froze the port, as that
> > will result in a misleading AC_ERR_SYSTEM error print, instead of printing
> > the error that actually caused the port to be frozen (AC_ERR_TIMEOUT).
> 
> Beside ata_read_log_page(), are there any other path that do a retry after
> ata_exec_internal_sg() fails ?

Let me check and get back to you.

> 
> Another note: this is patch 4/4 but I did not get any patch 3/4...

It is here:
https://lore.kernel.org/linux-scsi/20221007132342.1590367-1-niklas.cassel@wdc.com/T/#t

My scripts probably didn't add you since you are not a maintainer or
reviewer for drivers/scsi. I should probably have added you manually.

> 
> > 
> > Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
> > ---
> >  drivers/ata/libata-core.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
> > index 1cf326dd7c41..6ae5787103e7 100644
> > --- a/drivers/ata/libata-core.c
> > +++ b/drivers/ata/libata-core.c
> > @@ -2000,7 +2000,8 @@ unsigned int ata_read_log_page(struct ata_device *dev, u8 log,
> >  	if (err_mask) {
> >  		if (dma) {
> >  			dev->horkage |= ATA_HORKAGE_NO_DMA_LOG;
> > -			goto retry;
> > +			if (!ata_port_is_frozen(dev->link->ap))
> > +				goto retry;
> >  		}
> >  		ata_dev_err(dev,
> >  			    "Read log 0x%02x page 0x%02x failed, Emask 0x%x\n",
> 
> -- 
> Damien Le Moal
> Western Digital Research
> 

  reply	other threads:[~2022-10-07 23:47 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-07 13:23 [PATCH 0/4] libata: misc frozen port cleanups Niklas Cassel
2022-10-07 13:23 ` [PATCH 1/4] ata: add ata_port_is_frozen() helper Niklas Cassel
2022-10-10  7:00   ` John Garry
2022-10-10 10:17     ` Niklas Cassel
2022-10-10 11:22       ` John Garry
2022-10-11  0:32         ` Damien Le Moal
2022-10-07 13:23 ` [PATCH 2/4] ata: make use of " Niklas Cassel
2022-10-07 22:31   ` Damien Le Moal
2022-10-07 23:50     ` Niklas Cassel
2022-10-07 23:56       ` Damien Le Moal
2022-10-08  0:09         ` Niklas Cassel
2022-10-07 13:23 ` [PATCH 4/4] ata: libata-core: do not retry reading the log on timeout Niklas Cassel
2022-10-07 22:33   ` Damien Le Moal
2022-10-07 23:47     ` Niklas Cassel [this message]
2022-10-07 23:52       ` Damien Le Moal
2022-10-10 17:10       ` Niklas Cassel
2022-10-18  4:59 ` [PATCH 0/4] libata: misc frozen port cleanups Damien Le Moal

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=Y0C6pUSjHqIZF0Hg@x1-carbon \
    --to=niklas.cassel@wdc.com \
    --cc=damien.lemoal@opensource.wdc.com \
    --cc=john.garry@huawei.com \
    --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