On 1/28/25 9:47 PM, Christian Kühnke wrote: > I think, I found the root cause. Please CC the maintainers if you want your email to not be lost in the noise of the lists... scripts/get_maintainers.pl drivers/ata > > Kernel 6.12.11 and Kernel 6.13 do _not_ exhibit the problem and to my untrained > eye, the affected layer has been reworked quite a bit in these versions. > > After reviewing the mailing list archives and the kernel commit logs I suspect > the following patch is missing from the kernel 6.6 stable series. It was > developed by Igor together with the patches to libata-sata, but it did not make > it into the 6.6 stable branch of offical kernel. > > After applying this to 6.6.74, that version also works like a charm (without > backing out the libata-sata patch). > > From 18676c6aab0863618eb35443e7b8615eea3535a9 Mon Sep 17 00:00:00 2001 > From: Igor Pylypiv <ipylypiv@xxxxxxxxxx> > Date: Tue, 2 Jul 2024 02:47:34 +0000 > Subject: ata: libata-core: Set ATA_QCFLAG_RTF_FILLED in fill_result_tf() > > ATA_QCFLAG_RTF_FILLED is not specific to ahci and can be used generally > to check if qc->result_tf contains valid data. > > Reviewed-by: Hannes Reinecke <hare@xxxxxxx> > Reviewed-by: Damien Le Moal <dlemoal@xxxxxxxxxx> > Reviewed-by: Niklas Cassel <cassel@xxxxxxxxxx> > Signed-off-by: Igor Pylypiv <ipylypiv@xxxxxxxxxx> > Link: https://lore.kernel.org/r/20240702024735.1152293-7-ipylypiv@xxxxxxxxxx > Signed-off-by: Niklas Cassel <cassel@xxxxxxxxxx> So this needs to be sent to stable. Please see: Documentation/process/stable-kernel-rules.rst To get this patch added to 6.6, you fall into option (2): Option 2 ******** If the patch already has been merged to mainline, send an email to stable@xxxxxxxxxxxxxxx containing the subject of the patch, the commit ID, why you think it should be applied, and what kernel versions you wish it to be applied to. > --- > drivers/ata/libata-core.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > (limited to 'drivers/ata/libata-core.c') > > diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c > index 4f35aab81a0a38..45e3acb466c32a 100644 > --- a/drivers/ata/libata-core.c > +++ b/drivers/ata/libata-core.c > @@ -4794,8 +4794,16 @@ static void fill_result_tf(struct ata_queued_cmd *qc) > { > struct ata_port *ap = qc->ap; > > + /* > + * rtf may already be filled (e.g. for successful NCQ commands). > + * If that is the case, we have nothing to do. > + */ > + if (qc->flags & ATA_QCFLAG_RTF_FILLED) > + return; > + > qc->result_tf.flags = qc->tf.flags; > ap->ops->qc_fill_rtf(qc); > + qc->flags |= ATA_QCFLAG_RTF_FILLED; > } > > static void ata_verify_xfer(struct ata_queued_cmd *qc) -- Damien Le Moal Western Digital Research