kernel: update kernel 4.4 to version 4.4.79

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
master
Hauke Mehrtens 7 years ago
parent 88f3c63572
commit 39e8ab17d5
  1. 4
      include/kernel-version.mk
  2. 37
      target/linux/ar71xx/patches-4.4/102-MIPS-ath79-fix-regression-in-PCI-window-initializati.patch
  3. 4
      target/linux/bcm53xx/patches-4.4/031-ARM-dts-enable-clock-support-for-BCM5301X.patch
  4. 41
      target/linux/bcm53xx/patches-4.4/047-0013-ARM-dts-BCM5301X-Correct-GIC_PPI-interrupt-flags.patch
  5. 48
      target/linux/bcm53xx/patches-4.4/060-0001-net-phy-Initialize-mdio-clock-at-probe-function.patch
  6. 2
      target/linux/brcm63xx/patches-4.4/000-4.5-03-mtd-nand-spi-nor-assign-MTD-of_node.patch
  7. 2
      target/linux/brcm63xx/patches-4.4/000-4.5-05-spi-nor-convert-to-spi_nor_-get-set-_flash_node.patch
  8. 2
      target/linux/brcm63xx/patches-4.4/000-4.5-08-mtd-spi-nor-drop-flash_node-field.patch
  9. 16
      target/linux/generic/patches-4.4/002-phy_drivers_backport.patch
  10. 35
      target/linux/generic/patches-4.4/040-0001-mtd-bcm47xxpart-limit-scanned-flash-area-on-BCM47XX-.patch
  11. 93
      target/linux/generic/patches-4.4/040-0002-mtd-bcm47xxpart-don-t-fail-because-of-bit-flips.patch
  12. 4
      target/linux/generic/patches-4.4/048-mtd-spi-nor-backport-SPI_NOR_HAS_LOCK-flag.patch
  13. 28
      target/linux/generic/patches-4.4/070-v4.5-0001-bgmac-fix-a-missing-check-for-build_skb.patch
  14. 22
      target/linux/generic/patches-4.4/070-v4.5-0002-bgmac-Fix-reversed-test-of-build_skb-return-value.patch
  15. 12
      target/linux/generic/patches-4.4/070-v4.6-0001-bgmac-add-helper-checking-for-BCM4707-BCM53018-chip-.patch
  16. 2
      target/linux/generic/patches-4.4/070-v4.6-0002-bgmac-support-Ethernet-device-on-BCM47094-SoC.patch
  17. 31
      target/linux/generic/patches-4.4/070-v4.6-0003-bgmac-reset-enable-Ethernet-core-before-using-it.patch
  18. 2
      target/linux/generic/patches-4.4/070-v4.8-0001-bgmac-Bind-net_device-with-backing-device-structure.patch
  19. 4
      target/linux/generic/patches-4.4/070-v4.8-0002-bgmac-Add-support-for-ethtool-statistics.patch
  20. 10
      target/linux/generic/patches-4.4/070-v4.8-0003-bgmac-Maintain-some-netdev-statistics.patch
  21. 20
      target/linux/generic/patches-4.4/070-v4.8-0004-net-ethernet-bgmac-use-phydev-from-struct-net_device.patch
  22. 37
      target/linux/generic/patches-4.4/071-v4.7-0001-net-bgmac-Fix-SOF-bit-checking.patch
  23. 28
      target/linux/generic/patches-4.4/071-v4.7-0002-net-bgmac-Start-transmit-queue-in-bgmac_open.patch
  24. 28
      target/linux/generic/patches-4.4/071-v4.7-0003-net-bgmac-Remove-superflous-netif_carrier_on.patch
  25. 30
      target/linux/generic/patches-4.4/104-of-Add-check-to-of_scan_flat_dt-before-accessing-ini.patch
  26. 4
      target/linux/generic/patches-4.4/201-extra_optimization.patch
  27. 4
      target/linux/generic/patches-4.4/208-disable-modorder.patch
  28. 2
      target/linux/generic/patches-4.4/465-m25p80-mx-disable-software-protection.patch
  29. 8
      target/linux/generic/patches-4.4/662-use_fq_codel_by_default.patch
  30. 14
      target/linux/generic/patches-4.4/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch
  31. 10
      target/linux/generic/patches-4.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch
  32. 2
      target/linux/generic/patches-4.4/721-phy_packets.patch
  33. 2
      target/linux/layerscape/patches-4.4/1074-mtd-nand-spi-nor-assign-MTD-of_node.patch
  34. 2
      target/linux/layerscape/patches-4.4/1075-mtd-spi-nor-convert-to-spi_nor_-get-set-_flash_node.patch
  35. 2
      target/linux/layerscape/patches-4.4/1078-mtd-spi-nor-drop-flash_node-field.patch
  36. 4
      target/linux/layerscape/patches-4.4/1081-mtd-spi-nor-provide-default-erase_sector-implementat.patch
  37. 6
      target/linux/layerscape/patches-4.4/1090-mtd-spi-nor-Add-SPI-NOR-layer-PM-support.patch
  38. 2
      target/linux/layerscape/patches-4.4/1100-mtd-spi_nor-Disable-Micron-flash-HW-protection.patch
  39. 2
      target/linux/layerscape/patches-4.4/1103-mtd-spi-nor-Support-R-W-for-S25FS-S-family-flash.patch
  40. 10
      target/linux/layerscape/patches-4.4/1105-mtd-spi-nor-add-DDR-quad-read-support.patch
  41. 2
      target/linux/layerscape/patches-4.4/1110-mtd-spi-nor-fsl-quad-add-flash-S25FS-extra-support.patch
  42. 2
      target/linux/layerscape/patches-4.4/7018-devres-add-devm_alloc_percpu.patch
  43. 2
      target/linux/layerscape/patches-4.4/8138-pci-layerscape-add-MSI-interrupt-support.patch
  44. 2
      target/linux/mvebu/patches-4.4/030-mvneta-consolidate-autoneg-enabling.patch
  45. 2
      target/linux/mvebu/patches-4.4/031-mvneta-implement-ethtool-autonegotiation-control.patch
  46. 2
      target/linux/mvebu/patches-4.4/032-net-mvneta-Make-the-default-queue-related-for-each-p.patch
  47. 6
      target/linux/mvebu/patches-4.4/034-net-mvneta-Add-naive-RSS-support.patch
  48. 2
      target/linux/mvebu/patches-4.4/036-net-mvneta-fix-trivial-cut-off-issue-in-mvneta_ethto.patch
  49. 55
      target/linux/mvebu/patches-4.4/037-net-mvneta-Fix-for_each_present_cpu-usage.patch
  50. 2
      target/linux/mvebu/patches-4.4/126-phy-marvell-88E1512-add-flow-control-support.patch
  51. 10
      target/linux/oxnas/patches-4.4/0072-mtd-backport-v4.7-0day-patches-from-Boris.patch
  52. 51
      target/linux/rb532/patches-4.4/100-korina_fix_napi_disable.patch
  53. 11
      target/linux/uml/patches-4.4/000-um-Avoid-longjmp-setjmp-symbol-clashes-with-libpthre.patch

@ -3,11 +3,11 @@
LINUX_RELEASE?=1
LINUX_VERSION-3.18 = .43
LINUX_VERSION-4.4 = .74
LINUX_VERSION-4.4 = .79
LINUX_VERSION-4.9 = .40
LINUX_KERNEL_HASH-3.18.43 = 1236e8123a6ce537d5029232560966feed054ae31776fe8481dd7d18cdd5492c
LINUX_KERNEL_HASH-4.4.74 = c319ad6150d112bd4f8c9d1427868eeafd3ab461becf9457f814e4ba7c57808e
LINUX_KERNEL_HASH-4.4.79 = 0dbda3b51e11957fdb96c46844a823a212d46d6db680d77422ddea1a65bebca8
LINUX_KERNEL_HASH-4.9.40 = 025767f3652a656c7b5ed2949aef205f88a5acfd70ae3fe77710ad37f1662d9b
ifdef KERNEL_PATCHVER

