810-pci_disable_common_quirks.patch 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. From: Gabor Juhos <juhosg@openwrt.org>
  2. Subject: debloat: add kernel config option to disabling common PCI quirks
  3. Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
  4. ---
  5. drivers/pci/Kconfig | 6 ++++++
  6. drivers/pci/quirks.c | 6 ++++++
  7. 2 files changed, 12 insertions(+)
  8. --- a/drivers/pci/Kconfig
  9. +++ b/drivers/pci/Kconfig
  10. @@ -71,6 +71,12 @@ config XEN_PCIDEV_FRONTEND
  11. The PCI device frontend driver allows the kernel to import arbitrary
  12. PCI devices from a PCI backend to support PCI driver domains.
  13. +config PCI_DISABLE_COMMON_QUIRKS
  14. + bool "PCI disable common quirks"
  15. + depends on PCI
  16. + help
  17. + If you don't know what to do here, say N.
  18. +
  19. config HT_IRQ
  20. bool "Interrupts on hypertransport devices"
  21. default y
  22. --- a/drivers/pci/quirks.c
  23. +++ b/drivers/pci/quirks.c
  24. @@ -44,6 +44,7 @@ static void quirk_mmio_always_on(struct
  25. DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_ANY_ID, PCI_ANY_ID,
  26. PCI_CLASS_BRIDGE_HOST, 8, quirk_mmio_always_on);
  27. +#ifndef CONFIG_PCI_DISABLE_COMMON_QUIRKS
  28. /* The Mellanox Tavor device gives false positive parity errors
  29. * Mark this device with a broken_parity_status, to allow
  30. * PCI scanning code to "skip" this now blacklisted device.
  31. @@ -3095,6 +3096,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_I
  32. DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x65f9, quirk_intel_mc_errata);
  33. DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x65fa, quirk_intel_mc_errata);
  34. +#endif /* !CONFIG_PCI_DISABLE_COMMON_QUIRKS */
  35. /*
  36. * Ivytown NTB BAR sizes are misreported by the hardware due to an erratum. To
  37. @@ -3151,6 +3153,8 @@ static void fixup_debug_report(struct pc
  38. }
  39. }
  40. +#ifndef CONFIG_PCI_DISABLE_COMMON_QUIRKS
  41. +
  42. /*
  43. * Some BIOS implementations leave the Intel GPU interrupts enabled,
  44. * even though no one is handling them (f.e. i915 driver is never loaded).
  45. @@ -3189,6 +3193,8 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_IN
  46. DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x010a, disable_igfx_irq);
  47. DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0152, disable_igfx_irq);
  48. +#endif /* !CONFIG_PCI_DISABLE_COMMON_QUIRKS */
  49. +
  50. /*
  51. * PCI devices which are on Intel chips can skip the 10ms delay
  52. * before entering D3 mode.