linux/drivers/staging/gasket
Bjorn Helgaas 0a8f41023e PCI: Move Apex Edge TPU class quirk to fix BAR assignment
Some Google Apex Edge TPU devices have a class code of 0
(PCI_CLASS_NOT_DEFINED).  This prevents the PCI core from assigning
resources for the Apex BARs because __dev_sort_resources() ignores
classless devices, host bridges, and IOAPICs.

On x86, firmware typically assigns those resources, so this was not a
problem.  But on some architectures, firmware does *not* assign BARs, and
since the PCI core didn't do it either, the Apex device didn't work
correctly:

  apex 0000:01:00.0: can't enable device: BAR 0 [mem 0x00000000-0x00003fff 64bit pref] not claimed
  apex 0000:01:00.0: error enabling PCI device

f390d08d8b ("staging: gasket: apex: fixup undefined PCI class") added a
quirk to fix the class code, but it was in the apex driver, and if the
driver was built as a module, it was too late to help.

Move the quirk to the PCI core, where it will always run early enough that
the PCI core will assign resources if necessary.

Link: https://lore.kernel.org/r/CAEzXK1r0Er039iERnc2KJ4jn7ySNUOG9H=Ha8TD8XroVqiZjgg@mail.gmail.com
Fixes: f390d08d8b ("staging: gasket: apex: fixup undefined PCI class")
Reported-by: Luís Mendes <luis.p.mendes@gmail.com>
Debugged-by: Luís Mendes <luis.p.mendes@gmail.com>
Tested-by: Luis Mendes <luis.p.mendes@gmail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: Todd Poynor <toddpoynor@google.com>
2020-04-14 19:16:51 -05:00
..
Kconfig staging: add missing SPDX lines to Kconfig files 2019-04-03 11:10:15 +02:00
Makefile staging: add missing SPDX lines to Makefile files 2019-04-03 11:10:15 +02:00
TODO staging: gasket: TODO: re-implement using UIO 2018-09-10 18:08:06 +02:00
apex.h staging: gasket: apex: move driver-private defines out of apex.h 2018-08-01 20:07:03 +02:00
apex_driver.c PCI: Move Apex Edge TPU class quirk to fix BAR assignment 2020-04-14 19:16:51 -05:00
gasket.h staging: gasket: remove "reset type" param from framework 2018-08-02 11:00:21 +02:00
gasket_constants.h PCI: Add PCI_STD_NUM_BARS for the number of standard BARs 2019-10-14 10:22:26 -05:00
gasket_core.c mm/vma: introduce VM_ACCESS_FLAGS 2020-04-10 15:36:21 -07:00
gasket_core.h PCI: Add PCI_STD_NUM_BARS for the number of standard BARs 2019-10-14 10:22:26 -05:00
gasket_interrupt.c staging: gasket: gasket_interuppt.c: Fix string split issue. 2019-03-18 07:49:45 +01:00
gasket_interrupt.h staging: gasket: interrupt: simplify interrupt init parameters 2018-08-27 19:43:44 +02:00
gasket_ioctl.c staging: gasket: Fix lines ending with a '(' 2019-10-27 08:15:42 +01:00
gasket_ioctl.h staging: gasket: common ioctl dispatcher add __user annotations 2018-07-21 08:50:36 +02:00
gasket_page_table.c staging/gasket: Fix string split 2019-05-30 14:09:47 -07:00
gasket_page_table.h staging: gasket: page table: fix header file include guard symbol 2018-08-01 20:07:03 +02:00
gasket_sysfs.c Staging: gasket: gasket_sysfs.c: Fix string split issue. 2019-03-18 18:53:17 +01:00
gasket_sysfs.h staging: gasket: Replace macro __ATTR with __ATTR_NULL 2019-03-18 07:05:58 +01:00