From faaa67d196f67306d5b00b1add1d25753eafa2ca Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Mon, 3 Feb 2020 10:10:20 -0500 Subject: [PATCH] fixes for 4.14 Signed-off-by: Sasha Levin --- ...-cap_net_admin-check-in-airooldioctl.patch | 83 ++++++ ...e-info-leak-in-airooldioctl-siocdevp.patch | 70 +++++ ...relax-arch-timer-version-check-durin.patch | 50 ++++ ...35x-boneblack-common-fix-memory-size.patch | 41 +++ ...eagle-x15-common-model-5v0-regulator.patch | 56 ++++ ...-a83t-correct-usb3503-gpios-polarity.patch | 40 +++ ...soc-sti-fix-possible-sleep-in-atomic.patch | 71 +++++ ...n-fix-ipv6-rfs-filter-matching-logic.patch | 57 ++++ ...x-radar-event-during-another-phy-cac.patch | 186 +++++++++++++ ...2-fix-the-order-of-timer-mux-parents.patch | 41 +++ ...ii-sfp-module-discovery-for-100fx-lx.patch | 73 +++++ ...se-descriptors-of-current-altsetting.patch | 38 +++ ...i-mvm-fix-nvm-check-for-3168-devices.patch | 39 +++ ...ation-of-queue-with-vfs-and-flow-dir.patch | 84 ++++++ ...imit-of-10-entries-for-unicast-filte.patch | 42 +++ ..._next-should-increase-position-index.patch | 37 +++ ...p-replay-protection-immediately-afte.patch | 64 +++++ ...strict-airtime-metric-to-peered-esta.patch | 55 ++++ ...m_sf2-configure-imp-port-for-2gb-sec.patch | 39 +++ ...-update-in-inet_proto_csum_replace16.patch | 73 +++++ ...-rename-if_mode_xgmii-to-if_mode_10g.patch | 46 ++++ .../net-fsl-treat-fsl-erratum-a011043.patch | 59 ++++ ...tual-exclusion-for-accessing-shared-.patch | 158 +++++++++++ ...et-sonic-fix-receive-buffer-handling.patch | 116 ++++++++ ...e-sonic-before-re-initializing-descr.patch | 97 +++++++ queue-4.14/net-sonic-use-mmio-accessors.patch | 69 +++++ ...erpc-fsl-dts-add-fsl-erratum-a011043.patch | 257 ++++++++++++++++++ ...oft-lockup-while-collecting-firmware.patch | 62 +++++ ..._wwan-add-support-for-quectel-rm500q.patch | 39 +++ ...t-setting-of-wol-before-initializing.patch | 49 ++++ ...do-not-queue-commands-during-fwreset.patch | 48 ++++ ..._next-should-increase-position-index.patch | 37 +++ queue-4.14/series | 37 +++ ...pc-fix-race-condition-with-rproc_boo.patch | 55 ++++ ...tee-fix-compilation-issue-with-nommu.patch | 54 ++++ ...6-fix-packet-tx-through-bpf_redirect.patch | 82 ++++++ ...bling-channel-12-for-custom-regulato.patch | 65 +++++ .../wireless-wext-avoid-gcc-o3-warning.patch | 56 ++++ 38 files changed, 2625 insertions(+) create mode 100644 queue-4.14/airo-add-missing-cap_net_admin-check-in-airooldioctl.patch create mode 100644 queue-4.14/airo-fix-possible-info-leak-in-airooldioctl-siocdevp.patch create mode 100644 queue-4.14/arm-8955-1-virt-relax-arch-timer-version-check-durin.patch create mode 100644 queue-4.14/arm-dts-am335x-boneblack-common-fix-memory-size.patch create mode 100644 queue-4.14/arm-dts-beagle-x15-common-model-5v0-regulator.patch create mode 100644 queue-4.14/arm-dts-sun8i-a83t-correct-usb3503-gpios-polarity.patch create mode 100644 queue-4.14/asoc-sti-fix-possible-sleep-in-atomic.patch create mode 100644 queue-4.14/bnxt_en-fix-ipv6-rfs-filter-matching-logic.patch create mode 100644 queue-4.14/cfg80211-fix-radar-event-during-another-phy-cac.patch create mode 100644 queue-4.14/clk-mmp2-fix-the-order-of-timer-mux-parents.patch create mode 100644 queue-4.14/igb-fix-sgmii-sfp-module-discovery-for-100fx-lx.patch create mode 100644 queue-4.14/input-aiptek-use-descriptors-of-current-altsetting.patch create mode 100644 queue-4.14/iwlwifi-mvm-fix-nvm-check-for-3168-devices.patch create mode 100644 queue-4.14/ixgbe-fix-calculation-of-queue-with-vfs-and-flow-dir.patch create mode 100644 queue-4.14/ixgbevf-remove-limit-of-10-entries-for-unicast-filte.patch create mode 100644 queue-4.14/l2t_seq_next-should-increase-position-index.patch create mode 100644 queue-4.14/mac80211-fix-tkip-replay-protection-immediately-afte.patch create mode 100644 queue-4.14/mac80211-mesh-restrict-airtime-metric-to-peered-esta.patch create mode 100644 queue-4.14/net-dsa-bcm_sf2-configure-imp-port-for-2gb-sec.patch create mode 100644 queue-4.14/net-fix-skb-csum-update-in-inet_proto_csum_replace16.patch create mode 100644 queue-4.14/net-fsl-fman-rename-if_mode_xgmii-to-if_mode_10g.patch create mode 100644 queue-4.14/net-fsl-treat-fsl-erratum-a011043.patch create mode 100644 queue-4.14/net-sonic-add-mutual-exclusion-for-accessing-shared-.patch create mode 100644 queue-4.14/net-sonic-fix-receive-buffer-handling.patch create mode 100644 queue-4.14/net-sonic-quiesce-sonic-before-re-initializing-descr.patch create mode 100644 queue-4.14/net-sonic-use-mmio-accessors.patch create mode 100644 queue-4.14/powerpc-fsl-dts-add-fsl-erratum-a011043.patch create mode 100644 queue-4.14/qlcnic-fix-cpu-soft-lockup-while-collecting-firmware.patch create mode 100644 queue-4.14/qmi_wwan-add-support-for-quectel-rm500q.patch create mode 100644 queue-4.14/r8152-get-default-setting-of-wol-before-initializing.patch create mode 100644 queue-4.14/scsi-fnic-do-not-queue-commands-during-fwreset.patch create mode 100644 queue-4.14/seq_tab_next-should-increase-position-index.patch create mode 100644 queue-4.14/soc-ti-wkup_m3_ipc-fix-race-condition-with-rproc_boo.patch create mode 100644 queue-4.14/tee-optee-fix-compilation-issue-with-nommu.patch create mode 100644 queue-4.14/vti-6-fix-packet-tx-through-bpf_redirect.patch create mode 100644 queue-4.14/wireless-fix-enabling-channel-12-for-custom-regulato.patch create mode 100644 queue-4.14/wireless-wext-avoid-gcc-o3-warning.patch diff --git a/queue-4.14/airo-add-missing-cap_net_admin-check-in-airooldioctl.patch b/queue-4.14/airo-add-missing-cap_net_admin-check-in-airooldioctl.patch new file mode 100644 index 00000000000..f2f677e7510 --- /dev/null +++ b/queue-4.14/airo-add-missing-cap_net_admin-check-in-airooldioctl.patch @@ -0,0 +1,83 @@ +From 856c821be1ff8ffb8ad2d95ccb22657c01a5dd14 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 22 Jan 2020 15:07:28 +1100 +Subject: airo: Add missing CAP_NET_ADMIN check in AIROOLDIOCTL/SIOCDEVPRIVATE + +From: Michael Ellerman + +[ Upstream commit 78f7a7566f5eb59321e99b55a6fdb16ea05b37d1 ] + +The driver for Cisco Aironet 4500 and 4800 series cards (airo.c), +implements AIROOLDIOCTL/SIOCDEVPRIVATE in airo_ioctl(). + +The ioctl handler copies an aironet_ioctl struct from userspace, which +includes a command. Some of the commands are handled in readrids(), +where the user controlled command is converted into a driver-internal +value called "ridcode". + +There are two command values, AIROGWEPKTMP and AIROGWEPKNV, which +correspond to ridcode values of RID_WEP_TEMP and RID_WEP_PERM +respectively. These commands both have checks that the user has +CAP_NET_ADMIN, with the comment that "Only super-user can read WEP +keys", otherwise they return -EPERM. + +However there is another command value, AIRORRID, that lets the user +specify the ridcode value directly, with no other checks. This means +the user can bypass the CAP_NET_ADMIN check on AIROGWEPKTMP and +AIROGWEPKNV. + +Fix it by moving the CAP_NET_ADMIN check out of the command handling +and instead do it later based on the ridcode. That way regardless of +whether the ridcode is set via AIROGWEPKTMP or AIROGWEPKNV, or passed +in using AIRORID, we always do the CAP_NET_ADMIN check. + +Found by Ilja by code inspection, not tested as I don't have the +required hardware. + +Reported-by: Ilja Van Sprundel +Signed-off-by: Michael Ellerman +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/wireless/cisco/airo.c | 18 ++++++++---------- + 1 file changed, 8 insertions(+), 10 deletions(-) + +diff --git a/drivers/net/wireless/cisco/airo.c b/drivers/net/wireless/cisco/airo.c +index c9ffbdd42e67c..f3f20abbe2696 100644 +--- a/drivers/net/wireless/cisco/airo.c ++++ b/drivers/net/wireless/cisco/airo.c +@@ -7788,16 +7788,8 @@ static int readrids(struct net_device *dev, aironet_ioctl *comp) { + case AIROGVLIST: ridcode = RID_APLIST; break; + case AIROGDRVNAM: ridcode = RID_DRVNAME; break; + case AIROGEHTENC: ridcode = RID_ETHERENCAP; break; +- case AIROGWEPKTMP: ridcode = RID_WEP_TEMP; +- /* Only super-user can read WEP keys */ +- if (!capable(CAP_NET_ADMIN)) +- return -EPERM; +- break; +- case AIROGWEPKNV: ridcode = RID_WEP_PERM; +- /* Only super-user can read WEP keys */ +- if (!capable(CAP_NET_ADMIN)) +- return -EPERM; +- break; ++ case AIROGWEPKTMP: ridcode = RID_WEP_TEMP; break; ++ case AIROGWEPKNV: ridcode = RID_WEP_PERM; break; + case AIROGSTAT: ridcode = RID_STATUS; break; + case AIROGSTATSD32: ridcode = RID_STATSDELTA; break; + case AIROGSTATSC32: ridcode = RID_STATS; break; +@@ -7811,6 +7803,12 @@ static int readrids(struct net_device *dev, aironet_ioctl *comp) { + return -EINVAL; + } + ++ if (ridcode == RID_WEP_TEMP || ridcode == RID_WEP_PERM) { ++ /* Only super-user can read WEP keys */ ++ if (!capable(CAP_NET_ADMIN)) ++ return -EPERM; ++ } ++ + if ((iobuf = kzalloc(RIDSIZE, GFP_KERNEL)) == NULL) + return -ENOMEM; + +-- +2.20.1 + diff --git a/queue-4.14/airo-fix-possible-info-leak-in-airooldioctl-siocdevp.patch b/queue-4.14/airo-fix-possible-info-leak-in-airooldioctl-siocdevp.patch new file mode 100644 index 00000000000..440b7ddc9d7 --- /dev/null +++ b/queue-4.14/airo-fix-possible-info-leak-in-airooldioctl-siocdevp.patch @@ -0,0 +1,70 @@ +From a391c24d8c2f63bcf20d42b7e1bf0a716cfe5906 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 22 Jan 2020 15:07:27 +1100 +Subject: airo: Fix possible info leak in AIROOLDIOCTL/SIOCDEVPRIVATE + +From: Michael Ellerman + +[ Upstream commit d6bce2137f5d6bb1093e96d2f801479099b28094 ] + +The driver for Cisco Aironet 4500 and 4800 series cards (airo.c), +implements AIROOLDIOCTL/SIOCDEVPRIVATE in airo_ioctl(). + +The ioctl handler copies an aironet_ioctl struct from userspace, which +includes a command and a length. Some of the commands are handled in +readrids(), which kmalloc()'s a buffer of RIDSIZE (2048) bytes. + +That buffer is then passed to PC4500_readrid(), which has two cases. +The else case does some setup and then reads up to RIDSIZE bytes from +the hardware into the kmalloc()'ed buffer. + +Here len == RIDSIZE, pBuf is the kmalloc()'ed buffer: + + // read the rid length field + bap_read(ai, pBuf, 2, BAP1); + // length for remaining part of rid + len = min(len, (int)le16_to_cpu(*(__le16*)pBuf)) - 2; + ... + // read remainder of the rid + rc = bap_read(ai, ((__le16*)pBuf)+1, len, BAP1); + +PC4500_readrid() then returns to readrids() which does: + + len = comp->len; + if (copy_to_user(comp->data, iobuf, min(len, (int)RIDSIZE))) { + +Where comp->len is the user controlled length field. + +So if the "rid length field" returned by the hardware is < 2048, and +the user requests 2048 bytes in comp->len, we will leak the previous +contents of the kmalloc()'ed buffer to userspace. + +Fix it by kzalloc()'ing the buffer. + +Found by Ilja by code inspection, not tested as I don't have the +required hardware. + +Reported-by: Ilja Van Sprundel +Signed-off-by: Michael Ellerman +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/wireless/cisco/airo.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/net/wireless/cisco/airo.c b/drivers/net/wireless/cisco/airo.c +index fc49255bab009..c9ffbdd42e67c 100644 +--- a/drivers/net/wireless/cisco/airo.c ++++ b/drivers/net/wireless/cisco/airo.c +@@ -7811,7 +7811,7 @@ static int readrids(struct net_device *dev, aironet_ioctl *comp) { + return -EINVAL; + } + +- if ((iobuf = kmalloc(RIDSIZE, GFP_KERNEL)) == NULL) ++ if ((iobuf = kzalloc(RIDSIZE, GFP_KERNEL)) == NULL) + return -ENOMEM; + + PC4500_readrid(ai,ridcode,iobuf,RIDSIZE, 1); +-- +2.20.1 + diff --git a/queue-4.14/arm-8955-1-virt-relax-arch-timer-version-check-durin.patch b/queue-4.14/arm-8955-1-virt-relax-arch-timer-version-check-durin.patch new file mode 100644 index 00000000000..ef747272e64 --- /dev/null +++ b/queue-4.14/arm-8955-1-virt-relax-arch-timer-version-check-durin.patch @@ -0,0 +1,50 @@ +From d0b67e7a7b0fc2ee26368c03b64b2ccb506fa802 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 20 Jan 2020 15:07:46 +0100 +Subject: ARM: 8955/1: virt: Relax arch timer version check during early boot + +From: Vladimir Murzin + +[ Upstream commit 6849b5eba1965ceb0cad3a75877ef4569dd3638e ] + +Updates to the Generic Timer architecture allow ID_PFR1.GenTimer to +have values other than 0 or 1 while still preserving backward +compatibility. At the moment, Linux is quite strict in the way it +handles this field at early boot and will not configure arch timer if +it doesn't find the value 1. + +Since here use ubfx for arch timer version extraction (hyb-stub build +with -march=armv7-a, so it is safe) + +To help backports (even though the code was correct at the time of writing) + +Fixes: 8ec58be9f3ff ("ARM: virt: arch_timers: enable access to physical timers") +Acked-by: Marc Zyngier +Signed-off-by: Vladimir Murzin +Signed-off-by: Russell King +Signed-off-by: Sasha Levin +--- + arch/arm/kernel/hyp-stub.S | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +diff --git a/arch/arm/kernel/hyp-stub.S b/arch/arm/kernel/hyp-stub.S +index 82a942894fc04..83e463c05dcdb 100644 +--- a/arch/arm/kernel/hyp-stub.S ++++ b/arch/arm/kernel/hyp-stub.S +@@ -159,10 +159,9 @@ ARM_BE8(orr r7, r7, #(1 << 25)) @ HSCTLR.EE + #if !defined(ZIMAGE) && defined(CONFIG_ARM_ARCH_TIMER) + @ make CNTP_* and CNTPCT accessible from PL1 + mrc p15, 0, r7, c0, c1, 1 @ ID_PFR1 +- lsr r7, #16 +- and r7, #0xf +- cmp r7, #1 +- bne 1f ++ ubfx r7, r7, #16, #4 ++ teq r7, #0 ++ beq 1f + mrc p15, 4, r7, c14, c1, 0 @ CNTHCTL + orr r7, r7, #3 @ PL1PCEN | PL1PCTEN + mcr p15, 4, r7, c14, c1, 0 @ CNTHCTL +-- +2.20.1 + diff --git a/queue-4.14/arm-dts-am335x-boneblack-common-fix-memory-size.patch b/queue-4.14/arm-dts-am335x-boneblack-common-fix-memory-size.patch new file mode 100644 index 00000000000..8778162ebf8 --- /dev/null +++ b/queue-4.14/arm-dts-am335x-boneblack-common-fix-memory-size.patch @@ -0,0 +1,41 @@ +From ff4c583008301c60716c71310b3b60a5f6decfdd Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 6 Jan 2020 16:09:08 +0300 +Subject: ARM: dts: am335x-boneblack-common: fix memory size + +From: Matwey V. Kornilov + +[ Upstream commit 5abd45ea0fc3060f7805e131753fdcbafd6c6618 ] + +BeagleBone Black series is equipped with 512MB RAM +whereas only 256MB is included from am335x-bone-common.dtsi + +This leads to an issue with unusual setups when devicetree +is loaded by GRUB2 directly. + +Signed-off-by: Matwey V. Kornilov +Signed-off-by: Tony Lindgren +Signed-off-by: Sasha Levin +--- + arch/arm/boot/dts/am335x-boneblack-common.dtsi | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/arch/arm/boot/dts/am335x-boneblack-common.dtsi b/arch/arm/boot/dts/am335x-boneblack-common.dtsi +index 325daae40278a..485c27f039f59 100644 +--- a/arch/arm/boot/dts/am335x-boneblack-common.dtsi ++++ b/arch/arm/boot/dts/am335x-boneblack-common.dtsi +@@ -131,6 +131,11 @@ + }; + + / { ++ memory@80000000 { ++ device_type = "memory"; ++ reg = <0x80000000 0x20000000>; /* 512 MB */ ++ }; ++ + clk_mcasp0_fixed: clk_mcasp0_fixed { + #clock-cells = <0>; + compatible = "fixed-clock"; +-- +2.20.1 + diff --git a/queue-4.14/arm-dts-beagle-x15-common-model-5v0-regulator.patch b/queue-4.14/arm-dts-beagle-x15-common-model-5v0-regulator.patch new file mode 100644 index 00000000000..4c857558be6 --- /dev/null +++ b/queue-4.14/arm-dts-beagle-x15-common-model-5v0-regulator.patch @@ -0,0 +1,56 @@ +From b3bd1a224c508db2dc03178921dbdcef5af08582 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 17 Dec 2019 14:21:24 +0530 +Subject: ARM: dts: beagle-x15-common: Model 5V0 regulator + +From: Kishon Vijay Abraham I + +[ Upstream commit e17e7c498d4f734df93c300441e100818ed58168 ] + +On am57xx-beagle-x15, 5V0 is connected to P16, P17, P18 and P19 +connectors. On am57xx-evm, 5V0 regulator is used to get 3V6 regulator +which is connected to the COMQ port. Model 5V0 regulator here in order +for it to be used in am57xx-evm to model 3V6 regulator. + +Signed-off-by: Kishon Vijay Abraham I +Signed-off-by: Tony Lindgren +Signed-off-by: Sasha Levin +--- + .../boot/dts/am57xx-beagle-x15-common.dtsi | 21 +++++++++++++++++++ + 1 file changed, 21 insertions(+) + +diff --git a/arch/arm/boot/dts/am57xx-beagle-x15-common.dtsi b/arch/arm/boot/dts/am57xx-beagle-x15-common.dtsi +index 49aeecd312b4b..d578a9f7e1a0e 100644 +--- a/arch/arm/boot/dts/am57xx-beagle-x15-common.dtsi ++++ b/arch/arm/boot/dts/am57xx-beagle-x15-common.dtsi +@@ -32,6 +32,27 @@ + reg = <0x0 0x80000000 0x0 0x80000000>; + }; + ++ main_12v0: fixedregulator-main_12v0 { ++ /* main supply */ ++ compatible = "regulator-fixed"; ++ regulator-name = "main_12v0"; ++ regulator-min-microvolt = <12000000>; ++ regulator-max-microvolt = <12000000>; ++ regulator-always-on; ++ regulator-boot-on; ++ }; ++ ++ evm_5v0: fixedregulator-evm_5v0 { ++ /* Output of TPS54531D */ ++ compatible = "regulator-fixed"; ++ regulator-name = "evm_5v0"; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ vin-supply = <&main_12v0>; ++ regulator-always-on; ++ regulator-boot-on; ++ }; ++ + vdd_3v3: fixedregulator-vdd_3v3 { + compatible = "regulator-fixed"; + regulator-name = "vdd_3v3"; +-- +2.20.1 + diff --git a/queue-4.14/arm-dts-sun8i-a83t-correct-usb3503-gpios-polarity.patch b/queue-4.14/arm-dts-sun8i-a83t-correct-usb3503-gpios-polarity.patch new file mode 100644 index 00000000000..4f1dba7e800 --- /dev/null +++ b/queue-4.14/arm-dts-sun8i-a83t-correct-usb3503-gpios-polarity.patch @@ -0,0 +1,40 @@ +From 5ddd5ae6f6191885936c55cd829133c35ce8e340 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 11 Dec 2019 15:52:17 +0100 +Subject: ARM: dts: sun8i: a83t: Correct USB3503 GPIOs polarity + +From: Marek Szyprowski + +[ Upstream commit 1c226017d3ec93547b58082bdf778d9db7401c95 ] + +Current USB3503 driver ignores GPIO polarity and always operates as if the +GPIO lines were flagged as ACTIVE_HIGH. Fix the polarity for the existing +USB3503 chip applications to match the chip specification and common +convention for naming the pins. The only pin, which has to be ACTIVE_LOW +is the reset pin. The remaining are ACTIVE_HIGH. This change allows later +to fix the USB3503 driver to properly use generic GPIO bindings and read +polarity from DT. + +Signed-off-by: Marek Szyprowski +Signed-off-by: Maxime Ripard +Signed-off-by: Sasha Levin +--- + arch/arm/boot/dts/sun8i-a83t-cubietruck-plus.dts | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm/boot/dts/sun8i-a83t-cubietruck-plus.dts b/arch/arm/boot/dts/sun8i-a83t-cubietruck-plus.dts +index 716a205c6dbbe..1fed3231f5c18 100644 +--- a/arch/arm/boot/dts/sun8i-a83t-cubietruck-plus.dts ++++ b/arch/arm/boot/dts/sun8i-a83t-cubietruck-plus.dts +@@ -90,7 +90,7 @@ + initial-mode = <1>; /* initialize in HUB mode */ + disabled-ports = <1>; + intn-gpios = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */ +- reset-gpios = <&pio 4 16 GPIO_ACTIVE_HIGH>; /* PE16 */ ++ reset-gpios = <&pio 4 16 GPIO_ACTIVE_LOW>; /* PE16 */ + connect-gpios = <&pio 4 17 GPIO_ACTIVE_HIGH>; /* PE17 */ + refclk-frequency = <19200000>; + }; +-- +2.20.1 + diff --git a/queue-4.14/asoc-sti-fix-possible-sleep-in-atomic.patch b/queue-4.14/asoc-sti-fix-possible-sleep-in-atomic.patch new file mode 100644 index 00000000000..89f42b19079 --- /dev/null +++ b/queue-4.14/asoc-sti-fix-possible-sleep-in-atomic.patch @@ -0,0 +1,71 @@ +From 3b14dc63da7f30bb7c39b0d03e6e7d808b0ee63e Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 13 Jan 2020 11:04:00 +0100 +Subject: ASoC: sti: fix possible sleep-in-atomic + +From: Arnaud Pouliquen + +[ Upstream commit ce780a47c3c01e1e179d0792df6b853a913928f1 ] + +Change mutex and spinlock management to avoid sleep +in atomic issue. + +Signed-off-by: Arnaud Pouliquen +Link: https://lore.kernel.org/r/20200113100400.30472-1-arnaud.pouliquen@st.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/sti/uniperif_player.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/sound/soc/sti/uniperif_player.c b/sound/soc/sti/uniperif_player.c +index d8b6936e544e3..908f13623f8cd 100644 +--- a/sound/soc/sti/uniperif_player.c ++++ b/sound/soc/sti/uniperif_player.c +@@ -226,7 +226,6 @@ static void uni_player_set_channel_status(struct uniperif *player, + * sampling frequency. If no sample rate is already specified, then + * set one. + */ +- mutex_lock(&player->ctrl_lock); + if (runtime) { + switch (runtime->rate) { + case 22050: +@@ -303,7 +302,6 @@ static void uni_player_set_channel_status(struct uniperif *player, + player->stream_settings.iec958.status[3 + (n * 4)] << 24; + SET_UNIPERIF_CHANNEL_STA_REGN(player, n, status); + } +- mutex_unlock(&player->ctrl_lock); + + /* Update the channel status */ + if (player->ver < SND_ST_UNIPERIF_VERSION_UNI_PLR_TOP_1_0) +@@ -365,8 +363,10 @@ static int uni_player_prepare_iec958(struct uniperif *player, + + SET_UNIPERIF_CTRL_ZERO_STUFF_HW(player); + ++ mutex_lock(&player->ctrl_lock); + /* Update the channel status */ + uni_player_set_channel_status(player, runtime); ++ mutex_unlock(&player->ctrl_lock); + + /* Clear the user validity user bits */ + SET_UNIPERIF_USER_VALIDITY_VALIDITY_LR(player, 0); +@@ -598,7 +598,6 @@ static int uni_player_ctl_iec958_put(struct snd_kcontrol *kcontrol, + iec958->status[1] = ucontrol->value.iec958.status[1]; + iec958->status[2] = ucontrol->value.iec958.status[2]; + iec958->status[3] = ucontrol->value.iec958.status[3]; +- mutex_unlock(&player->ctrl_lock); + + spin_lock_irqsave(&player->irq_lock, flags); + if (player->substream && player->substream->runtime) +@@ -608,6 +607,8 @@ static int uni_player_ctl_iec958_put(struct snd_kcontrol *kcontrol, + uni_player_set_channel_status(player, NULL); + + spin_unlock_irqrestore(&player->irq_lock, flags); ++ mutex_unlock(&player->ctrl_lock); ++ + return 0; + } + +-- +2.20.1 + diff --git a/queue-4.14/bnxt_en-fix-ipv6-rfs-filter-matching-logic.patch b/queue-4.14/bnxt_en-fix-ipv6-rfs-filter-matching-logic.patch new file mode 100644 index 00000000000..12497a236ea --- /dev/null +++ b/queue-4.14/bnxt_en-fix-ipv6-rfs-filter-matching-logic.patch @@ -0,0 +1,57 @@ +From 17ff30ad10c1b53d128495f7031f43597992a448 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 17 Jan 2020 00:32:46 -0500 +Subject: bnxt_en: Fix ipv6 RFS filter matching logic. + +From: Michael Chan + +[ Upstream commit 6fc7caa84e713f7627e171ab1e7c4b5be0dc9b3d ] + +Fix bnxt_fltr_match() to match ipv6 source and destination addresses. +The function currently only checks ipv4 addresses and will not work +corrently on ipv6 filters. + +Fixes: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.") +Signed-off-by: Michael Chan +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/broadcom/bnxt/bnxt.c | 22 +++++++++++++++++----- + 1 file changed, 17 insertions(+), 5 deletions(-) + +diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c +index 38ee7692132c5..7461e7b9eaae5 100644 +--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c ++++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c +@@ -7402,11 +7402,23 @@ static bool bnxt_fltr_match(struct bnxt_ntuple_filter *f1, + struct flow_keys *keys1 = &f1->fkeys; + struct flow_keys *keys2 = &f2->fkeys; + +- if (keys1->addrs.v4addrs.src == keys2->addrs.v4addrs.src && +- keys1->addrs.v4addrs.dst == keys2->addrs.v4addrs.dst && +- keys1->ports.ports == keys2->ports.ports && +- keys1->basic.ip_proto == keys2->basic.ip_proto && +- keys1->basic.n_proto == keys2->basic.n_proto && ++ if (keys1->basic.n_proto != keys2->basic.n_proto || ++ keys1->basic.ip_proto != keys2->basic.ip_proto) ++ return false; ++ ++ if (keys1->basic.n_proto == htons(ETH_P_IP)) { ++ if (keys1->addrs.v4addrs.src != keys2->addrs.v4addrs.src || ++ keys1->addrs.v4addrs.dst != keys2->addrs.v4addrs.dst) ++ return false; ++ } else { ++ if (memcmp(&keys1->addrs.v6addrs.src, &keys2->addrs.v6addrs.src, ++ sizeof(keys1->addrs.v6addrs.src)) || ++ memcmp(&keys1->addrs.v6addrs.dst, &keys2->addrs.v6addrs.dst, ++ sizeof(keys1->addrs.v6addrs.dst))) ++ return false; ++ } ++ ++ if (keys1->ports.ports == keys2->ports.ports && + keys1->control.flags == keys2->control.flags && + ether_addr_equal(f1->src_mac_addr, f2->src_mac_addr) && + ether_addr_equal(f1->dst_mac_addr, f2->dst_mac_addr)) +-- +2.20.1 + diff --git a/queue-4.14/cfg80211-fix-radar-event-during-another-phy-cac.patch b/queue-4.14/cfg80211-fix-radar-event-during-another-phy-cac.patch new file mode 100644 index 00000000000..f930a955a6f --- /dev/null +++ b/queue-4.14/cfg80211-fix-radar-event-during-another-phy-cac.patch @@ -0,0 +1,186 @@ +From 7d4b7793042630b8511cf78f53cc92d302cb29c0 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 22 Dec 2019 14:55:31 +0000 +Subject: cfg80211: Fix radar event during another phy CAC + +From: Orr Mazor + +[ Upstream commit 26ec17a1dc5ecdd8d91aba63ead6f8b5ad5dea0d ] + +In case a radar event of CAC_FINISHED or RADAR_DETECTED +happens during another phy is during CAC we might need +to cancel that CAC. + +If we got a radar in a channel that another phy is now +doing CAC on then the CAC should be canceled there. + +If, for example, 2 phys doing CAC on the same channels, +or on comptable channels, once on of them will finish his +CAC the other might need to cancel his CAC, since it is no +longer relevant. + +To fix that the commit adds an callback and implement it in +mac80211 to end CAC. +This commit also adds a call to said callback if after a radar +event we see the CAC is no longer relevant + +Signed-off-by: Orr Mazor +Reviewed-by: Sergey Matyukevich +Link: https://lore.kernel.org/r/20191222145449.15792-1-Orr.Mazor@tandemg.com +[slightly reformat/reword commit message] +Signed-off-by: Johannes Berg +Signed-off-by: Sasha Levin +--- + include/net/cfg80211.h | 5 +++++ + net/mac80211/cfg.c | 23 +++++++++++++++++++++++ + net/wireless/rdev-ops.h | 10 ++++++++++ + net/wireless/reg.c | 23 ++++++++++++++++++++++- + net/wireless/trace.h | 5 +++++ + 5 files changed, 65 insertions(+), 1 deletion(-) + +diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h +index a4c8e9d7dd063..030eea38f2581 100644 +--- a/include/net/cfg80211.h ++++ b/include/net/cfg80211.h +@@ -2843,6 +2843,9 @@ struct cfg80211_pmk_conf { + * + * @start_radar_detection: Start radar detection in the driver. + * ++ * @end_cac: End running CAC, probably because a related CAC ++ * was finished on another phy. ++ * + * @update_ft_ies: Provide updated Fast BSS Transition information to the + * driver. If the SME is in the driver/firmware, this information can be + * used in building Authentication and Reassociation Request frames. +@@ -3148,6 +3151,8 @@ struct cfg80211_ops { + struct net_device *dev, + struct cfg80211_chan_def *chandef, + u32 cac_time_ms); ++ void (*end_cac)(struct wiphy *wiphy, ++ struct net_device *dev); + int (*update_ft_ies)(struct wiphy *wiphy, struct net_device *dev, + struct cfg80211_update_ft_ies_params *ftie); + int (*crit_proto_start)(struct wiphy *wiphy, +diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c +index d437007b15bb2..b1484b8316e87 100644 +--- a/net/mac80211/cfg.c ++++ b/net/mac80211/cfg.c +@@ -2800,6 +2800,28 @@ static int ieee80211_start_radar_detection(struct wiphy *wiphy, + return err; + } + ++static void ieee80211_end_cac(struct wiphy *wiphy, ++ struct net_device *dev) ++{ ++ struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); ++ struct ieee80211_local *local = sdata->local; ++ ++ mutex_lock(&local->mtx); ++ list_for_each_entry(sdata, &local->interfaces, list) { ++ /* it might be waiting for the local->mtx, but then ++ * by the time it gets it, sdata->wdev.cac_started ++ * will no longer be true ++ */ ++ cancel_delayed_work(&sdata->dfs_cac_timer_work); ++ ++ if (sdata->wdev.cac_started) { ++ ieee80211_vif_release_channel(sdata); ++ sdata->wdev.cac_started = false; ++ } ++ } ++ mutex_unlock(&local->mtx); ++} ++ + static struct cfg80211_beacon_data * + cfg80211_beacon_dup(struct cfg80211_beacon_data *beacon) + { +@@ -3730,6 +3752,7 @@ const struct cfg80211_ops mac80211_config_ops = { + #endif + .get_channel = ieee80211_cfg_get_channel, + .start_radar_detection = ieee80211_start_radar_detection, ++ .end_cac = ieee80211_end_cac, + .channel_switch = ieee80211_channel_switch, + .set_qos_map = ieee80211_set_qos_map, + .set_ap_chanwidth = ieee80211_set_ap_chanwidth, +diff --git a/net/wireless/rdev-ops.h b/net/wireless/rdev-ops.h +index 249919bdfc64e..4077bb3af440c 100644 +--- a/net/wireless/rdev-ops.h ++++ b/net/wireless/rdev-ops.h +@@ -1143,6 +1143,16 @@ rdev_start_radar_detection(struct cfg80211_registered_device *rdev, + return ret; + } + ++static inline void ++rdev_end_cac(struct cfg80211_registered_device *rdev, ++ struct net_device *dev) ++{ ++ trace_rdev_end_cac(&rdev->wiphy, dev); ++ if (rdev->ops->end_cac) ++ rdev->ops->end_cac(&rdev->wiphy, dev); ++ trace_rdev_return_void(&rdev->wiphy); ++} ++ + static inline int + rdev_set_mcast_rate(struct cfg80211_registered_device *rdev, + struct net_device *dev, +diff --git a/net/wireless/reg.c b/net/wireless/reg.c +index e60a7dedfbf1b..a520f433d4765 100644 +--- a/net/wireless/reg.c ++++ b/net/wireless/reg.c +@@ -3303,6 +3303,25 @@ bool regulatory_pre_cac_allowed(struct wiphy *wiphy) + return pre_cac_allowed; + } + ++static void cfg80211_check_and_end_cac(struct cfg80211_registered_device *rdev) ++{ ++ struct wireless_dev *wdev; ++ /* If we finished CAC or received radar, we should end any ++ * CAC running on the same channels. ++ * the check !cfg80211_chandef_dfs_usable contain 2 options: ++ * either all channels are available - those the CAC_FINISHED ++ * event has effected another wdev state, or there is a channel ++ * in unavailable state in wdev chandef - those the RADAR_DETECTED ++ * event has effected another wdev state. ++ * In both cases we should end the CAC on the wdev. ++ */ ++ list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) { ++ if (wdev->cac_started && ++ !cfg80211_chandef_dfs_usable(&rdev->wiphy, &wdev->chandef)) ++ rdev_end_cac(rdev, wdev->netdev); ++ } ++} ++ + void regulatory_propagate_dfs_state(struct wiphy *wiphy, + struct cfg80211_chan_def *chandef, + enum nl80211_dfs_state dfs_state, +@@ -3329,8 +3348,10 @@ void regulatory_propagate_dfs_state(struct wiphy *wiphy, + cfg80211_set_dfs_state(&rdev->wiphy, chandef, dfs_state); + + if (event == NL80211_RADAR_DETECTED || +- event == NL80211_RADAR_CAC_FINISHED) ++ event == NL80211_RADAR_CAC_FINISHED) { + cfg80211_sched_dfs_chan_update(rdev); ++ cfg80211_check_and_end_cac(rdev); ++ } + + nl80211_radar_notify(rdev, chandef, event, NULL, GFP_KERNEL); + } +diff --git a/net/wireless/trace.h b/net/wireless/trace.h +index f3353fe5b35b8..cd0a1c7c185d4 100644 +--- a/net/wireless/trace.h ++++ b/net/wireless/trace.h +@@ -607,6 +607,11 @@ DEFINE_EVENT(wiphy_netdev_evt, rdev_flush_pmksa, + TP_ARGS(wiphy, netdev) + ); + ++DEFINE_EVENT(wiphy_netdev_evt, rdev_end_cac, ++ TP_PROTO(struct wiphy *wiphy, struct net_device *netdev), ++ TP_ARGS(wiphy, netdev) ++); ++ + DECLARE_EVENT_CLASS(station_add_change, + TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 *mac, + struct station_parameters *params), +-- +2.20.1 + diff --git a/queue-4.14/clk-mmp2-fix-the-order-of-timer-mux-parents.patch b/queue-4.14/clk-mmp2-fix-the-order-of-timer-mux-parents.patch new file mode 100644 index 00000000000..918707e9880 --- /dev/null +++ b/queue-4.14/clk-mmp2-fix-the-order-of-timer-mux-parents.patch @@ -0,0 +1,41 @@ +From 8b866e68ef98899ec33abf19ffbc47537a111e9f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 18 Dec 2019 20:04:54 +0100 +Subject: clk: mmp2: Fix the order of timer mux parents + +From: Lubomir Rintel + +[ Upstream commit 8bea5ac0fbc5b2103f8779ddff216122e3c2e1ad ] + +Determined empirically, no documentation is available. + +The OLPC XO-1.75 laptop used parent 1, that one being VCTCXO/4 (65MHz), but +thought it's a VCTCXO/2 (130MHz). The mmp2 timer driver, not knowing +what is going on, ended up just dividing the rate as of +commit f36797ee4380 ("ARM: mmp/mmp2: dt: enable the clock")' + +Link: https://lore.kernel.org/r/20191218190454.420358-3-lkundrak@v3.sk +Signed-off-by: Lubomir Rintel +Acked-by: Stephen Boyd +Signed-off-by: Olof Johansson +Signed-off-by: Sasha Levin +--- + drivers/clk/mmp/clk-of-mmp2.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/clk/mmp/clk-of-mmp2.c b/drivers/clk/mmp/clk-of-mmp2.c +index d083b860f0833..10689d8cd3867 100644 +--- a/drivers/clk/mmp/clk-of-mmp2.c ++++ b/drivers/clk/mmp/clk-of-mmp2.c +@@ -134,7 +134,7 @@ static DEFINE_SPINLOCK(ssp3_lock); + static const char *ssp_parent_names[] = {"vctcxo_4", "vctcxo_2", "vctcxo", "pll1_16"}; + + static DEFINE_SPINLOCK(timer_lock); +-static const char *timer_parent_names[] = {"clk32", "vctcxo_2", "vctcxo_4", "vctcxo"}; ++static const char *timer_parent_names[] = {"clk32", "vctcxo_4", "vctcxo_2", "vctcxo"}; + + static DEFINE_SPINLOCK(reset_lock); + +-- +2.20.1 + diff --git a/queue-4.14/igb-fix-sgmii-sfp-module-discovery-for-100fx-lx.patch b/queue-4.14/igb-fix-sgmii-sfp-module-discovery-for-100fx-lx.patch new file mode 100644 index 00000000000..e221a174f29 --- /dev/null +++ b/queue-4.14/igb-fix-sgmii-sfp-module-discovery-for-100fx-lx.patch @@ -0,0 +1,73 @@ +From c64dd1ee23e4e54bc3974d5a64ec862668296006 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 4 Dec 2019 11:40:26 +0100 +Subject: igb: Fix SGMII SFP module discovery for 100FX/LX. + +From: Manfred Rudigier + +[ Upstream commit 5365ec1aeff5b9f2962a9c9b31d63f9dad7e0e2d ] + +Changing the link mode should also be done for 100BaseFX SGMII modules, +otherwise they just don't work when the default link mode in CTRL_EXT +coming from the EEPROM is SERDES. + +Additionally 100Base-LX SGMII SFP modules are also supported now, which +was not the case before. + +Tested with an i210 using Flexoptix S.1303.2M.G 100FX and +S.1303.10.G 100LX SGMII SFP modules. + +Signed-off-by: Manfred Rudigier +Tested-by: Aaron Brown +Signed-off-by: Jeff Kirsher +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/intel/igb/e1000_82575.c | 8 ++------ + drivers/net/ethernet/intel/igb/igb_ethtool.c | 2 +- + 2 files changed, 3 insertions(+), 7 deletions(-) + +diff --git a/drivers/net/ethernet/intel/igb/e1000_82575.c b/drivers/net/ethernet/intel/igb/e1000_82575.c +index c37cc8bccf477..158c277ec3538 100644 +--- a/drivers/net/ethernet/intel/igb/e1000_82575.c ++++ b/drivers/net/ethernet/intel/igb/e1000_82575.c +@@ -562,7 +562,7 @@ static s32 igb_set_sfp_media_type_82575(struct e1000_hw *hw) + dev_spec->module_plugged = true; + if (eth_flags->e1000_base_lx || eth_flags->e1000_base_sx) { + hw->phy.media_type = e1000_media_type_internal_serdes; +- } else if (eth_flags->e100_base_fx) { ++ } else if (eth_flags->e100_base_fx || eth_flags->e100_base_lx) { + dev_spec->sgmii_active = true; + hw->phy.media_type = e1000_media_type_internal_serdes; + } else if (eth_flags->e1000_base_t) { +@@ -689,14 +689,10 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw) + break; + } + +- /* do not change link mode for 100BaseFX */ +- if (dev_spec->eth_flags.e100_base_fx) +- break; +- + /* change current link mode setting */ + ctrl_ext &= ~E1000_CTRL_EXT_LINK_MODE_MASK; + +- if (hw->phy.media_type == e1000_media_type_copper) ++ if (dev_spec->sgmii_active) + ctrl_ext |= E1000_CTRL_EXT_LINK_MODE_SGMII; + else + ctrl_ext |= E1000_CTRL_EXT_LINK_MODE_PCIE_SERDES; +diff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c +index d06a8db514d4a..82028ce355fb1 100644 +--- a/drivers/net/ethernet/intel/igb/igb_ethtool.c ++++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c +@@ -201,7 +201,7 @@ static int igb_get_link_ksettings(struct net_device *netdev, + advertising &= ~ADVERTISED_1000baseKX_Full; + } + } +- if (eth_flags->e100_base_fx) { ++ if (eth_flags->e100_base_fx || eth_flags->e100_base_lx) { + supported |= SUPPORTED_100baseT_Full; + advertising |= ADVERTISED_100baseT_Full; + } +-- +2.20.1 + diff --git a/queue-4.14/input-aiptek-use-descriptors-of-current-altsetting.patch b/queue-4.14/input-aiptek-use-descriptors-of-current-altsetting.patch new file mode 100644 index 00000000000..2f8514aa237 --- /dev/null +++ b/queue-4.14/input-aiptek-use-descriptors-of-current-altsetting.patch @@ -0,0 +1,38 @@ +From 6d3a6800d4be737d22daa7c25e48deee21895a99 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 10 Jan 2020 11:59:52 -0800 +Subject: Input: aiptek - use descriptors of current altsetting + +From: Johan Hovold + +[ Upstream commit cfa4f6a99fb183742cace65ec551b444852b8ef6 ] + +Make sure to always use the descriptors of the current alternate setting +to avoid future issues when accessing fields that may differ between +settings. + +Signed-off-by: Johan Hovold +Acked-by: Vladis Dronov +Link: https://lore.kernel.org/r/20191210113737.4016-4-johan@kernel.org +Signed-off-by: Dmitry Torokhov +Signed-off-by: Sasha Levin +--- + drivers/input/tablet/aiptek.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/input/tablet/aiptek.c b/drivers/input/tablet/aiptek.c +index fbe2df91aad3a..838b91337cd03 100644 +--- a/drivers/input/tablet/aiptek.c ++++ b/drivers/input/tablet/aiptek.c +@@ -1733,7 +1733,7 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id) + + aiptek->inputdev = inputdev; + aiptek->intf = intf; +- aiptek->ifnum = intf->altsetting[0].desc.bInterfaceNumber; ++ aiptek->ifnum = intf->cur_altsetting->desc.bInterfaceNumber; + aiptek->inDelay = 0; + aiptek->endDelay = 0; + aiptek->previousJitterable = 0; +-- +2.20.1 + diff --git a/queue-4.14/iwlwifi-mvm-fix-nvm-check-for-3168-devices.patch b/queue-4.14/iwlwifi-mvm-fix-nvm-check-for-3168-devices.patch new file mode 100644 index 00000000000..da9eaff67a8 --- /dev/null +++ b/queue-4.14/iwlwifi-mvm-fix-nvm-check-for-3168-devices.patch @@ -0,0 +1,39 @@ +From e40beee5d2a725e6016e75b7ccbc1bc823ba7b39 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 25 Nov 2019 13:21:58 +0200 +Subject: iwlwifi: mvm: fix NVM check for 3168 devices + +From: Luca Coelho + +[ Upstream commit b3f20e098293892388d6a0491d6bbb2efb46fbff ] + +We had a check on !NVM_EXT and then a check for NVM_SDP in the else +block of this if. The else block, obviously, could only be reached if +using NVM_EXT, so it would never be NVM_SDP. + +Fix that by checking whether the nvm_type is IWL_NVM instead of +checking for !IWL_NVM_EXT to solve this issue. + +Reported-by: Stefan Sperling +Signed-off-by: Luca Coelho +Signed-off-by: Sasha Levin +--- + drivers/net/wireless/intel/iwlwifi/mvm/nvm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c b/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c +index ca2d66ce84247..8f3032b7174d3 100644 +--- a/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c ++++ b/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c +@@ -298,7 +298,7 @@ iwl_parse_nvm_sections(struct iwl_mvm *mvm) + int regulatory_type; + + /* Checking for required sections */ +- if (mvm->trans->cfg->nvm_type != IWL_NVM_EXT) { ++ if (mvm->trans->cfg->nvm_type == IWL_NVM) { + if (!mvm->nvm_sections[NVM_SECTION_TYPE_SW].data || + !mvm->nvm_sections[mvm->cfg->nvm_hw_section_num].data) { + IWL_ERR(mvm, "Can't parse empty OTP/NVM sections\n"); +-- +2.20.1 + diff --git a/queue-4.14/ixgbe-fix-calculation-of-queue-with-vfs-and-flow-dir.patch b/queue-4.14/ixgbe-fix-calculation-of-queue-with-vfs-and-flow-dir.patch new file mode 100644 index 00000000000..bb77224bf8e --- /dev/null +++ b/queue-4.14/ixgbe-fix-calculation-of-queue-with-vfs-and-flow-dir.patch @@ -0,0 +1,84 @@ +From 2f1ff15f43c9dd1f64e17974d6bc0dde666eb122 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 27 Nov 2019 17:03:55 +0800 +Subject: ixgbe: Fix calculation of queue with VFs and flow director on + interface flap + +From: Cambda Zhu + +[ Upstream commit 4fad78ad6422d9bca62135bbed8b6abc4cbb85b8 ] + +This patch fixes the calculation of queue when we restore flow director +filters after resetting adapter. In ixgbe_fdir_filter_restore(), filter's +vf may be zero which makes the queue outside of the rx_ring array. + +The calculation is changed to the same as ixgbe_add_ethtool_fdir_entry(). + +Signed-off-by: Cambda Zhu +Tested-by: Andrew Bowers +Signed-off-by: Jeff Kirsher +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 37 ++++++++++++++----- + 1 file changed, 27 insertions(+), 10 deletions(-) + +diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +index e4c1e6345edd0..ba184287e11f3 100644 +--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c ++++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +@@ -5131,7 +5131,7 @@ static void ixgbe_fdir_filter_restore(struct ixgbe_adapter *adapter) + struct ixgbe_hw *hw = &adapter->hw; + struct hlist_node *node2; + struct ixgbe_fdir_filter *filter; +- u64 action; ++ u8 queue; + + spin_lock(&adapter->fdir_perfect_lock); + +@@ -5140,17 +5140,34 @@ static void ixgbe_fdir_filter_restore(struct ixgbe_adapter *adapter) + + hlist_for_each_entry_safe(filter, node2, + &adapter->fdir_filter_list, fdir_node) { +- action = filter->action; +- if (action != IXGBE_FDIR_DROP_QUEUE && action != 0) +- action = +- (action >> ETHTOOL_RX_FLOW_SPEC_RING_VF_OFF) - 1; ++ if (filter->action == IXGBE_FDIR_DROP_QUEUE) { ++ queue = IXGBE_FDIR_DROP_QUEUE; ++ } else { ++ u32 ring = ethtool_get_flow_spec_ring(filter->action); ++ u8 vf = ethtool_get_flow_spec_ring_vf(filter->action); ++ ++ if (!vf && (ring >= adapter->num_rx_queues)) { ++ e_err(drv, "FDIR restore failed without VF, ring: %u\n", ++ ring); ++ continue; ++ } else if (vf && ++ ((vf > adapter->num_vfs) || ++ ring >= adapter->num_rx_queues_per_pool)) { ++ e_err(drv, "FDIR restore failed with VF, vf: %hhu, ring: %u\n", ++ vf, ring); ++ continue; ++ } ++ ++ /* Map the ring onto the absolute queue index */ ++ if (!vf) ++ queue = adapter->rx_ring[ring]->reg_idx; ++ else ++ queue = ((vf - 1) * ++ adapter->num_rx_queues_per_pool) + ring; ++ } + + ixgbe_fdir_write_perfect_filter_82599(hw, +- &filter->filter, +- filter->sw_idx, +- (action == IXGBE_FDIR_DROP_QUEUE) ? +- IXGBE_FDIR_DROP_QUEUE : +- adapter->rx_ring[action]->reg_idx); ++ &filter->filter, filter->sw_idx, queue); + } + + spin_unlock(&adapter->fdir_perfect_lock); +-- +2.20.1 + diff --git a/queue-4.14/ixgbevf-remove-limit-of-10-entries-for-unicast-filte.patch b/queue-4.14/ixgbevf-remove-limit-of-10-entries-for-unicast-filte.patch new file mode 100644 index 00000000000..5e7845ebc82 --- /dev/null +++ b/queue-4.14/ixgbevf-remove-limit-of-10-entries-for-unicast-filte.patch @@ -0,0 +1,42 @@ +From 89cb3bc0e125d055dc12679992633e8894c67528 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 25 Nov 2019 15:24:52 +0100 +Subject: ixgbevf: Remove limit of 10 entries for unicast filter list + +From: Radoslaw Tyl + +[ Upstream commit aa604651d523b1493988d0bf6710339f3ee60272 ] + +Currently, though the FDB entry is added to VF, it does not appear in +RAR filters. VF driver only allows to add 10 entries. Attempting to add +another causes an error. This patch removes limitation and allows use of +all free RAR entries for the FDB if needed. + +Fixes: 46ec20ff7d ("ixgbevf: Add macvlan support in the set rx mode op") +Signed-off-by: Radoslaw Tyl +Acked-by: Paul Menzel +Signed-off-by: Jeff Kirsher +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 5 ----- + 1 file changed, 5 deletions(-) + +diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +index e238f6e85ab66..a7708e14aa5ca 100644 +--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c ++++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +@@ -1858,11 +1858,6 @@ static int ixgbevf_write_uc_addr_list(struct net_device *netdev) + struct ixgbe_hw *hw = &adapter->hw; + int count = 0; + +- if ((netdev_uc_count(netdev)) > 10) { +- pr_err("Too many unicast filters - No Space\n"); +- return -ENOSPC; +- } +- + if (!netdev_uc_empty(netdev)) { + struct netdev_hw_addr *ha; + +-- +2.20.1 + diff --git a/queue-4.14/l2t_seq_next-should-increase-position-index.patch b/queue-4.14/l2t_seq_next-should-increase-position-index.patch new file mode 100644 index 00000000000..b46ddbd2094 --- /dev/null +++ b/queue-4.14/l2t_seq_next-should-increase-position-index.patch @@ -0,0 +1,37 @@ +From e0fdc32963009245b25f4c57206c3c59abb0ac73 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 23 Jan 2020 10:11:13 +0300 +Subject: l2t_seq_next should increase position index + +From: Vasily Averin + +[ Upstream commit 66018a102f7756cf72db4d2704e1b93969d9d332 ] + +if seq_file .next fuction does not change position index, +read after some lseek can generate unexpected output. + +https://bugzilla.kernel.org/show_bug.cgi?id=206283 +Signed-off-by: Vasily Averin +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/chelsio/cxgb4/l2t.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/drivers/net/ethernet/chelsio/cxgb4/l2t.c b/drivers/net/ethernet/chelsio/cxgb4/l2t.c +index f7ef8871dd0b0..67aa3c9974173 100644 +--- a/drivers/net/ethernet/chelsio/cxgb4/l2t.c ++++ b/drivers/net/ethernet/chelsio/cxgb4/l2t.c +@@ -682,8 +682,7 @@ static void *l2t_seq_start(struct seq_file *seq, loff_t *pos) + static void *l2t_seq_next(struct seq_file *seq, void *v, loff_t *pos) + { + v = l2t_get_idx(seq, *pos); +- if (v) +- ++*pos; ++ ++(*pos); + return v; + } + +-- +2.20.1 + diff --git a/queue-4.14/mac80211-fix-tkip-replay-protection-immediately-afte.patch b/queue-4.14/mac80211-fix-tkip-replay-protection-immediately-afte.patch new file mode 100644 index 00000000000..7be35d18a5c --- /dev/null +++ b/queue-4.14/mac80211-fix-tkip-replay-protection-immediately-afte.patch @@ -0,0 +1,64 @@ +From 5d0034f172aa9671d72b49253b75da7e952907c1 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 7 Jan 2020 17:35:45 +0200 +Subject: mac80211: Fix TKIP replay protection immediately after key setup + +From: Jouni Malinen + +[ Upstream commit 6f601265215a421f425ba3a4850a35861d024643 ] + +TKIP replay protection was skipped for the very first frame received +after a new key is configured. While this is potentially needed to avoid +dropping a frame in some cases, this does leave a window for replay +attacks with group-addressed frames at the station side. Any earlier +frame sent by the AP using the same key would be accepted as a valid +frame and the internal RSC would then be updated to the TSC from that +frame. This would allow multiple previously transmitted group-addressed +frames to be replayed until the next valid new group-addressed frame +from the AP is received by the station. + +Fix this by limiting the no-replay-protection exception to apply only +for the case where TSC=0, i.e., when this is for the very first frame +protected using the new key, and the local RSC had not been set to a +higher value when configuring the key (which may happen with GTK). + +Signed-off-by: Jouni Malinen +Link: https://lore.kernel.org/r/20200107153545.10934-1-j@w1.fi +Signed-off-by: Johannes Berg +Signed-off-by: Sasha Levin +--- + net/mac80211/tkip.c | 18 +++++++++++++++--- + 1 file changed, 15 insertions(+), 3 deletions(-) + +diff --git a/net/mac80211/tkip.c b/net/mac80211/tkip.c +index b3622823bad23..ebd66e8f46b3f 100644 +--- a/net/mac80211/tkip.c ++++ b/net/mac80211/tkip.c +@@ -266,9 +266,21 @@ int ieee80211_tkip_decrypt_data(struct crypto_cipher *tfm, + if ((keyid >> 6) != key->conf.keyidx) + return TKIP_DECRYPT_INVALID_KEYIDX; + +- if (rx_ctx->ctx.state != TKIP_STATE_NOT_INIT && +- (iv32 < rx_ctx->iv32 || +- (iv32 == rx_ctx->iv32 && iv16 <= rx_ctx->iv16))) ++ /* Reject replays if the received TSC is smaller than or equal to the ++ * last received value in a valid message, but with an exception for ++ * the case where a new key has been set and no valid frame using that ++ * key has yet received and the local RSC was initialized to 0. This ++ * exception allows the very first frame sent by the transmitter to be ++ * accepted even if that transmitter were to use TSC 0 (IEEE 802.11 ++ * described TSC to be initialized to 1 whenever a new key is taken into ++ * use). ++ */ ++ if (iv32 < rx_ctx->iv32 || ++ (iv32 == rx_ctx->iv32 && ++ (iv16 < rx_ctx->iv16 || ++ (iv16 == rx_ctx->iv16 && ++ (rx_ctx->iv32 || rx_ctx->iv16 || ++ rx_ctx->ctx.state != TKIP_STATE_NOT_INIT))))) + return TKIP_DECRYPT_REPLAY; + + if (only_iv) { +-- +2.20.1 + diff --git a/queue-4.14/mac80211-mesh-restrict-airtime-metric-to-peered-esta.patch b/queue-4.14/mac80211-mesh-restrict-airtime-metric-to-peered-esta.patch new file mode 100644 index 00000000000..594dff75439 --- /dev/null +++ b/queue-4.14/mac80211-mesh-restrict-airtime-metric-to-peered-esta.patch @@ -0,0 +1,55 @@ +From 63847a7a13d9c2ff7970ffb6b697f52df290ea58 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 3 Dec 2019 19:06:44 +0100 +Subject: mac80211: mesh: restrict airtime metric to peered established plinks + +From: Markus Theil + +[ Upstream commit 02a614499600af836137c3fbc4404cd96365fff2 ] + +The following warning is triggered every time an unestablished mesh peer +gets dumped. Checks if a peer link is established before retrieving the +airtime link metric. + +[ 9563.022567] WARNING: CPU: 0 PID: 6287 at net/mac80211/mesh_hwmp.c:345 + airtime_link_metric_get+0xa2/0xb0 [mac80211] +[ 9563.022697] Hardware name: PC Engines apu2/apu2, BIOS v4.10.0.3 +[ 9563.022756] RIP: 0010:airtime_link_metric_get+0xa2/0xb0 [mac80211] +[ 9563.022838] Call Trace: +[ 9563.022897] sta_set_sinfo+0x936/0xa10 [mac80211] +[ 9563.022964] ieee80211_dump_station+0x6d/0x90 [mac80211] +[ 9563.023062] nl80211_dump_station+0x154/0x2a0 [cfg80211] +[ 9563.023120] netlink_dump+0x17b/0x370 +[ 9563.023130] netlink_recvmsg+0x2a4/0x480 +[ 9563.023140] ____sys_recvmsg+0xa6/0x160 +[ 9563.023154] ___sys_recvmsg+0x93/0xe0 +[ 9563.023169] __sys_recvmsg+0x7e/0xd0 +[ 9563.023210] do_syscall_64+0x4e/0x140 +[ 9563.023217] entry_SYSCALL_64_after_hwframe+0x44/0xa9 + +Signed-off-by: Markus Theil +Link: https://lore.kernel.org/r/20191203180644.70653-1-markus.theil@tu-ilmenau.de +[rewrite commit message] +Signed-off-by: Johannes Berg +Signed-off-by: Sasha Levin +--- + net/mac80211/mesh_hwmp.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c +index fab0764c315fe..994dde6e5f9d9 100644 +--- a/net/mac80211/mesh_hwmp.c ++++ b/net/mac80211/mesh_hwmp.c +@@ -326,6 +326,9 @@ static u32 airtime_link_metric_get(struct ieee80211_local *local, + unsigned long fail_avg = + ewma_mesh_fail_avg_read(&sta->mesh->fail_avg); + ++ if (sta->mesh->plink_state != NL80211_PLINK_ESTAB) ++ return MAX_METRIC; ++ + /* Try to get rate based on HW/SW RC algorithm. + * Rate is returned in units of Kbps, correct this + * to comply with airtime calculation units +-- +2.20.1 + diff --git a/queue-4.14/net-dsa-bcm_sf2-configure-imp-port-for-2gb-sec.patch b/queue-4.14/net-dsa-bcm_sf2-configure-imp-port-for-2gb-sec.patch new file mode 100644 index 00000000000..9baa30dd27c --- /dev/null +++ b/queue-4.14/net-dsa-bcm_sf2-configure-imp-port-for-2gb-sec.patch @@ -0,0 +1,39 @@ +From 9e8d254a0f4fd38df6aba7368617b8dc13a42eda Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 16 Jan 2020 12:55:48 -0800 +Subject: net: dsa: bcm_sf2: Configure IMP port for 2Gb/sec + +From: Florian Fainelli + +[ Upstream commit 8f1880cbe8d0d49ebb7e9ae409b3b96676e5aa97 ] + +With the implementation of the system reset controller we lost a setting +that is currently applied by the bootloader and which configures the IMP +port for 2Gb/sec, the default is 1Gb/sec. This is needed given the +number of ports and applications we expect to run so bring back that +setting. + +Fixes: 01b0ac07589e ("net: dsa: bcm_sf2: Add support for optional reset controller line") +Signed-off-by: Florian Fainelli +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/dsa/bcm_sf2.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c +index 94ad2fdd6ef0d..05440b7272615 100644 +--- a/drivers/net/dsa/bcm_sf2.c ++++ b/drivers/net/dsa/bcm_sf2.c +@@ -137,7 +137,7 @@ static void bcm_sf2_imp_setup(struct dsa_switch *ds, int port) + + /* Force link status for IMP port */ + reg = core_readl(priv, offset); +- reg |= (MII_SW_OR | LINK_STS); ++ reg |= (MII_SW_OR | LINK_STS | GMII_SPEED_UP_2G); + core_writel(priv, reg, offset); + + /* Enable Broadcast, Multicast, Unicast forwarding to IMP port */ +-- +2.20.1 + diff --git a/queue-4.14/net-fix-skb-csum-update-in-inet_proto_csum_replace16.patch b/queue-4.14/net-fix-skb-csum-update-in-inet_proto_csum_replace16.patch new file mode 100644 index 00000000000..0096ec3013e --- /dev/null +++ b/queue-4.14/net-fix-skb-csum-update-in-inet_proto_csum_replace16.patch @@ -0,0 +1,73 @@ +From 6f4aad1b08c66d78c1c2fed1782f0472de3bb6fb Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 23 Jan 2020 12:33:28 -0800 +Subject: net: Fix skb->csum update in inet_proto_csum_replace16(). + +From: Praveen Chaudhary + +[ Upstream commit 189c9b1e94539b11c80636bc13e9cf47529e7bba ] + +skb->csum is updated incorrectly, when manipulation for +NF_NAT_MANIP_SRC\DST is done on IPV6 packet. + +Fix: +There is no need to update skb->csum in inet_proto_csum_replace16(), +because update in two fields a.) IPv6 src/dst address and b.) L4 header +checksum cancels each other for skb->csum calculation. Whereas +inet_proto_csum_replace4 function needs to update skb->csum, because +update in 3 fields a.) IPv4 src/dst address, b.) IPv4 Header checksum +and c.) L4 header checksum results in same diff as L4 Header checksum +for skb->csum calculation. + +[ pablo@netfilter.org: a few comestic documentation edits ] +Signed-off-by: Praveen Chaudhary +Signed-off-by: Zhenggen Xu +Signed-off-by: Andy Stracner +Reviewed-by: Florian Westphal +Signed-off-by: Pablo Neira Ayuso +Signed-off-by: Sasha Levin +--- + net/core/utils.c | 20 +++++++++++++++++--- + 1 file changed, 17 insertions(+), 3 deletions(-) + +diff --git a/net/core/utils.c b/net/core/utils.c +index 93066bd0305ab..b1823e76b8772 100644 +--- a/net/core/utils.c ++++ b/net/core/utils.c +@@ -419,6 +419,23 @@ void inet_proto_csum_replace4(__sum16 *sum, struct sk_buff *skb, + } + EXPORT_SYMBOL(inet_proto_csum_replace4); + ++/** ++ * inet_proto_csum_replace16 - update layer 4 header checksum field ++ * @sum: Layer 4 header checksum field ++ * @skb: sk_buff for the packet ++ * @from: old IPv6 address ++ * @to: new IPv6 address ++ * @pseudohdr: True if layer 4 header checksum includes pseudoheader ++ * ++ * Update layer 4 header as per the update in IPv6 src/dst address. ++ * ++ * There is no need to update skb->csum in this function, because update in two ++ * fields a.) IPv6 src/dst address and b.) L4 header checksum cancels each other ++ * for skb->csum calculation. Whereas inet_proto_csum_replace4 function needs to ++ * update skb->csum, because update in 3 fields a.) IPv4 src/dst address, ++ * b.) IPv4 Header checksum and c.) L4 header checksum results in same diff as ++ * L4 Header checksum for skb->csum calculation. ++ */ + void inet_proto_csum_replace16(__sum16 *sum, struct sk_buff *skb, + const __be32 *from, const __be32 *to, + bool pseudohdr) +@@ -430,9 +447,6 @@ void inet_proto_csum_replace16(__sum16 *sum, struct sk_buff *skb, + if (skb->ip_summed != CHECKSUM_PARTIAL) { + *sum = csum_fold(csum_partial(diff, sizeof(diff), + ~csum_unfold(*sum))); +- if (skb->ip_summed == CHECKSUM_COMPLETE && pseudohdr) +- skb->csum = ~csum_partial(diff, sizeof(diff), +- ~skb->csum); + } else if (pseudohdr) + *sum = ~csum_fold(csum_partial(diff, sizeof(diff), + csum_unfold(*sum))); +-- +2.20.1 + diff --git a/queue-4.14/net-fsl-fman-rename-if_mode_xgmii-to-if_mode_10g.patch b/queue-4.14/net-fsl-fman-rename-if_mode_xgmii-to-if_mode_10g.patch new file mode 100644 index 00000000000..d65edf3a5b8 --- /dev/null +++ b/queue-4.14/net-fsl-fman-rename-if_mode_xgmii-to-if_mode_10g.patch @@ -0,0 +1,46 @@ +From 31410149c553eda6beb83d702b2a4e5dd2fde462 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 22 Jan 2020 16:15:14 +0200 +Subject: net: fsl/fman: rename IF_MODE_XGMII to IF_MODE_10G + +From: Madalin Bucur + +[ Upstream commit 457bfc0a4bf531487ecc3cf82ec728a5e114fb1e ] + +As the only 10G PHY interface type defined at the moment the code +was developed was XGMII, although the PHY interface mode used was +not XGMII, XGMII was used in the code to denote 10G. This patch +renames the 10G interface mode to remove the ambiguity. + +Signed-off-by: Madalin Bucur +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/freescale/fman/fman_memac.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/net/ethernet/freescale/fman/fman_memac.c b/drivers/net/ethernet/freescale/fman/fman_memac.c +index 75ce773c21a62..b33650a897f18 100644 +--- a/drivers/net/ethernet/freescale/fman/fman_memac.c ++++ b/drivers/net/ethernet/freescale/fman/fman_memac.c +@@ -110,7 +110,7 @@ do { \ + /* Interface Mode Register (IF_MODE) */ + + #define IF_MODE_MASK 0x00000003 /* 30-31 Mask on i/f mode bits */ +-#define IF_MODE_XGMII 0x00000000 /* 30-31 XGMII (10G) interface */ ++#define IF_MODE_10G 0x00000000 /* 30-31 10G interface */ + #define IF_MODE_GMII 0x00000002 /* 30-31 GMII (1G) interface */ + #define IF_MODE_RGMII 0x00000004 + #define IF_MODE_RGMII_AUTO 0x00008000 +@@ -439,7 +439,7 @@ static int init(struct memac_regs __iomem *regs, struct memac_cfg *cfg, + tmp = 0; + switch (phy_if) { + case PHY_INTERFACE_MODE_XGMII: +- tmp |= IF_MODE_XGMII; ++ tmp |= IF_MODE_10G; + break; + default: + tmp |= IF_MODE_GMII; +-- +2.20.1 + diff --git a/queue-4.14/net-fsl-treat-fsl-erratum-a011043.patch b/queue-4.14/net-fsl-treat-fsl-erratum-a011043.patch new file mode 100644 index 00000000000..34c47860462 --- /dev/null +++ b/queue-4.14/net-fsl-treat-fsl-erratum-a011043.patch @@ -0,0 +1,59 @@ +From c2a5973cfb7cf36216b08c4b0393a27f37e8bcf0 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 22 Jan 2020 15:20:29 +0200 +Subject: net/fsl: treat fsl,erratum-a011043 + +From: Madalin Bucur + +[ Upstream commit 1d3ca681b9d9575ccf696ebc2840a1ebb1fd4074 ] + +When fsl,erratum-a011043 is set, adjust for erratum A011043: +MDIO reads to internal PCS registers may result in having +the MDIO_CFG[MDIO_RD_ER] bit set, even when there is no +error and read data (MDIO_DATA[MDIO_DATA]) is correct. +Software may get false read error when reading internal +PCS registers through MDIO. As a workaround, all internal +MDIO accesses should ignore the MDIO_CFG[MDIO_RD_ER] bit. + +Signed-off-by: Madalin Bucur +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/freescale/xgmac_mdio.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/ethernet/freescale/xgmac_mdio.c b/drivers/net/ethernet/freescale/xgmac_mdio.c +index e03b30c60dcfd..c82c85ef5fb34 100644 +--- a/drivers/net/ethernet/freescale/xgmac_mdio.c ++++ b/drivers/net/ethernet/freescale/xgmac_mdio.c +@@ -49,6 +49,7 @@ struct tgec_mdio_controller { + struct mdio_fsl_priv { + struct tgec_mdio_controller __iomem *mdio_base; + bool is_little_endian; ++ bool has_a011043; + }; + + static u32 xgmac_read32(void __iomem *regs, +@@ -226,7 +227,8 @@ static int xgmac_mdio_read(struct mii_bus *bus, int phy_id, int regnum) + return ret; + + /* Return all Fs if nothing was there */ +- if (xgmac_read32(®s->mdio_stat, endian) & MDIO_STAT_RD_ER) { ++ if ((xgmac_read32(®s->mdio_stat, endian) & MDIO_STAT_RD_ER) && ++ !priv->has_a011043) { + dev_err(&bus->dev, + "Error while reading PHY%d reg at %d.%hhu\n", + phy_id, dev_addr, regnum); +@@ -274,6 +276,9 @@ static int xgmac_mdio_probe(struct platform_device *pdev) + priv->is_little_endian = of_property_read_bool(pdev->dev.of_node, + "little-endian"); + ++ priv->has_a011043 = of_property_read_bool(pdev->dev.of_node, ++ "fsl,erratum-a011043"); ++ + ret = of_mdiobus_register(bus, np); + if (ret) { + dev_err(&pdev->dev, "cannot register MDIO bus\n"); +-- +2.20.1 + diff --git a/queue-4.14/net-sonic-add-mutual-exclusion-for-accessing-shared-.patch b/queue-4.14/net-sonic-add-mutual-exclusion-for-accessing-shared-.patch new file mode 100644 index 00000000000..de8e415d11a --- /dev/null +++ b/queue-4.14/net-sonic-add-mutual-exclusion-for-accessing-shared-.patch @@ -0,0 +1,158 @@ +From ad3a955cf715994d70cf8b1feb95ea58164d2ffc Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 23 Jan 2020 09:07:26 +1100 +Subject: net/sonic: Add mutual exclusion for accessing shared state + +From: Finn Thain + +[ Upstream commit 865ad2f2201dc18685ba2686f13217f8b3a9c52c ] + +The netif_stop_queue() call in sonic_send_packet() races with the +netif_wake_queue() call in sonic_interrupt(). This causes issues +like "NETDEV WATCHDOG: eth0 (macsonic): transmit queue 0 timed out". +Fix this by disabling interrupts when accessing tx_skb[] and next_tx. +Update a comment to clarify the synchronization properties. + +Fixes: efcce839360f ("[PATCH] macsonic/jazzsonic network drivers update") +Tested-by: Stan Johnson +Signed-off-by: Finn Thain +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/natsemi/sonic.c | 49 ++++++++++++++++++++-------- + drivers/net/ethernet/natsemi/sonic.h | 1 + + 2 files changed, 36 insertions(+), 14 deletions(-) + +diff --git a/drivers/net/ethernet/natsemi/sonic.c b/drivers/net/ethernet/natsemi/sonic.c +index a051dddcbd768..7aa7f8050d44e 100644 +--- a/drivers/net/ethernet/natsemi/sonic.c ++++ b/drivers/net/ethernet/natsemi/sonic.c +@@ -50,6 +50,8 @@ static int sonic_open(struct net_device *dev) + if (sonic_debug > 2) + printk("sonic_open: initializing sonic driver.\n"); + ++ spin_lock_init(&lp->lock); ++ + for (i = 0; i < SONIC_NUM_RRS; i++) { + struct sk_buff *skb = netdev_alloc_skb(dev, SONIC_RBSIZE + 2); + if (skb == NULL) { +@@ -194,8 +196,6 @@ static void sonic_tx_timeout(struct net_device *dev) + * wake the tx queue + * Concurrently with all of this, the SONIC is potentially writing to + * the status flags of the TDs. +- * Until some mutual exclusion is added, this code will not work with SMP. However, +- * MIPS Jazz machines and m68k Macs were all uni-processor machines. + */ + + static int sonic_send_packet(struct sk_buff *skb, struct net_device *dev) +@@ -203,7 +203,8 @@ static int sonic_send_packet(struct sk_buff *skb, struct net_device *dev) + struct sonic_local *lp = netdev_priv(dev); + dma_addr_t laddr; + int length; +- int entry = lp->next_tx; ++ int entry; ++ unsigned long flags; + + if (sonic_debug > 2) + printk("sonic_send_packet: skb=%p, dev=%p\n", skb, dev); +@@ -226,6 +227,10 @@ static int sonic_send_packet(struct sk_buff *skb, struct net_device *dev) + return NETDEV_TX_OK; + } + ++ spin_lock_irqsave(&lp->lock, flags); ++ ++ entry = lp->next_tx; ++ + sonic_tda_put(dev, entry, SONIC_TD_STATUS, 0); /* clear status */ + sonic_tda_put(dev, entry, SONIC_TD_FRAG_COUNT, 1); /* single fragment */ + sonic_tda_put(dev, entry, SONIC_TD_PKTSIZE, length); /* length of packet */ +@@ -235,10 +240,6 @@ static int sonic_send_packet(struct sk_buff *skb, struct net_device *dev) + sonic_tda_put(dev, entry, SONIC_TD_LINK, + sonic_tda_get(dev, entry, SONIC_TD_LINK) | SONIC_EOL); + +- /* +- * Must set tx_skb[entry] only after clearing status, and +- * before clearing EOL and before stopping queue +- */ + wmb(); + lp->tx_len[entry] = length; + lp->tx_laddr[entry] = laddr; +@@ -263,6 +264,8 @@ static int sonic_send_packet(struct sk_buff *skb, struct net_device *dev) + + SONIC_WRITE(SONIC_CMD, SONIC_CR_TXP); + ++ spin_unlock_irqrestore(&lp->lock, flags); ++ + return NETDEV_TX_OK; + } + +@@ -275,9 +278,21 @@ static irqreturn_t sonic_interrupt(int irq, void *dev_id) + struct net_device *dev = dev_id; + struct sonic_local *lp = netdev_priv(dev); + int status; ++ unsigned long flags; ++ ++ /* The lock has two purposes. Firstly, it synchronizes sonic_interrupt() ++ * with sonic_send_packet() so that the two functions can share state. ++ * Secondly, it makes sonic_interrupt() re-entrant, as that is required ++ * by macsonic which must use two IRQs with different priority levels. ++ */ ++ spin_lock_irqsave(&lp->lock, flags); ++ ++ status = SONIC_READ(SONIC_ISR) & SONIC_IMR_DEFAULT; ++ if (!status) { ++ spin_unlock_irqrestore(&lp->lock, flags); + +- if (!(status = SONIC_READ(SONIC_ISR) & SONIC_IMR_DEFAULT)) + return IRQ_NONE; ++ } + + do { + if (status & SONIC_INT_PKTRX) { +@@ -292,11 +307,12 @@ static irqreturn_t sonic_interrupt(int irq, void *dev_id) + int td_status; + int freed_some = 0; + +- /* At this point, cur_tx is the index of a TD that is one of: +- * unallocated/freed (status set & tx_skb[entry] clear) +- * allocated and sent (status set & tx_skb[entry] set ) +- * allocated and not yet sent (status clear & tx_skb[entry] set ) +- * still being allocated by sonic_send_packet (status clear & tx_skb[entry] clear) ++ /* The state of a Transmit Descriptor may be inferred ++ * from { tx_skb[entry], td_status } as follows. ++ * { clear, clear } => the TD has never been used ++ * { set, clear } => the TD was handed to SONIC ++ * { set, set } => the TD was handed back ++ * { clear, set } => the TD is available for re-use + */ + + if (sonic_debug > 2) +@@ -398,7 +414,12 @@ static irqreturn_t sonic_interrupt(int irq, void *dev_id) + /* load CAM done */ + if (status & SONIC_INT_LCD) + SONIC_WRITE(SONIC_ISR, SONIC_INT_LCD); /* clear the interrupt */ +- } while((status = SONIC_READ(SONIC_ISR) & SONIC_IMR_DEFAULT)); ++ ++ status = SONIC_READ(SONIC_ISR) & SONIC_IMR_DEFAULT; ++ } while (status); ++ ++ spin_unlock_irqrestore(&lp->lock, flags); ++ + return IRQ_HANDLED; + } + +diff --git a/drivers/net/ethernet/natsemi/sonic.h b/drivers/net/ethernet/natsemi/sonic.h +index 421b1a283feda..944f4830c4a1d 100644 +--- a/drivers/net/ethernet/natsemi/sonic.h ++++ b/drivers/net/ethernet/natsemi/sonic.h +@@ -321,6 +321,7 @@ struct sonic_local { + unsigned int next_tx; /* next free TD */ + struct device *device; /* generic device */ + struct net_device_stats stats; ++ spinlock_t lock; + }; + + #define TX_TIMEOUT (3 * HZ) +-- +2.20.1 + diff --git a/queue-4.14/net-sonic-fix-receive-buffer-handling.patch b/queue-4.14/net-sonic-fix-receive-buffer-handling.patch new file mode 100644 index 00000000000..116e2180c5f --- /dev/null +++ b/queue-4.14/net-sonic-fix-receive-buffer-handling.patch @@ -0,0 +1,116 @@ +From 7693ccebaecc47ca5e26940b2a9a64edfa18f806 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 23 Jan 2020 09:07:26 +1100 +Subject: net/sonic: Fix receive buffer handling + +From: Finn Thain + +[ Upstream commit 9e311820f67e740f4fb8dcb82b4c4b5b05bdd1a5 ] + +The SONIC can sometimes advance its rx buffer pointer (RRP register) +without advancing its rx descriptor pointer (CRDA register). As a result +the index of the current rx descriptor may not equal that of the current +rx buffer. The driver mistakenly assumes that they are always equal. +This assumption leads to incorrect packet lengths and possible packet +duplication. Avoid this by calling a new function to locate the buffer +corresponding to a given descriptor. + +Fixes: efcce839360f ("[PATCH] macsonic/jazzsonic network drivers update") +Tested-by: Stan Johnson +Signed-off-by: Finn Thain +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/natsemi/sonic.c | 35 ++++++++++++++++++++++++---- + drivers/net/ethernet/natsemi/sonic.h | 5 ++-- + 2 files changed, 33 insertions(+), 7 deletions(-) + +diff --git a/drivers/net/ethernet/natsemi/sonic.c b/drivers/net/ethernet/natsemi/sonic.c +index 7aa7f8050d44e..b6599aa22504f 100644 +--- a/drivers/net/ethernet/natsemi/sonic.c ++++ b/drivers/net/ethernet/natsemi/sonic.c +@@ -423,6 +423,21 @@ static irqreturn_t sonic_interrupt(int irq, void *dev_id) + return IRQ_HANDLED; + } + ++/* Return the array index corresponding to a given Receive Buffer pointer. */ ++static int index_from_addr(struct sonic_local *lp, dma_addr_t addr, ++ unsigned int last) ++{ ++ unsigned int i = last; ++ ++ do { ++ i = (i + 1) & SONIC_RRS_MASK; ++ if (addr == lp->rx_laddr[i]) ++ return i; ++ } while (i != last); ++ ++ return -ENOENT; ++} ++ + /* + * We have a good packet(s), pass it/them up the network stack. + */ +@@ -442,6 +457,16 @@ static void sonic_rx(struct net_device *dev) + + status = sonic_rda_get(dev, entry, SONIC_RD_STATUS); + if (status & SONIC_RCR_PRX) { ++ u32 addr = (sonic_rda_get(dev, entry, ++ SONIC_RD_PKTPTR_H) << 16) | ++ sonic_rda_get(dev, entry, SONIC_RD_PKTPTR_L); ++ int i = index_from_addr(lp, addr, entry); ++ ++ if (i < 0) { ++ WARN_ONCE(1, "failed to find buffer!\n"); ++ break; ++ } ++ + /* Malloc up new buffer. */ + new_skb = netdev_alloc_skb(dev, SONIC_RBSIZE + 2); + if (new_skb == NULL) { +@@ -463,7 +488,7 @@ static void sonic_rx(struct net_device *dev) + + /* now we have a new skb to replace it, pass the used one up the stack */ + dma_unmap_single(lp->device, lp->rx_laddr[entry], SONIC_RBSIZE, DMA_FROM_DEVICE); +- used_skb = lp->rx_skb[entry]; ++ used_skb = lp->rx_skb[i]; + pkt_len = sonic_rda_get(dev, entry, SONIC_RD_PKTLEN); + skb_trim(used_skb, pkt_len); + used_skb->protocol = eth_type_trans(used_skb, dev); +@@ -472,13 +497,13 @@ static void sonic_rx(struct net_device *dev) + lp->stats.rx_bytes += pkt_len; + + /* and insert the new skb */ +- lp->rx_laddr[entry] = new_laddr; +- lp->rx_skb[entry] = new_skb; ++ lp->rx_laddr[i] = new_laddr; ++ lp->rx_skb[i] = new_skb; + + bufadr_l = (unsigned long)new_laddr & 0xffff; + bufadr_h = (unsigned long)new_laddr >> 16; +- sonic_rra_put(dev, entry, SONIC_RR_BUFADR_L, bufadr_l); +- sonic_rra_put(dev, entry, SONIC_RR_BUFADR_H, bufadr_h); ++ sonic_rra_put(dev, i, SONIC_RR_BUFADR_L, bufadr_l); ++ sonic_rra_put(dev, i, SONIC_RR_BUFADR_H, bufadr_h); + } else { + /* This should only happen, if we enable accepting broken packets. */ + lp->stats.rx_errors++; +diff --git a/drivers/net/ethernet/natsemi/sonic.h b/drivers/net/ethernet/natsemi/sonic.h +index 7057760cb55c6..83905eee6960c 100644 +--- a/drivers/net/ethernet/natsemi/sonic.h ++++ b/drivers/net/ethernet/natsemi/sonic.h +@@ -274,8 +274,9 @@ + #define SONIC_NUM_RDS SONIC_NUM_RRS /* number of receive descriptors */ + #define SONIC_NUM_TDS 16 /* number of transmit descriptors */ + +-#define SONIC_RDS_MASK (SONIC_NUM_RDS-1) +-#define SONIC_TDS_MASK (SONIC_NUM_TDS-1) ++#define SONIC_RRS_MASK (SONIC_NUM_RRS - 1) ++#define SONIC_RDS_MASK (SONIC_NUM_RDS - 1) ++#define SONIC_TDS_MASK (SONIC_NUM_TDS - 1) + + #define SONIC_RBSIZE 1520 /* size of one resource buffer */ + +-- +2.20.1 + diff --git a/queue-4.14/net-sonic-quiesce-sonic-before-re-initializing-descr.patch b/queue-4.14/net-sonic-quiesce-sonic-before-re-initializing-descr.patch new file mode 100644 index 00000000000..656a64ec563 --- /dev/null +++ b/queue-4.14/net-sonic-quiesce-sonic-before-re-initializing-descr.patch @@ -0,0 +1,97 @@ +From 653e0434f3d2b1ba50b12ff5bacfed1e739256ef Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 23 Jan 2020 09:07:26 +1100 +Subject: net/sonic: Quiesce SONIC before re-initializing descriptor memory + +From: Finn Thain + +[ Upstream commit 3f4b7e6a2be982fd8820a2b54d46dd9c351db899 ] + +Make sure the SONIC's DMA engine is idle before altering the transmit +and receive descriptors. Add a helper for this as it will be needed +again. + +Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") +Tested-by: Stan Johnson +Signed-off-by: Finn Thain +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/natsemi/sonic.c | 25 +++++++++++++++++++++++++ + drivers/net/ethernet/natsemi/sonic.h | 3 +++ + 2 files changed, 28 insertions(+) + +diff --git a/drivers/net/ethernet/natsemi/sonic.c b/drivers/net/ethernet/natsemi/sonic.c +index b6599aa22504f..254e6dbc4c6aa 100644 +--- a/drivers/net/ethernet/natsemi/sonic.c ++++ b/drivers/net/ethernet/natsemi/sonic.c +@@ -103,6 +103,24 @@ static int sonic_open(struct net_device *dev) + return 0; + } + ++/* Wait for the SONIC to become idle. */ ++static void sonic_quiesce(struct net_device *dev, u16 mask) ++{ ++ struct sonic_local * __maybe_unused lp = netdev_priv(dev); ++ int i; ++ u16 bits; ++ ++ for (i = 0; i < 1000; ++i) { ++ bits = SONIC_READ(SONIC_CMD) & mask; ++ if (!bits) ++ return; ++ if (irqs_disabled() || in_interrupt()) ++ udelay(20); ++ else ++ usleep_range(100, 200); ++ } ++ WARN_ONCE(1, "command deadline expired! 0x%04x\n", bits); ++} + + /* + * Close the SONIC device +@@ -120,6 +138,9 @@ static int sonic_close(struct net_device *dev) + /* + * stop the SONIC, disable interrupts + */ ++ SONIC_WRITE(SONIC_CMD, SONIC_CR_RXDIS); ++ sonic_quiesce(dev, SONIC_CR_ALL); ++ + SONIC_WRITE(SONIC_IMR, 0); + SONIC_WRITE(SONIC_ISR, 0x7fff); + SONIC_WRITE(SONIC_CMD, SONIC_CR_RST); +@@ -159,6 +180,9 @@ static void sonic_tx_timeout(struct net_device *dev) + * put the Sonic into software-reset mode and + * disable all interrupts before releasing DMA buffers + */ ++ SONIC_WRITE(SONIC_CMD, SONIC_CR_RXDIS); ++ sonic_quiesce(dev, SONIC_CR_ALL); ++ + SONIC_WRITE(SONIC_IMR, 0); + SONIC_WRITE(SONIC_ISR, 0x7fff); + SONIC_WRITE(SONIC_CMD, SONIC_CR_RST); +@@ -638,6 +662,7 @@ static int sonic_init(struct net_device *dev) + */ + SONIC_WRITE(SONIC_CMD, 0); + SONIC_WRITE(SONIC_CMD, SONIC_CR_RXDIS); ++ sonic_quiesce(dev, SONIC_CR_ALL); + + /* + * initialize the receive resource area +diff --git a/drivers/net/ethernet/natsemi/sonic.h b/drivers/net/ethernet/natsemi/sonic.h +index 83905eee6960c..7dc011655e70a 100644 +--- a/drivers/net/ethernet/natsemi/sonic.h ++++ b/drivers/net/ethernet/natsemi/sonic.h +@@ -110,6 +110,9 @@ + #define SONIC_CR_TXP 0x0002 + #define SONIC_CR_HTX 0x0001 + ++#define SONIC_CR_ALL (SONIC_CR_LCAM | SONIC_CR_RRRA | \ ++ SONIC_CR_RXEN | SONIC_CR_TXP) ++ + /* + * SONIC data configuration bits + */ +-- +2.20.1 + diff --git a/queue-4.14/net-sonic-use-mmio-accessors.patch b/queue-4.14/net-sonic-use-mmio-accessors.patch new file mode 100644 index 00000000000..ad6931f6121 --- /dev/null +++ b/queue-4.14/net-sonic-use-mmio-accessors.patch @@ -0,0 +1,69 @@ +From 0e763a27927aaffe660a84fe521a2321c265007d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 23 Jan 2020 09:07:26 +1100 +Subject: net/sonic: Use MMIO accessors + +From: Finn Thain + +[ Upstream commit e3885f576196ddfc670b3d53e745de96ffcb49ab ] + +The driver accesses descriptor memory which is simultaneously accessed by +the chip, so the compiler must not be allowed to re-order CPU accesses. +sonic_buf_get() used 'volatile' to prevent that. sonic_buf_put() should +have done so too but was overlooked. + +Fixes: efcce839360f ("[PATCH] macsonic/jazzsonic network drivers update") +Tested-by: Stan Johnson +Signed-off-by: Finn Thain +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/natsemi/sonic.h | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/drivers/net/ethernet/natsemi/sonic.h b/drivers/net/ethernet/natsemi/sonic.h +index 944f4830c4a1d..7057760cb55c6 100644 +--- a/drivers/net/ethernet/natsemi/sonic.h ++++ b/drivers/net/ethernet/natsemi/sonic.h +@@ -343,30 +343,30 @@ static void sonic_tx_timeout(struct net_device *dev); + as far as we can tell. */ + /* OpenBSD calls this "SWO". I'd like to think that sonic_buf_put() + is a much better name. */ +-static inline void sonic_buf_put(void* base, int bitmode, ++static inline void sonic_buf_put(u16 *base, int bitmode, + int offset, __u16 val) + { + if (bitmode) + #ifdef __BIG_ENDIAN +- ((__u16 *) base + (offset*2))[1] = val; ++ __raw_writew(val, base + (offset * 2) + 1); + #else +- ((__u16 *) base + (offset*2))[0] = val; ++ __raw_writew(val, base + (offset * 2) + 0); + #endif + else +- ((__u16 *) base)[offset] = val; ++ __raw_writew(val, base + (offset * 1) + 0); + } + +-static inline __u16 sonic_buf_get(void* base, int bitmode, ++static inline __u16 sonic_buf_get(u16 *base, int bitmode, + int offset) + { + if (bitmode) + #ifdef __BIG_ENDIAN +- return ((volatile __u16 *) base + (offset*2))[1]; ++ return __raw_readw(base + (offset * 2) + 1); + #else +- return ((volatile __u16 *) base + (offset*2))[0]; ++ return __raw_readw(base + (offset * 2) + 0); + #endif + else +- return ((volatile __u16 *) base)[offset]; ++ return __raw_readw(base + (offset * 1) + 0); + } + + /* Inlines that you should actually use for reading/writing DMA buffers */ +-- +2.20.1 + diff --git a/queue-4.14/powerpc-fsl-dts-add-fsl-erratum-a011043.patch b/queue-4.14/powerpc-fsl-dts-add-fsl-erratum-a011043.patch new file mode 100644 index 00000000000..15485a1511d --- /dev/null +++ b/queue-4.14/powerpc-fsl-dts-add-fsl-erratum-a011043.patch @@ -0,0 +1,257 @@ +From 5189ff3b7d946b3cca655a3037ee9b87a617fbf3 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 22 Jan 2020 15:20:28 +0200 +Subject: powerpc/fsl/dts: add fsl,erratum-a011043 + +From: Madalin Bucur + +[ Upstream commit 73d527aef68f7644e59f22ce7f9ac75e7b533aea ] + +Add fsl,erratum-a011043 to internal MDIO buses. +Software may get false read error when reading internal +PCS registers through MDIO. As a workaround, all internal +MDIO accesses should ignore the MDIO_CFG[MDIO_RD_ER] bit. + +Signed-off-by: Madalin Bucur +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-0-best-effort.dtsi | 1 + + arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-0.dtsi | 1 + + arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-1-best-effort.dtsi | 1 + + arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-1.dtsi | 1 + + arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-0.dtsi | 1 + + arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-1.dtsi | 1 + + arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-2.dtsi | 1 + + arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-3.dtsi | 1 + + arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-4.dtsi | 1 + + arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-5.dtsi | 1 + + arch/powerpc/boot/dts/fsl/qoriq-fman3-1-10g-0.dtsi | 1 + + arch/powerpc/boot/dts/fsl/qoriq-fman3-1-10g-1.dtsi | 1 + + arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-0.dtsi | 1 + + arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-1.dtsi | 1 + + arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-2.dtsi | 1 + + arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-3.dtsi | 1 + + arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-4.dtsi | 1 + + arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-5.dtsi | 1 + + 18 files changed, 18 insertions(+) + +diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-0-best-effort.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-0-best-effort.dtsi +index e1a961f05dcd5..baa0c503e741b 100644 +--- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-0-best-effort.dtsi ++++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-0-best-effort.dtsi +@@ -63,6 +63,7 @@ fman@400000 { + #size-cells = <0>; + compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio"; + reg = <0xe1000 0x1000>; ++ fsl,erratum-a011043; /* must ignore read errors */ + + pcsphy0: ethernet-phy@0 { + reg = <0x0>; +diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-0.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-0.dtsi +index c288f3c6c6378..93095600e8086 100644 +--- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-0.dtsi ++++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-0.dtsi +@@ -60,6 +60,7 @@ fman@400000 { + #size-cells = <0>; + compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio"; + reg = <0xf1000 0x1000>; ++ fsl,erratum-a011043; /* must ignore read errors */ + + pcsphy6: ethernet-phy@0 { + reg = <0x0>; +diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-1-best-effort.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-1-best-effort.dtsi +index 94f3e71750124..ff4bd38f06459 100644 +--- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-1-best-effort.dtsi ++++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-1-best-effort.dtsi +@@ -63,6 +63,7 @@ fman@400000 { + #size-cells = <0>; + compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio"; + reg = <0xe3000 0x1000>; ++ fsl,erratum-a011043; /* must ignore read errors */ + + pcsphy1: ethernet-phy@0 { + reg = <0x0>; +diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-1.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-1.dtsi +index 94a76982d214b..1fa38ed6f59e2 100644 +--- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-1.dtsi ++++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-1.dtsi +@@ -60,6 +60,7 @@ fman@400000 { + #size-cells = <0>; + compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio"; + reg = <0xf3000 0x1000>; ++ fsl,erratum-a011043; /* must ignore read errors */ + + pcsphy7: ethernet-phy@0 { + reg = <0x0>; +diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-0.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-0.dtsi +index b5ff5f71c6b8b..a8cc9780c0c42 100644 +--- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-0.dtsi ++++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-0.dtsi +@@ -59,6 +59,7 @@ fman@400000 { + #size-cells = <0>; + compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio"; + reg = <0xe1000 0x1000>; ++ fsl,erratum-a011043; /* must ignore read errors */ + + pcsphy0: ethernet-phy@0 { + reg = <0x0>; +diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-1.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-1.dtsi +index ee44182c63485..8b8bd70c93823 100644 +--- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-1.dtsi ++++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-1.dtsi +@@ -59,6 +59,7 @@ fman@400000 { + #size-cells = <0>; + compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio"; + reg = <0xe3000 0x1000>; ++ fsl,erratum-a011043; /* must ignore read errors */ + + pcsphy1: ethernet-phy@0 { + reg = <0x0>; +diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-2.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-2.dtsi +index f05f0d775039b..619c880b54d8d 100644 +--- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-2.dtsi ++++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-2.dtsi +@@ -59,6 +59,7 @@ fman@400000 { + #size-cells = <0>; + compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio"; + reg = <0xe5000 0x1000>; ++ fsl,erratum-a011043; /* must ignore read errors */ + + pcsphy2: ethernet-phy@0 { + reg = <0x0>; +diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-3.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-3.dtsi +index a9114ec510759..d7ebb73a400d0 100644 +--- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-3.dtsi ++++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-3.dtsi +@@ -59,6 +59,7 @@ fman@400000 { + #size-cells = <0>; + compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio"; + reg = <0xe7000 0x1000>; ++ fsl,erratum-a011043; /* must ignore read errors */ + + pcsphy3: ethernet-phy@0 { + reg = <0x0>; +diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-4.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-4.dtsi +index 44dd00ac7367f..b151d696a0699 100644 +--- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-4.dtsi ++++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-4.dtsi +@@ -59,6 +59,7 @@ fman@400000 { + #size-cells = <0>; + compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio"; + reg = <0xe9000 0x1000>; ++ fsl,erratum-a011043; /* must ignore read errors */ + + pcsphy4: ethernet-phy@0 { + reg = <0x0>; +diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-5.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-5.dtsi +index 5b1b84b58602f..adc0ae0013a3c 100644 +--- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-5.dtsi ++++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-5.dtsi +@@ -59,6 +59,7 @@ fman@400000 { + #size-cells = <0>; + compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio"; + reg = <0xeb000 0x1000>; ++ fsl,erratum-a011043; /* must ignore read errors */ + + pcsphy5: ethernet-phy@0 { + reg = <0x0>; +diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-10g-0.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-10g-0.dtsi +index 0e1daaef9e74b..435047e0e250e 100644 +--- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-10g-0.dtsi ++++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-10g-0.dtsi +@@ -60,6 +60,7 @@ fman@500000 { + #size-cells = <0>; + compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio"; + reg = <0xf1000 0x1000>; ++ fsl,erratum-a011043; /* must ignore read errors */ + + pcsphy14: ethernet-phy@0 { + reg = <0x0>; +diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-10g-1.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-10g-1.dtsi +index 68c5ef779266a..c098657cca0a7 100644 +--- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-10g-1.dtsi ++++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-10g-1.dtsi +@@ -60,6 +60,7 @@ fman@500000 { + #size-cells = <0>; + compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio"; + reg = <0xf3000 0x1000>; ++ fsl,erratum-a011043; /* must ignore read errors */ + + pcsphy15: ethernet-phy@0 { + reg = <0x0>; +diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-0.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-0.dtsi +index 605363cc1117f..9d06824815f34 100644 +--- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-0.dtsi ++++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-0.dtsi +@@ -59,6 +59,7 @@ fman@500000 { + #size-cells = <0>; + compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio"; + reg = <0xe1000 0x1000>; ++ fsl,erratum-a011043; /* must ignore read errors */ + + pcsphy8: ethernet-phy@0 { + reg = <0x0>; +diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-1.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-1.dtsi +index 1955dfa136348..70e947730c4ba 100644 +--- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-1.dtsi ++++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-1.dtsi +@@ -59,6 +59,7 @@ fman@500000 { + #size-cells = <0>; + compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio"; + reg = <0xe3000 0x1000>; ++ fsl,erratum-a011043; /* must ignore read errors */ + + pcsphy9: ethernet-phy@0 { + reg = <0x0>; +diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-2.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-2.dtsi +index 2c1476454ee01..ad96e65295959 100644 +--- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-2.dtsi ++++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-2.dtsi +@@ -59,6 +59,7 @@ fman@500000 { + #size-cells = <0>; + compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio"; + reg = <0xe5000 0x1000>; ++ fsl,erratum-a011043; /* must ignore read errors */ + + pcsphy10: ethernet-phy@0 { + reg = <0x0>; +diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-3.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-3.dtsi +index b8b541ff5fb03..034bc4b71f7a5 100644 +--- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-3.dtsi ++++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-3.dtsi +@@ -59,6 +59,7 @@ fman@500000 { + #size-cells = <0>; + compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio"; + reg = <0xe7000 0x1000>; ++ fsl,erratum-a011043; /* must ignore read errors */ + + pcsphy11: ethernet-phy@0 { + reg = <0x0>; +diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-4.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-4.dtsi +index 4b2cfddd1b155..93ca23d82b39b 100644 +--- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-4.dtsi ++++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-4.dtsi +@@ -59,6 +59,7 @@ fman@500000 { + #size-cells = <0>; + compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio"; + reg = <0xe9000 0x1000>; ++ fsl,erratum-a011043; /* must ignore read errors */ + + pcsphy12: ethernet-phy@0 { + reg = <0x0>; +diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-5.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-5.dtsi +index 0a52ddf7cc171..23b3117a2fd2a 100644 +--- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-5.dtsi ++++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-5.dtsi +@@ -59,6 +59,7 @@ fman@500000 { + #size-cells = <0>; + compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio"; + reg = <0xeb000 0x1000>; ++ fsl,erratum-a011043; /* must ignore read errors */ + + pcsphy13: ethernet-phy@0 { + reg = <0x0>; +-- +2.20.1 + diff --git a/queue-4.14/qlcnic-fix-cpu-soft-lockup-while-collecting-firmware.patch b/queue-4.14/qlcnic-fix-cpu-soft-lockup-while-collecting-firmware.patch new file mode 100644 index 00000000000..e3c701cc334 --- /dev/null +++ b/queue-4.14/qlcnic-fix-cpu-soft-lockup-while-collecting-firmware.patch @@ -0,0 +1,62 @@ +From 54425ab919bab087525d3540dfd68b4bb5d162b9 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 22 Jan 2020 01:43:38 -0800 +Subject: qlcnic: Fix CPU soft lockup while collecting firmware dump + +From: Manish Chopra + +[ Upstream commit 22e984493a41bf8081f13d9ed84def3ca8cfd427 ] + +Driver while collecting firmware dump takes longer time to +collect/process some of the firmware dump entries/memories. +Bigger capture masks makes it worse as it results in larger +amount of data being collected and results in CPU soft lockup. +Place cond_resched() in some of the driver flows that are +expectedly time consuming to relinquish the CPU to avoid CPU +soft lockup panic. + +Signed-off-by: Shahed Shaikh +Tested-by: Yonggen Xu +Signed-off-by: Manish Chopra +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c | 1 + + drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c | 2 ++ + 2 files changed, 3 insertions(+) + +diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c +index a496390b8632f..07f9067affc65 100644 +--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c ++++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c +@@ -2043,6 +2043,7 @@ static void qlcnic_83xx_exec_template_cmd(struct qlcnic_adapter *p_dev, + break; + } + entry += p_hdr->size; ++ cond_resched(); + } + p_dev->ahw->reset.seq_index = index; + } +diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c +index afa10a163da1f..f34ae8c75bc5e 100644 +--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c ++++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c +@@ -703,6 +703,7 @@ static u32 qlcnic_read_memory_test_agent(struct qlcnic_adapter *adapter, + addr += 16; + reg_read -= 16; + ret += 16; ++ cond_resched(); + } + out: + mutex_unlock(&adapter->ahw->mem_lock); +@@ -1383,6 +1384,7 @@ int qlcnic_dump_fw(struct qlcnic_adapter *adapter) + buf_offset += entry->hdr.cap_size; + entry_offset += entry->hdr.offset; + buffer = fw_dump->data + buf_offset; ++ cond_resched(); + } + + fw_dump->clr = 1; +-- +2.20.1 + diff --git a/queue-4.14/qmi_wwan-add-support-for-quectel-rm500q.patch b/queue-4.14/qmi_wwan-add-support-for-quectel-rm500q.patch new file mode 100644 index 00000000000..74d82147a5f --- /dev/null +++ b/queue-4.14/qmi_wwan-add-support-for-quectel-rm500q.patch @@ -0,0 +1,39 @@ +From 53d093e2e07cd127a1257a356ee795456b15d95c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 13 Jan 2020 14:57:40 +0100 +Subject: qmi_wwan: Add support for Quectel RM500Q +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Kristian Evensen + +[ Upstream commit a9ff44f0e61d074f29770413fef6a5452be7b83e ] + +RM500Q is a 5G module from Quectel, supporting both standalone and +non-standalone modes. The normal Quectel quirks apply (DTR and dynamic +interface numbers). + +Signed-off-by: Kristian Evensen +Acked-by: Bjørn Mork +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + drivers/net/usb/qmi_wwan.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c +index 4a984b76a60ec..db70d4c5778a6 100644 +--- a/drivers/net/usb/qmi_wwan.c ++++ b/drivers/net/usb/qmi_wwan.c +@@ -999,6 +999,7 @@ static const struct usb_device_id products[] = { + {QMI_QUIRK_QUECTEL_DYNCFG(0x2c7c, 0x0125)}, /* Quectel EC25, EC20 R2.0 Mini PCIe */ + {QMI_QUIRK_QUECTEL_DYNCFG(0x2c7c, 0x0306)}, /* Quectel EP06/EG06/EM06 */ + {QMI_QUIRK_QUECTEL_DYNCFG(0x2c7c, 0x0512)}, /* Quectel EG12/EM12 */ ++ {QMI_QUIRK_QUECTEL_DYNCFG(0x2c7c, 0x0800)}, /* Quectel RM500Q-GL */ + + /* 3. Combined interface devices matching on interface number */ + {QMI_FIXED_INTF(0x0408, 0xea42, 4)}, /* Yota / Megafon M100-1 */ +-- +2.20.1 + diff --git a/queue-4.14/r8152-get-default-setting-of-wol-before-initializing.patch b/queue-4.14/r8152-get-default-setting-of-wol-before-initializing.patch new file mode 100644 index 00000000000..d6ee564f724 --- /dev/null +++ b/queue-4.14/r8152-get-default-setting-of-wol-before-initializing.patch @@ -0,0 +1,49 @@ +From 1b1d32512a10757eb9af582abaadac6190229d54 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 22 Jan 2020 16:02:07 +0800 +Subject: r8152: get default setting of WOL before initializing + +From: Hayes Wang + +[ Upstream commit 9583a3638dc07cc1878f41265e85ed497f72efcb ] + +Initailization would reset runtime suspend by tp->saved_wolopts, so +the tp->saved_wolopts should be set before initializing. + +Signed-off-by: Hayes Wang +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/usb/r8152.c | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c +index 0083c60f5cdff..a7f9c1886bd4c 100644 +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -5244,6 +5244,11 @@ static int rtl8152_probe(struct usb_interface *intf, + + intf->needs_remote_wakeup = 1; + ++ if (!rtl_can_wakeup(tp)) ++ __rtl_set_wol(tp, 0); ++ else ++ tp->saved_wolopts = __rtl_get_wol(tp); ++ + tp->rtl_ops.init(tp); + queue_delayed_work(system_long_wq, &tp->hw_phy_work, 0); + set_ethernet_addr(tp); +@@ -5257,10 +5262,6 @@ static int rtl8152_probe(struct usb_interface *intf, + goto out1; + } + +- if (!rtl_can_wakeup(tp)) +- __rtl_set_wol(tp, 0); +- +- tp->saved_wolopts = __rtl_get_wol(tp); + if (tp->saved_wolopts) + device_set_wakeup_enable(&udev->dev, true); + else +-- +2.20.1 + diff --git a/queue-4.14/scsi-fnic-do-not-queue-commands-during-fwreset.patch b/queue-4.14/scsi-fnic-do-not-queue-commands-during-fwreset.patch new file mode 100644 index 00000000000..351fde10c94 --- /dev/null +++ b/queue-4.14/scsi-fnic-do-not-queue-commands-during-fwreset.patch @@ -0,0 +1,48 @@ +From 825d4919ae7b93139c28a366bac1908326fe3935 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 16 Jan 2020 11:20:53 +0100 +Subject: scsi: fnic: do not queue commands during fwreset + +From: Hannes Reinecke + +[ Upstream commit 0e2209629fec427ba75a6351486153a9feddd36b ] + +When a link is going down the driver will be calling fnic_cleanup_io(), +which will traverse all commands and calling 'done' for each found command. +While the traversal is handled under the host_lock, calling 'done' happens +after the host_lock is being dropped. + +As fnic_queuecommand_lck() is being called with the host_lock held, it +might well be that it will pick the command being selected for abortion +from the above routine and enqueue it for sending, but then 'done' is being +called on that very command from the above routine. + +Which of course confuses the hell out of the scsi midlayer. + +So fix this by not queueing commands when fnic_cleanup_io is active. + +Link: https://lore.kernel.org/r/20200116102053.62755-1-hare@suse.de +Signed-off-by: Hannes Reinecke +Signed-off-by: Martin K. Petersen +Signed-off-by: Sasha Levin +--- + drivers/scsi/fnic/fnic_scsi.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/scsi/fnic/fnic_scsi.c b/drivers/scsi/fnic/fnic_scsi.c +index 242e2ee494a1c..d79ac0b24f5af 100644 +--- a/drivers/scsi/fnic/fnic_scsi.c ++++ b/drivers/scsi/fnic/fnic_scsi.c +@@ -446,6 +446,9 @@ static int fnic_queuecommand_lck(struct scsi_cmnd *sc, void (*done)(struct scsi_ + if (unlikely(fnic_chk_state_flags_locked(fnic, FNIC_FLAGS_IO_BLOCKED))) + return SCSI_MLQUEUE_HOST_BUSY; + ++ if (unlikely(fnic_chk_state_flags_locked(fnic, FNIC_FLAGS_FWRESET))) ++ return SCSI_MLQUEUE_HOST_BUSY; ++ + rport = starget_to_rport(scsi_target(sc->device)); + if (!rport) { + FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, +-- +2.20.1 + diff --git a/queue-4.14/seq_tab_next-should-increase-position-index.patch b/queue-4.14/seq_tab_next-should-increase-position-index.patch new file mode 100644 index 00000000000..177af238b54 --- /dev/null +++ b/queue-4.14/seq_tab_next-should-increase-position-index.patch @@ -0,0 +1,37 @@ +From 86af2cb2a06e0038d2cde97282dd0e95da926fb3 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 23 Jan 2020 10:11:08 +0300 +Subject: seq_tab_next() should increase position index + +From: Vasily Averin + +[ Upstream commit 70a87287c821e9721b62463777f55ba588ac4623 ] + +if seq_file .next fuction does not change position index, +read after some lseek can generate unexpected output. + +https://bugzilla.kernel.org/show_bug.cgi?id=206283 +Signed-off-by: Vasily Averin +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c +index 9e5cd18e7358c..8bd90ad156073 100644 +--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c ++++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c +@@ -66,8 +66,7 @@ static void *seq_tab_start(struct seq_file *seq, loff_t *pos) + static void *seq_tab_next(struct seq_file *seq, void *v, loff_t *pos) + { + v = seq_tab_get_idx(seq->private, *pos + 1); +- if (v) +- ++*pos; ++ ++(*pos); + return v; + } + +-- +2.20.1 + diff --git a/queue-4.14/series b/queue-4.14/series index 73b2864a001..aa93e54dbca 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -50,3 +50,40 @@ ttyprintk-fix-a-potential-deadlock-in-interrupt-context-issue.patch bluetooth-fix-race-condition-in-hci_release_sock.patch cgroup-prevent-double-killing-of-css-when-enabling-threaded-cgroup.patch media-si470x-i2c-move-free-past-last-use-of-radio.patch +arm-dts-sun8i-a83t-correct-usb3503-gpios-polarity.patch +arm-dts-beagle-x15-common-model-5v0-regulator.patch +soc-ti-wkup_m3_ipc-fix-race-condition-with-rproc_boo.patch +mac80211-mesh-restrict-airtime-metric-to-peered-esta.patch +clk-mmp2-fix-the-order-of-timer-mux-parents.patch +ixgbevf-remove-limit-of-10-entries-for-unicast-filte.patch +ixgbe-fix-calculation-of-queue-with-vfs-and-flow-dir.patch +igb-fix-sgmii-sfp-module-discovery-for-100fx-lx.patch +asoc-sti-fix-possible-sleep-in-atomic.patch +qmi_wwan-add-support-for-quectel-rm500q.patch +wireless-fix-enabling-channel-12-for-custom-regulato.patch +cfg80211-fix-radar-event-during-another-phy-cac.patch +mac80211-fix-tkip-replay-protection-immediately-afte.patch +wireless-wext-avoid-gcc-o3-warning.patch +net-dsa-bcm_sf2-configure-imp-port-for-2gb-sec.patch +bnxt_en-fix-ipv6-rfs-filter-matching-logic.patch +iwlwifi-mvm-fix-nvm-check-for-3168-devices.patch +input-aiptek-use-descriptors-of-current-altsetting.patch +arm-dts-am335x-boneblack-common-fix-memory-size.patch +vti-6-fix-packet-tx-through-bpf_redirect.patch +scsi-fnic-do-not-queue-commands-during-fwreset.patch +arm-8955-1-virt-relax-arch-timer-version-check-durin.patch +tee-optee-fix-compilation-issue-with-nommu.patch +airo-fix-possible-info-leak-in-airooldioctl-siocdevp.patch +airo-add-missing-cap_net_admin-check-in-airooldioctl.patch +r8152-get-default-setting-of-wol-before-initializing.patch +qlcnic-fix-cpu-soft-lockup-while-collecting-firmware.patch +powerpc-fsl-dts-add-fsl-erratum-a011043.patch +net-fsl-treat-fsl-erratum-a011043.patch +net-fsl-fman-rename-if_mode_xgmii-to-if_mode_10g.patch +net-sonic-add-mutual-exclusion-for-accessing-shared-.patch +net-sonic-use-mmio-accessors.patch +net-sonic-fix-receive-buffer-handling.patch +net-sonic-quiesce-sonic-before-re-initializing-descr.patch +seq_tab_next-should-increase-position-index.patch +l2t_seq_next-should-increase-position-index.patch +net-fix-skb-csum-update-in-inet_proto_csum_replace16.patch diff --git a/queue-4.14/soc-ti-wkup_m3_ipc-fix-race-condition-with-rproc_boo.patch b/queue-4.14/soc-ti-wkup_m3_ipc-fix-race-condition-with-rproc_boo.patch new file mode 100644 index 00000000000..0bee27d7cf3 --- /dev/null +++ b/queue-4.14/soc-ti-wkup_m3_ipc-fix-race-condition-with-rproc_boo.patch @@ -0,0 +1,55 @@ +From 6ef2fab66867153c0b9fe1e3d976155b7fb3d228 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 11 Dec 2019 22:03:14 -0600 +Subject: soc: ti: wkup_m3_ipc: Fix race condition with rproc_boot + +From: Dave Gerlach + +[ Upstream commit 03729cfa0d543bc996bf959e762ec999afc8f3d2 ] + +Any user of wkup_m3_ipc calls wkup_m3_ipc_get to get a handle and this +checks the value of the static variable m3_ipc_state to see if the +wkup_m3 is ready. Currently this is populated during probe before +rproc_boot has been called, meaning there is a window of time that +wkup_m3_ipc_get can return a valid handle but the wkup_m3 itself is not +ready, leading to invalid IPC calls to the wkup_m3 and system +instability. + +To avoid this, move the population of the m3_ipc_state variable until +after rproc_boot has succeeded to guarantee a valid and usable handle +is always returned. + +Reported-by: Suman Anna +Signed-off-by: Dave Gerlach +Acked-by: Santosh Shilimkar +Signed-off-by: Tony Lindgren +Signed-off-by: Sasha Levin +--- + drivers/soc/ti/wkup_m3_ipc.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/soc/ti/wkup_m3_ipc.c b/drivers/soc/ti/wkup_m3_ipc.c +index 369aef5e7228e..651827c6ee6f9 100644 +--- a/drivers/soc/ti/wkup_m3_ipc.c ++++ b/drivers/soc/ti/wkup_m3_ipc.c +@@ -375,6 +375,8 @@ static void wkup_m3_rproc_boot_thread(struct wkup_m3_ipc *m3_ipc) + ret = rproc_boot(m3_ipc->rproc); + if (ret) + dev_err(dev, "rproc_boot failed\n"); ++ else ++ m3_ipc_state = m3_ipc; + + do_exit(0); + } +@@ -461,8 +463,6 @@ static int wkup_m3_ipc_probe(struct platform_device *pdev) + goto err_put_rproc; + } + +- m3_ipc_state = m3_ipc; +- + return 0; + + err_put_rproc: +-- +2.20.1 + diff --git a/queue-4.14/tee-optee-fix-compilation-issue-with-nommu.patch b/queue-4.14/tee-optee-fix-compilation-issue-with-nommu.patch new file mode 100644 index 00000000000..87728a3794e --- /dev/null +++ b/queue-4.14/tee-optee-fix-compilation-issue-with-nommu.patch @@ -0,0 +1,54 @@ +From cb8d695734198732515f237d35eb03b4fdd2329e Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 10 Jan 2020 12:28:07 +0000 +Subject: tee: optee: Fix compilation issue with nommu +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Vincenzo Frascino + +[ Upstream commit 9e0caab8e0f96f0af7d1dd388e62f44184a75372 ] + +The optee driver uses specific page table types to verify if a memory +region is normal. These types are not defined in nommu systems. Trying +to compile the driver in these systems results in a build error: + + linux/drivers/tee/optee/call.c: In function ‘is_normal_memory’: + linux/drivers/tee/optee/call.c:533:26: error: ‘L_PTE_MT_MASK’ undeclared + (first use in this function); did you mean ‘PREEMPT_MASK’? + return (pgprot_val(p) & L_PTE_MT_MASK) == L_PTE_MT_WRITEALLOC; + ^~~~~~~~~~~~~ + PREEMPT_MASK + linux/drivers/tee/optee/call.c:533:26: note: each undeclared identifier is + reported only once for each function it appears in + linux/drivers/tee/optee/call.c:533:44: error: ‘L_PTE_MT_WRITEALLOC’ undeclared + (first use in this function) + return (pgprot_val(p) & L_PTE_MT_MASK) == L_PTE_MT_WRITEALLOC; + ^~~~~~~~~~~~~~~~~~~ + +Make the optee driver depend on MMU to fix the compilation issue. + +Signed-off-by: Vincenzo Frascino +[jw: update commit title] +Signed-off-by: Jens Wiklander +Signed-off-by: Sasha Levin +--- + drivers/tee/optee/Kconfig | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/tee/optee/Kconfig b/drivers/tee/optee/Kconfig +index 0126de898036c..108600c6eb564 100644 +--- a/drivers/tee/optee/Kconfig ++++ b/drivers/tee/optee/Kconfig +@@ -2,6 +2,7 @@ + config OPTEE + tristate "OP-TEE" + depends on HAVE_ARM_SMCCC ++ depends on MMU + help + This implements the OP-TEE Trusted Execution Environment (TEE) + driver. +-- +2.20.1 + diff --git a/queue-4.14/vti-6-fix-packet-tx-through-bpf_redirect.patch b/queue-4.14/vti-6-fix-packet-tx-through-bpf_redirect.patch new file mode 100644 index 00000000000..85eb2d5a9af --- /dev/null +++ b/queue-4.14/vti-6-fix-packet-tx-through-bpf_redirect.patch @@ -0,0 +1,82 @@ +From 9106c64d11c02b04147c0366baa56a367fec49a0 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 13 Jan 2020 09:32:46 +0100 +Subject: vti[6]: fix packet tx through bpf_redirect() + +From: Nicolas Dichtel + +[ Upstream commit 95224166a9032ff5d08fca633d37113078ce7d01 ] + +With an ebpf program that redirects packets through a vti[6] interface, +the packets are dropped because no dst is attached. + +This could also be reproduced with an AF_PACKET socket, with the following +python script (vti1 is an ip_vti interface): + + import socket + send_s = socket.socket(socket.AF_PACKET, socket.SOCK_RAW, 0) + # scapy + # p = IP(src='10.100.0.2', dst='10.200.0.1')/ICMP(type='echo-request') + # raw(p) + req = b'E\x00\x00\x1c\x00\x01\x00\x00@\x01e\xb2\nd\x00\x02\n\xc8\x00\x01\x08\x00\xf7\xff\x00\x00\x00\x00' + send_s.sendto(req, ('vti1', 0x800, 0, 0)) + +Signed-off-by: Nicolas Dichtel +Signed-off-by: Steffen Klassert +Signed-off-by: Sasha Levin +--- + net/ipv4/ip_vti.c | 13 +++++++++++-- + net/ipv6/ip6_vti.c | 13 +++++++++++-- + 2 files changed, 22 insertions(+), 4 deletions(-) + +diff --git a/net/ipv4/ip_vti.c b/net/ipv4/ip_vti.c +index 08c15dd42d935..59384ffe89f73 100644 +--- a/net/ipv4/ip_vti.c ++++ b/net/ipv4/ip_vti.c +@@ -208,8 +208,17 @@ static netdev_tx_t vti_xmit(struct sk_buff *skb, struct net_device *dev, + int mtu; + + if (!dst) { +- dev->stats.tx_carrier_errors++; +- goto tx_error_icmp; ++ struct rtable *rt; ++ ++ fl->u.ip4.flowi4_oif = dev->ifindex; ++ fl->u.ip4.flowi4_flags |= FLOWI_FLAG_ANYSRC; ++ rt = __ip_route_output_key(dev_net(dev), &fl->u.ip4); ++ if (IS_ERR(rt)) { ++ dev->stats.tx_carrier_errors++; ++ goto tx_error_icmp; ++ } ++ dst = &rt->dst; ++ skb_dst_set(skb, dst); + } + + dst_hold(dst); +diff --git a/net/ipv6/ip6_vti.c b/net/ipv6/ip6_vti.c +index 557fe3880a3f3..396a0f61f5f88 100644 +--- a/net/ipv6/ip6_vti.c ++++ b/net/ipv6/ip6_vti.c +@@ -453,8 +453,17 @@ vti6_xmit(struct sk_buff *skb, struct net_device *dev, struct flowi *fl) + int err = -1; + int mtu; + +- if (!dst) +- goto tx_err_link_failure; ++ if (!dst) { ++ fl->u.ip6.flowi6_oif = dev->ifindex; ++ fl->u.ip6.flowi6_flags |= FLOWI_FLAG_ANYSRC; ++ dst = ip6_route_output(dev_net(dev), NULL, &fl->u.ip6); ++ if (dst->error) { ++ dst_release(dst); ++ dst = NULL; ++ goto tx_err_link_failure; ++ } ++ skb_dst_set(skb, dst); ++ } + + dst_hold(dst); + dst = xfrm_lookup(t->net, dst, fl, NULL, 0); +-- +2.20.1 + diff --git a/queue-4.14/wireless-fix-enabling-channel-12-for-custom-regulato.patch b/queue-4.14/wireless-fix-enabling-channel-12-for-custom-regulato.patch new file mode 100644 index 00000000000..a97f599557f --- /dev/null +++ b/queue-4.14/wireless-fix-enabling-channel-12-for-custom-regulato.patch @@ -0,0 +1,65 @@ +From 64fd464b4585928166b46fd4fdf1b740c1dba179 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 20 Dec 2019 10:14:32 +0000 +Subject: wireless: fix enabling channel 12 for custom regulatory domain + +From: Ganapathi Bhat + +[ Upstream commit c4b9d655e445a8be0bff624aedea190606b5ebbc ] + +Commit e33e2241e272 ("Revert "cfg80211: Use 5MHz bandwidth by +default when checking usable channels"") fixed a broken +regulatory (leaving channel 12 open for AP where not permitted). +Apply a similar fix to custom regulatory domain processing. + +Signed-off-by: Cathy Luo +Signed-off-by: Ganapathi Bhat +Link: https://lore.kernel.org/r/1576836859-8945-1-git-send-email-ganapathi.bhat@nxp.com +[reword commit message, fix coding style, add a comment] +Signed-off-by: Johannes Berg +Signed-off-by: Sasha Levin +--- + net/wireless/reg.c | 13 ++++++++++--- + 1 file changed, 10 insertions(+), 3 deletions(-) + +diff --git a/net/wireless/reg.c b/net/wireless/reg.c +index 804eac073b6b9..e60a7dedfbf1b 100644 +--- a/net/wireless/reg.c ++++ b/net/wireless/reg.c +@@ -1718,14 +1718,15 @@ static void update_all_wiphy_regulatory(enum nl80211_reg_initiator initiator) + + static void handle_channel_custom(struct wiphy *wiphy, + struct ieee80211_channel *chan, +- const struct ieee80211_regdomain *regd) ++ const struct ieee80211_regdomain *regd, ++ u32 min_bw) + { + u32 bw_flags = 0; + const struct ieee80211_reg_rule *reg_rule = NULL; + const struct ieee80211_power_rule *power_rule = NULL; + u32 bw; + +- for (bw = MHZ_TO_KHZ(20); bw >= MHZ_TO_KHZ(5); bw = bw / 2) { ++ for (bw = MHZ_TO_KHZ(20); bw >= min_bw; bw = bw / 2) { + reg_rule = freq_reg_info_regd(MHZ_TO_KHZ(chan->center_freq), + regd, bw); + if (!IS_ERR(reg_rule)) +@@ -1781,8 +1782,14 @@ static void handle_band_custom(struct wiphy *wiphy, + if (!sband) + return; + ++ /* ++ * We currently assume that you always want at least 20 MHz, ++ * otherwise channel 12 might get enabled if this rule is ++ * compatible to US, which permits 2402 - 2472 MHz. ++ */ + for (i = 0; i < sband->n_channels; i++) +- handle_channel_custom(wiphy, &sband->channels[i], regd); ++ handle_channel_custom(wiphy, &sband->channels[i], regd, ++ MHZ_TO_KHZ(20)); + } + + /* Used by drivers prior to wiphy registration */ +-- +2.20.1 + diff --git a/queue-4.14/wireless-wext-avoid-gcc-o3-warning.patch b/queue-4.14/wireless-wext-avoid-gcc-o3-warning.patch new file mode 100644 index 00000000000..84ce3933cdb --- /dev/null +++ b/queue-4.14/wireless-wext-avoid-gcc-o3-warning.patch @@ -0,0 +1,56 @@ +From 02d17e4bc349fac06b15c1332e3636f268cf351e Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 7 Jan 2020 21:07:35 +0100 +Subject: wireless: wext: avoid gcc -O3 warning + +From: Arnd Bergmann + +[ Upstream commit e16119655c9e6c4aa5767cd971baa9c491f41b13 ] + +After the introduction of CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3, +the wext code produces a bogus warning: + +In function 'iw_handler_get_iwstats', + inlined from 'ioctl_standard_call' at net/wireless/wext-core.c:1015:9, + inlined from 'wireless_process_ioctl' at net/wireless/wext-core.c:935:10, + inlined from 'wext_ioctl_dispatch.part.8' at net/wireless/wext-core.c:986:8, + inlined from 'wext_handle_ioctl': +net/wireless/wext-core.c:671:3: error: argument 1 null where non-null expected [-Werror=nonnull] + memcpy(extra, stats, sizeof(struct iw_statistics)); + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +In file included from arch/x86/include/asm/string.h:5, +net/wireless/wext-core.c: In function 'wext_handle_ioctl': +arch/x86/include/asm/string_64.h:14:14: note: in a call to function 'memcpy' declared here + +The problem is that ioctl_standard_call() sometimes calls the handler +with a NULL argument that would cause a problem for iw_handler_get_iwstats. +However, iw_handler_get_iwstats never actually gets called that way. + +Marking that function as noinline avoids the warning and leads +to slightly smaller object code as well. + +Signed-off-by: Arnd Bergmann +Link: https://lore.kernel.org/r/20200107200741.3588770-1-arnd@arndb.de +Signed-off-by: Johannes Berg +Signed-off-by: Sasha Levin +--- + net/wireless/wext-core.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/net/wireless/wext-core.c b/net/wireless/wext-core.c +index 6cdb054484d66..5236a3c2c0ccf 100644 +--- a/net/wireless/wext-core.c ++++ b/net/wireless/wext-core.c +@@ -659,7 +659,8 @@ struct iw_statistics *get_wireless_stats(struct net_device *dev) + return NULL; + } + +-static int iw_handler_get_iwstats(struct net_device * dev, ++/* noinline to avoid a bogus warning with -O3 */ ++static noinline int iw_handler_get_iwstats(struct net_device * dev, + struct iw_request_info * info, + union iwreq_data * wrqu, + char * extra) +-- +2.20.1 + -- 2.47.3