brcm47xx: add patches for kernel 4.0
[openwrt/svn-archive/archive.git] / target / linux / brcm47xx / patches-4.0 / 900-ssb-reject-PCI-writes-setting-CardBus-bridge-resourc.patch
1 From 5c81397a0147ea59c778d1de14ef54e2268221f6 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
3 Date: Wed, 8 Apr 2015 06:58:11 +0200
4 Subject: [PATCH] ssb: reject PCI writes setting CardBus bridge resources
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 If SoC has a CardBus we can set resources of device at slot 1 only. It's
10 impossigle to set bridge resources as it simply overwrites device 1
11 configuration and usually results in Data bus error-s.
12
13 Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
14 ---
15 drivers/ssb/driver_pcicore.c | 4 ++++
16 1 file changed, 4 insertions(+)
17
18 diff --git a/drivers/ssb/driver_pcicore.c b/drivers/ssb/driver_pcicore.c
19 index 15a7ee3..c603d19 100644
20 --- a/drivers/ssb/driver_pcicore.c
21 +++ b/drivers/ssb/driver_pcicore.c
22 @@ -164,6 +164,10 @@ static int ssb_extpci_write_config(struct ssb_pcicore *pc,
23 SSB_WARN_ON(!pc->hostmode);
24 if (unlikely(len != 1 && len != 2 && len != 4))
25 goto out;
26 + /* CardBus SoCs allow configuring dev 1 resources only */
27 + if (extpci_core->cardbusmode && dev != 1 &&
28 + off >= PCI_BASE_ADDRESS_0 && off <= PCI_BASE_ADDRESS_5)
29 + goto out;
30 addr = get_cfgspace_addr(pc, bus, dev, func, off);
31 if (unlikely(!addr))
32 goto out;
33 --
34 1.8.4.5
35