@ -1,37 +0,0 @@
From: Felix Fietkau <nbd@nbd.name>
Date: Sun, 15 May 2016 13:09:20 +0200
Subject: [PATCH] MIPS: ath79: fix regression in PCI window initialization
ath79_ddr_pci_win_base has the type void __iomem *, so register offsets
need to be a multiple of 4.
Cc: Alban Bedel <albeu@free.fr>
Fixes: 24b0e3e84fbf ("MIPS: ath79: Improve the DDR controller interface")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
--- a/arch/mips/ath79/common.c
+++ b/arch/mips/ath79/common.c
@@ -76,14 +76,14 @@ void ath79_ddr_set_pci_windows(void)
{
BUG_ON(!ath79_ddr_pci_win_base);
- __raw_writel(AR71XX_PCI_WIN0_OFFS, ath79_ddr_pci_win_base + 0);
- __raw_writel(AR71XX_PCI_WIN1_OFFS, ath79_ddr_pci_win_base + 1);
- __raw_writel(AR71XX_PCI_WIN2_OFFS, ath79_ddr_pci_win_base + 2);
- __raw_writel(AR71XX_PCI_WIN3_OFFS, ath79_ddr_pci_win_base + 3);
- __raw_writel(AR71XX_PCI_WIN4_OFFS, ath79_ddr_pci_win_base + 4);
- __raw_writel(AR71XX_PCI_WIN5_OFFS, ath79_ddr_pci_win_base + 5);
- __raw_writel(AR71XX_PCI_WIN6_OFFS, ath79_ddr_pci_win_base + 6);
- __raw_writel(AR71XX_PCI_WIN7_OFFS, ath79_ddr_pci_win_base + 7);
+ __raw_writel(AR71XX_PCI_WIN0_OFFS, ath79_ddr_pci_win_base + 0x0);
+ __raw_writel(AR71XX_PCI_WIN1_OFFS, ath79_ddr_pci_win_base + 0x4);
+ __raw_writel(AR71XX_PCI_WIN2_OFFS, ath79_ddr_pci_win_base + 0x8);
+ __raw_writel(AR71XX_PCI_WIN3_OFFS, ath79_ddr_pci_win_base + 0xc);
+ __raw_writel(AR71XX_PCI_WIN4_OFFS, ath79_ddr_pci_win_base + 0x10);
+ __raw_writel(AR71XX_PCI_WIN5_OFFS, ath79_ddr_pci_win_base + 0x14);
+ __raw_writel(AR71XX_PCI_WIN6_OFFS, ath79_ddr_pci_win_base + 0x18);
+ __raw_writel(AR71XX_PCI_WIN7_OFFS, ath79_ddr_pci_win_base + 0x1c);
}
EXPORT_SYMBOL_GPL(ath79_ddr_set_pci_windows);

@ -68,7 +68,7 @@ Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
compatible = "arm,cortex-a9-global-timer";
- reg = <0x0200 0x100>;
+ reg = <0x20200 0x100>;
interrupts = <GIC_PPI 11 IRQ_TYPE_LEVEL_HIGH>;
interrupts = <GIC_PPI 11 IRQ_TYPE_EDGE_RISING>;
- clocks = <&clk_periph>;
+ clocks = <&periph_clk>;
};
@ -78,7 +78,7 @@ Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
compatible = "arm,cortex-a9-twd-timer";
- reg = <0x0600 0x100>;
+ reg = <0x20600 0x100>;
interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_HIGH>;
interrupts = <GIC_PPI 13 IRQ_TYPE_EDGE_RISING>;
- clocks = <&clk_periph>;
+ clocks = <&periph_clk>;
};

