kernel: update kernel 4.9 to 4.9.29
- Refresh all patches - Removed upstreamed - Adapted 1 Compile tested on: bcm53xx, cns3xxx, imx6, lantiq Run tested on: cns3xxx & imx6 Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com> [update from 4.9.28 to 4.9.29] Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>v19.07.3_mercusys_ac12_duma
parent
088e28772c
commit
e842e16f45
@ -1,75 +0,0 @@
|
||||
From 09f3510fb70a46c8921f2cf4a90dbcae460a6820 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Sat, 29 Oct 2016 13:12:29 +0200
|
||||
Subject: [PATCH] ARM: BCM5301X: Add back handler ignoring external imprecise
|
||||
aborts
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Since early BCM5301X days we got abort handler that was removed by
|
||||
commit 937b12306ea79 ("ARM: BCM5301X: remove workaround imprecise abort
|
||||
fault handler"). It assumed we need to deal only with pending aborts
|
||||
left by the bootloader. Unfortunately this isn't true for BCM5301X.
|
||||
|
||||
When probing PCI config space (device enumeration) it is expected to
|
||||
have master aborts on the PCI bus. Most bridges don't forward (or they
|
||||
allow disabling it) these errors onto the AXI/AMBA bus but not the
|
||||
Northstar (BCM5301X) one.
|
||||
|
||||
iProc PCIe controller on Northstar seems to be some older one, without
|
||||
a control register for errors forwarding. It means we need to workaround
|
||||
this at platform level. All newer platforms are not affected by this
|
||||
issue.
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
|
||||
---
|
||||
arch/arm/mach-bcm/bcm_5301x.c | 28 ++++++++++++++++++++++++++++
|
||||
1 file changed, 28 insertions(+)
|
||||
|
||||
--- a/arch/arm/mach-bcm/bcm_5301x.c
|
||||
+++ b/arch/arm/mach-bcm/bcm_5301x.c
|
||||
@@ -9,14 +9,42 @@
|
||||
#include <asm/hardware/cache-l2x0.h>
|
||||
|
||||
#include <asm/mach/arch.h>
|
||||
+#include <asm/siginfo.h>
|
||||
+#include <asm/signal.h>
|
||||
+
|
||||
+#define FSR_EXTERNAL (1 << 12)
|
||||
+#define FSR_READ (0 << 10)
|
||||
+#define FSR_IMPRECISE 0x0406
|
||||
|
||||
static const char *const bcm5301x_dt_compat[] __initconst = {
|
||||
"brcm,bcm4708",
|
||||
NULL,
|
||||
};
|
||||
|
||||
+static int bcm5301x_abort_handler(unsigned long addr, unsigned int fsr,
|
||||
+ struct pt_regs *regs)
|
||||
+{
|
||||
+ /*
|
||||
+ * We want to ignore aborts forwarded from the PCIe bus that are
|
||||
+ * expected and shouldn't really be passed by the PCIe controller.
|
||||
+ * The biggest disadvantage is the same FSR code may be reported when
|
||||
+ * reading non-existing APB register and we shouldn't ignore that.
|
||||
+ */
|
||||
+ if (fsr == (FSR_EXTERNAL | FSR_READ | FSR_IMPRECISE))
|
||||
+ return 0;
|
||||
+
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
+static void __init bcm5301x_init_early(void)
|
||||
+{
|
||||
+ hook_fault_code(16 + 6, bcm5301x_abort_handler, SIGBUS, BUS_OBJERR,
|
||||
+ "imprecise external abort");
|
||||
+}
|
||||
+
|
||||
DT_MACHINE_START(BCM5301X, "BCM5301X")
|
||||
.l2c_aux_val = 0,
|
||||
.l2c_aux_mask = ~0,
|
||||
.dt_compat = bcm5301x_dt_compat,
|
||||
+ .init_early = bcm5301x_init_early,
|
||||
MACHINE_END
|
@ -1,41 +0,0 @@
|
||||
From 0e34079cd1f674449749aafe4be07336177de90d Mon Sep 17 00:00:00 2001
|
||||
From: Jon Mason <jon.mason@broadcom.com>
|
||||
Date: Thu, 2 Mar 2017 19:21:32 -0500
|
||||
Subject: [PATCH] ARM: dts: BCM5301X: Correct GIC_PPI interrupt flags
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
GIC_PPI flags were misconfigured for the timers, resulting in errors
|
||||
like:
|
||||
[ 0.000000] GIC: PPI11 is secure or misconfigured
|
||||
|
||||
Changing them to being edge triggered corrects the issue
|
||||
|
||||
Suggested-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Signed-off-by: Jon Mason <jon.mason@broadcom.com>
|
||||
Fixes: d27509f1 ("ARM: BCM5301X: add dts files for BCM4708 SoC")
|
||||
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
|
||||
---
|
||||
arch/arm/boot/dts/bcm5301x.dtsi | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/arch/arm/boot/dts/bcm5301x.dtsi
|
||||
+++ b/arch/arm/boot/dts/bcm5301x.dtsi
|
||||
@@ -66,14 +66,14 @@
|
||||
timer@20200 {
|
||||
compatible = "arm,cortex-a9-global-timer";
|
||||
reg = <0x20200 0x100>;
|
||||
- interrupts = <GIC_PPI 11 IRQ_TYPE_LEVEL_HIGH>;
|
||||
+ interrupts = <GIC_PPI 11 IRQ_TYPE_EDGE_RISING>;
|
||||
clocks = <&periph_clk>;
|
||||
};
|
||||
|
||||
local-timer@20600 {
|
||||
compatible = "arm,cortex-a9-twd-timer";
|
||||
reg = <0x20600 0x100>;
|
||||
- interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_HIGH>;
|
||||
+ interrupts = <GIC_PPI 13 IRQ_TYPE_EDGE_RISING>;
|
||||
clocks = <&periph_clk>;
|
||||
};
|
||||
|
@ -1,131 +0,0 @@
|
||||
From 6e347b5e05ea2ac4ac467a5a1cfaebb2c7f06f80 Mon Sep 17 00:00:00 2001
|
||||
From: Bjorn Helgaas <bhelgaas@google.com>
|
||||
Date: Thu, 9 Mar 2017 11:27:07 -0600
|
||||
Subject: [PATCH] PCI: iproc: Save host bridge window resource in struct
|
||||
iproc_pcie
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
The host bridge memory window resource is inserted into the iomem_resource
|
||||
tree and cannot be deallocated until the host bridge itself is removed.
|
||||
|
||||
Previously, the window was on the stack, which meant the iomem_resource
|
||||
entry pointed into the stack and was corrupted as soon as the probe
|
||||
function returned, which caused memory corruption and errors like this:
|
||||
|
||||
pcie_iproc_bcma bcma0:8: resource collision: [mem 0x40000000-0x47ffffff] conflicts with PCIe MEM space [mem 0x40000000-0x47ffffff]
|
||||
|
||||
Move the memory window resource from the stack into struct iproc_pcie so
|
||||
its lifetime matches that of the host bridge.
|
||||
|
||||
Fixes: c3245a566400 ("PCI: iproc: Request host bridge window resources")
|
||||
Reported-and-tested-by: Rafał Miłecki <zajec5@gmail.com>
|
||||
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
|
||||
CC: stable@vger.kernel.org # v4.8+
|
||||
---
|
||||
drivers/pci/host/pcie-iproc-bcma.c | 24 ++++++++++++------------
|
||||
drivers/pci/host/pcie-iproc-platform.c | 19 ++++++++++---------
|
||||
drivers/pci/host/pcie-iproc.h | 1 +
|
||||
3 files changed, 23 insertions(+), 21 deletions(-)
|
||||
|
||||
--- a/drivers/pci/host/pcie-iproc-bcma.c
|
||||
+++ b/drivers/pci/host/pcie-iproc-bcma.c
|
||||
@@ -44,8 +44,7 @@ static int iproc_pcie_bcma_probe(struct
|
||||
{
|
||||
struct device *dev = &bdev->dev;
|
||||
struct iproc_pcie *pcie;
|
||||
- LIST_HEAD(res);
|
||||
- struct resource res_mem;
|
||||
+ LIST_HEAD(resources);
|
||||
int ret;
|
||||
|
||||
pcie = devm_kzalloc(dev, sizeof(*pcie), GFP_KERNEL);
|
||||
@@ -62,22 +61,23 @@ static int iproc_pcie_bcma_probe(struct
|
||||
|
||||
pcie->base_addr = bdev->addr;
|
||||
|
||||
- res_mem.start = bdev->addr_s[0];
|
||||
- res_mem.end = bdev->addr_s[0] + SZ_128M - 1;
|
||||
- res_mem.name = "PCIe MEM space";
|
||||
- res_mem.flags = IORESOURCE_MEM;
|
||||
- pci_add_resource(&res, &res_mem);
|
||||
+ pcie->mem.start = bdev->addr_s[0];
|
||||
+ pcie->mem.end = bdev->addr_s[0] + SZ_128M - 1;
|
||||
+ pcie->mem.name = "PCIe MEM space";
|
||||
+ pcie->mem.flags = IORESOURCE_MEM;
|
||||
+ pci_add_resource(&resources, &pcie->mem);
|
||||
|
||||
pcie->map_irq = iproc_pcie_bcma_map_irq;
|
||||
|
||||
- ret = iproc_pcie_setup(pcie, &res);
|
||||
- if (ret)
|
||||
+ ret = iproc_pcie_setup(pcie, &resources);
|
||||
+ if (ret) {
|
||||
dev_err(dev, "PCIe controller setup failed\n");
|
||||
-
|
||||
- pci_free_resource_list(&res);
|
||||
+ pci_free_resource_list(&resources);
|
||||
+ return ret;
|
||||
+ }
|
||||
|
||||
bcma_set_drvdata(bdev, pcie);
|
||||
- return ret;
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
static void iproc_pcie_bcma_remove(struct bcma_device *bdev)
|
||||
--- a/drivers/pci/host/pcie-iproc-platform.c
|
||||
+++ b/drivers/pci/host/pcie-iproc-platform.c
|
||||
@@ -46,7 +46,7 @@ static int iproc_pcie_pltfm_probe(struct
|
||||
struct device_node *np = dev->of_node;
|
||||
struct resource reg;
|
||||
resource_size_t iobase = 0;
|
||||
- LIST_HEAD(res);
|
||||
+ LIST_HEAD(resources);
|
||||
int ret;
|
||||
|
||||
of_id = of_match_device(iproc_pcie_of_match_table, dev);
|
||||
@@ -108,23 +108,24 @@ static int iproc_pcie_pltfm_probe(struct
|
||||
pcie->phy = NULL;
|
||||
}
|
||||
|
||||
- ret = of_pci_get_host_bridge_resources(np, 0, 0xff, &res, &iobase);
|
||||
+ ret = of_pci_get_host_bridge_resources(np, 0, 0xff, &resources,
|
||||
+ &iobase);
|
||||
if (ret) {
|
||||
- dev_err(dev,
|
||||
- "unable to get PCI host bridge resources\n");
|
||||
+ dev_err(dev, "unable to get PCI host bridge resources\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
pcie->map_irq = of_irq_parse_and_map_pci;
|
||||
|
||||
- ret = iproc_pcie_setup(pcie, &res);
|
||||
- if (ret)
|
||||
+ ret = iproc_pcie_setup(pcie, &resources);
|
||||
+ if (ret) {
|
||||
dev_err(dev, "PCIe controller setup failed\n");
|
||||
-
|
||||
- pci_free_resource_list(&res);
|
||||
+ pci_free_resource_list(&resources);
|
||||
+ return ret;
|
||||
+ }
|
||||
|
||||
platform_set_drvdata(pdev, pcie);
|
||||
- return ret;
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
static int iproc_pcie_pltfm_remove(struct platform_device *pdev)
|
||||
--- a/drivers/pci/host/pcie-iproc.h
|
||||
+++ b/drivers/pci/host/pcie-iproc.h
|
||||
@@ -68,6 +68,7 @@ struct iproc_pcie {
|
||||
#ifdef CONFIG_ARM
|
||||
struct pci_sys_data sysdata;
|
||||
#endif
|
||||
+ struct resource mem;
|
||||
struct pci_bus *root_bus;
|
||||
struct phy *phy;
|
||||
int (*map_irq)(const struct pci_dev *, u8, u8);
|
@ -1,90 +0,0 @@
|
||||
From 89b466914a0d49f08d00be25556ba22497b9a284 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>
|
||||
Date: Sat, 17 Sep 2016 15:07:10 +0200
|
||||
Subject: [PATCH] i2c: bcm2835: Fix hang for writing messages larger than 16
|
||||
bytes
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Writing messages larger than the FIFO size results in a hang, rendering
|
||||
the machine unusable. This is because the RXD status flag is set on the
|
||||
first interrupt which results in bcm2835_drain_rxfifo() stealing bytes
|
||||
from the buffer. The controller continues to trigger interrupts waiting
|
||||
for the missing bytes, but bcm2835_fill_txfifo() has none to give.
|
||||
In this situation wait_for_completion_timeout() apparently is unable to
|
||||
stop the madness.
|
||||
|
||||
The BCM2835 ARM Peripherals datasheet has this to say about the flags:
|
||||
TXD: is set when the FIFO has space for at least one byte of data.
|
||||
RXD: is set when the FIFO contains at least one byte of data.
|
||||
TXW: is set during a write transfer and the FIFO is less than full.
|
||||
RXR: is set during a read transfer and the FIFO is or more full.
|
||||
|
||||
Implementing the logic from the downstream i2c-bcm2708 driver solved
|
||||
the hang problem.
|
||||
|
||||
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
|
||||
Reviewed-by: Eric Anholt <eric@anholt.net>
|
||||
Reviewed-by: Martin Sperl <kernel@martin.sperl.org>
|
||||
---
|
||||
drivers/i2c/busses/i2c-bcm2835.c | 22 ++++++++++++++--------
|
||||
1 file changed, 14 insertions(+), 8 deletions(-)
|
||||
|
||||
--- a/drivers/i2c/busses/i2c-bcm2835.c
|
||||
+++ b/drivers/i2c/busses/i2c-bcm2835.c
|
||||
@@ -64,6 +64,7 @@ struct bcm2835_i2c_dev {
|
||||
int irq;
|
||||
struct i2c_adapter adapter;
|
||||
struct completion completion;
|
||||
+ struct i2c_msg *curr_msg;
|
||||
u32 msg_err;
|
||||
u8 *msg_buf;
|
||||
size_t msg_buf_remaining;
|
||||
@@ -126,14 +127,13 @@ static irqreturn_t bcm2835_i2c_isr(int t
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
- if (val & BCM2835_I2C_S_RXD) {
|
||||
- bcm2835_drain_rxfifo(i2c_dev);
|
||||
- if (!(val & BCM2835_I2C_S_DONE))
|
||||
- return IRQ_HANDLED;
|
||||
- }
|
||||
-
|
||||
if (val & BCM2835_I2C_S_DONE) {
|
||||
- if (i2c_dev->msg_buf_remaining)
|
||||
+ if (i2c_dev->curr_msg->flags & I2C_M_RD) {
|
||||
+ bcm2835_drain_rxfifo(i2c_dev);
|
||||
+ val = bcm2835_i2c_readl(i2c_dev, BCM2835_I2C_S);
|
||||
+ }
|
||||
+
|
||||
+ if ((val & BCM2835_I2C_S_RXD) || i2c_dev->msg_buf_remaining)
|
||||
i2c_dev->msg_err = BCM2835_I2C_S_LEN;
|
||||
else
|
||||
i2c_dev->msg_err = 0;
|
||||
@@ -141,11 +141,16 @@ static irqreturn_t bcm2835_i2c_isr(int t
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
- if (val & BCM2835_I2C_S_TXD) {
|
||||
+ if (val & BCM2835_I2C_S_TXW) {
|
||||
bcm2835_fill_txfifo(i2c_dev);
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
+ if (val & BCM2835_I2C_S_RXR) {
|
||||
+ bcm2835_drain_rxfifo(i2c_dev);
|
||||
+ return IRQ_HANDLED;
|
||||
+ }
|
||||
+
|
||||
return IRQ_NONE;
|
||||
}
|
||||
|
||||
@@ -155,6 +160,7 @@ static int bcm2835_i2c_xfer_msg(struct b
|
||||
u32 c;
|
||||
unsigned long time_left;
|
||||
|
||||
+ i2c_dev->curr_msg = msg;
|
||||
i2c_dev->msg_buf = msg->buf;
|
||||
i2c_dev->msg_buf_remaining = msg->len;
|
||||
reinit_completion(&i2c_dev->completion);
|
@ -1,49 +0,0 @@
|
||||
From 3d6159640da9c9175d1ca42f151fc1a14caded59 Mon Sep 17 00:00:00 2001
|
||||
From: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
|
||||
Date: Thu, 13 Apr 2017 15:33:34 +0300
|
||||
Subject: [PATCH] usb: Make sure usb/phy/of gets built-in
|
||||
|
||||
DWC3 driver uses of_usb_get_phy_mode() which is
|
||||
implemented in drivers/usb/phy/of.c and in bare minimal
|
||||
configuration it might not be pulled in kernel binary.
|
||||
|
||||
In case of ARC or ARM this could be easily reproduced with
|
||||
"allnodefconfig" +CONFIG_USB=m +CONFIG_USB_DWC3=m.
|
||||
|
||||
On building all ends-up with:
|
||||
---------------------->8------------------
|
||||
Kernel: arch/arm/boot/Image is ready
|
||||
Kernel: arch/arm/boot/zImage is ready
|
||||
Building modules, stage 2.
|
||||
MODPOST 5 modules
|
||||
ERROR: "of_usb_get_phy_mode" [drivers/usb/dwc3/dwc3.ko] undefined!
|
||||
make[1]: *** [__modpost] Error 1
|
||||
make: *** [modules] Error 2
|
||||
---------------------->8------------------
|
||||
|
||||
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
|
||||
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
|
||||
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
|
||||
Cc: Nicolas Pitre <nicolas.pitre@linaro.org>
|
||||
Cc: Thomas Gleixner <tglx@linutronix.de>
|
||||
Cc: Felipe Balbi <balbi@kernel.org>
|
||||
Cc: Felix Fietkau <nbd@nbd.name>
|
||||
Cc: Jeremy Kerr <jk@ozlabs.org>
|
||||
Cc: linux-snps-arc@lists.infradead.org
|
||||
Cc: stable@vger.kernel.org
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
---
|
||||
drivers/Makefile | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
--- a/drivers/Makefile
|
||||
+++ b/drivers/Makefile
|
||||
@@ -101,6 +101,7 @@ obj-$(CONFIG_USB_PHY) += usb/
|
||||
obj-$(CONFIG_USB) += usb/
|
||||
obj-$(CONFIG_PCI) += usb/
|
||||
obj-$(CONFIG_USB_GADGET) += usb/
|
||||
+obj-$(CONFIG_OF) += usb/
|
||||
obj-$(CONFIG_SERIO) += input/serio/
|
||||
obj-$(CONFIG_GAMEPORT) += input/gameport/
|
||||
obj-$(CONFIG_INPUT) += input/
|
@ -1,25 +0,0 @@
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Mon, 6 Mar 2017 09:48:52 +0100
|
||||
Subject: [PATCH] ubifs: fix RENAME_WHITEOUT support
|
||||
|
||||
Remove faulty leftover check in do_rename(), apparently introduced in a
|
||||
merge that combined whiteout support changes with commit f03b8ad8d386
|
||||
("fs: support RENAME_NOREPLACE for local filesystems")
|
||||
|
||||
Fixes: 9e0a1fff8db5 ("ubifs: Implement RENAME_WHITEOUT")
|
||||
Cc: stable@vger.kernel.org
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
|
||||
--- a/fs/ubifs/dir.c
|
||||
+++ b/fs/ubifs/dir.c
|
||||
@@ -1088,9 +1088,6 @@ static int do_rename(struct inode *old_d
|
||||
struct timespec time;
|
||||
unsigned int uninitialized_var(saved_nlink);
|
||||
|
||||
- if (flags & ~RENAME_NOREPLACE)
|
||||
- return -EINVAL;
|
||||
-
|
||||
/*
|
||||
* Budget request settings: deletion direntry, new direntry, removing
|
||||
* the old inode, and changing old and new parent directory inodes.
|
@ -1,70 +0,0 @@
|
||||
From: Matt Redfearn <matt.redfearn@imgtec.com>
|
||||
Date: Mon, 19 Dec 2016 14:20:56 +0000
|
||||
Subject: [PATCH] MIPS: Introduce irq_stack
|
||||
|
||||
Allocate a per-cpu irq stack for use within interrupt handlers.
|
||||
|
||||
Also add a utility function on_irq_stack to determine if a given stack
|
||||
pointer is within the irq stack for that cpu.
|
||||
|
||||
Signed-off-by: Matt Redfearn <matt.redfearn@imgtec.com>
|
||||
---
|
||||
|
||||
--- a/arch/mips/include/asm/irq.h
|
||||
+++ b/arch/mips/include/asm/irq.h
|
||||
@@ -17,6 +17,18 @@
|
||||
|
||||
#include <irq.h>
|
||||
|
||||
+#define IRQ_STACK_SIZE THREAD_SIZE
|
||||
+
|
||||
+extern void *irq_stack[NR_CPUS];
|
||||
+
|
||||
+static inline bool on_irq_stack(int cpu, unsigned long sp)
|
||||
+{
|
||||
+ unsigned long low = (unsigned long)irq_stack[cpu];
|
||||
+ unsigned long high = low + IRQ_STACK_SIZE;
|
||||
+
|
||||
+ return (low <= sp && sp <= high);
|
||||
+}
|
||||
+
|
||||
#ifdef CONFIG_I8259
|
||||
static inline int irq_canonicalize(int irq)
|
||||
{
|
||||
--- a/arch/mips/kernel/asm-offsets.c
|
||||
+++ b/arch/mips/kernel/asm-offsets.c
|
||||
@@ -102,6 +102,7 @@ void output_thread_info_defines(void)
|
||||
OFFSET(TI_REGS, thread_info, regs);
|
||||
DEFINE(_THREAD_SIZE, THREAD_SIZE);
|
||||
DEFINE(_THREAD_MASK, THREAD_MASK);
|
||||
+ DEFINE(_IRQ_STACK_SIZE, IRQ_STACK_SIZE);
|
||||
BLANK();
|
||||
}
|
||||
|
||||
--- a/arch/mips/kernel/irq.c
|
||||
+++ b/arch/mips/kernel/irq.c
|
||||
@@ -25,6 +25,8 @@
|
||||
#include <linux/atomic.h>
|
||||
#include <asm/uaccess.h>
|
||||
|
||||
+void *irq_stack[NR_CPUS];
|
||||
+
|
||||
/*
|
||||
* 'what should we do if we get a hw irq event on an illegal vector'.
|
||||
* each architecture has to answer this themselves.
|
||||
@@ -58,6 +60,15 @@ void __init init_IRQ(void)
|
||||
clear_c0_status(ST0_IM);
|
||||
|
||||
arch_init_irq();
|
||||
+
|
||||
+ for_each_possible_cpu(i) {
|
||||
+ int irq_pages = IRQ_STACK_SIZE / PAGE_SIZE;
|
||||
+ void *s = (void *)__get_free_pages(GFP_KERNEL, irq_pages);
|
||||
+
|
||||
+ irq_stack[i] = s;
|
||||
+ pr_debug("CPU%d IRQ stack at 0x%p - 0x%p\n", i,
|
||||
+ irq_stack[i], irq_stack[i] + IRQ_STACK_SIZE);
|
||||
+ }
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DEBUG_STACKOVERFLOW
|
@ -1,42 +0,0 @@
|
||||
From: Matt Redfearn <matt.redfearn@imgtec.com>
|
||||
Date: Mon, 19 Dec 2016 14:20:57 +0000
|
||||
Subject: [PATCH] MIPS: Stack unwinding while on IRQ stack
|
||||
|
||||
Within unwind stack, check if the stack pointer being unwound is within
|
||||
the CPU's irq_stack and if so use that page rather than the task's stack
|
||||
page.
|
||||
|
||||
Signed-off-by: Matt Redfearn <matt.redfearn@imgtec.com>
|
||||
---
|
||||
|
||||
--- a/arch/mips/kernel/process.c
|
||||
+++ b/arch/mips/kernel/process.c
|
||||
@@ -33,6 +33,7 @@
|
||||
#include <asm/dsemul.h>
|
||||
#include <asm/dsp.h>
|
||||
#include <asm/fpu.h>
|
||||
+#include <asm/irq.h>
|
||||
#include <asm/msa.h>
|
||||
#include <asm/pgtable.h>
|
||||
#include <asm/mipsregs.h>
|
||||
@@ -556,7 +557,19 @@ EXPORT_SYMBOL(unwind_stack_by_address);
|
||||
unsigned long unwind_stack(struct task_struct *task, unsigned long *sp,
|
||||
unsigned long pc, unsigned long *ra)
|
||||
{
|
||||
- unsigned long stack_page = (unsigned long)task_stack_page(task);
|
||||
+ unsigned long stack_page = 0;
|
||||
+ int cpu;
|
||||
+
|
||||
+ for_each_possible_cpu(cpu) {
|
||||
+ if (on_irq_stack(cpu, *sp)) {
|
||||
+ stack_page = (unsigned long)irq_stack[cpu];
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (!stack_page)
|
||||
+ stack_page = (unsigned long)task_stack_page(task);
|
||||
+
|
||||
return unwind_stack_by_address(stack_page, sp, pc, ra);
|
||||
}
|
||||
#endif
|
@ -1,48 +0,0 @@
|
||||
From: Matt Redfearn <matt.redfearn@imgtec.com>
|
||||
Date: Mon, 19 Dec 2016 14:20:58 +0000
|
||||
Subject: [PATCH] MIPS: Only change $28 to thread_info if coming from user
|
||||
mode
|
||||
|
||||
The SAVE_SOME macro is used to save the execution context on all
|
||||
exceptions.
|
||||
If an exception occurs while executing user code, the stack is switched
|
||||
to the kernel's stack for the current task, and register $28 is switched
|
||||
to point to the current_thread_info, which is at the bottom of the stack
|
||||
region.
|
||||
If the exception occurs while executing kernel code, the stack is left,
|
||||
and this change ensures that register $28 is not updated. This is the
|
||||
correct behaviour when the kernel can be executing on the separate irq
|
||||
stack, because the thread_info will not be at the base of it.
|
||||
|
||||
With this change, register $28 is only switched to it's kernel
|
||||
conventional usage of the currrent thread info pointer at the point at
|
||||
which execution enters kernel space. Doing it on every exception was
|
||||
redundant, but OK without an IRQ stack, but will be erroneous once that
|
||||
is introduced.
|
||||
|
||||
Signed-off-by: Matt Redfearn <matt.redfearn@imgtec.com>
|
||||
Reviewed-by: Maciej W. Rozycki <macro@imgtec.com>
|
||||
---
|
||||
|
||||
--- a/arch/mips/include/asm/stackframe.h
|
||||
+++ b/arch/mips/include/asm/stackframe.h
|
||||
@@ -216,12 +216,19 @@
|
||||
LONG_S $25, PT_R25(sp)
|
||||
LONG_S $28, PT_R28(sp)
|
||||
LONG_S $31, PT_R31(sp)
|
||||
+
|
||||
+ /* Set thread_info if we're coming from user mode */
|
||||
+ mfc0 k0, CP0_STATUS
|
||||
+ sll k0, 3 /* extract cu0 bit */
|
||||
+ bltz k0, 9f
|
||||
+
|
||||
ori $28, sp, _THREAD_MASK
|
||||
xori $28, _THREAD_MASK
|
||||
#ifdef CONFIG_CPU_CAVIUM_OCTEON
|
||||
.set mips64
|
||||
pref 0, 0($28) /* Prefetch the current pointer */
|
||||
#endif
|
||||
+9:
|
||||
.set pop
|
||||
.endm
|
||||
|
@ -1,116 +0,0 @@
|
||||
From: Matt Redfearn <matt.redfearn@imgtec.com>
|
||||
Date: Mon, 19 Dec 2016 14:20:59 +0000
|
||||
Subject: [PATCH] MIPS: Switch to the irq_stack in interrupts
|
||||
|
||||
When enterring interrupt context via handle_int or except_vec_vi, switch
|
||||
to the irq_stack of the current CPU if it is not already in use.
|
||||
|
||||
The current stack pointer is masked with the thread size and compared to
|
||||
the base or the irq stack. If it does not match then the stack pointer
|
||||
is set to the top of that stack, otherwise this is a nested irq being
|
||||
handled on the irq stack so the stack pointer should be left as it was.
|
||||
|
||||
The in-use stack pointer is placed in the callee saved register s1. It
|
||||
will be saved to the stack when plat_irq_dispatch is invoked and can be
|
||||
restored once control returns here.
|
||||
|
||||
Signed-off-by: Matt Redfearn <matt.redfearn@imgtec.com>
|
||||
---
|
||||
|
||||
--- a/arch/mips/kernel/genex.S
|
||||
+++ b/arch/mips/kernel/genex.S
|
||||
@@ -187,9 +187,44 @@ NESTED(handle_int, PT_SIZE, sp)
|
||||
|
||||
LONG_L s0, TI_REGS($28)
|
||||
LONG_S sp, TI_REGS($28)
|
||||
- PTR_LA ra, ret_from_irq
|
||||
- PTR_LA v0, plat_irq_dispatch
|
||||
- jr v0
|
||||
+
|
||||
+ /*
|
||||
+ * SAVE_ALL ensures we are using a valid kernel stack for the thread.
|
||||
+ * Check if we are already using the IRQ stack.
|
||||
+ */
|
||||
+ move s1, sp # Preserve the sp
|
||||
+
|
||||
+ /* Get IRQ stack for this CPU */
|
||||
+ ASM_CPUID_MFC0 k0, ASM_SMP_CPUID_REG
|
||||
+#if defined(CONFIG_32BIT) || defined(KBUILD_64BIT_SYM32)
|
||||
+ lui k1, %hi(irq_stack)
|
||||
+#else
|
||||
+ lui k1, %highest(irq_stack)
|
||||
+ daddiu k1, %higher(irq_stack)
|
||||
+ dsll k1, 16
|
||||
+ daddiu k1, %hi(irq_stack)
|
||||
+ dsll k1, 16
|
||||
+#endif
|
||||
+ LONG_SRL k0, SMP_CPUID_PTRSHIFT
|
||||
+ LONG_ADDU k1, k0
|
||||
+ LONG_L t0, %lo(irq_stack)(k1)
|
||||
+
|
||||
+ # Check if already on IRQ stack
|
||||
+ PTR_LI t1, ~(_THREAD_SIZE-1)
|
||||
+ and t1, t1, sp
|
||||
+ beq t0, t1, 2f
|
||||
+
|
||||
+ /* Switch to IRQ stack */
|
||||
+ li t1, _IRQ_STACK_SIZE
|
||||
+ PTR_ADD sp, t0, t1
|
||||
+
|
||||
+2:
|
||||
+ jal plat_irq_dispatch
|
||||
+
|
||||
+ /* Restore sp */
|
||||
+ move sp, s1
|
||||
+
|
||||
+ j ret_from_irq
|
||||
#ifdef CONFIG_CPU_MICROMIPS
|
||||
nop
|
||||
#endif
|
||||
@@ -262,8 +297,44 @@ NESTED(except_vec_vi_handler, 0, sp)
|
||||
|
||||
LONG_L s0, TI_REGS($28)
|
||||
LONG_S sp, TI_REGS($28)
|
||||
- PTR_LA ra, ret_from_irq
|
||||
- jr v0
|
||||
+
|
||||
+ /*
|
||||
+ * SAVE_ALL ensures we are using a valid kernel stack for the thread.
|
||||
+ * Check if we are already using the IRQ stack.
|
||||
+ */
|
||||
+ move s1, sp # Preserve the sp
|
||||
+
|
||||
+ /* Get IRQ stack for this CPU */
|
||||
+ ASM_CPUID_MFC0 k0, ASM_SMP_CPUID_REG
|
||||
+#if defined(CONFIG_32BIT) || defined(KBUILD_64BIT_SYM32)
|
||||
+ lui k1, %hi(irq_stack)
|
||||
+#else
|
||||
+ lui k1, %highest(irq_stack)
|
||||
+ daddiu k1, %higher(irq_stack)
|
||||
+ dsll k1, 16
|
||||
+ daddiu k1, %hi(irq_stack)
|
||||
+ dsll k1, 16
|
||||
+#endif
|
||||
+ LONG_SRL k0, SMP_CPUID_PTRSHIFT
|
||||
+ LONG_ADDU k1, k0
|
||||
+ LONG_L t0, %lo(irq_stack)(k1)
|
||||
+
|
||||
+ # Check if already on IRQ stack
|
||||
+ PTR_LI t1, ~(_THREAD_SIZE-1)
|
||||
+ and t1, t1, sp
|
||||
+ beq t0, t1, 2f
|
||||
+
|
||||
+ /* Switch to IRQ stack */
|
||||
+ li t1, _IRQ_STACK_SIZE
|
||||
+ PTR_ADD sp, t0, t1
|
||||
+
|
||||
+2:
|
||||
+ jal plat_irq_dispatch
|
||||
+
|
||||
+ /* Restore sp */
|
||||
+ move sp, s1
|
||||
+
|
||||
+ j ret_from_irq
|
||||
END(except_vec_vi_handler)
|
||||
|
||||
/*
|
@ -1,21 +0,0 @@
|
||||
From: Matt Redfearn <matt.redfearn@imgtec.com>
|
||||
Date: Mon, 19 Dec 2016 14:21:00 +0000
|
||||
Subject: [PATCH] MIPS: Select HAVE_IRQ_EXIT_ON_IRQ_STACK
|
||||
|
||||
Since do_IRQ is now invoked on a separate IRQ stack, we select
|
||||
HAVE_IRQ_EXIT_ON_IRQ_STACK so that softirq's may be invoked directly
|
||||
from irq_exit(), rather than requiring do_softirq_own_stack.
|
||||
|
||||
Signed-off-by: Matt Redfearn <matt.redfearn@imgtec.com>
|
||||
---
|
||||
|
||||
--- a/arch/mips/Kconfig
|
||||
+++ b/arch/mips/Kconfig
|
||||
@@ -9,6 +9,7 @@ config MIPS
|
||||
select HAVE_CONTEXT_TRACKING
|
||||
select HAVE_GENERIC_DMA_COHERENT
|
||||
select HAVE_IDE
|
||||
+ select HAVE_IRQ_EXIT_ON_IRQ_STACK
|
||||
select HAVE_OPROFILE
|
||||
select HAVE_PERF_EVENTS
|
||||
select PERF_USE_VMALLOC
|
@ -1,35 +0,0 @@
|
||||
From de856416e7143e32afc4849625616554aa060f7a Mon Sep 17 00:00:00 2001
|
||||
From: Matt Redfearn <matt.redfearn@imgtec.com>
|
||||
Date: Wed, 25 Jan 2017 17:00:25 +0000
|
||||
Subject: [PATCH] MIPS: IRQ Stack: Fix erroneous jal to plat_irq_dispatch
|
||||
|
||||
Commit dda45f701c9d ("MIPS: Switch to the irq_stack in interrupts")
|
||||
changed both the normal and vectored interrupt handlers. Unfortunately
|
||||
the vectored version, "except_vec_vi_handler", was incorrectly modified
|
||||
to unconditionally jal to plat_irq_dispatch, rather than doing a jalr to
|
||||
the vectored handler that has been set up. This is ok for many platforms
|
||||
which set the vectored handler to plat_irq_dispatch anyway, but will
|
||||
cause problems with platforms that use other handlers.
|
||||
|
||||
Fixes: dda45f701c9d ("MIPS: Switch to the irq_stack in interrupts")
|
||||
Signed-off-by: Matt Redfearn <matt.redfearn@imgtec.com>
|
||||
Cc: Ralf Baechle <ralf@linux-mips.org>
|
||||
Cc: Paul Burton <paul.burton@imgtec.com>
|
||||
Cc: linux-mips@linux-mips.org
|
||||
Patchwork: https://patchwork.linux-mips.org/patch/15110/
|
||||
Signed-off-by: James Hogan <james.hogan@imgtec.com>
|
||||
---
|
||||
arch/mips/kernel/genex.S | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/arch/mips/kernel/genex.S
|
||||
+++ b/arch/mips/kernel/genex.S
|
||||
@@ -329,7 +329,7 @@ NESTED(except_vec_vi_handler, 0, sp)
|
||||
PTR_ADD sp, t0, t1
|
||||
|
||||
2:
|
||||
- jal plat_irq_dispatch
|
||||
+ jalr v0
|
||||
|
||||
/* Restore sp */
|
||||
move sp, s1
|
@ -1,40 +0,0 @@
|
||||
From bd5d21310133921021d78995ad6346f908483124 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Sun, 20 Nov 2016 16:09:30 +0100
|
||||
Subject: [PATCH] mtd: bcm47xxpart: fix parsing first block after aligned TRX
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
After parsing TRX we should skip to the first block placed behind it.
|
||||
Our code was working only with TRX with length not aligned to the
|
||||
blocksize. In other cases (length aligned) it was missing the block
|
||||
places right after TRX.
|
||||
|
||||
This fixes calculation and simplifies the comment.
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
|
||||
---
|
||||
drivers/mtd/bcm47xxpart.c | 10 ++++------
|
||||
1 file changed, 4 insertions(+), 6 deletions(-)
|
||||
|
||||
--- a/drivers/mtd/bcm47xxpart.c
|
||||
+++ b/drivers/mtd/bcm47xxpart.c
|
||||
@@ -229,12 +229,10 @@ static int bcm47xxpart_parse(struct mtd_
|
||||
|
||||
last_trx_part = curr_part - 1;
|
||||
|
||||
- /*
|
||||
- * We have whole TRX scanned, skip to the next part. Use
|
||||
- * roundown (not roundup), as the loop will increase
|
||||
- * offset in next step.
|
||||
- */
|
||||
- offset = rounddown(offset + trx->length, blocksize);
|
||||
+ /* Jump to the end of TRX */
|
||||
+ offset = roundup(offset + trx->length, blocksize);
|
||||
+ /* Next loop iteration will increase the offset */
|
||||
+ offset -= blocksize;
|
||||
continue;
|
||||
}
|
||||
|
@ -1,42 +0,0 @@
|
||||
From 9f327845358d3dd0d8a5a7a5436b0aa5c432e757 Mon Sep 17 00:00:00 2001
|
||||
From: Haibo Chen <haibo.chen@nxp.com>
|
||||
Date: Wed, 19 Apr 2017 10:53:51 +0800
|
||||
Subject: [PATCH] mmc: sdhci-esdhc-imx: increase the pad I/O drive strength for
|
||||
DDR50 card
|
||||
|
||||
Currently for DDR50 card, it need tuning in default. We meet tuning fail
|
||||
issue for DDR50 card and some data CRC error when DDR50 sd card works.
|
||||
|
||||
This is because the default pad I/O drive strength can't make sure DDR50
|
||||
card work stable. So increase the pad I/O drive strength for DDR50 card,
|
||||
and use pins_100mhz.
|
||||
|
||||
This fixes DDR50 card support for IMX since DDR50 tuning was enabled from
|
||||
commit 9faac7b95ea4 ("mmc: sdhci: enable tuning for DDR50")
|
||||
|
||||
Tested-and-reported-by: Tim Harvey <tharvey@gateworks.com>
|
||||
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
|
||||
Cc: stable@vger.kernel.org # v4.4+
|
||||
Acked-by: Dong Aisheng <aisheng.dong@nxp.com>
|
||||
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
|
||||
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
|
||||
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
|
||||
---
|
||||
drivers/mmc/host/sdhci-esdhc-imx.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
|
||||
index 7123ef9..445fc47 100644
|
||||
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
|
||||
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
|
||||
@@ -830,6 +830,7 @@ static int esdhc_change_pinstate(struct sdhci_host *host,
|
||||
|
||||
switch (uhs) {
|
||||
case MMC_TIMING_UHS_SDR50:
|
||||
+ case MMC_TIMING_UHS_DDR50:
|
||||
pinctrl = imx_data->pins_100mhz;
|
||||
break;
|
||||
case MMC_TIMING_UHS_SDR104:
|
||||
--
|
||||
2.7.4
|
||||
|
@ -1,21 +0,0 @@
|
||||
From 2583143af8111d430bdca0268b6cdb7ccc7c3f9d Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
Date: Fri, 13 Jan 2017 05:40:04 +0100
|
||||
Subject: [PATCH] mips: ralink/rt3883: fix typo in pinctrl lna_g_func
|
||||
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
---
|
||||
arch/mips/ralink/rt3883.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/arch/mips/ralink/rt3883.c
|
||||
+++ b/arch/mips/ralink/rt3883.c
|
||||
@@ -36,7 +36,7 @@ static struct rt2880_pmx_func uartlite_f
|
||||
static struct rt2880_pmx_func jtag_func[] = { FUNC("jtag", 0, 17, 5) };
|
||||
static struct rt2880_pmx_func mdio_func[] = { FUNC("mdio", 0, 22, 2) };
|
||||
static struct rt2880_pmx_func lna_a_func[] = { FUNC("lna a", 0, 32, 3) };
|
||||
-static struct rt2880_pmx_func lna_g_func[] = { FUNC("lna a", 0, 35, 3) };
|
||||
+static struct rt2880_pmx_func lna_g_func[] = { FUNC("lna g", 0, 35, 3) };
|
||||
static struct rt2880_pmx_func pci_func[] = {
|
||||
FUNC("pci-dev", 0, 40, 32),
|
||||
FUNC("pci-host2", 1, 40, 32),
|
Loading…
Reference in New Issue