From a0f8137f9c58c2b5b774142288c293eb4378c2b1 Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Wed, 6 May 2020 21:32:47 -0400 Subject: [PATCH] Fixes for 4.9 Signed-off-by: Sasha Levin --- ...c-sgtl5000-fix-vag-power-on-handling.patch | 89 +++++++++++++ ...ating-server-dstaddr-with-a-spinlock.patch | 39 ++++++ ...o-ad7797-use-correct-attribute_group.patch | 40 ++++++ ...-fix-building-for-powerpc-with-clang.patch | 123 ++++++++++++++++++ ...press-warnings-on-failed-rx-skb-allo.patch | 47 +++++++ .../net-dsa-b53-rework-arl-bin-logic.patch | 119 +++++++++++++++++ .../net-stmmac-fix-sub-second-increment.patch | 78 +++++++++++ ...uppress-warnings-on-failed-rx-skb-al.patch | 47 +++++++ ...llow-colons-in-option-strings-for-se.patch | 48 +++++++ ...x-test-failure-seen-after-initial-te.patch | 61 +++++++++ queue-4.9/series | 11 ++ ...i2400m-fix-potential-urb-refcnt-leak.patch | 46 +++++++ 12 files changed, 748 insertions(+) create mode 100644 queue-4.9/asoc-sgtl5000-fix-vag-power-on-handling.patch create mode 100644 queue-4.9/cifs-protect-updating-server-dstaddr-with-a-spinlock.patch create mode 100644 queue-4.9/iio-ad7797-use-correct-attribute_group.patch create mode 100644 queue-4.9/lib-mpi-fix-building-for-powerpc-with-clang.patch create mode 100644 queue-4.9/net-bcmgenet-suppress-warnings-on-failed-rx-skb-allo.patch create mode 100644 queue-4.9/net-dsa-b53-rework-arl-bin-logic.patch create mode 100644 queue-4.9/net-stmmac-fix-sub-second-increment.patch create mode 100644 queue-4.9/net-systemport-suppress-warnings-on-failed-rx-skb-al.patch create mode 100644 queue-4.9/scripts-config-allow-colons-in-option-strings-for-se.patch create mode 100644 queue-4.9/selftests-ipc-fix-test-failure-seen-after-initial-te.patch create mode 100644 queue-4.9/wimax-i2400m-fix-potential-urb-refcnt-leak.patch diff --git a/queue-4.9/asoc-sgtl5000-fix-vag-power-on-handling.patch b/queue-4.9/asoc-sgtl5000-fix-vag-power-on-handling.patch new file mode 100644 index 00000000000..bb736f7a491 --- /dev/null +++ b/queue-4.9/asoc-sgtl5000-fix-vag-power-on-handling.patch @@ -0,0 +1,89 @@ +From 06890b8c4d8afb1c1bad3e8dfdb5f83dc0b1c5e4 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 14 Apr 2020 20:11:40 +0200 +Subject: ASoC: sgtl5000: Fix VAG power-on handling + +From: Sebastian Reichel + +[ Upstream commit aa7812737f2877e192d57626cbe8825cc7cf6de9 ] + +As mentioned slightly out of patch context in the code, there +is no reset routine for the chip. On boards where the chip is +supplied by a fixed regulator, it might not even be resetted +during (e.g. watchdog) reboot and can be in any state. + +If the device is probed with VAG enabled, the driver's probe +routine will generate a loud pop sound when ANA_POWER is +being programmed. Avoid this by properly disabling just the +VAG bit and waiting the required power down time. + +Signed-off-by: Sebastian Reichel +Reviewed-by: Fabio Estevam +Link: https://lore.kernel.org/r/20200414181140.145825-1-sebastian.reichel@collabora.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/codecs/sgtl5000.c | 34 ++++++++++++++++++++++++++++++++++ + sound/soc/codecs/sgtl5000.h | 1 + + 2 files changed, 35 insertions(+) + +diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c +index 39810b713d5f2..0c2a1413a8f57 100644 +--- a/sound/soc/codecs/sgtl5000.c ++++ b/sound/soc/codecs/sgtl5000.c +@@ -1464,6 +1464,40 @@ static int sgtl5000_i2c_probe(struct i2c_client *client, + dev_err(&client->dev, + "Error %d initializing CHIP_CLK_CTRL\n", ret); + ++ /* Mute everything to avoid pop from the following power-up */ ++ ret = regmap_write(sgtl5000->regmap, SGTL5000_CHIP_ANA_CTRL, ++ SGTL5000_CHIP_ANA_CTRL_DEFAULT); ++ if (ret) { ++ dev_err(&client->dev, ++ "Error %d muting outputs via CHIP_ANA_CTRL\n", ret); ++ goto disable_clk; ++ } ++ ++ /* ++ * If VAG is powered-on (e.g. from previous boot), it would be disabled ++ * by the write to ANA_POWER in later steps of the probe code. This ++ * may create a loud pop even with all outputs muted. The proper way ++ * to circumvent this is disabling the bit first and waiting the proper ++ * cool-down time. ++ */ ++ ret = regmap_read(sgtl5000->regmap, SGTL5000_CHIP_ANA_POWER, &value); ++ if (ret) { ++ dev_err(&client->dev, "Failed to read ANA_POWER: %d\n", ret); ++ goto disable_clk; ++ } ++ if (value & SGTL5000_VAG_POWERUP) { ++ ret = regmap_update_bits(sgtl5000->regmap, ++ SGTL5000_CHIP_ANA_POWER, ++ SGTL5000_VAG_POWERUP, ++ 0); ++ if (ret) { ++ dev_err(&client->dev, "Error %d disabling VAG\n", ret); ++ goto disable_clk; ++ } ++ ++ msleep(SGTL5000_VAG_POWERDOWN_DELAY); ++ } ++ + /* Follow section 2.2.1.1 of AN3663 */ + ana_pwr = SGTL5000_ANA_POWER_DEFAULT; + if (sgtl5000->num_supplies <= VDDD) { +diff --git a/sound/soc/codecs/sgtl5000.h b/sound/soc/codecs/sgtl5000.h +index 22f3442af9826..9ea41749d0375 100644 +--- a/sound/soc/codecs/sgtl5000.h ++++ b/sound/soc/codecs/sgtl5000.h +@@ -236,6 +236,7 @@ + /* + * SGTL5000_CHIP_ANA_CTRL + */ ++#define SGTL5000_CHIP_ANA_CTRL_DEFAULT 0x0133 + #define SGTL5000_LINE_OUT_MUTE 0x0100 + #define SGTL5000_HP_SEL_MASK 0x0040 + #define SGTL5000_HP_SEL_SHIFT 6 +-- +2.20.1 + diff --git a/queue-4.9/cifs-protect-updating-server-dstaddr-with-a-spinlock.patch b/queue-4.9/cifs-protect-updating-server-dstaddr-with-a-spinlock.patch new file mode 100644 index 00000000000..ab712b3c7c9 --- /dev/null +++ b/queue-4.9/cifs-protect-updating-server-dstaddr-with-a-spinlock.patch @@ -0,0 +1,39 @@ +From 61de2dc6e435ba5bf66db96f860c89f1550e3dfa Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 21 Apr 2020 12:37:39 +1000 +Subject: cifs: protect updating server->dstaddr with a spinlock + +From: Ronnie Sahlberg + +[ Upstream commit fada37f6f62995cc449b36ebba1220594bfe55fe ] + +We use a spinlock while we are reading and accessing the destination address for a server. +We need to also use this spinlock to protect when we are modifying this address from +reconn_set_ipaddr(). + +Signed-off-by: Ronnie Sahlberg +Reviewed-by: Jeff Layton +Signed-off-by: Steve French +Signed-off-by: Sasha Levin +--- + fs/cifs/connect.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c +index f2707ff795d45..c018d161735c4 100644 +--- a/fs/cifs/connect.c ++++ b/fs/cifs/connect.c +@@ -341,8 +341,10 @@ static int reconn_set_ipaddr(struct TCP_Server_Info *server) + return rc; + } + ++ spin_lock(&cifs_tcp_ses_lock); + rc = cifs_convert_address((struct sockaddr *)&server->dstaddr, ipaddr, + strlen(ipaddr)); ++ spin_unlock(&cifs_tcp_ses_lock); + kfree(ipaddr); + + return !rc ? -1 : 0; +-- +2.20.1 + diff --git a/queue-4.9/iio-ad7797-use-correct-attribute_group.patch b/queue-4.9/iio-ad7797-use-correct-attribute_group.patch new file mode 100644 index 00000000000..fed762de555 --- /dev/null +++ b/queue-4.9/iio-ad7797-use-correct-attribute_group.patch @@ -0,0 +1,40 @@ +From bc7cc04ea590605b63c174d31167d54fdf901471 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 10 Mar 2020 22:16:54 +0800 +Subject: iio:ad7797: Use correct attribute_group + +From: YueHaibing + +[ Upstream commit 28535877ac5b2b84f0d394fd67a5ec71c0c48b10 ] + +It should use ad7797_attribute_group in ad7797_info, +according to commit ("iio:ad7793: Add support for the ad7796 and ad7797"). + +Scale is fixed for the ad7796 and not programmable, hence +should not have the scale_available attribute. + +Fixes: fd1a8b912841 ("iio:ad7793: Add support for the ad7796 and ad7797") +Signed-off-by: YueHaibing +Reviewed-by: Lars-Peter Clausen +Signed-off-by: Jonathan Cameron +Signed-off-by: Sasha Levin +--- + drivers/iio/adc/ad7793.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/iio/adc/ad7793.c b/drivers/iio/adc/ad7793.c +index 47c3d7f329004..437762a1e4877 100644 +--- a/drivers/iio/adc/ad7793.c ++++ b/drivers/iio/adc/ad7793.c +@@ -570,7 +570,7 @@ static const struct iio_info ad7797_info = { + .read_raw = &ad7793_read_raw, + .write_raw = &ad7793_write_raw, + .write_raw_get_fmt = &ad7793_write_raw_get_fmt, +- .attrs = &ad7793_attribute_group, ++ .attrs = &ad7797_attribute_group, + .validate_trigger = ad_sd_validate_trigger, + .driver_module = THIS_MODULE, + }; +-- +2.20.1 + diff --git a/queue-4.9/lib-mpi-fix-building-for-powerpc-with-clang.patch b/queue-4.9/lib-mpi-fix-building-for-powerpc-with-clang.patch new file mode 100644 index 00000000000..af624ba05d2 --- /dev/null +++ b/queue-4.9/lib-mpi-fix-building-for-powerpc-with-clang.patch @@ -0,0 +1,123 @@ +From 38366a55f8599750adbb9295a05ee8c0d21200d7 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 13 Apr 2020 12:50:42 -0700 +Subject: lib/mpi: Fix building for powerpc with clang + +From: Nathan Chancellor + +[ Upstream commit 5990cdee689c6885b27c6d969a3d58b09002b0bc ] + +0day reports over and over on an powerpc randconfig with clang: + +lib/mpi/generic_mpih-mul1.c:37:13: error: invalid use of a cast in a +inline asm context requiring an l-value: remove the cast or build with +-fheinous-gnu-extensions + +Remove the superfluous casts, which have been done previously for x86 +and arm32 in commit dea632cadd12 ("lib/mpi: fix build with clang") and +commit 7b7c1df2883d ("lib/mpi/longlong.h: fix building with 32-bit +x86"). + +Reported-by: kbuild test robot +Signed-off-by: Nathan Chancellor +Acked-by: Herbert Xu +Signed-off-by: Michael Ellerman +Link: https://github.com/ClangBuiltLinux/linux/issues/991 +Link: https://lore.kernel.org/r/20200413195041.24064-1-natechancellor@gmail.com +Signed-off-by: Sasha Levin +--- + lib/mpi/longlong.h | 34 +++++++++++++++++----------------- + 1 file changed, 17 insertions(+), 17 deletions(-) + +diff --git a/lib/mpi/longlong.h b/lib/mpi/longlong.h +index 0f64fcee4ccd1..8f383cca6bb1f 100644 +--- a/lib/mpi/longlong.h ++++ b/lib/mpi/longlong.h +@@ -756,22 +756,22 @@ do { \ + do { \ + if (__builtin_constant_p(bh) && (bh) == 0) \ + __asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{aze|addze} %0,%2" \ +- : "=r" ((USItype)(sh)), \ +- "=&r" ((USItype)(sl)) \ ++ : "=r" (sh), \ ++ "=&r" (sl) \ + : "%r" ((USItype)(ah)), \ + "%r" ((USItype)(al)), \ + "rI" ((USItype)(bl))); \ + else if (__builtin_constant_p(bh) && (bh) == ~(USItype) 0) \ + __asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{ame|addme} %0,%2" \ +- : "=r" ((USItype)(sh)), \ +- "=&r" ((USItype)(sl)) \ ++ : "=r" (sh), \ ++ "=&r" (sl) \ + : "%r" ((USItype)(ah)), \ + "%r" ((USItype)(al)), \ + "rI" ((USItype)(bl))); \ + else \ + __asm__ ("{a%I5|add%I5c} %1,%4,%5\n\t{ae|adde} %0,%2,%3" \ +- : "=r" ((USItype)(sh)), \ +- "=&r" ((USItype)(sl)) \ ++ : "=r" (sh), \ ++ "=&r" (sl) \ + : "%r" ((USItype)(ah)), \ + "r" ((USItype)(bh)), \ + "%r" ((USItype)(al)), \ +@@ -781,36 +781,36 @@ do { \ + do { \ + if (__builtin_constant_p(ah) && (ah) == 0) \ + __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{sfze|subfze} %0,%2" \ +- : "=r" ((USItype)(sh)), \ +- "=&r" ((USItype)(sl)) \ ++ : "=r" (sh), \ ++ "=&r" (sl) \ + : "r" ((USItype)(bh)), \ + "rI" ((USItype)(al)), \ + "r" ((USItype)(bl))); \ + else if (__builtin_constant_p(ah) && (ah) == ~(USItype) 0) \ + __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{sfme|subfme} %0,%2" \ +- : "=r" ((USItype)(sh)), \ +- "=&r" ((USItype)(sl)) \ ++ : "=r" (sh), \ ++ "=&r" (sl) \ + : "r" ((USItype)(bh)), \ + "rI" ((USItype)(al)), \ + "r" ((USItype)(bl))); \ + else if (__builtin_constant_p(bh) && (bh) == 0) \ + __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{ame|addme} %0,%2" \ +- : "=r" ((USItype)(sh)), \ +- "=&r" ((USItype)(sl)) \ ++ : "=r" (sh), \ ++ "=&r" (sl) \ + : "r" ((USItype)(ah)), \ + "rI" ((USItype)(al)), \ + "r" ((USItype)(bl))); \ + else if (__builtin_constant_p(bh) && (bh) == ~(USItype) 0) \ + __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{aze|addze} %0,%2" \ +- : "=r" ((USItype)(sh)), \ +- "=&r" ((USItype)(sl)) \ ++ : "=r" (sh), \ ++ "=&r" (sl) \ + : "r" ((USItype)(ah)), \ + "rI" ((USItype)(al)), \ + "r" ((USItype)(bl))); \ + else \ + __asm__ ("{sf%I4|subf%I4c} %1,%5,%4\n\t{sfe|subfe} %0,%3,%2" \ +- : "=r" ((USItype)(sh)), \ +- "=&r" ((USItype)(sl)) \ ++ : "=r" (sh), \ ++ "=&r" (sl) \ + : "r" ((USItype)(ah)), \ + "r" ((USItype)(bh)), \ + "rI" ((USItype)(al)), \ +@@ -821,7 +821,7 @@ do { \ + do { \ + USItype __m0 = (m0), __m1 = (m1); \ + __asm__ ("mulhwu %0,%1,%2" \ +- : "=r" ((USItype) ph) \ ++ : "=r" (ph) \ + : "%r" (__m0), \ + "r" (__m1)); \ + (pl) = __m0 * __m1; \ +-- +2.20.1 + diff --git a/queue-4.9/net-bcmgenet-suppress-warnings-on-failed-rx-skb-allo.patch b/queue-4.9/net-bcmgenet-suppress-warnings-on-failed-rx-skb-allo.patch new file mode 100644 index 00000000000..443b031a719 --- /dev/null +++ b/queue-4.9/net-bcmgenet-suppress-warnings-on-failed-rx-skb-allo.patch @@ -0,0 +1,47 @@ +From 010c608d6bfd03a96c0f9668046fe0461a6f19e0 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 23 Apr 2020 16:02:11 -0700 +Subject: net: bcmgenet: suppress warnings on failed Rx SKB allocations + +From: Doug Berger + +[ Upstream commit ecaeceb8a8a145d93c7e136f170238229165348f ] + +The driver is designed to drop Rx packets and reclaim the buffers +when an allocation fails, and the network interface needs to safely +handle this packet loss. Therefore, an allocation failure of Rx +SKBs is relatively benign. + +However, the output of the warning message occurs with a high +scheduling priority that can cause excessive jitter/latency for +other high priority processing. + +This commit suppresses the warning messages to prevent scheduling +problems while retaining the failure count in the statistics of +the network interface. + +Signed-off-by: Doug Berger +Acked-by: Florian Fainelli +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/broadcom/genet/bcmgenet.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c +index a234044805977..5d4189c94718c 100644 +--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c ++++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c +@@ -1596,7 +1596,8 @@ static struct sk_buff *bcmgenet_rx_refill(struct bcmgenet_priv *priv, + dma_addr_t mapping; + + /* Allocate a new Rx skb */ +- skb = netdev_alloc_skb(priv->dev, priv->rx_buf_len + SKB_ALIGNMENT); ++ skb = __netdev_alloc_skb(priv->dev, priv->rx_buf_len + SKB_ALIGNMENT, ++ GFP_ATOMIC | __GFP_NOWARN); + if (!skb) { + priv->mib.alloc_rx_buff_failed++; + netif_err(priv, rx_err, priv->dev, +-- +2.20.1 + diff --git a/queue-4.9/net-dsa-b53-rework-arl-bin-logic.patch b/queue-4.9/net-dsa-b53-rework-arl-bin-logic.patch new file mode 100644 index 00000000000..4df9d65112c --- /dev/null +++ b/queue-4.9/net-dsa-b53-rework-arl-bin-logic.patch @@ -0,0 +1,119 @@ +From d36c892b44fc4aad20bdd354d25e88eaff81e07f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 20 Apr 2020 20:26:54 -0700 +Subject: net: dsa: b53: Rework ARL bin logic + +From: Florian Fainelli + +[ Upstream commit 6344dbde6a27d10d16246d734b968f84887841e2 ] + +When asking the ARL to read a MAC address, we will get a number of bins +returned in a single read. Out of those bins, there can essentially be 3 +states: + +- all bins are full, we have no space left, and we can either replace an + existing address or return that full condition + +- the MAC address was found, then we need to return its bin index and + modify that one, and only that one + +- the MAC address was not found and we have a least one bin free, we use + that bin index location then + +The code would unfortunately fail on all counts. + +Fixes: 1da6df85c6fb ("net: dsa: b53: Implement ARL add/del/dump operations") +Signed-off-by: Florian Fainelli +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/dsa/b53/b53_common.c | 30 ++++++++++++++++++++++++++---- + drivers/net/dsa/b53/b53_regs.h | 3 +++ + 2 files changed, 29 insertions(+), 4 deletions(-) + +diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c +index 71525950c641d..060f9b1769298 100644 +--- a/drivers/net/dsa/b53/b53_common.c ++++ b/drivers/net/dsa/b53/b53_common.c +@@ -1109,6 +1109,7 @@ static int b53_arl_read(struct b53_device *dev, u64 mac, + u16 vid, struct b53_arl_entry *ent, u8 *idx, + bool is_valid) + { ++ DECLARE_BITMAP(free_bins, B53_ARLTBL_MAX_BIN_ENTRIES); + unsigned int i; + int ret; + +@@ -1116,6 +1117,8 @@ static int b53_arl_read(struct b53_device *dev, u64 mac, + if (ret) + return ret; + ++ bitmap_zero(free_bins, dev->num_arl_entries); ++ + /* Read the bins */ + for (i = 0; i < dev->num_arl_entries; i++) { + u64 mac_vid; +@@ -1127,13 +1130,21 @@ static int b53_arl_read(struct b53_device *dev, u64 mac, + B53_ARLTBL_DATA_ENTRY(i), &fwd_entry); + b53_arl_to_entry(ent, mac_vid, fwd_entry); + +- if (!(fwd_entry & ARLTBL_VALID)) ++ if (!(fwd_entry & ARLTBL_VALID)) { ++ set_bit(i, free_bins); + continue; ++ } + if ((mac_vid & ARLTBL_MAC_MASK) != mac) + continue; + *idx = i; ++ return 0; + } + ++ if (bitmap_weight(free_bins, dev->num_arl_entries) == 0) ++ return -ENOSPC; ++ ++ *idx = find_first_bit(free_bins, dev->num_arl_entries); ++ + return -ENOENT; + } + +@@ -1163,10 +1174,21 @@ static int b53_arl_op(struct b53_device *dev, int op, int port, + if (op) + return ret; + +- /* We could not find a matching MAC, so reset to a new entry */ +- if (ret) { ++ switch (ret) { ++ case -ENOSPC: ++ dev_dbg(dev->dev, "{%pM,%.4d} no space left in ARL\n", ++ addr, vid); ++ return is_valid ? ret : 0; ++ case -ENOENT: ++ /* We could not find a matching MAC, so reset to a new entry */ ++ dev_dbg(dev->dev, "{%pM,%.4d} not found, using idx: %d\n", ++ addr, vid, idx); + fwd_entry = 0; +- idx = 1; ++ break; ++ default: ++ dev_dbg(dev->dev, "{%pM,%.4d} found, using idx: %d\n", ++ addr, vid, idx); ++ break; + } + + memset(&ent, 0, sizeof(ent)); +diff --git a/drivers/net/dsa/b53/b53_regs.h b/drivers/net/dsa/b53/b53_regs.h +index 85c44bfba55a2..3cf246c6bdcc4 100644 +--- a/drivers/net/dsa/b53/b53_regs.h ++++ b/drivers/net/dsa/b53/b53_regs.h +@@ -280,6 +280,9 @@ + #define ARLTBL_STATIC BIT(15) + #define ARLTBL_VALID BIT(16) + ++/* Maximum number of bin entries in the ARL for all switches */ ++#define B53_ARLTBL_MAX_BIN_ENTRIES 4 ++ + /* ARL Search Control Register (8 bit) */ + #define B53_ARL_SRCH_CTL 0x50 + #define B53_ARL_SRCH_CTL_25 0x20 +-- +2.20.1 + diff --git a/queue-4.9/net-stmmac-fix-sub-second-increment.patch b/queue-4.9/net-stmmac-fix-sub-second-increment.patch new file mode 100644 index 00000000000..49f37f27af3 --- /dev/null +++ b/queue-4.9/net-stmmac-fix-sub-second-increment.patch @@ -0,0 +1,78 @@ +From ddca8c8d4f1cda8f6e674a44d86c315ea2802d3c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 15 Apr 2020 14:24:32 +0200 +Subject: net: stmmac: Fix sub-second increment + +From: Julien Beraud + +[ Upstream commit 91a2559c1dc5b0f7e1256d42b1508935e8eabfbf ] + +In fine adjustement mode, which is the current default, the sub-second + increment register is the number of nanoseconds that will be added to + the clock when the accumulator overflows. At each clock cycle, the + value of the addend register is added to the accumulator. + Currently, we use 20ns = 1e09ns / 50MHz as this value whatever the + frequency of the ptp clock actually is. + The adjustment is then done on the addend register, only incrementing + every X clock cycles X being the ratio between 50MHz and ptp_clock_rate + (addend = 2^32 * 50MHz/ptp_clock_rate). + This causes the following issues : + - In case the frequency of the ptp clock is inferior or equal to 50MHz, + the addend value calculation will overflow and the default + addend value will be set to 0, causing the clock to not work at + all. (For instance, for ptp_clock_rate = 50MHz, addend = 2^32). + - The resolution of the timestamping clock is limited to 20ns while it + is not needed, thus limiting the accuracy of the timestamping to + 20ns. + + Fix this by setting sub-second increment to 2e09ns / ptp_clock_rate. + It will allow to reach the minimum possible frequency for + ptp_clk_ref, which is 5MHz for GMII 1000Mps Full-Duplex by setting the + sub-second-increment to a higher value. For instance, for 25MHz, it + gives ssinc = 80ns and default_addend = 2^31. + It will also allow to use a lower value for sub-second-increment, thus + improving the timestamping accuracy with frequencies higher than + 100MHz, for instance, for 200MHz, ssinc = 10ns and default_addend = + 2^31. + +v1->v2: + - Remove modifications to the calculation of default addend, which broke + compatibility with clock frequencies for which 2000000000 / ptp_clk_freq + is not an integer. + - Modify description according to discussions. + +Signed-off-by: Julien Beraud +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + .../net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c +index 25136941a9648..5b91a95476de2 100644 +--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c ++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c +@@ -40,12 +40,16 @@ static u32 stmmac_config_sub_second_increment(void __iomem *ioaddr, + unsigned long data; + u32 reg_value; + +- /* For GMAC3.x, 4.x versions, convert the ptp_clock to nano second +- * formula = (1/ptp_clock) * 1000000000 +- * where ptp_clock is 50MHz if fine method is used to update system ++ /* For GMAC3.x, 4.x versions, in "fine adjustement mode" set sub-second ++ * increment to twice the number of nanoseconds of a clock cycle. ++ * The calculation of the default_addend value by the caller will set it ++ * to mid-range = 2^31 when the remainder of this division is zero, ++ * which will make the accumulator overflow once every 2 ptp_clock ++ * cycles, adding twice the number of nanoseconds of a clock cycle : ++ * 2000000000ULL / ptp_clock. + */ + if (value & PTP_TCR_TSCFUPDT) +- data = (1000000000ULL / 50000000); ++ data = (2000000000ULL / ptp_clock); + else + data = (1000000000ULL / ptp_clock); + +-- +2.20.1 + diff --git a/queue-4.9/net-systemport-suppress-warnings-on-failed-rx-skb-al.patch b/queue-4.9/net-systemport-suppress-warnings-on-failed-rx-skb-al.patch new file mode 100644 index 00000000000..b499f6e37e6 --- /dev/null +++ b/queue-4.9/net-systemport-suppress-warnings-on-failed-rx-skb-al.patch @@ -0,0 +1,47 @@ +From c97d847116cf5f54f1cc69c70678b5c52d02976c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 23 Apr 2020 16:13:30 -0700 +Subject: net: systemport: suppress warnings on failed Rx SKB allocations + +From: Doug Berger + +[ Upstream commit 3554e54a46125030c534820c297ed7f6c3907e24 ] + +The driver is designed to drop Rx packets and reclaim the buffers +when an allocation fails, and the network interface needs to safely +handle this packet loss. Therefore, an allocation failure of Rx +SKBs is relatively benign. + +However, the output of the warning message occurs with a high +scheduling priority that can cause excessive jitter/latency for +other high priority processing. + +This commit suppresses the warning messages to prevent scheduling +problems while retaining the failure count in the statistics of +the network interface. + +Signed-off-by: Doug Berger +Acked-by: Florian Fainelli +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/broadcom/bcmsysport.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c +index 6519dd33c7ca2..5d67dbdd943dc 100644 +--- a/drivers/net/ethernet/broadcom/bcmsysport.c ++++ b/drivers/net/ethernet/broadcom/bcmsysport.c +@@ -504,7 +504,8 @@ static struct sk_buff *bcm_sysport_rx_refill(struct bcm_sysport_priv *priv, + dma_addr_t mapping; + + /* Allocate a new SKB for a new packet */ +- skb = netdev_alloc_skb(priv->netdev, RX_BUF_LENGTH); ++ skb = __netdev_alloc_skb(priv->netdev, RX_BUF_LENGTH, ++ GFP_ATOMIC | __GFP_NOWARN); + if (!skb) { + priv->mib.alloc_rx_buff_failed++; + netif_err(priv, rx_err, ndev, "SKB alloc failed\n"); +-- +2.20.1 + diff --git a/queue-4.9/scripts-config-allow-colons-in-option-strings-for-se.patch b/queue-4.9/scripts-config-allow-colons-in-option-strings-for-se.patch new file mode 100644 index 00000000000..d4edb71cae7 --- /dev/null +++ b/queue-4.9/scripts-config-allow-colons-in-option-strings-for-se.patch @@ -0,0 +1,48 @@ +From 69a41f8afd39c916566bab315f082198f2f61dab Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 10 Apr 2020 18:57:40 +0200 +Subject: scripts/config: allow colons in option strings for sed + +From: Jeremie Francois (on alpha) + +[ Upstream commit e461bc9f9ab105637b86065d24b0b83f182d477c ] + +Sed broke on some strings as it used colon as a separator. +I made it more robust by using \001, which is legit POSIX AFAIK. + +E.g. ./config --set-str CONFIG_USBNET_DEVADDR "de:ad:be:ef:00:01" +failed with: sed: -e expression #1, char 55: unknown option to `s' + +Signed-off-by: Jeremie Francois (on alpha) +Signed-off-by: Masahiro Yamada +Signed-off-by: Sasha Levin +--- + scripts/config | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/scripts/config b/scripts/config +index 026aeb4f32ee3..73de17d396987 100755 +--- a/scripts/config ++++ b/scripts/config +@@ -6,6 +6,9 @@ myname=${0##*/} + # If no prefix forced, use the default CONFIG_ + CONFIG_="${CONFIG_-CONFIG_}" + ++# We use an uncommon delimiter for sed substitutions ++SED_DELIM=$(echo -en "\001") ++ + usage() { + cat >&2 <"$tmpfile" ++ sed -e "s$SED_DELIM$before$SED_DELIM$after$SED_DELIM" "$infile" >"$tmpfile" + # replace original file with the edited one + mv "$tmpfile" "$infile" + } +-- +2.20.1 + diff --git a/queue-4.9/selftests-ipc-fix-test-failure-seen-after-initial-te.patch b/queue-4.9/selftests-ipc-fix-test-failure-seen-after-initial-te.patch new file mode 100644 index 00000000000..23caba09272 --- /dev/null +++ b/queue-4.9/selftests-ipc-fix-test-failure-seen-after-initial-te.patch @@ -0,0 +1,61 @@ +From 3b66b4fa68a2cd9cda9afae6e57633b579f2e71f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 13 Apr 2020 15:21:45 -0500 +Subject: selftests/ipc: Fix test failure seen after initial test run + +From: Tyler Hicks + +[ Upstream commit b87080eab4c1377706c113fc9c0157f19ea8fed1 ] + +After successfully running the IPC msgque test once, subsequent runs +result in a test failure: + + $ sudo ./run_kselftest.sh + TAP version 13 + 1..1 + # selftests: ipc: msgque + # Failed to get stats for IPC queue with id 0 + # Failed to dump queue: -22 + # Bail out! + # # Pass 0 Fail 0 Xfail 0 Xpass 0 Skip 0 Error 0 + not ok 1 selftests: ipc: msgque # exit=1 + +The dump_queue() function loops through the possible message queue index +values using calls to msgctl(kern_id, MSG_STAT, ...) where kern_id +represents the index value. The first time the test is ran, the initial +index value of 0 is valid and the test is able to complete. The index +value of 0 is not valid in subsequent test runs and the loop attempts to +try index values of 1, 2, 3, and so on until a valid index value is +found that corresponds to the message queue created earlier in the test. + +The msgctl() syscall returns -1 and sets errno to EINVAL when invalid +index values are used. The test failure is caused by incorrectly +comparing errno to -EINVAL when cycling through possible index values. + +Fix invalid test failures on subsequent runs of the msgque test by +correctly comparing errno values to a non-negated EINVAL. + +Fixes: 3a665531a3b7 ("selftests: IPC message queue copy feature test") +Signed-off-by: Tyler Hicks +Signed-off-by: Shuah Khan +Signed-off-by: Sasha Levin +--- + tools/testing/selftests/ipc/msgque.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tools/testing/selftests/ipc/msgque.c b/tools/testing/selftests/ipc/msgque.c +index 1b2ce334bb3f0..47c074d73e610 100644 +--- a/tools/testing/selftests/ipc/msgque.c ++++ b/tools/testing/selftests/ipc/msgque.c +@@ -135,7 +135,7 @@ int dump_queue(struct msgque_data *msgque) + for (kern_id = 0; kern_id < 256; kern_id++) { + ret = msgctl(kern_id, MSG_STAT, &ds); + if (ret < 0) { +- if (errno == -EINVAL) ++ if (errno == EINVAL) + continue; + printf("Failed to get stats for IPC queue with id %d\n", + kern_id); +-- +2.20.1 + diff --git a/queue-4.9/series b/queue-4.9/series index ace00595c27..31f9937618a 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -1,2 +1,13 @@ vhost-vsock-kick-send_pkt-worker-once-device-is-started.patch powerpc-pci-of-parse-unassigned-resources.patch +iio-ad7797-use-correct-attribute_group.patch +selftests-ipc-fix-test-failure-seen-after-initial-te.patch +asoc-sgtl5000-fix-vag-power-on-handling.patch +wimax-i2400m-fix-potential-urb-refcnt-leak.patch +net-stmmac-fix-sub-second-increment.patch +cifs-protect-updating-server-dstaddr-with-a-spinlock.patch +scripts-config-allow-colons-in-option-strings-for-se.patch +net-dsa-b53-rework-arl-bin-logic.patch +lib-mpi-fix-building-for-powerpc-with-clang.patch +net-bcmgenet-suppress-warnings-on-failed-rx-skb-allo.patch +net-systemport-suppress-warnings-on-failed-rx-skb-al.patch diff --git a/queue-4.9/wimax-i2400m-fix-potential-urb-refcnt-leak.patch b/queue-4.9/wimax-i2400m-fix-potential-urb-refcnt-leak.patch new file mode 100644 index 00000000000..9df38d71755 --- /dev/null +++ b/queue-4.9/wimax-i2400m-fix-potential-urb-refcnt-leak.patch @@ -0,0 +1,46 @@ +From a45607e8d00330f310e8a4fb1413caba5e2201fc Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 15 Apr 2020 16:41:20 +0800 +Subject: wimax/i2400m: Fix potential urb refcnt leak + +From: Xiyu Yang + +[ Upstream commit 7717cbec172c3554d470023b4020d5781961187e ] + +i2400mu_bus_bm_wait_for_ack() invokes usb_get_urb(), which increases the +refcount of the "notif_urb". + +When i2400mu_bus_bm_wait_for_ack() returns, local variable "notif_urb" +becomes invalid, so the refcount should be decreased to keep refcount +balanced. + +The issue happens in all paths of i2400mu_bus_bm_wait_for_ack(), which +forget to decrease the refcnt increased by usb_get_urb(), causing a +refcnt leak. + +Fix this issue by calling usb_put_urb() before the +i2400mu_bus_bm_wait_for_ack() returns. + +Signed-off-by: Xiyu Yang +Signed-off-by: Xin Tan +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/wimax/i2400m/usb-fw.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/net/wimax/i2400m/usb-fw.c b/drivers/net/wimax/i2400m/usb-fw.c +index e74664b84925e..4e4167976acf6 100644 +--- a/drivers/net/wimax/i2400m/usb-fw.c ++++ b/drivers/net/wimax/i2400m/usb-fw.c +@@ -354,6 +354,7 @@ ssize_t i2400mu_bus_bm_wait_for_ack(struct i2400m *i2400m, + usb_autopm_put_interface(i2400mu->usb_iface); + d_fnend(8, dev, "(i2400m %p ack %p size %zu) = %ld\n", + i2400m, ack, ack_size, (long) result); ++ usb_put_urb(¬if_urb); + return result; + + error_exceeded: +-- +2.20.1 + -- 2.47.3