An error occurred while fetching folder content.
ata: libata-transport: fix {dma|pio|xfer}_mode sysfs files
Sergey Shtylyov authored
commit 72aad489 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: d9027470 ("...
a650ccd6
Name Last commit Last update
..
ABI ata: libata-transport: fix {dma|pio|xfer}_mode sysfs files
EDID drm: use .hword to represent 16-bit numbers
PCI Merge branch 'remotes/lorenzo/pci/dwc'
RCU rculist: Improve documentation for list_for_each_entry_from_rcu()
accelerators ocxl: Document new OCXL IOCTLs
accounting tools: move accounting tool from Documentation
acpi ACPI: property: graph: Update graph documentation to use generic references
admin-guide x86/speculation: Update link to AMD speculation whitepaper
aoe aoe: remove do-nothing NAME="%k" term from example udev rules
arm ARM: 8833/1: Ensure that NEON code always compiles with Clang
arm64 arm64: errata: Hide CTR_EL0.DIC on systems affected by Neoverse-N1 #1542419
auxdisplay Doc: misc-devices: move lcd-panel-cgram.txt to auxdisplay/
backlight backlight: lp855x_bl: support new LP8555 device
block block: Track DISCARD statistics and output them in stat and diskstat
blockdev zram: introduce zram memory tracking
bpf Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next
bus-devices ARM: OMAP2+: gpmc: generic timing calculation
cdrom Documentation/cdrom: fix German sharp s in LaTex
cgroup-v1 page cache: use xa_lock
cma cma: debug: document new debugfs interface
connector samples: connector: from Documentation to samples directory
console Documentation: corrections to console/console.txt
core-api idr: Change documentation license
cpu-freq cpufreq: Drop cpufreq_table_validate_and_show()
cpuidle cpuidle: Add definition of residency to sysfs documentation
crypto
dev-tools
device-mapper
devicetree
doc-guide
driver-api
driver-model
early-userspace
extcon
fault-injection
fb
features
filesystems
firmware_class
fmc
fpga
gpio
gpu
hid
hwmon
i2c
ia64
ide
iio
infiniband
input
ioctl
isdn
kbuild
kdump
kernel-hacking
laptops
leds
lightnvm
livepatch
locking
m68k
maintainer
md
media
memory-devices
mic
mips
misc-devices
mmc
mtd
namespaces
netlabel
networking
nfc
nios2
nvdimm
nvmem
openrisc
parisc
pcmcia
perf
phy
platform
power
powerpc
pps
process
pti
ptp
rapidio
riscv
s390
scheduler
scsi
security
serial
sh
sound
sparc