From c882a46869339dd25070ab898201895e86878b55 Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Wed, 6 May 2020 21:32:46 -0400 Subject: [PATCH] Fixes for 4.19 Signed-off-by: Sasha Levin --- ..._hdmi-fix-incorrect-use-of-list_for_.patch | 49 +++++++ ...treat-master-ssi-in-multi-ssi-setup-.patch | 85 +++++++++++ ...mi-channel-mapping-for-multi-ssi-mod.patch | 49 +++++++ ...rent-ssi-start-stop-in-multi-ssi-mod.patch | 67 +++++++++ ...atus-check-failed-spam-for-multi-ssi.patch | 52 +++++++ ...c-sgtl5000-fix-vag-power-on-handling.patch | 89 ++++++++++++ ...gy-check-return-value-of-pcm_new_ver.patch | 43 ++++++ ...ating-server-dstaddr-with-a-spinlock.patch | 39 +++++ ...ctly-initialize-thermal-controller-f.patch | 60 ++++++++ ...-fix-building-for-powerpc-with-clang.patch | 123 ++++++++++++++++ ...press-warnings-on-failed-rx-skb-allo.patch | 47 ++++++ ...fix-enabling-socfpga-s-ptp_ref_clock.patch | 57 ++++++++ .../net-stmmac-fix-sub-second-increment.patch | 78 ++++++++++ ...uppress-warnings-on-failed-rx-skb-al.patch | 47 ++++++ ...potential-crashes-when-switching-tra.patch | 78 ++++++++++ ...llow-colons-in-option-strings-for-se.patch | 48 +++++++ ...x-test-failure-seen-after-initial-te.patch | 61 ++++++++ queue-4.19/series | 19 +++ ...-gadget-properly-set-maxpacket-limit.patch | 135 ++++++++++++++++++ ...i2400m-fix-potential-urb-refcnt-leak.patch | 46 ++++++ 20 files changed, 1272 insertions(+) create mode 100644 queue-4.19/asoc-codecs-hdac_hdmi-fix-incorrect-use-of-list_for_.patch create mode 100644 queue-4.19/asoc-rsnd-don-t-treat-master-ssi-in-multi-ssi-setup-.patch create mode 100644 queue-4.19/asoc-rsnd-fix-hdmi-channel-mapping-for-multi-ssi-mod.patch create mode 100644 queue-4.19/asoc-rsnd-fix-parent-ssi-start-stop-in-multi-ssi-mod.patch create mode 100644 queue-4.19/asoc-rsnd-fix-status-check-failed-spam-for-multi-ssi.patch create mode 100644 queue-4.19/asoc-sgtl5000-fix-vag-power-on-handling.patch create mode 100644 queue-4.19/asoc-topology-check-return-value-of-pcm_new_ver.patch create mode 100644 queue-4.19/cifs-protect-updating-server-dstaddr-with-a-spinlock.patch create mode 100644 queue-4.19/drm-amdgpu-correctly-initialize-thermal-controller-f.patch create mode 100644 queue-4.19/lib-mpi-fix-building-for-powerpc-with-clang.patch create mode 100644 queue-4.19/net-bcmgenet-suppress-warnings-on-failed-rx-skb-allo.patch create mode 100644 queue-4.19/net-stmmac-fix-enabling-socfpga-s-ptp_ref_clock.patch create mode 100644 queue-4.19/net-stmmac-fix-sub-second-increment.patch create mode 100644 queue-4.19/net-systemport-suppress-warnings-on-failed-rx-skb-al.patch create mode 100644 queue-4.19/s390-ftrace-fix-potential-crashes-when-switching-tra.patch create mode 100644 queue-4.19/scripts-config-allow-colons-in-option-strings-for-se.patch create mode 100644 queue-4.19/selftests-ipc-fix-test-failure-seen-after-initial-te.patch create mode 100644 queue-4.19/usb-dwc3-gadget-properly-set-maxpacket-limit.patch create mode 100644 queue-4.19/wimax-i2400m-fix-potential-urb-refcnt-leak.patch diff --git a/queue-4.19/asoc-codecs-hdac_hdmi-fix-incorrect-use-of-list_for_.patch b/queue-4.19/asoc-codecs-hdac_hdmi-fix-incorrect-use-of-list_for_.patch new file mode 100644 index 00000000000..e4d1cde5005 --- /dev/null +++ b/queue-4.19/asoc-codecs-hdac_hdmi-fix-incorrect-use-of-list_for_.patch @@ -0,0 +1,49 @@ +From 84e3f3f56a90e763172949cdc21be7793dadbfd8 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 15 Apr 2020 12:28:49 -0400 +Subject: ASoC: codecs: hdac_hdmi: Fix incorrect use of list_for_each_entry +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Amadeusz Sławiński + +[ Upstream commit 326b509238171d37402dbe308e154cc234ed1960 ] + +If we don't find any pcm, pcm will point at address at an offset from +the the list head and not a meaningful structure. Fix this by returning +correct pcm if found and NULL if not. Found with coccinelle. + +Signed-off-by: Amadeusz Sławiński +Link: https://lore.kernel.org/r/20200415162849.308-1-amadeuszx.slawinski@linux.intel.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/codecs/hdac_hdmi.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/sound/soc/codecs/hdac_hdmi.c b/sound/soc/codecs/hdac_hdmi.c +index be2473166bfaf..4594b1447900a 100644 +--- a/sound/soc/codecs/hdac_hdmi.c ++++ b/sound/soc/codecs/hdac_hdmi.c +@@ -148,14 +148,14 @@ static struct hdac_hdmi_pcm * + hdac_hdmi_get_pcm_from_cvt(struct hdac_hdmi_priv *hdmi, + struct hdac_hdmi_cvt *cvt) + { +- struct hdac_hdmi_pcm *pcm = NULL; ++ struct hdac_hdmi_pcm *pcm; + + list_for_each_entry(pcm, &hdmi->pcm_list, head) { + if (pcm->cvt == cvt) +- break; ++ return pcm; + } + +- return pcm; ++ return NULL; + } + + static void hdac_hdmi_jack_report(struct hdac_hdmi_pcm *pcm, +-- +2.20.1 + diff --git a/queue-4.19/asoc-rsnd-don-t-treat-master-ssi-in-multi-ssi-setup-.patch b/queue-4.19/asoc-rsnd-don-t-treat-master-ssi-in-multi-ssi-setup-.patch new file mode 100644 index 00000000000..158e2bbb2cc --- /dev/null +++ b/queue-4.19/asoc-rsnd-don-t-treat-master-ssi-in-multi-ssi-setup-.patch @@ -0,0 +1,85 @@ +From 9aff776e98ae6539b483b990bfb75294140b2967 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 17 Apr 2020 17:30:16 +0200 +Subject: ASoC: rsnd: Don't treat master SSI in multi SSI setup as parent + +From: Matthias Blankertz + +[ Upstream commit 0c258657ddfe81b4fc0183378d800c97ba0b7cdd ] + +The master SSI of a multi-SSI setup was attached both to the +RSND_MOD_SSI slot and the RSND_MOD_SSIP slot of the rsnd_dai_stream. +This is not correct wrt. the meaning of being "parent" in the rest of +the SSI code, where it seems to indicate an SSI that provides clock and +word sync but is not transmitting/receiving audio data. + +Not treating the multi-SSI master as parent allows removal of various +special cases to the rsnd_ssi_is_parent conditions introduced in commit +a09fb3f28a60 ("ASoC: rsnd: Fix parent SSI start/stop in multi-SSI mode"). +It also fixes the issue that operations performed via rsnd_dai_call() +were performed twice for the master SSI. This caused some "status check +failed" spam when stopping a multi-SSI stream as the driver attempted to +stop the master SSI twice. + +Signed-off-by: Matthias Blankertz +Acked-by: Kuninori Morimoto +Link: https://lore.kernel.org/r/20200417153017.1744454-2-matthias.blankertz@cetitec.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/sh/rcar/ssi.c | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c +index 3fe88f7743824..d5f663bb965f1 100644 +--- a/sound/soc/sh/rcar/ssi.c ++++ b/sound/soc/sh/rcar/ssi.c +@@ -375,7 +375,7 @@ static void rsnd_ssi_config_init(struct rsnd_mod *mod, + * We shouldn't exchange SWSP after running. + * This means, parent needs to care it. + */ +- if (rsnd_ssi_is_parent(mod, io) && !rsnd_ssi_multi_slaves(io)) ++ if (rsnd_ssi_is_parent(mod, io)) + goto init_end; + + if (rsnd_io_is_play(io)) +@@ -531,7 +531,7 @@ static int rsnd_ssi_start(struct rsnd_mod *mod, + * EN is for data output. + * SSI parent EN is not needed. + */ +- if (rsnd_ssi_is_parent(mod, io) && !rsnd_ssi_multi_slaves(io)) ++ if (rsnd_ssi_is_parent(mod, io)) + return 0; + + ssi->cr_en = EN; +@@ -554,7 +554,7 @@ static int rsnd_ssi_stop(struct rsnd_mod *mod, + if (!rsnd_ssi_is_run_mods(mod, io)) + return 0; + +- if (rsnd_ssi_is_parent(mod, io) && !rsnd_ssi_multi_slaves(io)) ++ if (rsnd_ssi_is_parent(mod, io)) + return 0; + + cr = ssi->cr_own | +@@ -592,7 +592,7 @@ static int rsnd_ssi_irq(struct rsnd_mod *mod, + if (rsnd_is_gen1(priv)) + return 0; + +- if (rsnd_ssi_is_parent(mod, io) && !rsnd_ssi_multi_slaves(io)) ++ if (rsnd_ssi_is_parent(mod, io)) + return 0; + + if (!rsnd_ssi_is_run_mods(mod, io)) +@@ -674,6 +674,9 @@ static void rsnd_ssi_parent_attach(struct rsnd_mod *mod, + if (!rsnd_rdai_is_clk_master(rdai)) + return; + ++ if (rsnd_ssi_is_multi_slave(mod, io)) ++ return; ++ + switch (rsnd_mod_id(mod)) { + case 1: + case 2: +-- +2.20.1 + diff --git a/queue-4.19/asoc-rsnd-fix-hdmi-channel-mapping-for-multi-ssi-mod.patch b/queue-4.19/asoc-rsnd-fix-hdmi-channel-mapping-for-multi-ssi-mod.patch new file mode 100644 index 00000000000..1d895d4c97c --- /dev/null +++ b/queue-4.19/asoc-rsnd-fix-hdmi-channel-mapping-for-multi-ssi-mod.patch @@ -0,0 +1,49 @@ +From bd188cceaa6ae223f79b4230818b5dbb06bc22d3 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 15 Apr 2020 16:10:17 +0200 +Subject: ASoC: rsnd: Fix HDMI channel mapping for multi-SSI mode + +From: Matthias Blankertz + +[ Upstream commit b94e164759b82d0c1c80d4b1c8f12c9bee83f11d ] + +The HDMI?_SEL register maps up to four stereo SSI data lanes onto the +sdata[0..3] inputs of the HDMI output block. The upper half of the +register contains four blocks of 4 bits, with the most significant +controlling the sdata3 line and the least significant the sdata0 line. + +The shift calculation has an off-by-one error, causing the parent SSI to +be mapped to sdata3, the first multi-SSI child to sdata0 and so forth. +As the parent SSI transmits the stereo L/R channels, and the HDMI core +expects it on the sdata0 line, this causes no audio to be output when +playing stereo audio on a multichannel capable HDMI out, and +multichannel audio has permutated channels. + +Fix the shift calculation to map the parent SSI to sdata0, the first +child to sdata1 etc. + +Signed-off-by: Matthias Blankertz +Acked-by: Kuninori Morimoto +Link: https://lore.kernel.org/r/20200415141017.384017-3-matthias.blankertz@cetitec.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/sh/rcar/ssiu.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sound/soc/sh/rcar/ssiu.c b/sound/soc/sh/rcar/ssiu.c +index 016fbf5ac242c..7b5eb316c3665 100644 +--- a/sound/soc/sh/rcar/ssiu.c ++++ b/sound/soc/sh/rcar/ssiu.c +@@ -172,7 +172,7 @@ static int rsnd_ssiu_init_gen2(struct rsnd_mod *mod, + i; + + for_each_rsnd_mod_array(i, pos, io, rsnd_ssi_array) { +- shift = (i * 4) + 16; ++ shift = (i * 4) + 20; + val = (val & ~(0xF << shift)) | + rsnd_mod_id(pos) << shift; + } +-- +2.20.1 + diff --git a/queue-4.19/asoc-rsnd-fix-parent-ssi-start-stop-in-multi-ssi-mod.patch b/queue-4.19/asoc-rsnd-fix-parent-ssi-start-stop-in-multi-ssi-mod.patch new file mode 100644 index 00000000000..967aeaa3431 --- /dev/null +++ b/queue-4.19/asoc-rsnd-fix-parent-ssi-start-stop-in-multi-ssi-mod.patch @@ -0,0 +1,67 @@ +From fa31fd451b1bf1d12da230ae2ff12a233e77308c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 15 Apr 2020 16:10:16 +0200 +Subject: ASoC: rsnd: Fix parent SSI start/stop in multi-SSI mode + +From: Matthias Blankertz + +[ Upstream commit a09fb3f28a60ba3e928a1fa94b0456780800299d ] + +The parent SSI of a multi-SSI setup must be fully setup, started and +stopped since it is also part of the playback/capture setup. So only +skip the SSI (as per commit 203cdf51f288 ("ASoC: rsnd: SSI parent cares +SWSP bit") and commit 597b046f0d99 ("ASoC: rsnd: control SSICR::EN +correctly")) if the SSI is parent outside of a multi-SSI setup. + +Signed-off-by: Matthias Blankertz +Acked-by: Kuninori Morimoto +Link: https://lore.kernel.org/r/20200415141017.384017-2-matthias.blankertz@cetitec.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/sh/rcar/ssi.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c +index 33dc8d6ad35b2..3fe88f7743824 100644 +--- a/sound/soc/sh/rcar/ssi.c ++++ b/sound/soc/sh/rcar/ssi.c +@@ -375,7 +375,7 @@ static void rsnd_ssi_config_init(struct rsnd_mod *mod, + * We shouldn't exchange SWSP after running. + * This means, parent needs to care it. + */ +- if (rsnd_ssi_is_parent(mod, io)) ++ if (rsnd_ssi_is_parent(mod, io) && !rsnd_ssi_multi_slaves(io)) + goto init_end; + + if (rsnd_io_is_play(io)) +@@ -531,7 +531,7 @@ static int rsnd_ssi_start(struct rsnd_mod *mod, + * EN is for data output. + * SSI parent EN is not needed. + */ +- if (rsnd_ssi_is_parent(mod, io)) ++ if (rsnd_ssi_is_parent(mod, io) && !rsnd_ssi_multi_slaves(io)) + return 0; + + ssi->cr_en = EN; +@@ -554,7 +554,7 @@ static int rsnd_ssi_stop(struct rsnd_mod *mod, + if (!rsnd_ssi_is_run_mods(mod, io)) + return 0; + +- if (rsnd_ssi_is_parent(mod, io)) ++ if (rsnd_ssi_is_parent(mod, io) && !rsnd_ssi_multi_slaves(io)) + return 0; + + cr = ssi->cr_own | +@@ -592,7 +592,7 @@ static int rsnd_ssi_irq(struct rsnd_mod *mod, + if (rsnd_is_gen1(priv)) + return 0; + +- if (rsnd_ssi_is_parent(mod, io)) ++ if (rsnd_ssi_is_parent(mod, io) && !rsnd_ssi_multi_slaves(io)) + return 0; + + if (!rsnd_ssi_is_run_mods(mod, io)) +-- +2.20.1 + diff --git a/queue-4.19/asoc-rsnd-fix-status-check-failed-spam-for-multi-ssi.patch b/queue-4.19/asoc-rsnd-fix-status-check-failed-spam-for-multi-ssi.patch new file mode 100644 index 00000000000..35c2e317db4 --- /dev/null +++ b/queue-4.19/asoc-rsnd-fix-status-check-failed-spam-for-multi-ssi.patch @@ -0,0 +1,52 @@ +From dcb5af252ffd7b1284841db11e56a4dedd96a346 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 17 Apr 2020 17:30:17 +0200 +Subject: ASoC: rsnd: Fix "status check failed" spam for multi-SSI + +From: Matthias Blankertz + +[ Upstream commit 54cb6221688660670a2e430892d7f4e6370263b8 ] + +Fix the rsnd_ssi_stop function to skip disabling the individual SSIs of +a multi-SSI setup, as the actual stop is performed by rsnd_ssiu_stop_gen2 +- the same logic as in rsnd_ssi_start. The attempt to disable these SSIs +was harmless, but caused a "status check failed" message to be printed +for every SSI in the multi-SSI setup. +The disabling of interrupts is still performed, as they are enabled for +all SSIs in rsnd_ssi_init, but care is taken to not accidentally set the +EN bit for an SSI where it was not set by rsnd_ssi_start. + +Signed-off-by: Matthias Blankertz +Acked-by: Kuninori Morimoto +Link: https://lore.kernel.org/r/20200417153017.1744454-3-matthias.blankertz@cetitec.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/sh/rcar/ssi.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c +index d5f663bb965f1..a6cf2ac223e42 100644 +--- a/sound/soc/sh/rcar/ssi.c ++++ b/sound/soc/sh/rcar/ssi.c +@@ -566,10 +566,16 @@ static int rsnd_ssi_stop(struct rsnd_mod *mod, + * Capture: It might not receave data. Do nothing + */ + if (rsnd_io_is_play(io)) { +- rsnd_mod_write(mod, SSICR, cr | EN); ++ rsnd_mod_write(mod, SSICR, cr | ssi->cr_en); + rsnd_ssi_status_check(mod, DIRQ); + } + ++ /* In multi-SSI mode, stop is performed by setting ssi0129 in ++ * SSI_CONTROL to 0 (in rsnd_ssio_stop_gen2). Do nothing here. ++ */ ++ if (rsnd_ssi_multi_slaves_runtime(io)) ++ return 0; ++ + /* + * disable SSI, + * and, wait idle state +-- +2.20.1 + diff --git a/queue-4.19/asoc-sgtl5000-fix-vag-power-on-handling.patch b/queue-4.19/asoc-sgtl5000-fix-vag-power-on-handling.patch new file mode 100644 index 00000000000..ac45338a5fa --- /dev/null +++ b/queue-4.19/asoc-sgtl5000-fix-vag-power-on-handling.patch @@ -0,0 +1,89 @@ +From 50a626b925ec05765790e0f0fc30a5e4de91b4aa 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 896412d11a31c..7c0a06b487f74 100644 +--- a/sound/soc/codecs/sgtl5000.c ++++ b/sound/soc/codecs/sgtl5000.c +@@ -1633,6 +1633,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 18cae08bbd3a6..066517e352a70 100644 +--- a/sound/soc/codecs/sgtl5000.h ++++ b/sound/soc/codecs/sgtl5000.h +@@ -233,6 +233,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.19/asoc-topology-check-return-value-of-pcm_new_ver.patch b/queue-4.19/asoc-topology-check-return-value-of-pcm_new_ver.patch new file mode 100644 index 00000000000..e5e70c9e941 --- /dev/null +++ b/queue-4.19/asoc-topology-check-return-value-of-pcm_new_ver.patch @@ -0,0 +1,43 @@ +From 18925a963995ccdab50a4b1fbdd6d4a346f79df0 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 27 Mar 2020 16:47:28 -0400 +Subject: ASoC: topology: Check return value of pcm_new_ver +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Amadeusz Sławiński + +[ Upstream commit b3677fc3d68dd942c92de52f0bd9dd8b472a40e6 ] + +Function pcm_new_ver can fail, so we should check it's return value and +handle possible error. + +Signed-off-by: Amadeusz Sławiński +Reviewed-by: Ranjani Sridharan +Reviewed-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20200327204729.397-6-amadeuszx.slawinski@linux.intel.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/soc-topology.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c +index 756dd23031063..2c6598e07dde3 100644 +--- a/sound/soc/soc-topology.c ++++ b/sound/soc/soc-topology.c +@@ -1923,7 +1923,9 @@ static int soc_tplg_pcm_elems_load(struct soc_tplg *tplg, + _pcm = pcm; + } else { + abi_match = false; +- pcm_new_ver(tplg, pcm, &_pcm); ++ ret = pcm_new_ver(tplg, pcm, &_pcm); ++ if (ret < 0) ++ return ret; + } + + /* create the FE DAIs and DAI links */ +-- +2.20.1 + diff --git a/queue-4.19/cifs-protect-updating-server-dstaddr-with-a-spinlock.patch b/queue-4.19/cifs-protect-updating-server-dstaddr-with-a-spinlock.patch new file mode 100644 index 00000000000..e627a9c87d7 --- /dev/null +++ b/queue-4.19/cifs-protect-updating-server-dstaddr-with-a-spinlock.patch @@ -0,0 +1,39 @@ +From 917ea32be267a744167e01299bf07d026b6ea291 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 975f800b9dd4d..9e569d60c636b 100644 +--- a/fs/cifs/connect.c ++++ b/fs/cifs/connect.c +@@ -353,8 +353,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.19/drm-amdgpu-correctly-initialize-thermal-controller-f.patch b/queue-4.19/drm-amdgpu-correctly-initialize-thermal-controller-f.patch new file mode 100644 index 00000000000..d8db0eb6215 --- /dev/null +++ b/queue-4.19/drm-amdgpu-correctly-initialize-thermal-controller-f.patch @@ -0,0 +1,60 @@ +From 15285fce6941974b2fe116caeb966ba7f7f7c358 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 17 Apr 2020 01:37:45 +0530 +Subject: drm/amdgpu: Correctly initialize thermal controller for GPUs with + Powerplay table v0 (e.g Hawaii) + +From: Sandeep Raghuraman + +[ Upstream commit bbc25dadc7ed19f9d6b2e30980f0eb4c741bb8bf ] + +Initialize thermal controller fields in the PowerPlay table for Hawaii +GPUs, so that fan speeds are reported. + +Signed-off-by: Sandeep Raghuraman +Signed-off-by: Alex Deucher +Signed-off-by: Sasha Levin +--- + .../drm/amd/powerplay/hwmgr/processpptables.c | 26 +++++++++++++++++++ + 1 file changed, 26 insertions(+) + +diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c b/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c +index 925e17104f909..b9e08b06ed5db 100644 +--- a/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c ++++ b/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c +@@ -983,6 +983,32 @@ static int init_thermal_controller( + struct pp_hwmgr *hwmgr, + const ATOM_PPLIB_POWERPLAYTABLE *powerplay_table) + { ++ hwmgr->thermal_controller.ucType = ++ powerplay_table->sThermalController.ucType; ++ hwmgr->thermal_controller.ucI2cLine = ++ powerplay_table->sThermalController.ucI2cLine; ++ hwmgr->thermal_controller.ucI2cAddress = ++ powerplay_table->sThermalController.ucI2cAddress; ++ ++ hwmgr->thermal_controller.fanInfo.bNoFan = ++ (0 != (powerplay_table->sThermalController.ucFanParameters & ++ ATOM_PP_FANPARAMETERS_NOFAN)); ++ ++ hwmgr->thermal_controller.fanInfo.ucTachometerPulsesPerRevolution = ++ powerplay_table->sThermalController.ucFanParameters & ++ ATOM_PP_FANPARAMETERS_TACHOMETER_PULSES_PER_REVOLUTION_MASK; ++ ++ hwmgr->thermal_controller.fanInfo.ulMinRPM ++ = powerplay_table->sThermalController.ucFanMinRPM * 100UL; ++ hwmgr->thermal_controller.fanInfo.ulMaxRPM ++ = powerplay_table->sThermalController.ucFanMaxRPM * 100UL; ++ ++ set_hw_cap(hwmgr, ++ ATOM_PP_THERMALCONTROLLER_NONE != hwmgr->thermal_controller.ucType, ++ PHM_PlatformCaps_ThermalController); ++ ++ hwmgr->thermal_controller.use_hw_fan_control = 1; ++ + return 0; + } + +-- +2.20.1 + diff --git a/queue-4.19/lib-mpi-fix-building-for-powerpc-with-clang.patch b/queue-4.19/lib-mpi-fix-building-for-powerpc-with-clang.patch new file mode 100644 index 00000000000..e11ed15b558 --- /dev/null +++ b/queue-4.19/lib-mpi-fix-building-for-powerpc-with-clang.patch @@ -0,0 +1,123 @@ +From 9578c2b6d1b1abe14c754b6ffc63a15dd7e32b58 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 08c60d10747fd..e01b705556aa6 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.19/net-bcmgenet-suppress-warnings-on-failed-rx-skb-allo.patch b/queue-4.19/net-bcmgenet-suppress-warnings-on-failed-rx-skb-allo.patch new file mode 100644 index 00000000000..9afef6e9f1b --- /dev/null +++ b/queue-4.19/net-bcmgenet-suppress-warnings-on-failed-rx-skb-allo.patch @@ -0,0 +1,47 @@ +From b301f14da456ed5f337ed209016863a2fc5f9cfa 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 789c206b515ed..89cc146d2c5c8 100644 +--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c ++++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c +@@ -1699,7 +1699,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.19/net-stmmac-fix-enabling-socfpga-s-ptp_ref_clock.patch b/queue-4.19/net-stmmac-fix-enabling-socfpga-s-ptp_ref_clock.patch new file mode 100644 index 00000000000..5684065485d --- /dev/null +++ b/queue-4.19/net-stmmac-fix-enabling-socfpga-s-ptp_ref_clock.patch @@ -0,0 +1,57 @@ +From 5a260371aa548bf911331b7fc4bed0b0421a9070 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 15 Apr 2020 14:24:31 +0200 +Subject: net: stmmac: fix enabling socfpga's ptp_ref_clock + +From: Julien Beraud + +[ Upstream commit 15ce30609d1e88d42fb1cd948f453e6d5f188249 ] + +There are 2 registers to write to enable a ptp ref clock coming from the +fpga. +One that enables the usage of the clock from the fpga for emac0 and emac1 +as a ptp ref clock, and the other to allow signals from the fpga to reach +emac0 and emac1. +Currently, if the dwmac-socfpga has phymode set to PHY_INTERFACE_MODE_MII, +PHY_INTERFACE_MODE_GMII, or PHY_INTERFACE_MODE_SGMII, both registers will +be written and the ptp ref clock will be set as coming from the fpga. +Separate the 2 register writes to only enable signals from the fpga to +reach emac0 or emac1 when ptp ref clock is not coming from the fpga. + +Signed-off-by: Julien Beraud +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c +index 5b3b06a0a3bf5..33407df6bea69 100644 +--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c ++++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c +@@ -274,16 +274,19 @@ static int socfpga_dwmac_set_phy_mode(struct socfpga_dwmac *dwmac) + phymode == PHY_INTERFACE_MODE_MII || + phymode == PHY_INTERFACE_MODE_GMII || + phymode == PHY_INTERFACE_MODE_SGMII) { +- ctrl |= SYSMGR_EMACGRP_CTRL_PTP_REF_CLK_MASK << (reg_shift / 2); + regmap_read(sys_mgr_base_addr, SYSMGR_FPGAGRP_MODULE_REG, + &module); + module |= (SYSMGR_FPGAGRP_MODULE_EMAC << (reg_shift / 2)); + regmap_write(sys_mgr_base_addr, SYSMGR_FPGAGRP_MODULE_REG, + module); +- } else { +- ctrl &= ~(SYSMGR_EMACGRP_CTRL_PTP_REF_CLK_MASK << (reg_shift / 2)); + } + ++ if (dwmac->f2h_ptp_ref_clk) ++ ctrl |= SYSMGR_EMACGRP_CTRL_PTP_REF_CLK_MASK << (reg_shift / 2); ++ else ++ ctrl &= ~(SYSMGR_EMACGRP_CTRL_PTP_REF_CLK_MASK << ++ (reg_shift / 2)); ++ + regmap_write(sys_mgr_base_addr, reg_offset, ctrl); + + /* Deassert reset for the phy configuration to be sampled by +-- +2.20.1 + diff --git a/queue-4.19/net-stmmac-fix-sub-second-increment.patch b/queue-4.19/net-stmmac-fix-sub-second-increment.patch new file mode 100644 index 00000000000..a2efc536a9e --- /dev/null +++ b/queue-4.19/net-stmmac-fix-sub-second-increment.patch @@ -0,0 +1,78 @@ +From a20f9ac7b01c13dd2fbb1a05c247d4801ef3c994 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 7423262ce5907..e1fbd7c81bfa9 100644 +--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c ++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c +@@ -36,12 +36,16 @@ static void 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.19/net-systemport-suppress-warnings-on-failed-rx-skb-al.patch b/queue-4.19/net-systemport-suppress-warnings-on-failed-rx-skb-al.patch new file mode 100644 index 00000000000..70cf4479ab9 --- /dev/null +++ b/queue-4.19/net-systemport-suppress-warnings-on-failed-rx-skb-al.patch @@ -0,0 +1,47 @@ +From 5c6af3ea7b094320402e44e76f9f996eb27112d5 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 3fdf135bad56e..6b761f6b8fd56 100644 +--- a/drivers/net/ethernet/broadcom/bcmsysport.c ++++ b/drivers/net/ethernet/broadcom/bcmsysport.c +@@ -677,7 +677,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.19/s390-ftrace-fix-potential-crashes-when-switching-tra.patch b/queue-4.19/s390-ftrace-fix-potential-crashes-when-switching-tra.patch new file mode 100644 index 00000000000..1256b244e08 --- /dev/null +++ b/queue-4.19/s390-ftrace-fix-potential-crashes-when-switching-tra.patch @@ -0,0 +1,78 @@ +From bcc2179f66601c0c97032c690990989a24bde473 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 6 Apr 2020 14:47:48 +0200 +Subject: s390/ftrace: fix potential crashes when switching tracers + +From: Philipp Rudo + +[ Upstream commit 8ebf6da9db1b2a20bb86cc1bee2552e894d03308 ] + +Switching tracers include instruction patching. To prevent that a +instruction is patched while it's read the instruction patching is done +in stop_machine 'context'. This also means that any function called +during stop_machine must not be traced. Thus add 'notrace' to all +functions called within stop_machine. + +Fixes: 1ec2772e0c3c ("s390/diag: add a statistic for diagnose calls") +Fixes: 38f2c691a4b3 ("s390: improve wait logic of stop_machine") +Fixes: 4ecf0a43e729 ("processor: get rid of cpu_relax_yield") +Signed-off-by: Philipp Rudo +Signed-off-by: Vasily Gorbik +Signed-off-by: Sasha Levin +--- + arch/s390/kernel/diag.c | 2 +- + arch/s390/kernel/smp.c | 4 ++-- + arch/s390/kernel/trace.c | 2 +- + 3 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/arch/s390/kernel/diag.c b/arch/s390/kernel/diag.c +index 35c842aa87058..4c7cf8787a848 100644 +--- a/arch/s390/kernel/diag.c ++++ b/arch/s390/kernel/diag.c +@@ -128,7 +128,7 @@ void diag_stat_inc(enum diag_stat_enum nr) + } + EXPORT_SYMBOL(diag_stat_inc); + +-void diag_stat_inc_norecursion(enum diag_stat_enum nr) ++void notrace diag_stat_inc_norecursion(enum diag_stat_enum nr) + { + this_cpu_inc(diag_stat.counter[nr]); + trace_s390_diagnose_norecursion(diag_map[nr].code); +diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c +index ecd24711f3aa9..8e31dfd85de32 100644 +--- a/arch/s390/kernel/smp.c ++++ b/arch/s390/kernel/smp.c +@@ -393,7 +393,7 @@ int smp_find_processor_id(u16 address) + return -1; + } + +-bool arch_vcpu_is_preempted(int cpu) ++bool notrace arch_vcpu_is_preempted(int cpu) + { + if (test_cpu_flag_of(CIF_ENABLED_WAIT, cpu)) + return false; +@@ -403,7 +403,7 @@ bool arch_vcpu_is_preempted(int cpu) + } + EXPORT_SYMBOL(arch_vcpu_is_preempted); + +-void smp_yield_cpu(int cpu) ++void notrace smp_yield_cpu(int cpu) + { + if (MACHINE_HAS_DIAG9C) { + diag_stat_inc_norecursion(DIAG_STAT_X09C); +diff --git a/arch/s390/kernel/trace.c b/arch/s390/kernel/trace.c +index 490b52e850145..11a669f3cc93c 100644 +--- a/arch/s390/kernel/trace.c ++++ b/arch/s390/kernel/trace.c +@@ -14,7 +14,7 @@ EXPORT_TRACEPOINT_SYMBOL(s390_diagnose); + + static DEFINE_PER_CPU(unsigned int, diagnose_trace_depth); + +-void trace_s390_diagnose_norecursion(int diag_nr) ++void notrace trace_s390_diagnose_norecursion(int diag_nr) + { + unsigned long flags; + unsigned int *depth; +-- +2.20.1 + diff --git a/queue-4.19/scripts-config-allow-colons-in-option-strings-for-se.patch b/queue-4.19/scripts-config-allow-colons-in-option-strings-for-se.patch new file mode 100644 index 00000000000..4b6fd372a32 --- /dev/null +++ b/queue-4.19/scripts-config-allow-colons-in-option-strings-for-se.patch @@ -0,0 +1,48 @@ +From 033ad49f22c3afdb5117c712e08b21dad1501ea1 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 e0e39826dae90..eee5b7f3a092a 100755 +--- a/scripts/config ++++ b/scripts/config +@@ -7,6 +7,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.19/selftests-ipc-fix-test-failure-seen-after-initial-te.patch b/queue-4.19/selftests-ipc-fix-test-failure-seen-after-initial-te.patch new file mode 100644 index 00000000000..757146897b7 --- /dev/null +++ b/queue-4.19/selftests-ipc-fix-test-failure-seen-after-initial-te.patch @@ -0,0 +1,61 @@ +From 261b33403babc8f68a6b7d6f94416b5628b13607 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 4c156aeab6b80..5ec4d9e18806c 100644 +--- a/tools/testing/selftests/ipc/msgque.c ++++ b/tools/testing/selftests/ipc/msgque.c +@@ -137,7 +137,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.19/series b/queue-4.19/series index ace00595c27..8d5583f6e01 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -1,2 +1,21 @@ vhost-vsock-kick-send_pkt-worker-once-device-is-started.patch powerpc-pci-of-parse-unassigned-resources.patch +asoc-topology-check-return-value-of-pcm_new_ver.patch +selftests-ipc-fix-test-failure-seen-after-initial-te.patch +asoc-sgtl5000-fix-vag-power-on-handling.patch +usb-dwc3-gadget-properly-set-maxpacket-limit.patch +asoc-rsnd-fix-parent-ssi-start-stop-in-multi-ssi-mod.patch +asoc-rsnd-fix-hdmi-channel-mapping-for-multi-ssi-mod.patch +asoc-codecs-hdac_hdmi-fix-incorrect-use-of-list_for_.patch +drm-amdgpu-correctly-initialize-thermal-controller-f.patch +wimax-i2400m-fix-potential-urb-refcnt-leak.patch +net-stmmac-fix-enabling-socfpga-s-ptp_ref_clock.patch +net-stmmac-fix-sub-second-increment.patch +asoc-rsnd-don-t-treat-master-ssi-in-multi-ssi-setup-.patch +asoc-rsnd-fix-status-check-failed-spam-for-multi-ssi.patch +cifs-protect-updating-server-dstaddr-with-a-spinlock.patch +s390-ftrace-fix-potential-crashes-when-switching-tra.patch +scripts-config-allow-colons-in-option-strings-for-se.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.19/usb-dwc3-gadget-properly-set-maxpacket-limit.patch b/queue-4.19/usb-dwc3-gadget-properly-set-maxpacket-limit.patch new file mode 100644 index 00000000000..02a5c191a35 --- /dev/null +++ b/queue-4.19/usb-dwc3-gadget-properly-set-maxpacket-limit.patch @@ -0,0 +1,135 @@ +From 4616acb0710e778737476c8c63747da8ba3a0464 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 31 Jan 2020 16:59:27 -0800 +Subject: usb: dwc3: gadget: Properly set maxpacket limit + +From: Thinh Nguyen + +[ Upstream commit d94ea5319813658ad5861d161ae16a194c2abf88 ] + +Currently the calculation of max packet size limit for IN endpoints is +too restrictive. This prevents a matching of a capable hardware endpoint +during configuration. Below is the minimum recommended HW configuration +to support a particular endpoint setup from the databook: + +For OUT endpoints, the databook recommended the minimum RxFIFO size to +be at least 3x MaxPacketSize + 3x setup packets size (8 bytes each) + +clock crossing margin (16 bytes). + +For IN endpoints, the databook recommended the minimum TxFIFO size to be +at least 3x MaxPacketSize for endpoints that support burst. If the +endpoint doesn't support burst or when the device is operating in USB +2.0 mode, a minimum TxFIFO size of 2x MaxPacketSize is recommended. + +Base on these recommendations, we can calculate the MaxPacketSize limit +of each endpoint. This patch revises the IN endpoint MaxPacketSize limit +and also sets the MaxPacketSize limit for OUT endpoints. + +Reference: Databook 3.30a section 3.2.2 and 3.2.3 + +Signed-off-by: Thinh Nguyen +Signed-off-by: Felipe Balbi +Signed-off-by: Sasha Levin +--- + drivers/usb/dwc3/core.h | 4 +++ + drivers/usb/dwc3/gadget.c | 52 ++++++++++++++++++++++++++++++--------- + 2 files changed, 45 insertions(+), 11 deletions(-) + +diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h +index e34308d64619e..d6968b90ee6bb 100644 +--- a/drivers/usb/dwc3/core.h ++++ b/drivers/usb/dwc3/core.h +@@ -300,6 +300,10 @@ + #define DWC3_GTXFIFOSIZ_TXFDEF(n) ((n) & 0xffff) + #define DWC3_GTXFIFOSIZ_TXFSTADDR(n) ((n) & 0xffff0000) + ++/* Global RX Fifo Size Register */ ++#define DWC31_GRXFIFOSIZ_RXFDEP(n) ((n) & 0x7fff) /* DWC_usb31 only */ ++#define DWC3_GRXFIFOSIZ_RXFDEP(n) ((n) & 0xffff) ++ + /* Global Event Size Registers */ + #define DWC3_GEVNTSIZ_INTMASK BIT(31) + #define DWC3_GEVNTSIZ_SIZE(n) ((n) & 0xffff) +diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c +index 1a6c973da4879..99f6a5aa01095 100644 +--- a/drivers/usb/dwc3/gadget.c ++++ b/drivers/usb/dwc3/gadget.c +@@ -2032,7 +2032,6 @@ static int dwc3_gadget_init_in_endpoint(struct dwc3_ep *dep) + { + struct dwc3 *dwc = dep->dwc; + int mdwidth; +- int kbytes; + int size; + + mdwidth = DWC3_MDWIDTH(dwc->hwparams.hwparams0); +@@ -2048,17 +2047,17 @@ static int dwc3_gadget_init_in_endpoint(struct dwc3_ep *dep) + /* FIFO Depth is in MDWDITH bytes. Multiply */ + size *= mdwidth; + +- kbytes = size / 1024; +- if (kbytes == 0) +- kbytes = 1; +- + /* +- * FIFO sizes account an extra MDWIDTH * (kbytes + 1) bytes for +- * internal overhead. We don't really know how these are used, +- * but documentation say it exists. ++ * To meet performance requirement, a minimum TxFIFO size of 3x ++ * MaxPacketSize is recommended for endpoints that support burst and a ++ * minimum TxFIFO size of 2x MaxPacketSize for endpoints that don't ++ * support burst. Use those numbers and we can calculate the max packet ++ * limit as below. + */ +- size -= mdwidth * (kbytes + 1); +- size /= kbytes; ++ if (dwc->maximum_speed >= USB_SPEED_SUPER) ++ size /= 3; ++ else ++ size /= 2; + + usb_ep_set_maxpacket_limit(&dep->endpoint, size); + +@@ -2076,8 +2075,39 @@ static int dwc3_gadget_init_in_endpoint(struct dwc3_ep *dep) + static int dwc3_gadget_init_out_endpoint(struct dwc3_ep *dep) + { + struct dwc3 *dwc = dep->dwc; ++ int mdwidth; ++ int size; ++ ++ mdwidth = DWC3_MDWIDTH(dwc->hwparams.hwparams0); ++ ++ /* MDWIDTH is represented in bits, convert to bytes */ ++ mdwidth /= 8; + +- usb_ep_set_maxpacket_limit(&dep->endpoint, 1024); ++ /* All OUT endpoints share a single RxFIFO space */ ++ size = dwc3_readl(dwc->regs, DWC3_GRXFIFOSIZ(0)); ++ if (dwc3_is_usb31(dwc)) ++ size = DWC31_GRXFIFOSIZ_RXFDEP(size); ++ else ++ size = DWC3_GRXFIFOSIZ_RXFDEP(size); ++ ++ /* FIFO depth is in MDWDITH bytes */ ++ size *= mdwidth; ++ ++ /* ++ * To meet performance requirement, a minimum recommended RxFIFO size ++ * is defined as follow: ++ * RxFIFO size >= (3 x MaxPacketSize) + ++ * (3 x 8 bytes setup packets size) + (16 bytes clock crossing margin) ++ * ++ * Then calculate the max packet limit as below. ++ */ ++ size -= (3 * 8) + 16; ++ if (size < 0) ++ size = 0; ++ else ++ size /= 3; ++ ++ usb_ep_set_maxpacket_limit(&dep->endpoint, size); + dep->endpoint.max_streams = 15; + dep->endpoint.ops = &dwc3_gadget_ep_ops; + list_add_tail(&dep->endpoint.ep_list, +-- +2.20.1 + diff --git a/queue-4.19/wimax-i2400m-fix-potential-urb-refcnt-leak.patch b/queue-4.19/wimax-i2400m-fix-potential-urb-refcnt-leak.patch new file mode 100644 index 00000000000..9da9ee33ec2 --- /dev/null +++ b/queue-4.19/wimax-i2400m-fix-potential-urb-refcnt-leak.patch @@ -0,0 +1,46 @@ +From febd59cc311a149756283fdf47a9258bc51dcef2 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 529ebca1e9e13..1f7709d24f352 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