From: Damien Le Moal <damien.lemoal@opensource.wdc.com>
To: "Peter Fröhlich" <peter.hans.froehlich@gmail.com>,
linux-ide@vger.kernel.org
Subject: Re: libata-scsi: ata_to_sense_error handling status 0x40
Date: Mon, 29 Aug 2022 08:20:30 +0900 [thread overview]
Message-ID: <48bb6122-626d-aae1-fb96-2c40455f0303@opensource.wdc.com> (raw)
In-Reply-To: <CAHXXO6Eio2LecHS3i7C7yeWOrGFdMA4HTDB=d7azS_67zw5cyg@mail.gmail.com>
On 2022/08/26 21:00, Peter Fröhlich wrote:
> Apologies if this is the wrong place.
>
> In commit 8ae720449fca4b1d0294c0a0204c0c45556a3e61 "libata: whitespace
> fixes in ata_to_sense_error()" we find, among many actual whitespace
> changes, another change that adds an entry for 0x40 to the stat_table.
>
> I thought that 0x40 is bit 6 of the ATA status which means (I think)
> "drive ready" and not, as we translate here, "unaligned write
> command". I may be very much confused about this, but if so, please
> tell me how.
See the code below that table definition. You can see this hunk:
if (drv_err) {
/* Look for drv_err */
for (i = 0; sense_table[i][0] != 0xFF; i++) {
/* Look for best matches first */
if ((sense_table[i][0] & drv_err) ==
sense_table[i][0]) {
*sk = sense_table[i][1];
*asc = sense_table[i][2];
*ascq = sense_table[i][3];
goto translate_done;
}
}
}
So the first field of the table defines the *error* bits, not the status. You
can check the ACS specs (Section 10.3 of ACS6-r1) to see that bit 6 of the error
field for an error output is "UNCORRECTABLE ERROR bit" for the commands READ DMA
Ext, Read Log Ext, Read PIO, Read Stream, SMART Read log, Read PIO Extended and
NCQ Read.
So this code is per specs.
> (I've been tracking another, presumably unrelated, error and have the
> impression that this "unaligned write" message has been leading me in
> the wrong direction.)
Are you using an SMR drive ? Getting an aligned write should not happen for a
regular disk as the kernel ensure alignments of IO to LBAs. But for SMR, it is
possible to send a write command that is not aligned to a zone write pointer
position, resulting in an unaligned write error.
--
Damien Le Moal
Western Digital Research
next prev parent reply other threads:[~2022-08-28 23:20 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-26 12:00 libata-scsi: ata_to_sense_error handling status 0x40 Peter Fröhlich
2022-08-28 23:20 ` Damien Le Moal [this message]
2022-08-29 6:04 ` Peter Fröhlich
2022-08-29 23:26 ` Damien Le Moal
2022-08-30 7:02 ` Peter Fröhlich
2022-08-31 1:40 ` Damien Le Moal
2022-08-31 7:15 ` Hannes Reinecke
2022-08-31 7:48 ` Damien Le Moal
2022-08-31 10:21 ` Peter Fröhlich
2022-08-31 13:30 ` Peter Fröhlich
2022-08-31 22:54 ` Damien Le Moal
2022-09-01 6:10 ` Peter Fröhlich
2022-09-01 6:13 ` Hannes Reinecke
2022-09-02 2:35 ` Damien Le Moal
2022-09-02 6:34 ` Peter Fröhlich
2022-09-02 8:41 ` Damien Le Moal
2022-09-12 7:52 ` Peter Fröhlich
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=48bb6122-626d-aae1-fb96-2c40455f0303@opensource.wdc.com \
--to=damien.lemoal@opensource.wdc.com \
--cc=linux-ide@vger.kernel.org \
--cc=peter.hans.froehlich@gmail.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