Messages in this thread Patch in this message | | | Date | Sun, 24 Aug 2008 21:41:28 -0700 | From | "Yinghai Lu" <> | Subject | Re: HPET regression in 2.6.26 versus 2.6.25 -- found another user with the same regression |
| |
On Sun, Aug 24, 2008 at 7:00 PM, David Witbrodt <dawitbro@sbcglobal.net> wrote: > > >> after discussing with Ingo, we have one more generic way to detect the >> same situation. >> >> please help to verify the attached patch. ( don't apply previous patch) > > Geez, a guy tries to leave so he doesn't get banned because of his stupid > webmail client, and... oh, never mind... ;) > > > Results: > > 1) patch applied perfectly to tip/master. > > 2) patched file compiles without warning or error. > (I thought there would be a type mismatch -- the "base" variable in your > patch is unsigned long, while "res->start" is resource_size_t ==> > u64 ==> unsigned long long, but I must have been mistaken.) > > 3) kernel builds fine > > 4) reboot hangs at the familiar call of inet_init() >
this one should work. please apply this one only.
YH [PATCH] x86: check hpet with BAR v2
insert some resources to resource tree forcily, so could avoid kernel update the resources in pci device.
should check in device too.
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
--- arch/x86/pci/i386.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+)
Index: linux-2.6/arch/x86/pci/i386.c =================================================================== --- linux-2.6.orig/arch/x86/pci/i386.c +++ linux-2.6/arch/x86/pci/i386.c @@ -33,6 +33,7 @@ #include <linux/bootmem.h> #include <asm/pat.h> +#include <asm/hpet.h> #include "pci.h" @@ -77,6 +78,30 @@ pcibios_align_resource(void *data, struc } EXPORT_SYMBOL(pcibios_align_resource); +static int check_res_with_valid(struct pci_dev *dev, struct resource *res) +{ + unsigned long base; + unsigned long size; + + base = res->start; + size = (res->start == 0 && res->end == res->start) ? 0 : + (res->end - res->start + 1); + + if (!base || !size) + return 0; + +#ifdef CONFIG_HPET_TIMER + /* for hpet */ + if (base == hpet_address && (res->flags & IORESOURCE_MEM)) { + dev_info(&dev->dev, "BAR has HPET at %08lx-%08lx\n", + base, base + size - 1); + return 1; + } +#endif + + return 0; +} + /* * Handle resources of PCI devices. If the world were perfect, we could * just allocate all the resource regions and do nothing more. It isn't. @@ -171,6 +196,22 @@ static void __init pcibios_allocate_reso r->flags, disabled, pass); pr = pci_find_parent_resource(dev, r); if (!pr || request_resource(pr, r) < 0) { + if (check_res_with_valid(dev, r)) { + struct resource *root = NULL; + + /* + * forcibly insert it into the + * resource tree + */ + if (r->flags & IORESOURCE_MEM) + root = &iomem_resource; + else if (r->flags & IORESOURCE_IO) + root = &ioport_resource; + + if (root) + insert_resource(root, r); + continue; + } dev_err(&dev->dev, "BAR %d: can't " "allocate resource\n", idx); /* We'll assign a new address later */ | |