public inbox for linux-ide@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ata: libata-transport: fix {dma|pio|xfer}_mode sysfs files
@ 2022-06-04 20:53 Sergey Shtylyov
  2022-06-06  2:42 ` Damien Le Moal
  0 siblings, 1 reply; 9+ messages in thread
From: Sergey Shtylyov @ 2022-06-04 20:53 UTC (permalink / raw)
  To: Damien Le Moal, linux-ide

The {dma|pio|xfer}_mode sysfs files are incorrectly 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

Fixes: d9027470b886 ("[libata] Add ATA transport class")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Cc: stable@vger.kernel.org

---
This patch is against the 'master' branch of Damien's 'libata.git' repo.

 drivers/ata/libata-transport.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: libata/drivers/ata/libata-transport.c
===================================================================
--- libata.orig/drivers/ata/libata-transport.c
+++ libata/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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-06-08 17:23 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-04 20:53 [PATCH] ata: libata-transport: fix {dma|pio|xfer}_mode sysfs files Sergey Shtylyov
2022-06-06  2:42 ` Damien Le Moal
2022-06-06 20:38   ` Sergey Shtylyov
2022-06-07  0:37     ` Damien Le Moal
2022-06-07  9:49       ` Sergei Shtylyov
2022-06-08  3:14         ` Damien Le Moal
2022-06-08 10:09           ` Sergey Shtylyov
2022-06-08 10:17             ` Damien Le Moal
2022-06-08 17:13               ` Sergey Shtylyov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox