This patch bumps the 4.14 kernel to .23. - Refreshed patches. - Deleted bcm53xx/patches-4.14/089-PCI-iproc-Fix-NULL-pointer-dereference-for-BCMA.patch. Has been accepted upstream. - Deleted generic/pending-4.14/821-usb-Remove-annoying-warning-about-bogus-URB.patch. The upstream URB code was changed, the patch no longer applies. I discussed this with the patch author and removed it for now, we'll see how it goes. Compile-tested on: ramips/mt7621, x86/64 Run-tested on: ramips/mt7621, x86/64 Signed-off-by: Stijn Segers <foss@volatilesystems.org>master
parent
844bdf94e4
commit
b5469b38cd
@ -1,80 +0,0 @@ |
||||
From 3b65ca50d24ce33cb92d88840e289135c92b40ed Mon Sep 17 00:00:00 2001
|
||||
From: Ray Jui <ray.jui@broadcom.com>
|
||||
Date: Thu, 11 Jan 2018 12:36:16 -0800
|
||||
Subject: [PATCH] PCI: iproc: Fix NULL pointer dereference for BCMA
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
With the inbound DMA mapping supported added, the iProc PCIe driver
|
||||
parses DT property "dma-ranges" through call to
|
||||
"of_pci_dma_range_parser_init()". In the case of BCMA, this results in a
|
||||
NULL pointer deference due to a missing of_node.
|
||||
|
||||
Fix this by adding a guard in pcie-iproc-platform.c to only enable the
|
||||
inbound DMA mapping logic when DT property "dma-ranges" is present.
|
||||
|
||||
Fixes: dd9d4e7498de3 ("PCI: iproc: Add inbound DMA mapping support")
|
||||
Reported-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Signed-off-by: Ray Jui <ray.jui@broadcom.com>
|
||||
[lorenzo.pieralisi@arm.com: updated commit log]
|
||||
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
|
||||
Tested-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
cc: <stable@vger.kernel.org> # 4.10+
|
||||
---
|
||||
drivers/pci/host/pcie-iproc-platform.c | 7 +++++++
|
||||
drivers/pci/host/pcie-iproc.c | 8 +++++---
|
||||
drivers/pci/host/pcie-iproc.h | 2 ++
|
||||
3 files changed, 14 insertions(+), 3 deletions(-)
|
||||
|
||||
--- a/drivers/pci/host/pcie-iproc-platform.c
|
||||
+++ b/drivers/pci/host/pcie-iproc-platform.c
|
||||
@@ -92,6 +92,13 @@ static int iproc_pcie_pltfm_probe(struct
|
||||
pcie->need_ob_cfg = true;
|
||||
}
|
||||
|
||||
+ /*
|
||||
+ * DT nodes are not used by all platforms that use the iProc PCIe
|
||||
+ * core driver. For platforms that require explict inbound mapping
|
||||
+ * configuration, "dma-ranges" would have been present in DT
|
||||
+ */
|
||||
+ pcie->need_ib_cfg = of_property_read_bool(np, "dma-ranges");
|
||||
+
|
||||
/* PHY use is optional */
|
||||
pcie->phy = devm_phy_get(dev, "pcie-phy");
|
||||
if (IS_ERR(pcie->phy)) {
|
||||
--- a/drivers/pci/host/pcie-iproc.c
|
||||
+++ b/drivers/pci/host/pcie-iproc.c
|
||||
@@ -1396,9 +1396,11 @@ int iproc_pcie_setup(struct iproc_pcie *
|
||||
}
|
||||
}
|
||||
|
||||
- ret = iproc_pcie_map_dma_ranges(pcie);
|
||||
- if (ret && ret != -ENOENT)
|
||||
- goto err_power_off_phy;
|
||||
+ if (pcie->need_ib_cfg) {
|
||||
+ ret = iproc_pcie_map_dma_ranges(pcie);
|
||||
+ if (ret && ret != -ENOENT)
|
||||
+ goto err_power_off_phy;
|
||||
+ }
|
||||
|
||||
#ifdef CONFIG_ARM
|
||||
pcie->sysdata.private_data = pcie;
|
||||
--- a/drivers/pci/host/pcie-iproc.h
|
||||
+++ b/drivers/pci/host/pcie-iproc.h
|
||||
@@ -74,6 +74,7 @@ struct iproc_msi;
|
||||
* @ob: outbound mapping related parameters
|
||||
* @ob_map: outbound mapping related parameters specific to the controller
|
||||
*
|
||||
+ * @need_ib_cfg: indicates SW needs to configure the inbound mapping window
|
||||
* @ib: inbound mapping related parameters
|
||||
* @ib_map: outbound mapping region related parameters
|
||||
*
|
||||
@@ -101,6 +102,7 @@ struct iproc_pcie {
|
||||
struct iproc_pcie_ob ob;
|
||||
const struct iproc_pcie_ob_map *ob_map;
|
||||
|
||||
+ bool need_ib_cfg;
|
||||
struct iproc_pcie_ib ib;
|
||||
const struct iproc_pcie_ib_map *ib_map;
|
||||
|
@ -1,76 +0,0 @@ |
||||
From: Alexey Brodkin <abrodkin@synopsys.com>
|
||||
Subject: usb: Remove annoying warning about bogus URB
|
||||
|
||||
When ath9k-htc Wi-Fi dongle is used with generic OHCI controller
|
||||
infinite stream of warnings appears in debug console like this:
|
||||
-------------------------->8----------------------
|
||||
usb 1-1: new full-speed USB device number 2 using ohci-platform
|
||||
usb 1-1: ath9k_htc: Firmware ath9k_htc/htc_9271-1.4.0.fw requested
|
||||
usb 1-1: ath9k_htc: Transferred FW: ath9k_htc/htc_9271-1.4.0.fw, size:
|
||||
51008
|
||||
------------[ cut here ]------------
|
||||
WARNING: CPU: 0 PID: 19 at drivers/usb/core/urb.c:449
|
||||
usb_submit_urb+0x1b4/0x498()
|
||||
usb 1-1: BOGUS urb xfer, pipe 1 != type 3
|
||||
Modules linked in:
|
||||
CPU: 0 PID: 19 Comm: kworker/0:1 Not tainted
|
||||
4.4.0-rc4-00017-g00e2d79-dirty #3
|
||||
Workqueue: events request_firmware_work_func
|
||||
|
||||
Stack Trace:
|
||||
arc_unwind_core.constprop.1+0xa4/0x110
|
||||
---[ end trace 649ef8c342817fc2 ]---
|
||||
------------[ cut here ]------------
|
||||
WARNING: CPU: 0 PID: 19 at drivers/usb/core/urb.c:449
|
||||
usb_submit_urb+0x1b4/0x498()
|
||||
usb 1-1: BOGUS urb xfer, pipe 1 != type 3
|
||||
Modules linked in:
|
||||
CPU: 0 PID: 19 Comm: kworker/0:1 Tainted: G W
|
||||
4.4.0-rc4-00017-g00e2d79-dirty #3
|
||||
Workqueue: events request_firmware_work_func
|
||||
|
||||
Stack Trace:
|
||||
arc_unwind_core.constprop.1+0xa4/0x110
|
||||
---[ end trace 649ef8c342817fc3 ]---
|
||||
------------[ cut here ]------------
|
||||
-------------------------->8----------------------
|
||||
|
||||
There're some discussions in mailing lists proposing to disable
|
||||
that particular check alltogether and magically all seem to work
|
||||
fine with muted warning.
|
||||
|
||||
Anyways new thread on that regard could be found here:
|
||||
http://lists.infradead.org/pipermail/linux-snps-arc/2016-July/001310.html
|
||||
|
||||
Let's see what comes out of that new discussion, hopefully patching
|
||||
of generic USB stuff won't be required then.
|
||||
|
||||
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
|
||||
---
|
||||
drivers/usb/core/urb.c | 5 -----
|
||||
1 file changed, 5 deletions(-)
|
||||
|
||||
--- a/drivers/usb/core/urb.c
|
||||
+++ b/drivers/usb/core/urb.c
|
||||
@@ -326,9 +326,6 @@ EXPORT_SYMBOL_GPL(usb_unanchor_urb);
|
||||
*/
|
||||
int usb_submit_urb(struct urb *urb, gfp_t mem_flags)
|
||||
{
|
||||
- static int pipetypes[4] = {
|
||||
- PIPE_CONTROL, PIPE_ISOCHRONOUS, PIPE_BULK, PIPE_INTERRUPT
|
||||
- };
|
||||
int xfertype, max;
|
||||
struct usb_device *dev;
|
||||
struct usb_host_endpoint *ep;
|
||||
@@ -443,11 +440,6 @@ int usb_submit_urb(struct urb *urb, gfp_
|
||||
* cause problems in HCDs if they get it wrong.
|
||||
*/
|
||||
|
||||
- /* Check that the pipe's type matches the endpoint's type */
|
||||
- if (usb_pipetype(urb->pipe) != pipetypes[xfertype])
|
||||
- dev_WARN(&dev->dev, "BOGUS urb xfer, pipe %x != type %x\n",
|
||||
- usb_pipetype(urb->pipe), pipetypes[xfertype]);
|
||||
-
|
||||
/* Check against a simple/standard policy */
|
||||
allowed = (URB_NO_TRANSFER_DMA_MAP | URB_NO_INTERRUPT | URB_DIR_MASK |
|
||||
URB_FREE_BUFFER);
|
Loading…
Reference in new issue