diff options
author | Alan Cox <alan@linux.intel.com> | 2009-11-30 08:22:43 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2009-12-03 02:46:36 -0500 |
commit | 10734fc8d5fbf89e88519d72e58cce83be21941a (patch) | |
tree | fd0639939de17a57be11166d2673e6baf64d1fee | |
parent | 294264a94215f5a16a92e8e6b05252ed22fed249 (diff) |
pata_via: Blacklist some combinations of Transcend Flash and via
Reported by Mikulas Patocka.
VIA VT82C586B + Transcend TS64GSSD25-M v0826 does not work in UDMA mode
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
-rw-r--r-- | drivers/ata/pata_via.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/ata/pata_via.c b/drivers/ata/pata_via.c index 520d5a31f8a2..78eac276effb 100644 --- a/drivers/ata/pata_via.c +++ b/drivers/ata/pata_via.c | |||
@@ -337,6 +337,32 @@ static void via_set_dmamode(struct ata_port *ap, struct ata_device *adev) | |||
337 | } | 337 | } |
338 | 338 | ||
339 | /** | 339 | /** |
340 | * via_mode_filter - filter buggy device/mode pairs | ||
341 | * @dev: ATA device | ||
342 | * @mask: Mode bitmask | ||
343 | * | ||
344 | * We need to apply some minimal filtering for old controllers and at least | ||
345 | * one breed of Transcend SSD. Return the updated mask. | ||
346 | */ | ||
347 | |||
348 | static unsigned long via_mode_filter(struct ata_device *dev, unsigned long mask) | ||
349 | { | ||
350 | struct ata_host *host = dev->link->ap->host; | ||
351 | const struct via_isa_bridge *config = host->private_data; | ||
352 | unsigned char model_num[ATA_ID_PROD_LEN + 1]; | ||
353 | |||
354 | if (config->id == PCI_DEVICE_ID_VIA_82C586_0) { | ||
355 | ata_id_c_string(dev->id, model_num, ATA_ID_PROD, sizeof(model_num)); | ||
356 | if (strcmp(model_num, "TS64GSSD25-M") == 0) { | ||
357 | ata_dev_printk(dev, KERN_WARNING, | ||
358 | "disabling UDMA mode due to reported lockups with this device.\n"); | ||
359 | mask &= ~ ATA_MASK_UDMA; | ||
360 | } | ||
361 | } | ||
362 | return ata_bmdma_mode_filter(dev, mask); | ||
363 | } | ||
364 | |||
365 | /** | ||
340 | * via_tf_load - send taskfile registers to host controller | 366 | * via_tf_load - send taskfile registers to host controller |
341 | * @ap: Port to which output is sent | 367 | * @ap: Port to which output is sent |
342 | * @tf: ATA taskfile register set | 368 | * @tf: ATA taskfile register set |
@@ -427,6 +453,7 @@ static struct ata_port_operations via_port_ops = { | |||
427 | .prereset = via_pre_reset, | 453 | .prereset = via_pre_reset, |
428 | .sff_tf_load = via_tf_load, | 454 | .sff_tf_load = via_tf_load, |
429 | .port_start = via_port_start, | 455 | .port_start = via_port_start, |
456 | .mode_filter = via_mode_filter, | ||
430 | }; | 457 | }; |
431 | 458 | ||
432 | static struct ata_port_operations via_port_ops_noirq = { | 459 | static struct ata_port_operations via_port_ops_noirq = { |