openwrt/target/linux
Koen Vandeputte 2f11a9ed68 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:12:06 +01:00
..
apm821xx kernel: bump 4.14 to 4.14.88 2018-12-14 13:04:54 +01:00
ar7 kernel: remove linux 3.18 support 2018-08-08 09:54:51 +02:00
ar71xx ar71xx: add support for UniFi-AC-Mesh-Pro 2018-12-15 18:26:49 +01:00
arc770 arc770: remove source-only 2018-05-24 17:24:30 +02:00
archs38 kernel: enable THIN_ARCHIVES by default 2018-05-24 17:24:31 +02:00
armvirt kernel: bump 4.14 to 4.14.77 2018-10-19 10:00:48 +02:00
at91 kernel: bump 4.9 to 4.9.143 2018-12-13 13:28:41 +01:00
ath25 kernel: bump 4.14 to 4.14.79 2018-11-05 16:00:47 +01:00
bcm53xx bcm53xx: exit if writing kernel during sysupgrade fails 2018-12-18 10:09:11 +01:00
brcm47xx brcm47xx: Enable USB power on WNDR3400v3 2018-12-18 11:28:12 +01:00
brcm63xx kernel: bump 4.14 to 4.14.79 2018-11-05 16:00:47 +01:00
brcm2708 kernel: bump 4.9 to 4.9.145 2018-12-14 13:04:54 +01:00
cns3xxx kernel: bump 4.14 to 4.14.77 2018-10-19 10:00:48 +02:00
gemini kernel: enable THIN_ARCHIVES by default 2018-05-24 17:24:31 +02:00
generic cns3xxx: fix writing to wrong PCI registers 2018-12-18 15:12:06 +01:00
imx6 imx6: fix DMA transaction errors 2018-11-06 11:49:55 +01:00
ipq40xx kernel: bump 4.14 to 4.14.89 2018-12-18 15:12:06 +01:00
ipq806x kernel: bump 4.14 to 4.14.81 2018-11-14 16:27:43 +01:00
ixp4xx kernel: bump 4.9 to 4.9.127 for 18.06 2018-09-17 15:47:44 +02:00
kirkwood kernel: enable THIN_ARCHIVES by default 2018-05-24 17:24:31 +02:00
lantiq kernel: bump 4.14 to 4.14.82 2018-11-22 10:51:27 +01:00
layerscape kernel: bump 4.9 to 4.9.146 2018-12-18 15:12:06 +01:00
malta malta: bump tp v4.14 2018-01-09 10:26:16 +01:00
mediatek kernel: bump 4.14 to 4.14.89 2018-12-18 15:12:06 +01:00
mpc85xx mpc85xx: add migration script for TP-Link TL-WDR4900 v1 WLAN PCI paths 2018-09-04 21:28:52 +02:00
mvebu kernel: bump 4.14 to 4.14.81 2018-11-14 16:27:43 +01:00
mxs kernel: bump 4.14 to 4.14.75 2018-10-10 14:46:25 +02:00
octeon kernel: enable THIN_ARCHIVES by default 2018-05-24 17:24:31 +02:00
octeontx kernel: enable memory compaction 2018-10-09 14:36:00 +02:00
omap kernel: bump 4.14 to 4.14.77 2018-10-19 10:00:48 +02:00
orion orion: remove linux 4.4 support 2018-04-19 14:38:57 +02:00
oxnas kernel: bump 4.14 to 4.14.81 2018-11-14 16:27:43 +01:00
pistachio kernel: Add support for Winbond w25q128jv SPI NOR flash 2018-11-07 11:41:59 +01:00
ramips kernel: bump 4.14 to 4.14.89 2018-12-18 15:12:06 +01:00
rb532 treewide: move nand_do_upgrade call to platform_do_upgrade 2018-02-16 14:44:02 +01:00
sunxi sunxi: remove kernel 4.9 support 2018-11-14 16:27:43 +01:00
uml kernel: bump 4.9 to 4.9.102 for 18.06 2018-05-24 16:03:58 +02:00
x86 x86/64: enable X86_INTEL_LPSS to select PINCTRL 2018-12-18 11:28:11 +01:00
Makefile