Files
linux/Documentation
Sergey Shtylyov 4562fa4e99 ata: libata-transport: fix {dma|pio|xfer}_mode sysfs files
commit 72aad489f9 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: d9027470b8 ("[libata] Add ATA transport class")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Cc: stable@vger.kernel.org
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-29 09:26:25 +09:00
..
2016-05-31 16:41:55 +08:00
2014-02-28 15:12:08 -08:00
2014-02-10 16:01:40 -08:00
2017-11-09 18:58:24 -07:00
2015-06-08 23:15:45 +02:00
2016-10-11 15:06:33 -07:00
2017-10-13 11:27:08 +00:00
2023-05-16 11:09:32 +09:00
2023-05-16 11:09:32 +09:00
2023-05-16 11:09:32 +09:00
2016-06-30 13:07:33 -06:00
2016-06-07 22:57:10 +02:00
2016-06-07 22:57:10 +02:00
2016-09-20 18:46:36 -06:00
2013-12-02 14:48:28 +01:00
2014-12-08 09:07:11 -05:00
2016-05-17 14:48:04 +02:00
2016-04-28 08:02:36 -06:00