@ -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,48 +0,0 @@
From bb1a619735b4660f21bce3e728b937640024b4ad Mon Sep 17 00:00:00 2001
From: Yendapally Reddy Dhananjaya Reddy <yendapally.reddy@broadcom.com>
Date: Wed, 8 Feb 2017 17:14:26 -0500
Subject: [PATCH] net: phy: Initialize mdio clock at probe function
USB PHYs need the MDIO clock divisor enabled earlier to work.
Initialize mdio clock divisor in probe function. The ext bus
bit available in the same register will be used by mdio mux
to enable external mdio.
Signed-off-by: Yendapally Reddy Dhananjaya Reddy <yendapally.reddy@broadcom.com>
Fixes: ddc24ae1 ("net: phy: Broadcom iProc MDIO bus driver")
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Jon Mason <jon.mason@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
drivers/net/phy/mdio-bcm-iproc.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
--- a/drivers/net/phy/mdio-bcm-iproc.c
+++ b/drivers/net/phy/mdio-bcm-iproc.c
@@ -81,8 +81,6 @@ static int iproc_mdio_read(struct mii_bu
if (rc)
return rc;
- iproc_mdio_config_clk(priv->base);
-
/* Prepare the read operation */
cmd = (MII_DATA_TA_VAL << MII_DATA_TA_SHIFT) |
(reg << MII_DATA_RA_SHIFT) |
@@ -112,8 +110,6 @@ static int iproc_mdio_write(struct mii_b
if (rc)
return rc;
- iproc_mdio_config_clk(priv->base);
-
/* Prepare the write operation */
cmd = (MII_DATA_TA_VAL << MII_DATA_TA_SHIFT) |
(reg << MII_DATA_RA_SHIFT) |
@@ -163,6 +159,8 @@ static int iproc_mdio_probe(struct platf
bus->read = iproc_mdio_read;
bus->write = iproc_mdio_write;
+ iproc_mdio_config_clk(priv->base);
+
rc = of_mdiobus_register(bus, pdev->dev.of_node);
if (rc) {
dev_err(&pdev->dev, "MDIO bus registration failed\n");

@ -27,7 +27,7 @@ Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
return ret;
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
@@ -1221,6 +1221,7 @@ int spi_nor_scan(struct spi_nor *nor, co
@@ -1228,6 +1228,7 @@ int spi_nor_scan(struct spi_nor *nor, co
mtd->flags |= MTD_NO_ERASE;
mtd->dev.parent = dev;

@ -68,7 +68,7 @@ Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
spifi->nor.write = nxp_spifi_write;
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
@@ -1113,7 +1113,7 @@ int spi_nor_scan(struct spi_nor *nor, co
@@ -1120,7 +1120,7 @@ int spi_nor_scan(struct spi_nor *nor, co
const struct flash_info *info = NULL;
struct device *dev = nor->dev;
struct mtd_info *mtd = &nor->mtd;

@ -14,7 +14,7 @@ Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
@@ -1221,7 +1221,6 @@ int spi_nor_scan(struct spi_nor *nor, co
@@ -1228,7 +1228,6 @@ int spi_nor_scan(struct spi_nor *nor, co
mtd->flags |= MTD_NO_ERASE;
mtd->dev.parent = dev;

@ -1,6 +1,6 @@
--- a/drivers/net/phy/adm6996.c
+++ b/drivers/net/phy/adm6996.c
@@ -287,7 +287,7 @@ static u16
@@ -286,7 +286,7 @@ static u16
adm6996_read_mii_reg(struct adm6996_priv *priv, enum admreg reg)
{
struct phy_device *phydev = priv->priv;
@ -9,7 +9,7 @@
return bus->read(bus, PHYADDR(reg));
}
@@ -296,7 +296,7 @@ static void
@@ -295,7 +295,7 @@ static void
adm6996_write_mii_reg(struct adm6996_priv *priv, enum admreg reg, u16 val)
{
struct phy_device *phydev = priv->priv;
@ -18,7 +18,7 @@
bus->write(bus, PHYADDR(reg), val);
}
@@ -1019,13 +1019,13 @@ static int adm6996_config_init(struct ph
@@ -1018,13 +1018,13 @@ static int adm6996_config_init(struct ph
pdev->supported = ADVERTISED_100baseT_Full;
pdev->advertising = ADVERTISED_100baseT_Full;
@ -35,7 +35,7 @@
if (!priv)
return -ENOMEM;
@@ -1045,7 +1045,7 @@ static int adm6996_config_init(struct ph
@@ -1044,7 +1044,7 @@ static int adm6996_config_init(struct ph
}
/*
@ -44,7 +44,7 @@
*/
static int adm6996_read_status(struct phy_device *phydev)
{
@@ -1061,7 +1061,7 @@ static int adm6996_read_status(struct ph
@@ -1060,7 +1060,7 @@ static int adm6996_read_status(struct ph
}
/*
@ -53,7 +53,7 @@
*/
static int adm6996_config_aneg(struct phy_device *phydev)
{
@@ -1070,11 +1070,11 @@ static int adm6996_config_aneg(struct ph
@@ -1069,11 +1069,11 @@ static int adm6996_config_aneg(struct ph
static int adm6996_fixup(struct phy_device *dev)
{
@ -67,7 +67,7 @@
return 0;
/* look for the switch on the bus */
@@ -1121,6 +1121,7 @@ static struct phy_driver adm6996_phy_dri
@@ -1120,6 +1120,7 @@ static struct phy_driver adm6996_phy_dri
.config_aneg = &adm6996_config_aneg,
.read_status = &adm6996_read_status,
.soft_reset = adm6996_soft_reset,
@ -75,7 +75,7 @@
};
static int adm6996_gpio_probe(struct platform_device *pdev)
@@ -1193,7 +1194,7 @@ static int __init adm6996_init(void)
@@ -1188,7 +1189,7 @@ static int __init adm6996_init(void)
int err;
phy_register_fixup_for_id(PHY_ANY_ID, adm6996_fixup);

@ -1,35 +0,0 @@
From 2a36a5c30eab9cd1c9d2d08bd27cd763325d70c5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
Date: Sat, 5 Dec 2015 02:09:43 +0100
Subject: [PATCH] mtd: bcm47xxpart: limit scanned flash area on BCM47XX (MIPS)
only
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
We allowed using bcm47xxpart on BCM5301X arch with commit:
9e3afa5f5c7 ("mtd: bcm47xxpart: allow enabling on ARCH_BCM_5301X")
BCM5301X devices may contain some partitions in higher memory, e.g.
Netgear R8000 has board_data at 0x2600000. To detect them we should
use size limit on MIPS only.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
---
drivers/mtd/bcm47xxpart.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/mtd/bcm47xxpart.c
+++ b/drivers/mtd/bcm47xxpart.c
@@ -118,8 +118,8 @@ static int bcm47xxpart_parse(struct mtd_
/* Parse block by block looking for magics */
for (offset = 0; offset <= master->size - blocksize;
offset += blocksize) {
- /* Nothing more in higher memory */
- if (offset >= 0x2000000)
+ /* Nothing more in higher memory on BCM47XX (MIPS) */
+ if (config_enabled(CONFIG_BCM47XX) && offset >= 0x2000000)
break;
if (curr_part >= BCM47XXPART_MAX_PARTS) {

@ -1,93 +0,0 @@
From 36bcc0c9c2bc8f56569cd735ba531a51358d7c2b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
Date: Sun, 6 Dec 2015 11:31:38 +0100
Subject: [PATCH] mtd: bcm47xxpart: don't fail because of bit-flips
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Bit-flip errors may occur on NAND flashes and are harmless. Handle them
gracefully as read content is still reliable and can be parsed.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
---
drivers/mtd/bcm47xxpart.c | 38 ++++++++++++++++++++++----------------
1 file changed, 22 insertions(+), 16 deletions(-)
--- a/drivers/mtd/bcm47xxpart.c
+++ b/drivers/mtd/bcm47xxpart.c
@@ -66,11 +66,13 @@ static const char *bcm47xxpart_trx_data_
{
uint32_t buf;
size_t bytes_read;
+ int err;
- if (mtd_read(master, offset, sizeof(buf), &bytes_read,
- (uint8_t *)&buf) < 0) {
- pr_err("mtd_read error while parsing (offset: 0x%X)!\n",
- offset);
+ err = mtd_read(master, offset, sizeof(buf), &bytes_read,
+ (uint8_t *)&buf);
+ if (err && !mtd_is_bitflip(err)) {
+ pr_err("mtd_read error while parsing (offset: 0x%X): %d\n",
+ offset, err);
goto out_default;
}
@@ -95,6 +97,7 @@ static int bcm47xxpart_parse(struct mtd_
int trx_part = -1;
int last_trx_part = -1;
int possible_nvram_sizes[] = { 0x8000, 0xF000, 0x10000, };
+ int err;
/*
* Some really old flashes (like AT45DB*) had smaller erasesize-s, but
@@ -128,10 +131,11 @@ static int bcm47xxpart_parse(struct mtd_
}
/* Read beginning of the block */
- if (mtd_read(master, offset, BCM47XXPART_BYTES_TO_READ,
- &bytes_read, (uint8_t *)buf) < 0) {
- pr_err("mtd_read error while parsing (offset: 0x%X)!\n",
- offset);
+ err = mtd_read(master, offset, BCM47XXPART_BYTES_TO_READ,
+ &bytes_read, (uint8_t *)buf);
+ if (err && !mtd_is_bitflip(err)) {
+ pr_err("mtd_read error while parsing (offset: 0x%X): %d\n",
+ offset, err);
continue;
}
@@ -252,10 +256,11 @@ static int bcm47xxpart_parse(struct mtd_
}
/* Read middle of the block */
- if (mtd_read(master, offset + 0x8000, 0x4,
- &bytes_read, (uint8_t *)buf) < 0) {
- pr_err("mtd_read error while parsing (offset: 0x%X)!\n",
- offset);
+ err = mtd_read(master, offset + 0x8000, 0x4, &bytes_read,
+ (uint8_t *)buf);
+ if (err && !mtd_is_bitflip(err)) {
+ pr_err("mtd_read error while parsing (offset: 0x%X): %d\n",
+ offset, err);
continue;
}
@@ -275,10 +280,11 @@ static int bcm47xxpart_parse(struct mtd_
}
offset = master->size - possible_nvram_sizes[i];
- if (mtd_read(master, offset, 0x4, &bytes_read,
- (uint8_t *)buf) < 0) {
- pr_err("mtd_read error while reading at offset 0x%X!\n",
- offset);
+ err = mtd_read(master, offset, 0x4, &bytes_read,
+ (uint8_t *)buf);
+ if (err && !mtd_is_bitflip(err)) {
+ pr_err("mtd_read error while reading (offset 0x%X): %d\n",
+ offset, err);
continue;
}

@ -25,7 +25,7 @@ Tested-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
};
#define JEDEC_MFR(info) ((info)->id[0])
@@ -1156,7 +1157,8 @@ int spi_nor_scan(struct spi_nor *nor, co
@@ -1163,7 +1164,8 @@ int spi_nor_scan(struct spi_nor *nor, co
if (JEDEC_MFR(info) == SNOR_MFR_ATMEL ||
JEDEC_MFR(info) == SNOR_MFR_INTEL ||
@ -35,7 +35,7 @@ Tested-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
write_enable(nor);
write_sr(nor, 0);
}
@@ -1172,7 +1174,8 @@ int spi_nor_scan(struct spi_nor *nor, co
@@ -1179,7 +1181,8 @@ int spi_nor_scan(struct spi_nor *nor, co
mtd->_read = spi_nor_read;
/* NOR protection support for STmicro/Micron chips and similar */

@ -1,28 +0,0 @@
From f1640c3ddeec12804bc9a21feee85fc15aca95f6 Mon Sep 17 00:00:00 2001
From: wangweidong <wangweidong1@huawei.com>
Date: Wed, 13 Jan 2016 11:06:41 +0800
Subject: [PATCH] bgmac: fix a missing check for build_skb
when build_skb failed, it may occure a NULL pointer.
So add a 'NULL check' for it.
Signed-off-by: Weidong Wang <wangweidong1@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
drivers/net/ethernet/broadcom/bgmac.c | 5 +++++
1 file changed, 5 insertions(+)
--- a/drivers/net/ethernet/broadcom/bgmac.c
+++ b/drivers/net/ethernet/broadcom/bgmac.c
@@ -469,6 +469,11 @@ static int bgmac_dma_rx_read(struct bgma
len -= ETH_FCS_LEN;
skb = build_skb(buf, BGMAC_RX_ALLOC_SIZE);
+ if (unlikely(skb)) {
+ bgmac_err(bgmac, "build_skb failed\n");
+ put_page(virt_to_head_page(buf));
+ break;
+ }
skb_put(skb, BGMAC_RX_FRAME_OFFSET +
BGMAC_RX_BUF_OFFSET + len);
skb_pull(skb, BGMAC_RX_FRAME_OFFSET +

@ -1,22 +0,0 @@
From 750afbf8ee9c6a1c74a1fe5fc9852146b1d72687 Mon Sep 17 00:00:00 2001
From: "David S. Miller" <davem@davemloft.net>
Date: Fri, 15 Jan 2016 16:07:13 -0500
Subject: [PATCH] bgmac: Fix reversed test of build_skb() return value.
Fixes: f1640c3ddeec ("bgmac: fix a missing check for build_skb")
Signed-off-by: David S. Miller <davem@davemloft.net>
---
drivers/net/ethernet/broadcom/bgmac.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/net/ethernet/broadcom/bgmac.c
+++ b/drivers/net/ethernet/broadcom/bgmac.c
@@ -469,7 +469,7 @@ static int bgmac_dma_rx_read(struct bgma
len -= ETH_FCS_LEN;
skb = build_skb(buf, BGMAC_RX_ALLOC_SIZE);
- if (unlikely(skb)) {
+ if (unlikely(!skb)) {
bgmac_err(bgmac, "build_skb failed\n");
put_page(virt_to_head_page(buf));
break;

@ -36,7 +36,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static bool bgmac_wait_value(struct bcma_device *core, u16 reg, u32 mask,
u32 value, int timeout)
{
@@ -990,11 +1001,9 @@ static void bgmac_mac_speed(struct bgmac
@@ -991,11 +1002,9 @@ static void bgmac_mac_speed(struct bgmac
static void bgmac_miiconfig(struct bgmac *bgmac)
{
struct bcma_device *core = bgmac->core;
@ -49,7 +49,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
bcma_awrite32(core, BCMA_IOCTL,
bcma_aread32(core, BCMA_IOCTL) | 0x40 |
BGMAC_BCMA_IOCTL_SW_CLKEN);
@@ -1058,9 +1067,7 @@ static void bgmac_chip_reset(struct bgma
@@ -1059,9 +1068,7 @@ static void bgmac_chip_reset(struct bgma
}
/* Request Misc PLL for corerev > 2 */
@ -60,7 +60,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
bgmac_set(bgmac, BCMA_CLKCTLST,
BGMAC_BCMA_CLKCTLST_MISC_PLL_REQ);
bgmac_wait_value(bgmac->core, BCMA_CLKCTLST,
@@ -1196,8 +1203,7 @@ static void bgmac_enable(struct bgmac *b
@@ -1197,8 +1204,7 @@ static void bgmac_enable(struct bgmac *b
break;
}
@ -70,7 +70,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
rxq_ctl = bgmac_read(bgmac, BGMAC_RXQ_CTL);
rxq_ctl &= ~BGMAC_RXQ_CTL_MDP_MASK;
bp_clk = bcma_pmu_get_bus_clock(&bgmac->core->bus->drv_cc) /
@@ -1475,14 +1481,12 @@ static int bgmac_fixed_phy_register(stru
@@ -1477,14 +1483,12 @@ static int bgmac_fixed_phy_register(stru
static int bgmac_mii_register(struct bgmac *bgmac)
{
@ -86,7 +86,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
return bgmac_fixed_phy_register(bgmac);
mii_bus = mdiobus_alloc();
@@ -1553,7 +1557,6 @@ static void bgmac_mii_unregister(struct
@@ -1555,7 +1559,6 @@ static void bgmac_mii_unregister(struct
/* http://bcm-v4.sipsolutions.net/mac-gbit/gmac/chipattach */
static int bgmac_probe(struct bcma_device *core)
{
@ -94,7 +94,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
struct net_device *net_dev;
struct bgmac *bgmac;
struct ssb_sprom *sprom = &core->bus->sprom;
@@ -1634,8 +1637,7 @@ static int bgmac_probe(struct bcma_devic
@@ -1641,8 +1644,7 @@ static int bgmac_probe(struct bcma_devic
bgmac_chip_reset(bgmac);
/* For Northstar, we have to take all GMAC core out of reset */

@ -25,7 +25,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
case BCMA_CHIP_ID_BCM53018:
return true;
default:
@@ -1055,8 +1056,9 @@ static void bgmac_chip_reset(struct bgma
@@ -1056,8 +1057,9 @@ static void bgmac_chip_reset(struct bgma
(ci->id == BCMA_CHIP_ID_BCM53572 && ci->pkg == BCMA_PKG_ID_BCM47188))
iost &= ~BGMAC_BCMA_IOST_ATTACHED;

@ -1,31 +0,0 @@
From b4dfd8e92956b396d3438212bc9a0be6267b8b34 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
Date: Tue, 12 Apr 2016 13:30:45 +0200
Subject: [PATCH] bgmac: reset & enable Ethernet core before using it
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This fixes Ethernet on D-Link DIR-885L with BCM47094 SoC. Felix reported
similar fix was needed for his BCM4709 device (Buffalo WXR-1900DHP?).
I tested this for regressions on BCM4706, BCM4708A0 and BCM47081A0.
Cc: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
--- a/drivers/net/ethernet/broadcom/bgmac.c
+++ b/drivers/net/ethernet/broadcom/bgmac.c
@@ -1586,6 +1586,11 @@ static int bgmac_probe(struct bcma_devic
dev_warn(&core->dev, "Using random MAC: %pM\n", mac);
}
+ /* This (reset &) enable is not preset in specs or reference driver but
+ * Broadcom does it in arch PCI code when enabling fake PCI device.
+ */
+ bcma_core_enable(core, 0);
+
/* Allocation and references */
net_dev = alloc_etherdev(sizeof(*bgmac));
if (!net_dev)

@ -15,7 +15,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/broadcom/bgmac.c
+++ b/drivers/net/ethernet/broadcom/bgmac.c
@@ -1602,6 +1602,7 @@ static int bgmac_probe(struct bcma_devic
@@ -1604,6 +1604,7 @@ static int bgmac_probe(struct bcma_devic
bgmac->net_dev = net_dev;
bgmac->core = core;
bcma_set_drvdata(core, bgmac);

@ -15,7 +15,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/broadcom/bgmac.c
+++ b/drivers/net/ethernet/broadcom/bgmac.c
@@ -1385,6 +1385,127 @@ static const struct net_device_ops bgmac
@@ -1387,6 +1387,127 @@ static const struct net_device_ops bgmac
* ethtool_ops
**************************************************/
@ -143,7 +143,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static int bgmac_get_settings(struct net_device *net_dev,
struct ethtool_cmd *cmd)
{
@@ -1409,6 +1530,9 @@ static void bgmac_get_drvinfo(struct net
@@ -1411,6 +1532,9 @@ static void bgmac_get_drvinfo(struct net
}
static const struct ethtool_ops bgmac_ethtool_ops = {

@ -23,7 +23,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
return NETDEV_TX_OK;
}
@@ -284,6 +286,8 @@ static void bgmac_dma_tx_free(struct bgm
@@ -285,6 +287,8 @@ static void bgmac_dma_tx_free(struct bgm
DMA_TO_DEVICE);
if (slot->skb) {
@ -32,7 +32,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
bytes_compl += slot->skb->len;
pkts_compl++;
@@ -467,6 +471,7 @@ static int bgmac_dma_rx_read(struct bgma
@@ -468,6 +472,7 @@ static int bgmac_dma_rx_read(struct bgma
bgmac_err(bgmac, "Found poisoned packet at slot %d, DMA issue!\n",
ring->start);
put_page(virt_to_head_page(buf));
@ -40,7 +40,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
break;
}
@@ -474,6 +479,8 @@ static int bgmac_dma_rx_read(struct bgma
@@ -475,6 +480,8 @@ static int bgmac_dma_rx_read(struct bgma
bgmac_err(bgmac, "Found oversized packet at slot %d, DMA issue!\n",
ring->start);
put_page(virt_to_head_page(buf));
@ -49,7 +49,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
break;
}
@@ -484,6 +491,7 @@ static int bgmac_dma_rx_read(struct bgma
@@ -485,6 +492,7 @@ static int bgmac_dma_rx_read(struct bgma
if (unlikely(!skb)) {
bgmac_err(bgmac, "build_skb failed\n");
put_page(virt_to_head_page(buf));
@ -57,7 +57,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
break;
}
skb_put(skb, BGMAC_RX_FRAME_OFFSET +
@@ -493,6 +501,8 @@ static int bgmac_dma_rx_read(struct bgma
@@ -494,6 +502,8 @@ static int bgmac_dma_rx_read(struct bgma
skb_checksum_none_assert(skb);
skb->protocol = eth_type_trans(skb, bgmac->net_dev);

@ -17,16 +17,16 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/broadcom/bgmac.c
+++ b/drivers/net/ethernet/broadcom/bgmac.c
@@ -1323,7 +1323,7 @@ static int bgmac_open(struct net_device
@@ -1324,7 +1324,7 @@ static int bgmac_open(struct net_device
}
napi_enable(&bgmac->napi);
- phy_start(bgmac->phy_dev);
+ phy_start(net_dev->phydev);
netif_carrier_on(net_dev);
return 0;
@@ -1335,7 +1335,7 @@ static int bgmac_stop(struct net_device
netif_start_queue(net_dev);
@@ -1337,7 +1337,7 @@ static int bgmac_stop(struct net_device
netif_carrier_off(net_dev);
@ -35,7 +35,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
napi_disable(&bgmac->napi);
bgmac_chip_intrs_off(bgmac);
@@ -1373,12 +1373,10 @@ static int bgmac_set_mac_address(struct
@@ -1375,12 +1375,10 @@ static int bgmac_set_mac_address(struct
static int bgmac_ioctl(struct net_device *net_dev, struct ifreq *ifr, int cmd)
{
@ -49,7 +49,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
static const struct net_device_ops bgmac_netdev_ops = {
@@ -1521,7 +1519,7 @@ static int bgmac_get_settings(struct net
@@ -1523,7 +1521,7 @@ static int bgmac_get_settings(struct net
{
struct bgmac *bgmac = netdev_priv(net_dev);
@ -58,7 +58,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
static int bgmac_set_settings(struct net_device *net_dev,
@@ -1529,7 +1527,7 @@ static int bgmac_set_settings(struct net
@@ -1531,7 +1529,7 @@ static int bgmac_set_settings(struct net
{
struct bgmac *bgmac = netdev_priv(net_dev);
@ -67,7 +67,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
static void bgmac_get_drvinfo(struct net_device *net_dev,
@@ -1566,7 +1564,7 @@ static int bgmac_mii_write(struct mii_bu
@@ -1568,7 +1566,7 @@ static int bgmac_mii_write(struct mii_bu
static void bgmac_adjust_link(struct net_device *net_dev)
{
struct bgmac *bgmac = netdev_priv(net_dev);
@ -76,7 +76,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
bool update = false;
if (phy_dev->link) {
@@ -1610,8 +1608,6 @@ static int bgmac_fixed_phy_register(stru
@@ -1612,8 +1610,6 @@ static int bgmac_fixed_phy_register(stru
return err;
}
@ -85,7 +85,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
return err;
}
@@ -1664,7 +1660,6 @@ static int bgmac_mii_register(struct bgm
@@ -1666,7 +1662,6 @@ static int bgmac_mii_register(struct bgm
err = PTR_ERR(phy_dev);
goto err_unregister_bus;
}

@ -1,37 +0,0 @@
From d2b13233879ca1268a1c027d4573109e5a777811 Mon Sep 17 00:00:00 2001
From: Florian Fainelli <f.fainelli@gmail.com>
Date: Thu, 23 Jun 2016 14:23:12 -0700
Subject: [PATCH 1/3] net: bgmac: Fix SOF bit checking
We are checking for the Start of Frame bit in the ctl1 word, while this
bit is set in the ctl0 word instead. Read the ctl0 word and update the
check to verify that.
Fixes: 9cde94506eac ("bgmac: implement scatter/gather support")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
drivers/net/ethernet/broadcom/bgmac.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--- a/drivers/net/ethernet/broadcom/bgmac.c
+++ b/drivers/net/ethernet/broadcom/bgmac.c
@@ -269,15 +269,16 @@ static void bgmac_dma_tx_free(struct bgm
while (ring->start != ring->end) {
int slot_idx = ring->start % BGMAC_TX_RING_SLOTS;
struct bgmac_slot_info *slot = &ring->slots[slot_idx];
- u32 ctl1;
+ u32 ctl0, ctl1;
int len;
if (slot_idx == empty_slot)
break;
+ ctl0 = le32_to_cpu(ring->cpu_base[slot_idx].ctl0);
ctl1 = le32_to_cpu(ring->cpu_base[slot_idx].ctl1);
len = ctl1 & BGMAC_DESC_CTL1_LEN;
- if (ctl1 & BGMAC_DESC_CTL0_SOF)
+ if (ctl0 & BGMAC_DESC_CTL0_SOF)
/* Unmap no longer used buffer */
dma_unmap_single(dma_dev, slot->dma_addr, len,
DMA_TO_DEVICE);

@ -1,28 +0,0 @@
From c3897f2a69e54dd113fc9abd2daf872e5b495798 Mon Sep 17 00:00:00 2001
From: Florian Fainelli <f.fainelli@gmail.com>
Date: Thu, 23 Jun 2016 14:25:32 -0700
Subject: [PATCH 2/3] net: bgmac: Start transmit queue in bgmac_open
The driver does not start the transmit queue in bgmac_open(). If the
queue was stopped prior to closing then re-opening the interface, we
would never be able to wake-up again.
Fixes: dd4544f05469 ("bgmac: driver for GBit MAC core on BCMA bus")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
drivers/net/ethernet/broadcom/bgmac.c | 3 +++
1 file changed, 3 insertions(+)
--- a/drivers/net/ethernet/broadcom/bgmac.c
+++ b/drivers/net/ethernet/broadcom/bgmac.c
@@ -1327,6 +1327,9 @@ static int bgmac_open(struct net_device
phy_start(net_dev->phydev);
netif_carrier_on(net_dev);
+
+ netif_start_queue(net_dev);
+
return 0;
}

@ -1,28 +0,0 @@
From 3894396e64994f31c3ef5c7e6f63dded0593e567 Mon Sep 17 00:00:00 2001
From: Florian Fainelli <f.fainelli@gmail.com>
Date: Thu, 23 Jun 2016 14:25:33 -0700
Subject: [PATCH 3/3] net: bgmac: Remove superflous netif_carrier_on()
bgmac_open() calls phy_start() to initialize the PHY state machine,
which will set the interface's carrier state accordingly, no need to
force that as this could be conflicting with the PHY state determined by
PHYLIB.
Fixes: dd4544f05469 ("bgmac: driver for GBit MAC core on BCMA bus")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
drivers/net/ethernet/broadcom/bgmac.c | 2 --
1 file changed, 2 deletions(-)
--- a/drivers/net/ethernet/broadcom/bgmac.c
+++ b/drivers/net/ethernet/broadcom/bgmac.c
@@ -1326,8 +1326,6 @@ static int bgmac_open(struct net_device
phy_start(net_dev->phydev);
- netif_carrier_on(net_dev);
-
netif_start_queue(net_dev);
return 0;

@ -1,30 +0,0 @@
From: Tobias Wolf <dev-NTEO@vplace.de>
Date: Wed, 23 Nov 2016 10:40:07 +0100
Subject: [PATCH] of: Add check to of_scan_flat_dt() before accessing
initial_boot_params
An empty __dtb_start to __dtb_end section might result in initial_boot_params
being null for arch/mips/ralink. This showed that the boot process hangs
indefinitely in of_scan_flat_dt().
Signed-off-by: Tobias Wolf <dev-NTEO@vplace.de>
---
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -632,9 +632,12 @@ int __init of_scan_flat_dt(int (*it)(uns
const char *pathp;
int offset, rc = 0, depth = -1;
- for (offset = fdt_next_node(blob, -1, &depth);
- offset >= 0 && depth >= 0 && !rc;
- offset = fdt_next_node(blob, offset, &depth)) {
+ if (!blob)
+ return 0;
+
+ for (offset = fdt_next_node(blob, -1, &depth);
+ offset >= 0 && depth >= 0 && !rc;
+ offset = fdt_next_node(blob, offset, &depth)) {
pathp = fdt_get_name(blob, offset, NULL);
if (*pathp == '/')

@ -1,7 +1,7 @@
--- a/Makefile
+++ b/Makefile
@@ -621,12 +621,12 @@ KBUILD_CFLAGS += $(call cc-disable-warni
KBUILD_CFLAGS += $(call cc-disable-warning,frame-address,)
@@ -624,12 +624,12 @@ KBUILD_CFLAGS += $(call cc-disable-warni
KBUILD_CFLAGS += $(call cc-disable-warning, int-in-bool-context)
ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
-KBUILD_CFLAGS += -Os

@ -5,7 +5,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
--- a/Makefile
+++ b/Makefile
@@ -1115,7 +1115,6 @@ all: modules
@@ -1118,7 +1118,6 @@ all: modules
PHONY += modules
modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin
@ -13,7 +13,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
@$(kecho) ' Building modules, stage 2.';
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware __fw_modbuild
@@ -1145,7 +1144,6 @@ _modinst_:
@@ -1148,7 +1147,6 @@ _modinst_:
rm -f $(MODLIB)/build ; \
ln -s $(CURDIR) $(MODLIB)/build ; \
fi

@ -4,7 +4,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
@@ -1159,6 +1159,7 @@ int spi_nor_scan(struct spi_nor *nor, co
@@ -1166,6 +1166,7 @@ int spi_nor_scan(struct spi_nor *nor, co
if (JEDEC_MFR(info) == SNOR_MFR_ATMEL ||
JEDEC_MFR(info) == SNOR_MFR_INTEL ||

@ -70,10 +70,10 @@
+ qdisc = qdisc_create_dflt(dev_queue, &fq_codel_qdisc_ops,
TC_H_MAKE(TC_H_MAJ(sch->handle),
TC_H_MIN(ntx + 1)));
if (qdisc == NULL)
if (!qdisc)
--- a/net/sched/sch_mqprio.c
+++ b/net/sched/sch_mqprio.c
@@ -124,7 +124,7 @@ static int mqprio_init(struct Qdisc *sch
@@ -122,7 +122,7 @@ static int mqprio_init(struct Qdisc *sch
for (i = 0; i < dev->num_tx_queues; i++) {
dev_queue = netdev_get_tx_queue(dev, i);
@ -81,10 +81,10 @@
+ qdisc = qdisc_create_dflt(dev_queue, &fq_codel_qdisc_ops,
TC_H_MAKE(TC_H_MAJ(sch->handle),
TC_H_MIN(i + 1)));
if (qdisc == NULL) {
if (!qdisc)
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -1948,7 +1948,7 @@ static int __init pktsched_init(void)
@@ -1951,7 +1951,7 @@ static int __init pktsched_init(void)
return err;
}

@ -88,7 +88,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
default:
--- a/net/ipv6/fib6_rules.c
+++ b/net/ipv6/fib6_rules.c
@@ -84,6 +84,10 @@ static int fib6_rule_action(struct fib_r
@@ -73,6 +73,10 @@ static int fib6_rule_action(struct fib_r
err = -EACCES;
rt = net->ipv6.ip6_prohibit_entry;
goto discard_pkt;
@ -183,7 +183,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
cfg->fc_flags |= RTF_REJECT;
if (rtm->rtm_type == RTN_LOCAL)
@@ -3093,6 +3127,9 @@ static int rt6_fill_node(struct net *net
@@ -3087,6 +3121,9 @@ static int rt6_fill_node(struct net *net
case -EACCES:
rtm->rtm_type = RTN_PROHIBIT;
break;
@ -193,7 +193,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
case -EAGAIN:
rtm->rtm_type = RTN_THROW;
break;
@@ -3372,6 +3409,8 @@ static int ip6_route_dev_notify(struct n
@@ -3366,6 +3403,8 @@ static int ip6_route_dev_notify(struct n
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
net->ipv6.ip6_prohibit_entry->dst.dev = dev;
net->ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(dev);
@ -202,7 +202,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
net->ipv6.ip6_blk_hole_entry->dst.dev = dev;
net->ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(dev);
#endif
@@ -3594,6 +3633,17 @@ static int __net_init ip6_route_net_init
@@ -3588,6 +3627,17 @@ static int __net_init ip6_route_net_init
net->ipv6.ip6_blk_hole_entry->dst.ops = &net->ipv6.ip6_dst_ops;
dst_init_metrics(&net->ipv6.ip6_blk_hole_entry->dst,
ip6_template_metrics, true);
@ -220,7 +220,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
#endif
net->ipv6.sysctl.flush_delay = 0;
@@ -3612,6 +3662,8 @@ out:
@@ -3606,6 +3656,8 @@ out:
return ret;
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
@ -229,7 +229,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
out_ip6_prohibit_entry:
kfree(net->ipv6.ip6_prohibit_entry);
out_ip6_null_entry:
@@ -3629,6 +3681,7 @@ static void __net_exit ip6_route_net_exi
@@ -3623,6 +3675,7 @@ static void __net_exit ip6_route_net_exi
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
kfree(net->ipv6.ip6_prohibit_entry);
kfree(net->ipv6.ip6_blk_hole_entry);
@ -237,7 +237,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
#endif
dst_entries_destroy(&net->ipv6.ip6_dst_ops);
}
@@ -3702,6 +3755,9 @@ void __init ip6_route_init_special_entri
@@ -3696,6 +3749,9 @@ void __init ip6_route_init_special_entri
init_net.ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev);
init_net.ipv6.ip6_blk_hole_entry->dst.dev = init_net.loopback_dev;
init_net.ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev);

@ -17,7 +17,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4248,6 +4248,9 @@ static enum gro_result dev_gro_receive(s
@@ -4249,6 +4249,9 @@ static enum gro_result dev_gro_receive(s
enum gro_result ret;
int grow;
@ -27,7 +27,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
if (!(skb->dev->features & NETIF_F_GRO))
goto normal;
@@ -5404,6 +5407,48 @@ static void __netdev_adjacent_dev_unlink
@@ -5415,6 +5418,48 @@ static void __netdev_adjacent_dev_unlink
&upper_dev->adj_list.lower);
}
@ -76,7 +76,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
static int __netdev_upper_dev_link(struct net_device *dev,
struct net_device *upper_dev, bool master,
void *private)
@@ -5475,6 +5520,7 @@ static int __netdev_upper_dev_link(struc
@@ -5486,6 +5531,7 @@ static int __netdev_upper_dev_link(struc
goto rollback_lower_mesh;
}
@ -84,7 +84,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, dev,
&changeupper_info.info);
return 0;
@@ -5601,6 +5647,7 @@ void netdev_upper_dev_unlink(struct net_
@@ -5612,6 +5658,7 @@ void netdev_upper_dev_unlink(struct net_
list_for_each_entry(i, &upper_dev->all_adj_list.upper, list)
__netdev_adjacent_dev_unlink(dev, i->dev, i->ref_nr);
@ -92,7 +92,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, dev,
&changeupper_info.info);
}
@@ -6141,6 +6188,7 @@ int dev_set_mac_address(struct net_devic
@@ -6152,6 +6199,7 @@ int dev_set_mac_address(struct net_devic
if (err)
return err;
dev->addr_assign_type = NET_ADDR_SET;

@ -86,7 +86,7 @@
help
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2735,10 +2735,20 @@ static int xmit_one(struct sk_buff *skb,
@@ -2736,10 +2736,20 @@ static int xmit_one(struct sk_buff *skb,
if (!list_empty(&ptype_all) || !list_empty(&dev->ptype_all))
dev_queue_xmit_nit(skb, dev);

@ -21,7 +21,7 @@ Signed-off-by: Yuan Yao <yao.yuan@nxp.com>
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
@@ -1221,6 +1221,7 @@ int spi_nor_scan(struct spi_nor *nor, co
@@ -1228,6 +1228,7 @@ int spi_nor_scan(struct spi_nor *nor, co
mtd->flags |= MTD_NO_ERASE;
mtd->dev.parent = dev;

@ -69,7 +69,7 @@ Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
spifi->nor.write = nxp_spifi_write;
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
@@ -1113,7 +1113,7 @@ int spi_nor_scan(struct spi_nor *nor, co
@@ -1120,7 +1120,7 @@ int spi_nor_scan(struct spi_nor *nor, co
const struct flash_info *info = NULL;
struct device *dev = nor->dev;
struct mtd_info *mtd = &nor->mtd;

@ -14,7 +14,7 @@ Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
@@ -1221,7 +1221,6 @@ int spi_nor_scan(struct spi_nor *nor, co
@@ -1228,7 +1228,6 @@ int spi_nor_scan(struct spi_nor *nor, co
mtd->flags |= MTD_NO_ERASE;
mtd->dev.parent = dev;

@ -69,7 +69,7 @@ Signed-off-by: Brian Norris <computersforpeace@gmail.com>
addr += mtd->erasesize;
len -= mtd->erasesize;
@@ -1100,7 +1123,7 @@ static int set_quad_mode(struct spi_nor
@@ -1107,7 +1130,7 @@ static int set_quad_mode(struct spi_nor
static int spi_nor_check(struct spi_nor *nor)
{
if (!nor->dev || !nor->read || !nor->write ||
@ -78,7 +78,7 @@ Signed-off-by: Brian Norris <computersforpeace@gmail.com>
pr_err("spi-nor: please fill all the necessary fields!\n");
return -EINVAL;
}
@@ -1303,6 +1326,12 @@ int spi_nor_scan(struct spi_nor *nor, co
@@ -1310,6 +1333,12 @@ int spi_nor_scan(struct spi_nor *nor, co
nor->addr_width = 3;
}

@ -24,7 +24,7 @@ Integrated-by: Jiang Yutang <yutang.jiang@nxp.com>
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
@@ -1141,6 +1141,26 @@ static int spi_nor_check(struct spi_nor
@@ -1148,6 +1148,26 @@ static int spi_nor_check(struct spi_nor
return 0;
}
@ -51,7 +51,7 @@ Integrated-by: Jiang Yutang <yutang.jiang@nxp.com>
int spi_nor_scan(struct spi_nor *nor, const char *name, enum read_mode mode)
{
const struct flash_info *info = NULL;
@@ -1188,19 +1208,9 @@ int spi_nor_scan(struct spi_nor *nor, co
@@ -1195,19 +1215,9 @@ int spi_nor_scan(struct spi_nor *nor, co
mutex_init(&nor->lock);
@ -74,7 +74,7 @@ Integrated-by: Jiang Yutang <yutang.jiang@nxp.com>
if (!mtd->name)
mtd->name = dev_name(dev);
@@ -1367,6 +1377,45 @@ int spi_nor_scan(struct spi_nor *nor, co
@@ -1374,6 +1384,45 @@ int spi_nor_scan(struct spi_nor *nor, co
}
EXPORT_SYMBOL_GPL(spi_nor_scan);

@ -24,7 +24,7 @@ Signed-off-by: Yunhui Cui <B56489@freescale.com>
struct flash_info {
char *name;
@@ -1239,6 +1240,14 @@ int spi_nor_scan(struct spi_nor *nor, co
@@ -1246,6 +1247,14 @@ int spi_nor_scan(struct spi_nor *nor, co
if (ret)
return ret;

@ -95,7 +95,7 @@ Signed-off-by: Yunhui Cui <yunhui.cui@nxp.com>
static int spi_nor_read(struct mtd_info *mtd, loff_t from, size_t len,
size_t *retlen, u_char *buf)
{
@@ -1248,6 +1302,12 @@ int spi_nor_scan(struct spi_nor *nor, co
@@ -1255,6 +1309,12 @@ int spi_nor_scan(struct spi_nor *nor, co
write_sr(nor, ret);
}

@ -63,7 +63,7 @@ Signed-off-by: Yunhui Cui <yunhui.cui@nxp.com>
{ "s25fl129p0", INFO(0x012018, 0x4d00, 256 * 1024, 64, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
{ "s25fl129p1", INFO(0x012018, 0x4d01, 64 * 1024, 256, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
{ "s25sl004a", INFO(0x010212, 0, 64 * 1024, 8, 0) },
@@ -1188,6 +1194,23 @@ static int spansion_quad_enable(struct s
@@ -1195,6 +1201,23 @@ static int spansion_quad_enable(struct s
return 0;
}
@ -87,7 +87,7 @@ Signed-off-by: Yunhui Cui <yunhui.cui@nxp.com>
static int set_quad_mode(struct spi_nor *nor, const struct flash_info *info)
{
int status;
@@ -1378,8 +1401,15 @@ int spi_nor_scan(struct spi_nor *nor, co
@@ -1385,8 +1408,15 @@ int spi_nor_scan(struct spi_nor *nor, co
if (info->flags & SPI_NOR_NO_FR)
nor->flash_read = SPI_NOR_NORMAL;
@ -105,7 +105,7 @@ Signed-off-by: Yunhui Cui <yunhui.cui@nxp.com>
ret = set_quad_mode(nor, info);
if (ret) {
dev_err(dev, "quad mode not supported\n");
@@ -1392,6 +1422,14 @@ int spi_nor_scan(struct spi_nor *nor, co
@@ -1399,6 +1429,14 @@ int spi_nor_scan(struct spi_nor *nor, co
/* Default commands */
switch (nor->flash_read) {
@ -120,7 +120,7 @@ Signed-off-by: Yunhui Cui <yunhui.cui@nxp.com>
case SPI_NOR_QUAD:
nor->read_opcode = SPINOR_OP_READ_1_1_4;
break;
@@ -1419,6 +1457,9 @@ int spi_nor_scan(struct spi_nor *nor, co
@@ -1426,6 +1464,9 @@ int spi_nor_scan(struct spi_nor *nor, co
if (JEDEC_MFR(info) == SNOR_MFR_SPANSION) {
/* Dedicated 4-byte command set */
switch (nor->flash_read) {
@ -130,7 +130,7 @@ Signed-off-by: Yunhui Cui <yunhui.cui@nxp.com>
case SPI_NOR_QUAD:
nor->read_opcode = SPINOR_OP_READ4_1_1_4;
break;
@@ -1448,7 +1489,7 @@ int spi_nor_scan(struct spi_nor *nor, co
@@ -1455,7 +1496,7 @@ int spi_nor_scan(struct spi_nor *nor, co
return -EINVAL;
}

@ -136,7 +136,7 @@ Integrated-by: Jiang Yutang <yutang.jiang@nxp.com>
return 0;
}
@@ -1336,6 +1333,8 @@ int spi_nor_scan(struct spi_nor *nor, co
@@ -1343,6 +1340,8 @@ int spi_nor_scan(struct spi_nor *nor, co
if (!mtd->name)
mtd->name = dev_name(dev);

@ -110,7 +110,7 @@ Conflicts:
+EXPORT_SYMBOL_GPL(devm_free_percpu);
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -681,6 +681,25 @@ void __iomem *devm_ioremap_resource(stru
@@ -683,6 +683,25 @@ void __iomem *devm_ioremap_resource(stru
int devm_add_action(struct device *dev, void (*action)(void *), void *data);
void devm_remove_action(struct device *dev, void (*action)(void *), void *data);

@ -69,7 +69,7 @@ Signed-off-by: Zhao Qiang <qiang.zhao@nxp.com>
if (IS_ERR(group))
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -686,10 +686,10 @@ static struct iommu_group *get_pci_alias
@@ -697,10 +697,10 @@ static struct iommu_group *get_pci_alias
continue;
/* We alias them or they alias us */

@ -43,7 +43,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
mvneta_set_ucast_table(pp, -1);
@@ -3230,9 +3243,6 @@ static int mvneta_port_power_up(struct m
@@ -3228,9 +3241,6 @@ static int mvneta_port_power_up(struct m
return -EINVAL;
}

@ -118,7 +118,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
mvneta_set_ucast_table(pp, -1);
mvneta_set_special_mcast_table(pp, -1);
mvneta_set_other_mcast_table(pp, -1);
@@ -2956,10 +2962,43 @@ int mvneta_ethtool_get_settings(struct n
@@ -2954,10 +2960,43 @@ int mvneta_ethtool_get_settings(struct n
int mvneta_ethtool_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
{
struct mvneta_port *pp = netdev_priv(dev);

@ -120,7 +120,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
for_each_online_cpu(cpu) {
if (i == online_cpu_idx)
@@ -3363,6 +3364,8 @@ static int mvneta_probe(struct platform_
@@ -3361,6 +3362,8 @@ static int mvneta_probe(struct platform_
strcmp(managed, "in-band-status") == 0);
pp->cpu_notifier.notifier_call = mvneta_percpu_notifier;

@ -62,7 +62,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static void mvneta_start_dev(struct mvneta_port *pp)
{
unsigned int cpu;
@@ -3231,6 +3250,106 @@ static int mvneta_ethtool_get_sset_count
@@ -3229,6 +3248,106 @@ static int mvneta_ethtool_get_sset_count
return -EOPNOTSUPP;
}
@ -169,7 +169,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static const struct net_device_ops mvneta_netdev_ops = {
.ndo_open = mvneta_open,
.ndo_stop = mvneta_stop,
@@ -3255,6 +3374,10 @@ const struct ethtool_ops mvneta_eth_tool
@@ -3253,6 +3372,10 @@ const struct ethtool_ops mvneta_eth_tool
.get_strings = mvneta_ethtool_get_strings,
.get_ethtool_stats = mvneta_ethtool_get_stats,
.get_sset_count = mvneta_ethtool_get_sset_count,
@ -180,7 +180,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
};
/* Initialize hw */
@@ -3446,6 +3569,8 @@ static int mvneta_probe(struct platform_
@@ -3444,6 +3567,8 @@ static int mvneta_probe(struct platform_
pp->rxq_def = rxq_def;

@ -13,7 +13,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -3242,26 +3242,25 @@ static void mvneta_ethtool_update_stats(
@@ -3240,26 +3240,25 @@ static void mvneta_ethtool_update_stats(
const struct mvneta_statistic *s;
void __iomem *base = pp->base;
u32 high, low, val;

@ -1,55 +0,0 @@
From: Gregory CLEMENT <gregory.clement@free-electrons.com>
Date: Thu, 4 Feb 2016 22:09:23 +0100
Subject: [PATCH] net: mvneta: Fix for_each_present_cpu usage
This patch convert the for_each_present in on_each_cpu, instead of
applying on the present cpus it will be applied only on the online cpus.
This fix a bug reported on
http://thread.gmane.org/gmane.linux.ports.arm.kernel/468173.
Using the macro on_each_cpu (instead of a for_each_* loop) also ensures
that all the calls will be done all at once.
Fixes: f86428854480 ("net: mvneta: Statically assign queues to CPUs")
Reported-by: Stefan Roese <stefan.roese@gmail.com>
Suggested-by: Jisheng Zhang <jszhang@marvell.com>
Suggested-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -2562,7 +2562,7 @@ static void mvneta_start_dev(struct mvne
mvneta_port_enable(pp);
/* Enable polling on the port */
- for_each_present_cpu(cpu) {
+ for_each_online_cpu(cpu) {
struct mvneta_pcpu_port *port = per_cpu_ptr(pp->ports, cpu);
napi_enable(&port->napi);
@@ -2587,7 +2587,7 @@ static void mvneta_stop_dev(struct mvnet
phy_stop(pp->phy_dev);
- for_each_present_cpu(cpu) {
+ for_each_online_cpu(cpu) {
struct mvneta_pcpu_port *port = per_cpu_ptr(pp->ports, cpu);
napi_disable(&port->napi);
@@ -3055,13 +3055,11 @@ err_cleanup_rxqs:
static int mvneta_stop(struct net_device *dev)
{
struct mvneta_port *pp = netdev_priv(dev);
- int cpu;
mvneta_stop_dev(pp);
mvneta_mdio_remove(pp);
unregister_cpu_notifier(&pp->cpu_notifier);
- for_each_present_cpu(cpu)
- smp_call_function_single(cpu, mvneta_percpu_disable, pp, true);
+ on_each_cpu(mvneta_percpu_disable, pp, true);
free_percpu_irq(dev->irq, pp->ports);
mvneta_cleanup_rxqs(pp);
mvneta_cleanup_txqs(pp);

@ -15,7 +15,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
--- a/drivers/net/phy/marvell.c
+++ b/drivers/net/phy/marvell.c
@@ -1150,7 +1150,7 @@ static struct phy_driver marvell_drivers
@@ -1148,7 +1148,7 @@ static struct phy_driver marvell_drivers
.phy_id = MARVELL_PHY_ID_88E1510,
.phy_id_mask = MARVELL_PHY_ID_MASK,
.name = "Marvell 88E1510",

@ -4370,7 +4370,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
write_enable(nor);
write_sr(nor, val | SR_QUAD_EN_MX);
@@ -1100,7 +1247,7 @@ static int set_quad_mode(struct spi_nor
@@ -1107,7 +1254,7 @@ static int set_quad_mode(struct spi_nor
static int spi_nor_check(struct spi_nor *nor)
{
if (!nor->dev || !nor->read || !nor->write ||
@ -4379,7 +4379,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
pr_err("spi-nor: please fill all the necessary fields!\n");
return -EINVAL;
}
@@ -1113,7 +1260,7 @@ int spi_nor_scan(struct spi_nor *nor, co
@@ -1120,7 +1267,7 @@ int spi_nor_scan(struct spi_nor *nor, co
const struct flash_info *info = NULL;
struct device *dev = nor->dev;
struct mtd_info *mtd = &nor->mtd;
@ -4388,7 +4388,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
int ret;
int i;
@@ -1167,6 +1314,7 @@ int spi_nor_scan(struct spi_nor *nor, co
@@ -1174,6 +1321,7 @@ int spi_nor_scan(struct spi_nor *nor, co
info->flags & SPI_NOR_HAS_LOCK) {
write_enable(nor);
write_sr(nor, 0);
@ -4396,7 +4396,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
}
if (!mtd->name)
@@ -1201,6 +1349,8 @@ int spi_nor_scan(struct spi_nor *nor, co
@@ -1208,6 +1356,8 @@ int spi_nor_scan(struct spi_nor *nor, co
if (info->flags & USE_FSR)
nor->flags |= SNOR_F_USE_FSR;
@ -4405,7 +4405,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
#ifdef CONFIG_MTD_SPI_NOR_USE_4K_SECTORS
/* prefer "small sector" erase if possible */
@@ -1303,6 +1453,12 @@ int spi_nor_scan(struct spi_nor *nor, co
@@ -1310,6 +1460,12 @@ int spi_nor_scan(struct spi_nor *nor, co
nor->addr_width = 3;
}

@ -1,51 +0,0 @@
From 5833532b49820aa221248f296c207cc50d20ca2d Mon Sep 17 00:00:00 2001
From: Florian Fainelli <f.fainelli@gmail.com>
Date: Fri, 23 Dec 2016 19:36:31 -0800
Subject: [PATCH net] net: korina: Fix NAPI versus resources freeing
Commit beb0babfb77e ("korina: disable napi on close and restart")
introduced calls to napi_disable() that were missing before,
unfortunately this leaves a small window during which NAPI has a chance
to run, yet we just freed resources since korina_free_ring() has been
called:
Fix this by disabling NAPI first then freeing resource, and make sure
that we also cancel the restart taks before doing the resource freeing.
Fixes: beb0babfb77e ("korina: disable napi on close and restart")
Reported-by: Alexandros C. Couloumbis <alex@ozo.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/ethernet/korina.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
--- a/drivers/net/ethernet/korina.c
+++ b/drivers/net/ethernet/korina.c
@@ -900,10 +900,10 @@ static void korina_restart_task(struct w
DMA_STAT_DONE | DMA_STAT_HALT | DMA_STAT_ERR,
&lp->rx_dma_regs->dmasm);
- korina_free_ring(dev);
-
napi_disable(&lp->napi);
+ korina_free_ring(dev);
+
if (korina_init(dev) < 0) {
printk(KERN_ERR "%s: cannot restart device\n", dev->name);
return;
@@ -1064,12 +1064,12 @@ static int korina_close(struct net_devic
tmp = tmp | DMA_STAT_DONE | DMA_STAT_HALT | DMA_STAT_ERR;
writel(tmp, &lp->rx_dma_regs->dmasm);
- korina_free_ring(dev);
-
napi_disable(&lp->napi);
cancel_work_sync(&lp->restart_task);
+ korina_free_ring(dev);
+
free_irq(lp->rx_irq, dev);
free_irq(lp->tx_irq, dev);
free_irq(lp->ovr_irq, dev);

@ -33,11 +33,9 @@ Signed-off-by: Richard Weinberger <richard@nod.at>
arch/x86/um/setjmp_64.S | 16 ++++++++--------
3 files changed, 20 insertions(+), 16 deletions(-)
diff --git a/arch/um/Makefile b/arch/um/Makefile
index 0ca46ededfc7..6ca4f66085c1 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
@@ -59,10 +59,14 @@ KBUILD_CPPFLAGS += -I$(srctree)/$(HOST_DIR)/um
@@ -59,10 +59,14 @@ KBUILD_CPPFLAGS += -I$(srctree)/$(HOST_D
# Same things for in6addr_loopback and mktime - found in libc. For these two we
# only get link-time error, luckily.
#
@ -52,8 +50,6 @@ index 0ca46ededfc7..6ca4f66085c1 100644
-Din6addr_loopback=kernel_in6addr_loopback \
-Din6addr_any=kernel_in6addr_any -Dstrrchr=kernel_strrchr
diff --git a/arch/x86/um/setjmp_32.S b/arch/x86/um/setjmp_32.S
index b766792c9933..39053192918d 100644
--- a/arch/x86/um/setjmp_32.S
+++ b/arch/x86/um/setjmp_32.S
@@ -16,9 +16,9 @@
@ -93,8 +89,6 @@ index b766792c9933..39053192918d 100644
- .size longjmp,.-longjmp
+ .size kernel_longjmp,.-kernel_longjmp
diff --git a/arch/x86/um/setjmp_64.S b/arch/x86/um/setjmp_64.S
index 45f547b4043e..c56942e1a38c 100644
--- a/arch/x86/um/setjmp_64.S
+++ b/arch/x86/um/setjmp_64.S
@@ -18,9 +18,9 @@
@ -134,6 +128,3 @@ index 45f547b4043e..c56942e1a38c 100644
- .size longjmp,.-longjmp
+ .size kernel_longjmp,.-kernel_longjmp
--
2.13.0

Loading…
Cancel
Save