lkml.org 
[lkml]   [2011]   [Dec]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 08/10] cpufreq: Add support for x86 cpuinfo auto loading
    On Mon, Dec 19, 2011 at 02:47:44PM -0800, Andi Kleen wrote:

    > diff --git a/drivers/cpufreq/gx-suspmod.c b/drivers/cpufreq/gx-suspmod.c
    > index ffe1f2c..05d0f7f 100644
    > --- a/drivers/cpufreq/gx-suspmod.c
    > +++ b/drivers/cpufreq/gx-suspmod.c
    > @@ -82,6 +82,7 @@
    > #include <linux/errno.h>
    > #include <linux/slab.h>
    >
    > +#include <asm/cpu_device_id.h>
    > #include <asm/processor-cyrix.h>
    >
    > /* PCI config registers, all at F0 */
    > @@ -171,12 +172,20 @@ static struct pci_device_id gx_chipset_tbl[] __initdata = {
    > { PCI_VDEVICE(CYRIX, PCI_DEVICE_ID_CYRIX_5510), },
    > { 0, },
    > };
    > +/* MODULE_DEVICE_TABLE here too? But the CPU should be enough. */
    >
    > static void gx_write_byte(int reg, int value)
    > {
    > pci_write_config_byte(gx_params->cs55x0, reg, value);
    > }
    >
    > +static const struct x86_cpu_id gx_ids[] = {
    > + { X86_VENDOR_NSC, },
    > + { X86_VENDOR_CYRIX },
    > + {}
    > +};
    > +MODULE_DEVICE_TABLE(x86cpu, gx_ids);
    > +
    > /**
    > * gx_detect_chipset:
    > *
    > @@ -185,12 +194,8 @@ static __init struct pci_dev *gx_detect_chipset(void)
    > {
    > struct pci_dev *gx_pci = NULL;
    >
    > - /* check if CPU is a MediaGX or a Geode. */
    > - if ((boot_cpu_data.x86_vendor != X86_VENDOR_NSC) &&
    > - (boot_cpu_data.x86_vendor != X86_VENDOR_CYRIX)) {
    > - pr_debug("error: no MediaGX/Geode processor found!\n");
    > + if (!x86_match_cpu(gx_ids))
    > return NULL;
    > - }
    >
    > /* detect which companion chip is used */
    > for_each_pci_dev(gx_pci) {

    Looking closer at this one, I think we could possibly just autoload based on the PCI IDs
    in gx_chipset_tbl, and remove the cpu vendor checking entirely.
    Pretty sure those Cyrix PCI devices won't show up anywhere else.

    Otherwise, we could narrow the range this gets loaded on to Cyrix Fam 4 model 5, and
    NatSemi Fam 5, model 4. (afaik, that covers all the possible cpus this driver works on)

    Dave



    \
     
     \ /
      Last update: 2011-12-20 00:07    [W:3.046 / U:0.028 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site