diff options
author | Alan Cox <alan@lxorguk.ukuu.org.uk> | 2005-12-08 14:22:28 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-12-12 23:23:03 -0500 |
commit | c621b140603dfb4a89809e00f965d42c054871e0 (patch) | |
tree | 8e72d8109a40ff2853a02e11db9e2b63f625995c /drivers/scsi/ata_piix.c | |
parent | 9da305eb089c94c535d1790fd2dec16f44c1689f (diff) |
[PATCH] libata: ata_piix 450NX errata
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/scsi/ata_piix.c')
-rw-r--r-- | drivers/scsi/ata_piix.c | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/drivers/scsi/ata_piix.c b/drivers/scsi/ata_piix.c index 908ff1f9671a..0ea27873b9ff 100644 --- a/drivers/scsi/ata_piix.c +++ b/drivers/scsi/ata_piix.c | |||
@@ -620,6 +620,40 @@ static int piix_disable_ahci(struct pci_dev *pdev) | |||
620 | } | 620 | } |
621 | 621 | ||
622 | /** | 622 | /** |
623 | * piix_check_450nx_errata - Check for problem 450NX setup | ||
624 | * | ||
625 | * Check for the present of 450NX errata #19 and errata #25. If | ||
626 | * they are found return an error code so we can turn off DMA | ||
627 | */ | ||
628 | |||
629 | static int __devinit piix_check_450nx_errata(struct pci_dev *ata_dev) | ||
630 | { | ||
631 | struct pci_dev *pdev = NULL; | ||
632 | u16 cfg; | ||
633 | u8 rev; | ||
634 | int no_piix_dma = 0; | ||
635 | |||
636 | while((pdev = pci_get_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82454NX, pdev)) != NULL) | ||
637 | { | ||
638 | /* Look for 450NX PXB. Check for problem configurations | ||
639 | A PCI quirk checks bit 6 already */ | ||
640 | pci_read_config_byte(pdev, PCI_REVISION_ID, &rev); | ||
641 | pci_read_config_word(pdev, 0x41, &cfg); | ||
642 | /* Only on the original revision: IDE DMA can hang */ | ||
643 | if(rev == 0x00) | ||
644 | no_piix_dma = 1; | ||
645 | /* On all revisions below 5 PXB bus lock must be disabled for IDE */ | ||
646 | else if(cfg & (1<<14) && rev < 5) | ||
647 | no_piix_dma = 2; | ||
648 | } | ||
649 | if(no_piix_dma) | ||
650 | dev_printk(KERN_WARNING, &ata_dev->dev, "450NX errata present, disabling IDE DMA.\n"); | ||
651 | if(no_piix_dma == 2) | ||
652 | dev_printk(KERN_WARNING, &ata_dev->dev, "A BIOS update may resolve this.\n"); | ||
653 | return no_piix_dma; | ||
654 | } | ||
655 | |||
656 | /** | ||
623 | * piix_init_one - Register PIIX ATA PCI device with kernel services | 657 | * piix_init_one - Register PIIX ATA PCI device with kernel services |
624 | * @pdev: PCI device to register | 658 | * @pdev: PCI device to register |
625 | * @ent: Entry in piix_pci_tbl matching with @pdev | 659 | * @ent: Entry in piix_pci_tbl matching with @pdev |
@@ -693,7 +727,15 @@ static int piix_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) | |||
693 | "combined mode detected (p=%u, s=%u)\n", | 727 | "combined mode detected (p=%u, s=%u)\n", |
694 | pata_chan, sata_chan); | 728 | pata_chan, sata_chan); |
695 | } | 729 | } |
696 | 730 | if (piix_check_450nx_errata(pdev)) { | |
731 | /* This writes into the master table but it does not | ||
732 | really matter for this errata as we will apply it to | ||
733 | all the PIIX devices on the board */ | ||
734 | port_info[0]->mwdma_mask = 0; | ||
735 | port_info[0]->udma_mask = 0; | ||
736 | port_info[1]->mwdma_mask = 0; | ||
737 | port_info[1]->udma_mask = 0; | ||
738 | } | ||
697 | return ata_pci_init_one(pdev, port_info, 2); | 739 | return ata_pci_init_one(pdev, port_info, 2); |
698 | } | 740 | } |
699 | 741 | ||