]> Git Repo - linux.git/commit
ata: libata-transport: fix {dma|pio|xfer}_mode sysfs files
authorSergey Shtylyov <[email protected]>
Wed, 8 Jun 2022 19:51:07 +0000 (22:51 +0300)
committerDamien Le Moal <[email protected]>
Thu, 9 Jun 2022 00:25:25 +0000 (09:25 +0900)
commit72aad489f992871e908ff6d9055b26c6366fb864
treefdfea758174cb627e27552d35d51ec70a0bb34ea
parent6d11acd452fd885ef6ace184c9c70bc863a8c72f
ata: libata-transport: fix {dma|pio|xfer}_mode sysfs files

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 <[email protected]>
Cc: [email protected]
Signed-off-by: Damien Le Moal <[email protected]>
Documentation/ABI/testing/sysfs-ata
drivers/ata/libata-transport.c
This page took 0.058663 seconds and 4 git commands to generate.