resolve collision of generic ATA_FLAG_LOWTAG and driver specific flag
PATCH 1/1 resolve collision of generic ATA_FLAG_LOWTAG and driver specific flag
The patch "libata: allow sata_sil24 to opt-out of tag ordered submission" (72dd299d5039a336493993dcc63413cf31d0e662) introduces a regression with the sata_sil24 driver.
The new flag ATA_FLAG_LOWTAG accidentially uses the same bit as SIL24_FLAG_PCIX_IRQ_WOC in the driver. This activates code for Silicon Image 3132, which is only suppossed to run under 3124.
ATA_FLAG_LOWTAG is only used in sata_sil24 and is planned to be removed soon, so lets just use another bit for the flag in sata_sil24.
drivers/ata/sata_sil24.c renamed from drivers/ata/sata_sil24.c.org +1 -1
@@ -247,7 +247,7 @@SIL24_COMMON_FLAGS =ATA_FLAG_SATA |ATA_FLAG_PIO_DMA |ATA_FLAG_NCQ |ATA_FLAG_ACPI_SATA |ATA_FLAG_AN |ATA_FLAG_PMP |ATA_FLAG_LOWTAG , -SIL24_FLAG_PCIX_IRQ_WOC = (1 <<24 ),/* IRQ loss errata on PCI-X */ +SIL24_FLAG_PCIX_IRQ_WOC = (1 <<25 ),/* IRQ loss errata on PCI-X */ IRQ_STAT_4PORTS = 0xf, };
Quoted 17 lines · Ronny Hegewald
The patch "libata: allow
sata_sil24to opt-out of tag ordered submission" (72dd299d5039a336493993dcc63413cf31d0e662) introduces a regression with thesata_sil24driver.The new flag
ATA_FLAG_LOWTAGaccidentially uses the same bit asSIL24_FLAG_PCIX_IRQ_WOCin the driver. This activates code for Silicon Image 3132, which is only suppossed to run under 3124.
ATA_FLAG_LOWTAGis only used insata_sil24and is planned to be removed soon, so lets just use another bit for the flag insata_sil24.Signed-off-by Ronny Hegewald <[email protected]>
drivers/ata/sata_sil24.c line 250
Quoted 5 lines
drivers/ata/sata_sil24.c renamed from drivers/ata/sata_sil24.c.org +1
-1@@ -247,7 +247,7 @@SIL24_COMMON_FLAGS =ATA_FLAG_SATA |ATA_FLAG_PIO_DMA |ATA_FLAG_NCQ |ATA_FLAG_ACPI_SATA |ATA_FLAG_AN |ATA_FLAG_PMP |ATA_FLAG_LOWTAG , - SIL24_FLAG_PCIX_IRQ_WOC = (1 << 24), /* IRQ loss errata on PCI-X */ + SIL24_FLAG_PCIX_IRQ_WOC = (1 << 25), /* IRQ loss errata on PCI-X */
And this will clash as soon as the next flag is added. Please don't abuse the common flag space for driver specific ones, and add a separate flags field for driver specific flags.
Hello.
Quoted 14 lines · Christoph Hellwig
Quoted 14 lines
The patch "libata: allow
sata_sil24to opt-out of tag ordered submission" (72dd299d5039a336493993dcc63413cf31d0e662) introduces a regression with thesata_sil24driver.The new flag
ATA_FLAG_LOWTAGaccidentially uses the same bit asSIL24_FLAG_PCIX_IRQ_WOCin the driver. This activates code for Silicon Image 3132, which is only suppossed to run under 3124.
ATA_FLAG_LOWTAGis only used insata_sil24and is planned to be removed soon, so lets just use another bit for the flag insata_sil24.Signed-off-by Ronny Hegewald <[email protected]>
Quoted 8 lines
drivers/ata/sata_sil24.c line 250
Quoted 8 lines
drivers/ata/sata_sil24.c renamed from drivers/ata/sata_sil24.c.org +1
-1@@ -247,7 +247,7 @@SIL24_COMMON_FLAGS =ATA_FLAG_SATA |ATA_FLAG_PIO_DMA |ATA_FLAG_NCQ |ATA_FLAG_ACPI_SATA |ATA_FLAG_AN |ATA_FLAG_PMP |ATA_FLAG_LOWTAG , - SIL24_FLAG_PCIX_IRQ_WOC = (1 << 24), /* IRQ loss errata on PCI-X */ + SIL24_FLAG_PCIX_IRQ_WOC = (1 << 25), /* IRQ loss errata on PCI-X */
This one also collides with ATA_FLAG_SAS_HOST.
Quoted 3 lines
And this will clash as soon as the next flag is added. Please don't abuse the common flag space for driver specific ones, and add a separate flags field for driver specific flags.
Actually, bits 24-31 are reserved for the low-level driver usage (see the
comment below ATA_FLAG_*), so it's the new ATA_FLAG_LOWTAG and ATA_FLAG_SAS_HOST that have violated the convention and should be moved (there's plenty of lower bits due to the removal of some obsolete flags).
WBR, Sergei
Quoted 5 lines · Sergei Shtylyov
Quoted 2 lines
drivers/ata/sata_sil24.c line 250
Quoted 2 lines
drivers/ata/sata_sil24.c renamed from drivers/ata/sata_sil24.c.org +1
-1- SIL24_FLAG_PCIX_IRQ_WOC = (1 << 24), /* IRQ loss errata on PCI-X */ + SIL24_FLAG_PCIX_IRQ_WOC = (1 << 25), /* IRQ loss errata on PCI-X */This one also collides with
ATA_FLAG_SAS_HOST.
Quoted 8 lines
Quoted 3 lines
And this will clash as soon as the next flag is added. Please don't abuse the common flag space for driver specific ones, and add a separate flags field for driver specific flags.
Actually, bits 24-31 are reserved for the low-level driver usage (see the
comment below ATA_FLAG_*), so it's the newATA_FLAG_LOWTAGandATA_FLAG_SAS_HOSTthat have violated the convention and should be moved (there's plenty of lower bits due to the removal of some obsolete flags).
Yeah, this something dumb I did way back. Can we please add a separate field for per-controller flags in port_info and all related structs so that we don't do this sharing?
Thanks.
Signature · 1 line
tejun
Hello.
Quoted 5 lines · Ronny Hegewald
The patch "libata: allow
sata_sil24to opt-out of tag ordered submission" (72dd299d5039a336493993dcc63413cf31d0e662) introduces a regression with thesata_sil24driver.The new flag
ATA_FLAG_LOWTAGaccidentially uses the same bit as
Accidentally.
Quoted 2 lines
SIL24_FLAG_PCIX_IRQ_WOCin the driver. This activates code for Silicon Image 3132, which is only suppossed to run under 3124.
Supposed.
Quoted 2 lines
ATA_FLAG_LOWTAGis only used insata_sil24and is planned to be removed soon, so lets just use another bit for the flag insata_sil24.
Actually, ATA_FLAG_LOWTAG has been removed in the 'for-next' branch, so
this patch is no longer needed. Moreover, the newly assigned flag clashes with the new ATA_FLAG_SATA_PORT.
Quoted 1 line
Signed-off-by Ronny Hegewald <[email protected]>
[...]
MBR, Sergei
On Friday 10 April 2015, you wrote
Quoted 2 lines
Actually,
ATA_FLAG_LOWTAGhas been removed in the 'for-next' branch, so this patch is no longer needed.
Its still needed for kernel <= 3.19, else the driver will malfunction for SI3132 based chipsets.
Quoted 1 line
Moreover, the newly assigned flag clashes with the new
ATA_FLAG_SATA_PORT.
As far i can tell its not really a problem in practice for this driver, as they will not be used together. But its certainly better to keep the flags clash-free nonetheless. I will change it to bit 31 in the next version of the patch.