diff options
author | Yinghai Lu <yinghai@kernel.org> | 2012-02-24 02:46:49 -0500 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2012-02-24 17:34:40 -0500 |
commit | f4ca5c6a56278ca5421bc2e40422e4155b6735d8 (patch) | |
tree | 53be4f61e4da75deae8cbcd4948d6d3b47404d79 /drivers/pci | |
parent | ecd58d667a6ac4350d2f67b9accaadf575bae4b0 (diff) |
PCI: Add class support in quirk handling
Recently added support to allow quirks to report duration also make the
boot log very crowded when initcall_debug is specified.
One thing we can to do mitigate this is to not call quirks unnecessarily
by adding a new quirk declaration macro that takes a class argument.
The new macro takes a class value and a class shift value (since it can
vary) so that quirks will be limited to certain device classes, greatly
reducing the number we call on every PCI device addition.
-v2: fix v1 that left over of sparated patch.
-v3: according to Jesse, change cls to class, cls_shift, to class_shift.
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/quirks.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index fb544d6d29f6..2b4b1ea158cf 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c | |||
@@ -2961,17 +2961,19 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x010a, disable_igfx_irq); | |||
2961 | static void pci_do_fixups(struct pci_dev *dev, struct pci_fixup *f, | 2961 | static void pci_do_fixups(struct pci_dev *dev, struct pci_fixup *f, |
2962 | struct pci_fixup *end) | 2962 | struct pci_fixup *end) |
2963 | { | 2963 | { |
2964 | while (f < end) { | 2964 | for (; f < end; f++) |
2965 | if ((f->vendor == dev->vendor || f->vendor == (u16) PCI_ANY_ID) && | 2965 | if ((f->class == (u32) (dev->class >> f->class_shift) || |
2966 | (f->device == dev->device || f->device == (u16) PCI_ANY_ID)) { | 2966 | f->class == (u32) PCI_ANY_ID) && |
2967 | (f->vendor == dev->vendor || | ||
2968 | f->vendor == (u16) PCI_ANY_ID) && | ||
2969 | (f->device == dev->device || | ||
2970 | f->device == (u16) PCI_ANY_ID)) { | ||
2967 | dev_dbg(&dev->dev, "calling %pF\n", f->hook); | 2971 | dev_dbg(&dev->dev, "calling %pF\n", f->hook); |
2968 | if (initcall_debug) | 2972 | if (initcall_debug) |
2969 | do_one_fixup_debug(f->hook, dev); | 2973 | do_one_fixup_debug(f->hook, dev); |
2970 | else | 2974 | else |
2971 | f->hook(dev); | 2975 | f->hook(dev); |
2972 | } | 2976 | } |
2973 | f++; | ||
2974 | } | ||
2975 | } | 2977 | } |
2976 | 2978 | ||
2977 | extern struct pci_fixup __start_pci_fixups_early[]; | 2979 | extern struct pci_fixup __start_pci_fixups_early[]; |