diff options
author | Dan McGee <dpmcgee@gmail.com> | 2011-09-07 12:23:19 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2011-10-08 00:07:15 -0400 |
commit | f30f9a5e7bc130c727712342dd064ae8d188b170 (patch) | |
tree | b32c45ad1dfd693eb9d0219648b4fbfeaf1039f7 /drivers/ata | |
parent | 023a0175ad4beaa14b303e133963c971ad31c338 (diff) |
pata_sis: add mode_filter method for certain sis5513 chipsets
This mirrors a very old commit (3160d5416f39da9d9, "sis5513: add
->udma_filter method for chipset_family >= ATA_133") to the old sis5513
IDE driver that prevents certain setups from working.
UDMA6 (ATA/133) is not supported on some chipsets and we need to ensure
this mode is not chosen even if a connected drive supports it. Port this
old patch forward to the new PATA driver to ensure UDMA5 is the highest
mode used if that is what is supported.
Kernel bugzilla #41582.
Reviewed-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Dan McGee <dpmcgee@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata')
-rw-r--r-- | drivers/ata/pata_sis.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/drivers/ata/pata_sis.c b/drivers/ata/pata_sis.c index 10af293b1c6..fb4e90f6d74 100644 --- a/drivers/ata/pata_sis.c +++ b/drivers/ata/pata_sis.c | |||
@@ -509,6 +509,27 @@ static void sis_133_set_dmamode (struct ata_port *ap, struct ata_device *adev) | |||
509 | pci_write_config_dword(pdev, port, t1); | 509 | pci_write_config_dword(pdev, port, t1); |
510 | } | 510 | } |
511 | 511 | ||
512 | /** | ||
513 | * sis_133_mode_filter - mode selection filter | ||
514 | * @adev: ATA device | ||
515 | * | ||
516 | * Block UDMA6 on devices that do not support it. | ||
517 | */ | ||
518 | |||
519 | static unsigned long sis_133_mode_filter(struct ata_device *adev, unsigned long mask) | ||
520 | { | ||
521 | struct ata_port *ap = adev->link->ap; | ||
522 | struct pci_dev *pdev = to_pci_dev(ap->host->dev); | ||
523 | int port = sis_port_base(adev); | ||
524 | u32 t1; | ||
525 | |||
526 | pci_read_config_dword(pdev, port, &t1); | ||
527 | /* if ATA133 is disabled, mask it out */ | ||
528 | if (!(t1 & 0x08)) | ||
529 | mask &= ~(0xC0 << ATA_SHIFT_UDMA); | ||
530 | return mask; | ||
531 | } | ||
532 | |||
512 | static struct scsi_host_template sis_sht = { | 533 | static struct scsi_host_template sis_sht = { |
513 | ATA_BMDMA_SHT(DRV_NAME), | 534 | ATA_BMDMA_SHT(DRV_NAME), |
514 | }; | 535 | }; |
@@ -530,6 +551,7 @@ static struct ata_port_operations sis_133_ops = { | |||
530 | .set_piomode = sis_133_set_piomode, | 551 | .set_piomode = sis_133_set_piomode, |
531 | .set_dmamode = sis_133_set_dmamode, | 552 | .set_dmamode = sis_133_set_dmamode, |
532 | .cable_detect = sis_133_cable_detect, | 553 | .cable_detect = sis_133_cable_detect, |
554 | .mode_filter = sis_133_mode_filter, | ||
533 | }; | 555 | }; |
534 | 556 | ||
535 | static struct ata_port_operations sis_133_early_ops = { | 557 | static struct ata_port_operations sis_133_early_ops = { |
@@ -779,10 +801,13 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) | |||
779 | 801 | ||
780 | switch(trueid) { | 802 | switch(trueid) { |
781 | case 0x5518: /* SIS 962/963 */ | 803 | case 0x5518: /* SIS 962/963 */ |
804 | dev_info(&pdev->dev, | ||
805 | "SiS 962/963 MuTIOL IDE UDMA133 controller\n"); | ||
782 | chipset = &sis133; | 806 | chipset = &sis133; |
783 | if ((idemisc & 0x40000000) == 0) { | 807 | if ((idemisc & 0x40000000) == 0) { |
784 | pci_write_config_dword(pdev, 0x54, idemisc | 0x40000000); | 808 | pci_write_config_dword(pdev, 0x54, idemisc | 0x40000000); |
785 | printk(KERN_INFO "SIS5513: Switching to 5513 register mapping\n"); | 809 | dev_info(&pdev->dev, |
810 | "Switching to 5513 register mapping\n"); | ||
786 | } | 811 | } |
787 | break; | 812 | break; |
788 | case 0x0180: /* SIS 965/965L */ | 813 | case 0x0180: /* SIS 965/965L */ |