810-pci_disable_common_quirks.patch 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. From: Gabor Juhos <[email protected]>
  2. Subject: debloat: add kernel config option to disabling common PCI quirks
  3. Signed-off-by: Gabor Juhos <[email protected]>
  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. @@ -113,6 +113,13 @@ 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. +
  20. config PCI_ATS
  21. bool
  22. --- a/drivers/pci/quirks.c
  23. +++ b/drivers/pci/quirks.c
  24. @@ -300,6 +300,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. /*
  29. * The Mellanox Tavor device gives false positive parity errors. Disable
  30. * parity error reporting.
  31. @@ -3488,6 +3489,8 @@ 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. /*
  37. * Ivytown NTB BAR sizes are misreported by the hardware due to an erratum.
  38. * To work around this, query the size it should be configured to by the
  39. @@ -3513,6 +3516,8 @@ static void quirk_intel_ntb(struct pci_d
  40. DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0e08, quirk_intel_ntb);
  41. DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0e0d, quirk_intel_ntb);
  42. +#ifndef CONFIG_PCI_DISABLE_COMMON_QUIRKS
  43. +
  44. /*
  45. * Some BIOS implementations leave the Intel GPU interrupts enabled, even
  46. * though no one is handling them (e.g., if the i915 driver is never
  47. @@ -3551,6 +3556,8 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_IN
  48. DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x010a, disable_igfx_irq);
  49. DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0152, disable_igfx_irq);
  50. +#endif /* !CONFIG_PCI_DISABLE_COMMON_QUIRKS */
  51. +
  52. /*
  53. * PCI devices which are on Intel chips can skip the 10ms delay
  54. * before entering D3 mode.