openwrt/target/linux
Koen Vandeputte 202c3ceb13 cns3xxx: fix writing to wrong PCI registers
Originally, cns3xxx used it's own functions for mapping, reading and writing registers.

Upstream commit 802b7c06adc7 ("ARM: cns3xxx: Convert PCI to use generic config accessors")
removed the internal PCI config write function in favor of the generic one:

cns3xxx_pci_write_config() --> pci_generic_config_write()

cns3xxx_pci_write_config() expected aligned addresses, being produced by cns3xxx_pci_map_bus()
while the generic one pci_generic_config_write() actually expects the real address
as both the function and hardware are capable of byte-aligned writes.

This currently leads to pci_generic_config_write() writing
to the wrong registers on some ocasions.

First issue seen due to this:

- driver ath9k gets loaded
- The driver wants to write value 0xA8 to register PCI_LATENCY_TIMER, located at 0x0D
- cns3xxx_pci_map_bus() aligns the address to 0x0C
- pci_generic_config_write() effectively writes 0xA8 into register 0x0C (CACHE_LINE_SIZE)

This seems to cause some slight instability when certain PCI devices are used.

Another issue example caused by this this is the PCI bus numbering,
where the primary bus is higher than the secondary, which is impossible.

Before:

00:00.0 PCI bridge: Cavium, Inc. Device 3400 (rev 01) (prog-if 00 [Normal decode])
    Flags: bus master, fast devsel, latency 0, IRQ 255
    Bus: primary=02, secondary=01, subordinate=ff, sec-latency=0

After fix:

00:00.0 PCI bridge: Cavium, Inc. Device 3400 (rev 01) (prog-if 00 [Normal decode])
    Flags: bus master, fast devsel, latency 0, IRQ 255
    Bus: primary=00, secondary=01, subordinate=02, sec-latency=0

And very likely some more ..

Fix all by omitting the alignment being done in the mapping function.

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
2018-12-18 15:14:39 +01:00
..
adm5120 Mark targets using kernel 3.18 as source-only 2017-02-17 06:58:33 +01:00
adm8668 Mark targets using kernel 3.18 as source-only 2017-02-17 06:58:33 +01:00
apm821xx kernel: bump 4.4 to 4.4.167 2018-12-18 15:14:39 +01:00
ar7 ar7: add NULL clock fix send upstream 2017-07-29 09:24:47 +02:00
ar71xx kernel: bump 4.4 to 4.4.167 2018-12-18 15:14:39 +01:00
arc770 arc770: only calculate entry point address when necessary 2017-03-01 20:37:37 +01:00
archs38 archs38: only calculate entry point address when necessary 2017-03-01 20:37:37 +01:00
arm64 kernel: bump kernel 4.4 to version 4.4.137 2018-06-15 19:20:56 +02:00
armvirt armvirt: add kernel config change missing from 0d44f0cb 2017-01-13 11:05:32 +01:00
at91 kernel: bump kernel 4.4 to version 4.4.137 2018-06-15 19:20:56 +02:00
ath25 kernel: bump kernel 4.4 to version 4.4.137 2018-06-15 19:20:56 +02:00
au1000 Mark targets using kernel 3.18 as source-only 2017-02-17 06:58:33 +01:00
bcm53xx kernel: bump 4.4 to 4.4.167 2018-12-18 15:14:39 +01:00
brcm47xx kernel: bump 4.4 to 4.4.167 2018-12-18 15:14:39 +01:00
brcm63xx kernel: bump 4.4 to 4.4.167 2018-12-18 15:14:39 +01:00
brcm2708 kernel: bump 4.4 to 4.4.167 2018-12-18 15:14:39 +01:00
cns3xxx kernel: bump kernel 4.4 to version 4.4.153 2018-08-30 13:07:40 +02:00
gemini kernel: bump kernel 4.4 to version 4.4.137 2018-06-15 19:20:56 +02:00
generic cns3xxx: fix writing to wrong PCI registers 2018-12-18 15:14:39 +01:00
imx6 kernel: bump 4.4 to 4.4.167 2018-12-18 15:14:39 +01:00
ipq806x kernel: bump kernel 4.4 to version 4.4.147 2018-08-09 23:17:09 +02:00
ixp4xx kernel: bump kernel 4.4 to version 4.4.147 2018-08-09 23:17:09 +02:00
kirkwood kirkwood: fix include in etc/board.d/02_network 2017-03-01 20:37:37 +01:00
lantiq kernel: bump kernel 4.4 to 4.4.129 for 17.01 2018-04-30 08:00:27 +02:00
layerscape kernel: bump 4.4 to 4.4.167 2018-12-18 15:14:39 +01:00
malta kernel: bump kernel 4.4 to version 4.4.137 2018-06-15 19:20:56 +02:00
mcs814x Mark targets using kernel 3.18 as source-only 2017-02-17 06:58:33 +01:00
mediatek kernel: bump 4.4 to 4.4.167 2018-12-18 15:14:39 +01:00
mpc85xx WDR4900v1 remove dt node for absent hw crypto. 2018-07-22 01:06:10 +00:00
mvebu kernel: bump 4.4 to 4.4.167 2018-12-18 15:14:39 +01:00
mxs kernel: bump 4.4 to 4.4.167 2018-12-18 15:14:39 +01:00
octeon kernel: bump kernel 4.4 to version 4.4.137 2018-06-15 19:20:56 +02:00
omap omap: build various core drivers into the kernel instead of packaging them 2017-01-10 13:44:26 +01:00
omap24xx kernel: clean up usb gadget support 2016-09-15 13:11:21 +02:00
orion kernel: remove DEVMEM/DEVKMEM platform overrides 2017-01-10 13:48:53 +01:00
oxnas kernel: bump 4.4 to 4.4.167 2018-12-18 15:14:39 +01:00
ppc40x build: fix subtarget descriptions 2016-09-04 13:35:11 +02:00
ppc44x ppc44x: mark as broken 2017-01-10 12:49:34 +01:00
ramips kernel: bump 4.4 to 4.4.167 2018-12-18 15:14:39 +01:00
rb532 kernel: bump kernel 4.4 to version 4.4.137 2018-06-15 19:20:56 +02:00
sunxi sunxi: disable LPAE to allow kernel to run on A13 2018-02-27 19:38:12 +01:00
uml uml: mark as source-only 2017-01-24 13:35:47 +01:00
x86 kernel: bump kernel 4.4 to version 4.4.147 2018-08-09 23:17:09 +02:00
xburst xburst: enable high-res timers, refresh kernel config 2017-12-13 15:55:45 +01:00
zynq kernel: bump kernel 4.4 to version 4.4.137 2018-06-15 19:20:56 +02:00
Makefile