Patchwork pata_amd: do not filter out valid modes in nv_mode_filter

login
register
mail settings
Submitter Robert Hancock
Date Sept. 13, 2009, 5:54 a.m.
Message ID <4AAC8927.4030401@gmail.com>
Download mbox | patch
Permalink /patch/33542/
State Not Applicable
Delegated to: David Miller
Headers show

Comments

Robert Hancock - Sept. 13, 2009, 5:54 a.m.
On a Compaq Presario V3000 laptop (NVIDIA MCP51 chipset), pata_amd selects
PIO0 mode for the PATA DVD-RAM drive instead of MWDMA2 which it supports:

ata4.00: ATAPI: HL-DT-ST DVDRAM GSA-4084N, KQ09, max MWDMA2
ata4: nv_mode_filter: 0x39f&0x7001->0x1, BIOS=0x0 (0x0) ACPI=0x7001 (60:600:0x11)
ata4.00: configured for PIO0

For some reason, the BIOS-set UDMA configuration returns 0 and the ACPI _GTM
reports that UDMA2 and PIO0 are enabled. This causes nv_mode_filter to end up
allowing only PIO0 and UDMA0-2. Since the drive doesn't support UDMA we end up
using PIO0.

Since the controllers should always support PIO4, MWDMA2 and UDMA2 regardless
of what cable type is used, let's make sure we don't filter out these modes
regardless of what wacky settings the BIOS is using.

Signed-off-by: Robert Hancock <hancockrwd@gmail.com>
Cc: stable@kernel.org

--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tejun Heo - Sept. 14, 2009, 9:21 a.m.
Robert Hancock wrote:
> On a Compaq Presario V3000 laptop (NVIDIA MCP51 chipset), pata_amd selects
> PIO0 mode for the PATA DVD-RAM drive instead of MWDMA2 which it supports:
> 
> ata4.00: ATAPI: HL-DT-ST DVDRAM GSA-4084N, KQ09, max MWDMA2
> ata4: nv_mode_filter: 0x39f&0x7001->0x1, BIOS=0x0 (0x0) ACPI=0x7001 (60:600:0x11)
> ata4.00: configured for PIO0
> 
> For some reason, the BIOS-set UDMA configuration returns 0 and the ACPI _GTM
> reports that UDMA2 and PIO0 are enabled. This causes nv_mode_filter to end up
> allowing only PIO0 and UDMA0-2. Since the drive doesn't support UDMA we end up
> using PIO0.
> 
> Since the controllers should always support PIO4, MWDMA2 and UDMA2 regardless
> of what cable type is used, let's make sure we don't filter out these modes
> regardless of what wacky settings the BIOS is using.
> 
> Signed-off-by: Robert Hancock <hancockrwd@gmail.com>
> Cc: stable@kernel.org

Looks good to me.

Acked-by: Tejun Heo <tj@kernel.org>

Not so sure whether this is -stable material yet tho.
Jeff Garzik - Sept. 17, 2009, 8:51 p.m.
On 09/13/2009 01:54 AM, Robert Hancock wrote:
> On a Compaq Presario V3000 laptop (NVIDIA MCP51 chipset), pata_amd selects
> PIO0 mode for the PATA DVD-RAM drive instead of MWDMA2 which it supports:
>
> ata4.00: ATAPI: HL-DT-ST DVDRAM GSA-4084N, KQ09, max MWDMA2
> ata4: nv_mode_filter: 0x39f&0x7001->0x1, BIOS=0x0 (0x0) ACPI=0x7001 (60:600:0x11)
> ata4.00: configured for PIO0
>
> For some reason, the BIOS-set UDMA configuration returns 0 and the ACPI _GTM
> reports that UDMA2 and PIO0 are enabled. This causes nv_mode_filter to end up
> allowing only PIO0 and UDMA0-2. Since the drive doesn't support UDMA we end up
> using PIO0.
>
> Since the controllers should always support PIO4, MWDMA2 and UDMA2 regardless
> of what cable type is used, let's make sure we don't filter out these modes
> regardless of what wacky settings the BIOS is using.
>
> Signed-off-by: Robert Hancock<hancockrwd@gmail.com>
> Cc: stable@kernel.org

applied


--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/ata/pata_amd.c b/drivers/ata/pata_amd.c
index 33a74f1..567f3f7 100644
--- a/drivers/ata/pata_amd.c
+++ b/drivers/ata/pata_amd.c
@@ -307,6 +307,9 @@  static unsigned long nv_mode_filter(struct ata_device *dev,
 		limit |= ATA_MASK_PIO;
 	if (!(limit & (ATA_MASK_MWDMA | ATA_MASK_UDMA)))
 		limit |= ATA_MASK_MWDMA | ATA_MASK_UDMA;
+	/* PIO4, MWDMA2, UDMA2 should always be supported regardless of
+	   cable detection result */
+	limit |= ata_pack_xfermask(ATA_PIO4, ATA_MWDMA2, ATA_UDMA2);
 
 	ata_port_printk(ap, KERN_DEBUG, "nv_mode_filter: 0x%lx&0x%lx->0x%lx, "
 			"BIOS=0x%lx (0x%x) ACPI=0x%lx%s\n",