TencentOS-kernel/arch
Ilya Lipnitskiy 0593e24e82 MIPS: pci-rt2880: fix slot 0 configuration
commit 8e98b697006d749d745d3b174168a877bb96c500 upstream.

pci_fixup_irqs() used to call pcibios_map_irq on every PCI device, which
for RT2880 included bus 0 slot 0. After pci_fixup_irqs() got removed,
only slots/funcs with devices attached would be called. While arguably
the right thing, that left no chance for this driver to ever initialize
slot 0, effectively bricking PCI and USB on RT2880 devices such as the
Belkin F5D8235-4 v1.

Slot 0 configuration needs to happen after PCI bus enumeration, but
before any device at slot 0x11 (func 0 or 1) is talked to. That was
determined empirically by testing on a Belkin F5D8235-4 v1 device. A
minimal BAR 0 config write followed by read, then setting slot 0
PCI_COMMAND to MASTER | IO | MEMORY is all that seems to be required for
proper functionality.

Tested by ensuring that full- and high-speed USB devices get enumerated
on the Belkin F5D8235-4 v1 (with an out of tree DTS file from OpenWrt).

Fixes: 04c81c7293df ("MIPS: PCI: Replace pci_fixup_irqs() call with host bridge IRQ mapping hooks")
Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Tobias Wolf <dev-NTEO@vplace.de>
Cc: <stable@vger.kernel.org> # v4.14+
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-20 16:07:40 +08:00
..
alpha alpha: fix annotation of io{read,write}{16,32}be() 2021-03-16 16:34:34 +08:00
arc arc: kernel: Return -EFAULT if copy_to_user() fails 2021-05-20 16:07:08 +08:00
arm ARM: 9056/1: decompressor: fix BSS size calculation for LLVM ld.lld 2021-05-20 16:07:19 +08:00
arm64 arm64/vdso: Discard .note.gnu.property sections in vDSO 2021-05-20 16:07:33 +08:00
c6x Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
csky csky: change a Kconfig symbol name to fix e1000 build error 2021-05-20 16:07:15 +08:00
h8300 h8300: fix PREEMPTION build, TI_PRE_COUNT undefined 2021-04-12 12:52:05 +08:00
hexagon hexagon: define ioremap_uc 2021-03-16 16:27:29 +08:00
ia64 ia64: fix discontig.c section mismatches 2021-05-20 16:07:15 +08:00
m68k m68k: q40: Fix info-leak in rtc_ioctl 2021-03-16 16:36:33 +08:00
microblaze Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
mips MIPS: pci-rt2880: fix slot 0 configuration 2021-05-20 16:07:40 +08:00
nds32 nds32: flush_dcache_page: use page_mapping_file to avoid races with swapoff 2021-05-20 16:06:56 +08:00
nios2 Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
openrisc openrisc: Fix issue with get_user for 64-bit values 2021-03-16 16:39:36 +08:00
parisc parisc: avoid a warning on u8 cast for cmpxchg on u8 pointers 2021-05-20 16:06:56 +08:00
powerpc powerpc: fix EDEADLOCK redefinition error in uapi/asm/errno.h 2021-05-20 16:07:34 +08:00
riscv riscv: Fix spelling mistake "SPARSEMEM" to "SPARSMEM" 2021-05-20 16:07:11 +08:00
s390 s390/archrandom: add parameter check for s390_arch_random_generate 2021-05-20 16:07:32 +08:00
sh sh: dma: fix kconfig dependency for G2_DMA 2021-04-12 12:51:39 +08:00
sparc sparc64: Fix opcode filtering in handling of no fault loads 2021-04-12 12:53:23 +08:00
um um: mm: check more comprehensively for stub changes 2021-04-12 12:52:40 +08:00
unicore32 Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
x86 x86/cpu: Initialize MSR_TSC_AUX if RDTSCP *or* RDPID is supported 2021-05-20 16:07:35 +08:00
xtensa xtensa: move coprocessor_flush to the .text section 2021-05-20 16:06:49 +08:00
.gitignore Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
Kconfig Revert: "ring-buffer: Remove HAVE_64BIT_ALIGNED_ACCESS" 2021-03-16 16:43:47 +08:00