Skip to contentSkip to conversation

libata: fix for transport xfer attributes

PATCH In review Bartlomiej Zolnierkiewicz 5 participants 6 messages Oct 13, 2011 – Oct 19, 2011 libata

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libata: fix for transport xfer attributes

From: Bartlomiej Zolnierkiewicz <[email protected]>
Subject: [PATCH] libata: fix for transport xfer attributes

Fix display of pio_mode, dma_mode and xfer_mode device attributes.

before:

$ cat /sys/class/ata_device/dev1.0/xfer_mode
XFER_UDMA_7, XFER_UDMA_6, XFER_UDMA_5, XFER_UDMA_4, XFER_UDMA_3, XFER_UDMA_2, XF
ER_UDMA_1, XFER_UDMA_0, XFER_MW_DMA_4, XFER_MW_DMA_3, XFER_MW_DMA_2, XFER_SW_DMA
_2, XFER_PIO_6, XFER_PIO_5, XFER_PIO_4, XFER_PIO_3, XFER_PIO_2

after:

$ cat /sys/class/ata_device/dev1.0/xfer_mode
XFER_UDMA_6
---
 Documentation/ABI/testing/sysfs-ata |    4 ++--
 drivers/ata/libata-transport.c      |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
Documentation/ABI/testing/sysfs-ata +2 -2
Index: b/Documentation/ABI/testing/sysfs-ata
===================================================================
@@ -59,12 +59,12 @@ class
 
 dma_mode
 
-	Transfer modes supported by the device when in DMA mode.
+	Transfer mode currently used by the device when in DMA mode.
 	Mostly used by PATA device.
 
 pio_mode
 
-	Transfer modes supported by the device when in PIO mode.
+	Transfer mode currently used by the device when in PIO mode.
 	Mostly used by PATA device.
 
 xfer_mode
drivers/ata/libata-transport.c +1 -1
Index: b/drivers/ata/libata-transport.c
===================================================================
@@ -194,7 +194,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
#1 lore raw
Quoted 45 lines · Bartlomiej Zolnierkiewicz

From: Bartlomiej Zolnierkiewicz<[email protected]>
Subject: [PATCH] libata: fix for transport xfer attributes

Fix display of pio_mode, dma_mode and xfer_mode device attributes.

before:

$ cat /sys/class/ata_device/dev1.0/xfer_mode
XFER_UDMA_7, XFER_UDMA_6, XFER_UDMA_5, XFER_UDMA_4, XFER_UDMA_3, XFER_UDMA_2, XF
ER_UDMA_1, XFER_UDMA_0, XFER_MW_DMA_4, XFER_MW_DMA_3, XFER_MW_DMA_2, XFER_SW_DMA
_2, XFER_PIO_6, XFER_PIO_5, XFER_PIO_4, XFER_PIO_3, XFER_PIO_2

after:

$ cat /sys/class/ata_device/dev1.0/xfer_mode
XFER_UDMA_6
---
  Documentation/ABI/testing/sysfs-ata |    4 ++--
  drivers/ata/libata-transport.c      |    2 +-
  2 files changed, 3 insertions(+), 3 deletions(-)

Index: b/Documentation/ABI/testing/sysfs-ata
===================================================================

Documentation/ABI/testing/sysfs-ata +2 -2
@@ -59,12 +59,12 @@ class
 
  dma_mode
 
-	Transfer modes supported by the device when in DMA mode.
+	Transfer mode currently used by the device when in DMA mode.
  	Mostly used by PATA device.
 
  pio_mode
 
-	Transfer modes supported by the device when in PIO mode.
+	Transfer mode currently used by the device when in PIO mode.
  	Mostly used by PATA device.
 
  xfer_mode

Index: b/drivers/ata/libata-transport.c
===================================================================

drivers/ata/libata-transport.c static struct { · line 197

Quoted 5 lines
drivers/ata/libata-transport.c +1 -1
@@ -194,7 +194,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)

"fix" or not it is an ABI change... who is impacted? Has anyone used the current, pre-patch behavior as documented?

Jeff

#2 lore raw
Quoted 40 lines · Jeff Garzik
Quoted 39 lines · Bartlomiej Zolnierkiewicz

From: Bartlomiej Zolnierkiewicz<[email protected]>
Subject: [PATCH] libata: fix for transport xfer attributes

Fix display of pio_mode, dma_mode and xfer_mode device attributes.

before:

$ cat /sys/class/ata_device/dev1.0/xfer_mode
XFER_UDMA_7, XFER_UDMA_6, XFER_UDMA_5, XFER_UDMA_4, XFER_UDMA_3, XFER_UDMA_2, XF
ER_UDMA_1, XFER_UDMA_0, XFER_MW_DMA_4, XFER_MW_DMA_3, XFER_MW_DMA_2, XFER_SW_DMA
_2, XFER_PIO_6, XFER_PIO_5, XFER_PIO_4, XFER_PIO_3, XFER_PIO_2

after:

$ cat /sys/class/ata_device/dev1.0/xfer_mode
XFER_UDMA_6
---
  Documentation/ABI/testing/sysfs-ata |    4 ++--
  drivers/ata/libata-transport.c      |    2 +-
  2 files changed, 3 insertions(+), 3 deletions(-)

Index: b/Documentation/ABI/testing/sysfs-ata
===================================================================

Documentation/ABI/testing/sysfs-ata +2 -2
@@ -59,12 +59,12 @@ class
 
  dma_mode
 
-	Transfer modes supported by the device when in DMA mode.
+	Transfer mode currently used by the device when in DMA mode.
  	Mostly used by PATA device.
 
  pio_mode
 
-	Transfer modes supported by the device when in PIO mode.
+	Transfer mode currently used by the device when in PIO mode.
  	Mostly used by PATA device.
 
Quoted 14 lines

drivers/ata/libata-transport.c static struct { · line 197

Quoted 11 lines
Documentation/ABI/testing/sysfs-ata +0 -0
  xfer_mode

Index: b/drivers/ata/libata-transport.c
===================================================================

drivers/ata/libata-transport.c +1 -1
@@ -194,7 +194,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)

"fix" or not it is an ABI change... who is impacted? Has anyone used the current, pre-patch behavior as documented?

I doubt that anyone has used it given the current incorrect behavior but lets ask libata transport authors..

#3 lore raw

On Fri, Oct 14, 2011 at 2:58 AM, Bartlomiej Zolnierkiewicz <[email protected]> wrote:
...

Quoted 5 lines
Quoted 2 lines

"fix" or not it is an ABI change... who is impacted?  Has anyone used the current, pre-patch behavior as documented?

I doubt that anyone has used it given the current incorrect behavior but lets ask libata transport authors..

Gwendal is the primary author.

I'm not aware of any uses either.

Based on this kernel.org documentation:
http://www.kernel.org/doc/Documentation/ABI/testing/sysfs-ata

"xfer_mode Current transfer mode."

I agree with Bartomiej that current behavior is incorrect.

cheers,
grant

#4 lore raw
Quoted 3 lines

"xfer_mode Current transfer mode."

I agree with Bartomiej that current behavior is incorrect.

Well we should probably fix the document and add the current transfer mode as its own sysfs entry - much less risky.

#5 lore raw

Changes looks good. I will post another one related to sata speed soon. Also, I have to support slave ATA devices.

Gwendal.

Quoted 11 lines · Alan Cox
Quoted 3 lines

    "xfer_mode   Current transfer mode."

I agree with Bartomiej that current behavior is incorrect.

Well we should probably fix the document and add the current transfer mode as its own sysfs entry - much less risky.
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html