From: Greg Kroah-Hartman Date: Mon, 13 Jun 2022 07:30:21 +0000 (+0200) Subject: 4.14-stable patches X-Git-Tag: v4.9.318~55 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6a644f74863cb1ad47c077cde6569147dc02d162;p=thirdparty%2Fkernel%2Fstable-queue.git 4.14-stable patches added patches: ata-libata-transport-fix-dma-pio-xfer-_mode-sysfs-files.patch --- diff --git a/queue-4.14/ata-libata-transport-fix-dma-pio-xfer-_mode-sysfs-files.patch b/queue-4.14/ata-libata-transport-fix-dma-pio-xfer-_mode-sysfs-files.patch new file mode 100644 index 00000000000..eb82410a71b --- /dev/null +++ b/queue-4.14/ata-libata-transport-fix-dma-pio-xfer-_mode-sysfs-files.patch @@ -0,0 +1,75 @@ +From 72aad489f992871e908ff6d9055b26c6366fb864 Mon Sep 17 00:00:00 2001 +From: Sergey Shtylyov +Date: Wed, 8 Jun 2022 22:51:07 +0300 +Subject: ata: libata-transport: fix {dma|pio|xfer}_mode sysfs files + +From: Sergey Shtylyov + +commit 72aad489f992871e908ff6d9055b26c6366fb864 upstream. + +The {dma|pio}_mode sysfs files are incorrectly documented as having a +list of the supported DMA/PIO transfer modes, while the corresponding +fields of the *struct* ata_device hold the transfer mode IDs, not masks. + +To match these docs, the {dma|pio}_mode (and even xfer_mode!) sysfs +files are handled by the ata_bitfield_name_match() macro which leads to +reading such kind of nonsense from them: + +$ cat /sys/class/ata_device/dev3.0/pio_mode +XFER_UDMA_7, XFER_UDMA_6, XFER_UDMA_5, XFER_UDMA_4, XFER_MW_DMA_4, +XFER_PIO_6, XFER_PIO_5, XFER_PIO_4, XFER_PIO_3, XFER_PIO_2, XFER_PIO_1, +XFER_PIO_0 + +Using the correct ata_bitfield_name_search() macro fixes that: + +$ cat /sys/class/ata_device/dev3.0/pio_mode +XFER_PIO_4 + +While fixing the file documentation, somewhat reword the {dma|pio}_mode +file doc and add a note about being mostly useful for PATA devices to +the xfer_mode file doc... + +Fixes: d9027470b886 ("[libata] Add ATA transport class") +Signed-off-by: Sergey Shtylyov +Cc: stable@vger.kernel.org +Signed-off-by: Damien Le Moal +Signed-off-by: Greg Kroah-Hartman +--- + Documentation/ABI/testing/sysfs-ata | 5 +++-- + drivers/ata/libata-transport.c | 2 +- + 2 files changed, 4 insertions(+), 3 deletions(-) + +--- a/Documentation/ABI/testing/sysfs-ata ++++ b/Documentation/ABI/testing/sysfs-ata +@@ -59,17 +59,18 @@ class + + dma_mode + +- Transfer modes supported by the device when in DMA mode. ++ DMA transfer mode used by the device. + Mostly used by PATA device. + + pio_mode + +- Transfer modes supported by the device when in PIO mode. ++ PIO transfer mode used by the device. + Mostly used by PATA device. + + xfer_mode + + Current transfer mode. ++ Mostly used by PATA device. + + id + +--- a/drivers/ata/libata-transport.c ++++ b/drivers/ata/libata-transport.c +@@ -196,7 +196,7 @@ static struct { + { XFER_PIO_0, "XFER_PIO_0" }, + { XFER_PIO_SLOW, "XFER_PIO_SLOW" } + }; +-ata_bitfield_name_match(xfer,ata_xfer_names) ++ata_bitfield_name_search(xfer, ata_xfer_names) + + /* + * ATA Port attributes diff --git a/queue-4.14/series b/queue-4.14/series index 4ad2c1c3653..4802d5dd828 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -206,3 +206,4 @@ nodemask-fix-return-values-to-be-unsigned.patch vringh-fix-loop-descriptors-check-in-the-indirect-ca.patch alsa-hda-conexant-fix-loopback-issue-with-cx20632.patch cifs-return-errors-during-session-setup-during-reconnects.patch +ata-libata-transport-fix-dma-pio-xfer-_mode-sysfs-files.patch