[PATCH] Add libata support for Intel Poulsbo chipset

Du, Alek alek.du at intel.com
Tue Aug 14 08:35:11 UTC 2007


Amit,

Thanks for your review.
Attached is the new one modified according to your comments.
One thing I need to clarify: I'm not sure if it is a "Temporary workaround" because I did not get any document about next stepping, and it is not clear whether it will get fixed. So I just add "Workaround for Intel Poulsbo chipset:" in the patch comments.

Thanks,
Alek

-----Original Message-----
From: amit.kucheria at verdurent.com [mailto:amit.kucheria at verdurent.com] On Behalf Of Amit Kucheria
Sent: 2007年8月14日 16:07
To: Du, Alek
Cc: kernel-team at lists.ubuntu.com
Subject: Re: [PATCH] Add libata support for Intel Poulsbo chipset

On 8/13/07, Du, Alek <alek.du at intel.com> wrote:
> Amit, Ben and kernel team,
>
> Attached is the patch for libata support on Intel Poulsbo chipset, it is
> against ubuntu-gutsy git tree.
>

commit fecfc5a40a78e64ad9098baea15ef852127c24cc
Author: Alek Du <alek.du at intel.com>
Date:   Sun Aug 12 23:14:37 2007 -0400

    Add Intel Poulsbo chipset Libata support

diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index 7a7fac7..97b0df1 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -632,7 +632,14 @@ static int piix_pata_prereset(struct ata_port
*ap, unsigned long deadline)
        struct pci_dev *pdev = to_pci_dev(ap->host->dev);

        if (!pci_test_config_bits(pdev, &piix_enable_bits[ap->port_no]))
-               return -ENOENT;
+/* Although a PCI quirk function is added to ~/drivers/pci/quirks.c to
+ * handle that, but currently, the quirk function won't work because
+ * Poulsbo chipset regards these "reserved" registers read 00 and wrote no
+ * effect
+ */

Please add a message such as "Temporary workaround" to the patch
comment since I assume this part will be reverted once the new
stepping fixes the problems.

+               if (pdev->vendor != PCI_VENDOR_ID_INTEL ||
+                       pdev->device != PCI_DEVICE_ID_INTEL_POULSBO_IDE)
+                       return -ENOENT;
        return ata_std_prereset(ap, deadline);
 }

diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 9fd27ae..1fb10a7 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -1730,3 +1730,35 @@ static void __devinit
quirk_nvidia_ck804_msi_ht_cap(struct pci_dev *dev)
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_CK804_PCIE,
                        quirk_nvidia_ck804_msi_ht_cap);
 #endif /* CONFIG_PCI_MSI */
+
+/* The Intel Poulsbo chipset pata controller IDE decode enable bit
holds default
+ * value -- it will always be 0. Actually on current stepping, this quirk
+ * function won't work either (write to this bit has no effect). But we still
+ * put it here, may for upcoming steppings.
+ */
+static void __devinit quirk_intel_poulsbo_ide_enable(struct pci_dev *dev)
+{
+       unsigned char value;
+
+       pci_read_config_byte(dev, 0x41, &value);
+       if (!(value & 0x80)) {
+               printk(KERN_ERR "PCI: PIIX4: Fixing "
+                       "Poulsbo PATA port 1 IDE decode enabling bit\n");

KERN_ERR? Perhaps KERN_INFO or KERN_DEBUG are more appropriate?

+               value |= 0x80;
+               pci_write_config_byte(dev, 0x41, value);
+               pci_read_config_byte(dev, 0x41, &value);
+               printk(KERN_ERR "Re-read enabling bit:%d\n", value);

same here.

+       }
+       pci_read_config_byte(dev, 0x43, &value);
+       if (!(value & 0x80)) {
+               printk(KERN_ERR "PCI: PIIX4: Fixing "
+                       "Poulsbo PATA port 2 IDE decode enabling bit\n");

and here

+               value |= 0x80;
+               pci_write_config_byte(dev, 0x43, value);
+               pci_read_config_byte(dev, 0x43, &value);
+               printk(KERN_ERR "Re-read enabling bit:%d\n", value);

and here.

+       }
+}
+
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_POULSBO_IDE,
+                       quirk_intel_poulsbo_ide_enable);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-Intel-Poulsbo-chipset-Libata-support.patch
Type: application/octet-stream
Size: 2763 bytes
Desc: 0001-Add-Intel-Poulsbo-chipset-Libata-support.patch
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20070814/fe9d89b4/attachment.obj>


More information about the kernel-team mailing list