linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Damien Le Moal <dlemoal@kernel.org>
To: Igor Pylypiv <ipylypiv@google.com>
Cc: Niklas Cassel <cassel@kernel.org>, Tejun Heo <tj@kernel.org>,
	Hannes Reinecke <hare@suse.de>,
	linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH v3 2/6] ata: libata-scsi: Do not overwrite valid sense data when CK_COND=1
Date: Fri, 28 Jun 2024 12:48:42 +0900	[thread overview]
Message-ID: <97d8fdb9-7477-4eef-a570-10a229eb48be@kernel.org> (raw)
In-Reply-To: <Zn3R3R_xJFvyNJU-@google.com>

On 6/28/24 5:55 AM, Igor Pylypiv wrote:
> On Thu, Jun 27, 2024 at 09:16:09AM +0900, Damien Le Moal wrote:
>> On 6/27/24 08:04, Igor Pylypiv wrote:
>>> Current ata_gen_passthru_sense() code performs two actions:
>>> 1. Generates sense data based on the ATA 'status' and ATA 'error' fields.
>>> 2. Populates "ATA Status Return sense data descriptor" / "Fixed format
>>>    sense data" with ATA taskfile fields.
>>>
>>> The problem is that #1 generates sense data even when a valid sense data
>>> is already present (ATA_QCFLAG_SENSE_VALID is set). Factoring out #2 into
>>> a separate function allows us to generate sense data only when there is
>>> no valid sense data (ATA_QCFLAG_SENSE_VALID is not set).
>>>
>>> As a bonus, we can now delete a FIXME comment in atapi_qc_complete()
>>> which states that we don't want to translate taskfile registers into
>>> sense descriptors for ATAPI.
>>>
>>> Cc: stable@vger.kernel.org
>>> Reviewed-by: Hannes Reinecke <hare@suse.de>
>>> Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
>>> Signed-off-by: Igor Pylypiv <ipylypiv@google.com>
>>
>> I wonder if we can find the patch that introduced the bug in the first place so
>> that we can add a Fixes tag. I have not checked. This may have been wrong since
>> a long time ago...
> 
> This code was first introduced in 2005 in commit b095518ef51c3 ("[libata]
> ATA passthru (arbitrary ATA command execution)").
> 
> ATA_QCFLAG_SENSE_VALID was introduced a year later in commit 9ec957f2002b
> ("[PATCH] libata-eh-fw: add flags and operations for new EH").
> 
> IIUC, ATA_QCFLAG_SENSE_VALID has not been set for ATA drives until 2016
> when the support for fetching the sense data was added in 5b01e4b9efa0
> ("libata: Implement NCQ autosense") and commit e87fd28cf9a2d ("libata:
> Implement support for sense data reporting").
> 
> To me none of the commits looks like a good candidate for the Fixes tag.
> What are your thoughts on this?

Then let's just mark which LTS version need the patch.
E.g. Cc: stable@vger.kernel.org # X.Y +


-- 
Damien Le Moal
Western Digital Research


  reply	other threads:[~2024-06-28  3:48 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-26 23:04 [PATCH v3 0/6] ATA PASS-THROUGH sense data fixes Igor Pylypiv
2024-06-26 23:04 ` [PATCH v3 1/6] ata: libata-scsi: Fix offsets for the fixed format sense data Igor Pylypiv
2024-06-27 12:08   ` Niklas Cassel
2024-06-27 21:21     ` Igor Pylypiv
2024-06-28  6:47     ` Hannes Reinecke
2024-06-28 15:49       ` Niklas Cassel
2024-06-28 18:25         ` Niklas Cassel
2024-06-28 23:17           ` Igor Pylypiv
2024-06-26 23:04 ` [PATCH v3 2/6] ata: libata-scsi: Do not overwrite valid sense data when CK_COND=1 Igor Pylypiv
2024-06-27  0:16   ` Damien Le Moal
2024-06-27 20:55     ` Igor Pylypiv
2024-06-28  3:48       ` Damien Le Moal [this message]
2024-06-27 14:14   ` Niklas Cassel
2024-06-27 15:15     ` Niklas Cassel
2024-06-27 21:54     ` Igor Pylypiv
2024-06-28 18:44       ` Niklas Cassel
2024-06-28 23:31         ` Igor Pylypiv
2024-06-29  3:09           ` Niklas Cassel
2024-07-01 20:00             ` Igor Pylypiv
2024-06-26 23:04 ` [PATCH v3 3/6] ata: libata-scsi: Remove redundant sense_buffer memsets Igor Pylypiv
2024-06-26 23:04 ` [PATCH v3 4/6] ata: libata-scsi: Do not pass ATA device id to ata_to_sense_error() Igor Pylypiv
2024-06-26 23:04 ` [PATCH v3 5/6] ata: libata: Set ATA_QCFLAG_RTF_FILLED in fill_result_tf() Igor Pylypiv
2024-06-28 20:12   ` Niklas Cassel
2024-06-28 23:08     ` Igor Pylypiv
2024-06-26 23:04 ` [PATCH v3 6/6] ata: libata-scsi: Check ATA_QCFLAG_RTF_FILLED before using result_tf Igor Pylypiv
2024-06-27  0:19   ` Damien Le Moal
2024-06-27 22:03     ` Igor Pylypiv
2024-06-27  6:16   ` Hannes Reinecke
2024-06-28 19:42   ` Niklas Cassel
2024-06-28 23:15     ` Igor Pylypiv

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=97d8fdb9-7477-4eef-a570-10a229eb48be@kernel.org \
    --to=dlemoal@kernel.org \
    --cc=cassel@kernel.org \
    --cc=hare@suse.de \
    --cc=ipylypiv@google.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tj@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;
as well as URLs for NNTP newsgroup(s).