linux/drivers/staging
Bjorn Helgaas 764a7d0a27 PCI: Move Apex Edge TPU class quirk to fix BAR assignment
commit 0a8f41023e upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-02 08:48:50 +02:00
..
android staging: android: ashmem: Disallow ashmem memory from being remapped 2020-02-28 17:22:15 +01:00
axis-fifo staging: axis-fifo: add unspecified HAS_IOMEM dependency 2020-01-12 12:21:35 +01:00
board
clocking-wizard
comedi staging: comedi: Fix comedi_device refcnt leak in comedi_open 2020-04-29 16:33:20 +02:00
emxx_udc staging: emxx_udc: remove local TRUE/FALSE definition 2019-09-12 10:35:51 +01:00
exfat staging: exfat: fix multiple definition error of `rename_file' 2019-12-17 19:55:33 +01:00
fbtft fbtft: Make sure string is NULL terminated 2019-12-31 16:45:42 +01:00
fieldbus dt-bindings: anybus-controller: move to staging/ tree 2019-09-12 10:35:51 +01:00
fsl-dpaa2 staging: fsl-dpaa2/ethsw: do not force user to bring interface down 2019-08-14 16:46:25 +02:00
fwserial
gasket PCI: Move Apex Edge TPU class quirk to fix BAR assignment 2020-05-02 08:48:50 +02:00
gdm724x
goldfish
greybus staging: greybus: loopback_test: fix potential path truncations 2020-03-25 08:25:59 +01:00
gs_fpgaboot
iio staging: iio: ad9834: add a check for devm_clk_get 2019-12-31 16:44:11 +01:00
isdn staging: gigaset: add endpoint-type sanity check 2019-12-17 19:55:36 +01:00
kpc2000 staging: kpc2000: prevent underflow in cpld_reconfigure() 2020-04-01 11:02:16 +02:00
ks7010
media media: hantro: Read be32 words starting at every fourth byte 2020-04-17 10:50:08 +02:00
most staging: most: net: fix buffer overflow 2020-02-01 09:34:33 +00:00
mt7621-dma
mt7621-dts
mt7621-pci staging: mt7621-pci: add quirks for 'E2' revision using 'soc_device_attribute' 2020-02-01 09:34:47 +00:00
mt7621-pci-phy
mt7621-pinctrl
netlogic
nvec staging: nvec: make use of devm_platform_ioremap_resource 2019-09-12 10:35:50 +01:00
octeon staging/octeon: Use stubs for MIPS && !CAVIUM_OCTEON_SOC 2019-12-13 08:42:19 +01:00
octeon-usb usb: add a HCD_DMA flag instead of guestimating DMA capabilities 2019-08-21 10:03:35 -07:00
olpc_dcon
pi433 staging: pi433: Fix typo in documentation 2019-09-06 18:20:33 +02:00
qlge
ralink-gdma
rtl8188eu staging: rtl8188eu: Add ASUS USB-N10 Nano B1 to device table 2020-04-01 11:02:16 +02:00
rtl8192e staging: rtl8192e: fix potential use after free 2019-12-04 22:30:47 +01:00
rtl8192u staging: rtl8192u: fix multiple memory leaks on error path 2019-12-31 16:43:10 +01:00
rtl8712 staging: rtl8712: fix interface sanity check 2019-12-17 19:55:34 +01:00
rtl8723bs staging: rtl8723bs: fix copy of overlapping memory 2020-02-28 17:22:26 +01:00
rts5208 staging: rts5208: Fix checkpath warning 2019-09-03 09:36:29 +02:00
sm750fb staging: sm750fb: fix odd license text 2019-08-15 14:43:57 +02:00
speakup staging/speakup: fix get_word non-space look-ahead 2020-03-25 08:25:55 +01:00
unisys Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-08-19 11:54:03 -07:00
uwb
vc04_services staging: vchiq: call unregister_chrdev_region() when driver registration fails 2019-12-17 19:55:34 +01:00
vme
vt6655 staging: vt6655: Fix memory leak in vt6655_probe 2019-10-07 12:34:55 +02:00
vt6656 staging: vt6656: Power save stop wake_up_count wrap around. 2020-04-29 16:33:22 +02:00
wilc1000 staging: wilc1000: avoid double unlocking of 'wilc->hif_cs' mutex 2020-04-17 10:50:00 +02:00
wlan-ng staging: wlan-ng: fix use-after-free Read in hfa384x_usbin_callback 2020-04-01 11:02:17 +02:00
wusbcore staging: wusbcore: Fix build error without CONFIG_USB 2019-08-09 14:56:57 +02:00
Kconfig Remove VirtualBox guest shared folders filesystem 2019-11-12 15:22:24 -08:00
Makefile Remove VirtualBox guest shared folders filesystem 2019-11-12 15:22:24 -08:00