aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
authorChristian Gmeiner <christian.gmeiner@gmail.com>2012-10-09 11:53:12 -0400
committerJeff Garzik <jgarzik@redhat.com>2012-11-28 12:38:41 -0500
commitabf8f2b877846573f0e6498883fe43f08be5696d (patch)
treef33d941d949395934f40e4c37768c55ecf4ebbe4 /drivers/ata
parentd9904344fc4052fbe7e4dc137eba0dcdadf326bd (diff)
pata_cs5536: add quirk for broken udma
I am working on a device which uses the cs5536 pata driver. There are some broken hardware revisions out in the field, which can be detected via DMI. On older versions with an embedded BIOS I used libata.dma=0 to disable dma completely. Now we are switching to a coreboot/seabios based BIOS where we have DMI support and so I think its a good idea to get rid of all those hacky kernel parameters as the same image is used other devices where libata.dma=0 is not a good idea. Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/pata_cs5536.c32
1 files changed, 31 insertions, 1 deletions
diff --git a/drivers/ata/pata_cs5536.c b/drivers/ata/pata_cs5536.c
index dec1b6c4b351..0448860a2077 100644
--- a/drivers/ata/pata_cs5536.c
+++ b/drivers/ata/pata_cs5536.c
@@ -38,6 +38,7 @@
38#include <linux/delay.h> 38#include <linux/delay.h>
39#include <linux/libata.h> 39#include <linux/libata.h>
40#include <scsi/scsi_host.h> 40#include <scsi/scsi_host.h>
41#include <linux/dmi.h>
41 42
42#ifdef CONFIG_X86_32 43#ifdef CONFIG_X86_32
43#include <asm/msr.h> 44#include <asm/msr.h>
@@ -80,6 +81,21 @@ enum {
80 IDE_ETC_UDMA_MASK = 0xc0, 81 IDE_ETC_UDMA_MASK = 0xc0,
81}; 82};
82 83
84/* Some Bachmann OT200 devices have a non working UDMA support due a
85 * missing resistor.
86 */
87static const struct dmi_system_id udma_quirk_dmi_table[] = {
88 {
89 .ident = "Bachmann electronic OT200",
90 .matches = {
91 DMI_MATCH(DMI_SYS_VENDOR, "Bachmann electronic"),
92 DMI_MATCH(DMI_PRODUCT_NAME, "OT200"),
93 DMI_MATCH(DMI_PRODUCT_VERSION, "1")
94 },
95 },
96 { }
97};
98
83static int cs5536_read(struct pci_dev *pdev, int reg, u32 *val) 99static int cs5536_read(struct pci_dev *pdev, int reg, u32 *val)
84{ 100{
85 if (unlikely(use_msr)) { 101 if (unlikely(use_msr)) {
@@ -242,9 +258,23 @@ static int cs5536_init_one(struct pci_dev *dev, const struct pci_device_id *id)
242 .port_ops = &cs5536_port_ops, 258 .port_ops = &cs5536_port_ops,
243 }; 259 };
244 260
245 const struct ata_port_info *ppi[] = { &info, &ata_dummy_port_info }; 261 static const struct ata_port_info no_udma_info = {
262 .flags = ATA_FLAG_SLAVE_POSS,
263 .pio_mask = ATA_PIO4,
264 .port_ops = &cs5536_port_ops,
265 };
266
267
268 const struct ata_port_info *ppi[2];
246 u32 cfg; 269 u32 cfg;
247 270
271 if (dmi_check_system(udma_quirk_dmi_table))
272 ppi[0] = &no_udma_info;
273 else
274 ppi[0] = &info;
275
276 ppi[1] = &ata_dummy_port_info;
277
248 if (use_msr) 278 if (use_msr)
249 printk(KERN_ERR DRV_NAME ": Using MSR regs instead of PCI\n"); 279 printk(KERN_ERR DRV_NAME ": Using MSR regs instead of PCI\n");
250 280