Re: HPET regression in 2.6.26 versus 2.6.25 -- found another user with the same regression

From: Yinghai Lu
Date: Sat Aug 23 2008 - 16:51:50 EST


On Sat, Aug 23, 2008 at 12:47 PM, David Witbrodt <dawitbro@xxxxxxxxxxxxx> wrote:
>
>
>> please check v2.
>
> Thanks Yinghai. This still applies to a different line number in
> v2.6.27-rc4 than what the patch indicates. I also get a warning
> about unused variable "i" (I commented it out in my previous fix,
> but not this time).
>
> At any rate, I still produces a kernel that hangs at the typical
> location.
>
David,

please check v3

deviceid should be 0x4385 instead.

YH
[PATCH] x86: protect hpet in BAR for one ATI chipset v3

so avoid kernel don't allocate nre resource for it because it can not allocate the old
address from BIOS.

the same way like some IO APIC address in BAR handling

Signed-off-by: Yinghai Lu <yhlu.kernel@xxxxxxxxx>

---
drivers/pci/quirks.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)

Index: linux-2.6/drivers/pci/quirks.c
===================================================================
--- linux-2.6.orig/drivers/pci/quirks.c
+++ linux-2.6/drivers/pci/quirks.c
@@ -1918,6 +1918,22 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_B
PCI_DEVICE_ID_NX2_5709S,
quirk_brcm_570x_limit_vpd);

+static void __init quirk_hpet_in_bar(struct pci_dev *pdev)
+{
+ int i;
+ u64 base, size;
+
+ /* the BAR1 is the location of the HPET...we must
+ * not touch this, so forcibly insert it into the resource tree */
+ base = pci_resource_start(pdev, 1);
+ size = pci_resource_len(pdev, 1);
+ if (base && size) {
+ insert_resource(&iomem_resource, &pdev->resource[1]);
+ dev_info(&pdev->dev, "HPET at %08llx-%08llx\n", base, base + size - 1);
+ }
+}
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATI, 0x4385, quirk_hpet_in_bar);
+
#ifdef CONFIG_PCI_MSI
/* Some chipsets do not support MSI. We cannot easily rely on setting
* PCI_BUS_FLAGS_NO_MSI in its bus flags because there are actually