From 41a323ef5b59263552dba5005ce42d21e0d27ab9 Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Fri, 18 Oct 2019 18:29:09 -0400 Subject: [PATCH] fixes for 4.14 Signed-off-by: Sasha Levin --- ...set-memory-bandwidth-limit-for-dispc.patch | 39 +++++++++ ...ssing-reset-done-flag-for-am3-and-am.patch | 53 ++++++++++++ ...eee802154-ca8210-prevent-memory-leak.patch | 42 +++++++++ ...211-fix-txq-null-pointer-dereference.patch | 77 +++++++++++++++++ ...ar9331-fix-interrupt-controller-size.patch | 42 +++++++++ ...x-the-link-time-qualifier-of-serial_.patch | 41 +++++++++ ...mespace.pl-script-to-support-relativ.patch | 86 +++++++++++++++++++ ...use-up-to-7-ports-for-all-operations.patch | 57 ++++++++++++ ...x-usage-of-uninitialized-variable-in.patch | 46 ++++++++++ ...nl80211-fix-null-pointer-dereference.patch | 62 +++++++++++++ ...macpassthru-in-reset_resume-callback.patch | 46 ++++++++++ ...sable-device-when-probe-failed-after.patch | 42 +++++++++ ...-unbound-sleep-in-fcport-delete-path.patch | 47 ++++++++++ ...-skip-shutdown-if-hba-is-not-powered.patch | 46 ++++++++++ queue-4.14/series | 15 ++++ .../xen-efi-set-nonblocking-callbacks.patch | 54 ++++++++++++ 16 files changed, 795 insertions(+) create mode 100644 queue-4.14/arm-dts-am4372-set-memory-bandwidth-limit-for-dispc.patch create mode 100644 queue-4.14/arm-omap2-fix-missing-reset-done-flag-for-am3-and-am.patch create mode 100644 queue-4.14/ieee802154-ca8210-prevent-memory-leak.patch create mode 100644 queue-4.14/mac80211-fix-txq-null-pointer-dereference.patch create mode 100644 queue-4.14/mips-dts-ar9331-fix-interrupt-controller-size.patch create mode 100644 queue-4.14/mips-loongson-fix-the-link-time-qualifier-of-serial_.patch create mode 100644 queue-4.14/namespace-fix-namespace.pl-script-to-support-relativ.patch create mode 100644 queue-4.14/net-dsa-qca8k-use-up-to-7-ports-for-all-operations.patch create mode 100644 queue-4.14/net-hisilicon-fix-usage-of-uninitialized-variable-in.patch create mode 100644 queue-4.14/nl80211-fix-null-pointer-dereference.patch create mode 100644 queue-4.14/r8152-set-macpassthru-in-reset_resume-callback.patch create mode 100644 queue-4.14/scsi-megaraid-disable-device-when-probe-failed-after.patch create mode 100644 queue-4.14/scsi-qla2xxx-fix-unbound-sleep-in-fcport-delete-path.patch create mode 100644 queue-4.14/scsi-ufs-skip-shutdown-if-hba-is-not-powered.patch create mode 100644 queue-4.14/series create mode 100644 queue-4.14/xen-efi-set-nonblocking-callbacks.patch diff --git a/queue-4.14/arm-dts-am4372-set-memory-bandwidth-limit-for-dispc.patch b/queue-4.14/arm-dts-am4372-set-memory-bandwidth-limit-for-dispc.patch new file mode 100644 index 00000000000..7451d37744e --- /dev/null +++ b/queue-4.14/arm-dts-am4372-set-memory-bandwidth-limit-for-dispc.patch @@ -0,0 +1,39 @@ +From 0e3960d452d13434e30e2e942cba2339f7224bf1 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 30 Sep 2019 11:54:50 +0300 +Subject: ARM: dts: am4372: Set memory bandwidth limit for DISPC + +From: Peter Ujfalusi + +[ Upstream commit f90ec6cdf674248dcad85bf9af6e064bf472b841 ] + +Set memory bandwidth limit to filter out resolutions above 720p@60Hz to +avoid underflow errors due to the bandwidth needs of higher resolutions. + +am43xx can not provide enough bandwidth to DISPC to correctly handle +'high' resolutions. + +Signed-off-by: Peter Ujfalusi +Signed-off-by: Tomi Valkeinen +Signed-off-by: Tony Lindgren +Signed-off-by: Sasha Levin +--- + arch/arm/boot/dts/am4372.dtsi | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/arch/arm/boot/dts/am4372.dtsi b/arch/arm/boot/dts/am4372.dtsi +index 4714a59fd86df..345c117bd5ef5 100644 +--- a/arch/arm/boot/dts/am4372.dtsi ++++ b/arch/arm/boot/dts/am4372.dtsi +@@ -1118,6 +1118,8 @@ + ti,hwmods = "dss_dispc"; + clocks = <&disp_clk>; + clock-names = "fck"; ++ ++ max-memory-bandwidth = <230000000>; + }; + + rfbi: rfbi@4832a800 { +-- +2.20.1 + diff --git a/queue-4.14/arm-omap2-fix-missing-reset-done-flag-for-am3-and-am.patch b/queue-4.14/arm-omap2-fix-missing-reset-done-flag-for-am3-and-am.patch new file mode 100644 index 00000000000..ecd6bd3e21e --- /dev/null +++ b/queue-4.14/arm-omap2-fix-missing-reset-done-flag-for-am3-and-am.patch @@ -0,0 +1,53 @@ +From 8af199f0e9518823298b5118704784f2143ac4b7 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 24 Sep 2019 09:25:52 -0700 +Subject: ARM: OMAP2+: Fix missing reset done flag for am3 and am43 + +From: Tony Lindgren + +[ Upstream commit 8ad8041b98c665b6147e607b749586d6e20ba73a ] + +For ti,sysc-omap4 compatible devices with no sysstatus register, we do have +reset done status available in the SOFTRESET bit that clears when the reset +is done. This is documented for example in am437x TRM for DMTIMER_TIOCP_CFG +register. The am335x TRM just says that SOFTRESET bit value 1 means reset is +ongoing, but it behaves the same way clearing after reset is done. + +With the ti-sysc driver handling this automatically based on no sysstatus +register defined, we see warnings if SYSC_HAS_RESET_STATUS is missing in the +legacy platform data: + +ti-sysc 48042000.target-module: sysc_flags 00000222 != 00000022 +ti-sysc 48044000.target-module: sysc_flags 00000222 != 00000022 +ti-sysc 48046000.target-module: sysc_flags 00000222 != 00000022 +... + +Let's fix these warnings by adding SYSC_HAS_RESET_STATUS. Let's also +remove the useless parentheses while at it. + +If it turns out we do have ti,sysc-omap4 compatible devices without a +working SOFTRESET bit we can set up additional quirk handling for it. + +Signed-off-by: Tony Lindgren +Signed-off-by: Sasha Levin +--- + arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c b/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c +index de06a1d5ffab5..e61c14f590634 100644 +--- a/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c ++++ b/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c +@@ -966,7 +966,8 @@ static struct omap_hwmod_class_sysconfig am33xx_timer_sysc = { + .rev_offs = 0x0000, + .sysc_offs = 0x0010, + .syss_offs = 0x0014, +- .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET), ++ .sysc_flags = SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET | ++ SYSC_HAS_RESET_STATUS, + .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | + SIDLE_SMART_WKUP), + .sysc_fields = &omap_hwmod_sysc_type2, +-- +2.20.1 + diff --git a/queue-4.14/ieee802154-ca8210-prevent-memory-leak.patch b/queue-4.14/ieee802154-ca8210-prevent-memory-leak.patch new file mode 100644 index 00000000000..3806d5f65e1 --- /dev/null +++ b/queue-4.14/ieee802154-ca8210-prevent-memory-leak.patch @@ -0,0 +1,42 @@ +From dc7f4609085aed3da0117362d6ab5a4ab827c681 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 17 Sep 2019 17:47:12 -0500 +Subject: ieee802154: ca8210: prevent memory leak + +From: Navid Emamdoost + +[ Upstream commit 6402939ec86eaf226c8b8ae00ed983936b164908 ] + +In ca8210_probe the allocated pdata needs to be assigned to +spi_device->dev.platform_data before calling ca8210_get_platform_data. +Othrwise when ca8210_get_platform_data fails pdata cannot be released. + +Signed-off-by: Navid Emamdoost +Link: https://lore.kernel.org/r/20190917224713.26371-1-navid.emamdoost@gmail.com +Signed-off-by: Stefan Schmidt +Signed-off-by: Sasha Levin +--- + drivers/net/ieee802154/ca8210.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/net/ieee802154/ca8210.c b/drivers/net/ieee802154/ca8210.c +index dcd10dba08c72..3a58962babd41 100644 +--- a/drivers/net/ieee802154/ca8210.c ++++ b/drivers/net/ieee802154/ca8210.c +@@ -3153,12 +3153,12 @@ static int ca8210_probe(struct spi_device *spi_device) + goto error; + } + ++ priv->spi->dev.platform_data = pdata; + ret = ca8210_get_platform_data(priv->spi, pdata); + if (ret) { + dev_crit(&spi_device->dev, "ca8210_get_platform_data failed\n"); + goto error; + } +- priv->spi->dev.platform_data = pdata; + + ret = ca8210_dev_com_init(priv); + if (ret) { +-- +2.20.1 + diff --git a/queue-4.14/mac80211-fix-txq-null-pointer-dereference.patch b/queue-4.14/mac80211-fix-txq-null-pointer-dereference.patch new file mode 100644 index 00000000000..b616deda9b9 --- /dev/null +++ b/queue-4.14/mac80211-fix-txq-null-pointer-dereference.patch @@ -0,0 +1,77 @@ +From 911963078b32f4a6f07d59293cf4657c22352685 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 27 Sep 2019 10:03:16 +0800 +Subject: mac80211: fix txq null pointer dereference +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Miaoqing Pan + +[ Upstream commit 8ed31a264065ae92058ce54aa3cc8da8d81dc6d7 ] + +If the interface type is P2P_DEVICE or NAN, read the file of +'/sys/kernel/debug/ieee80211/phyx/netdev:wlanx/aqm' will get a +NULL pointer dereference. As for those interface type, the +pointer sdata->vif.txq is NULL. + +Unable to handle kernel NULL pointer dereference at virtual address 00000011 +CPU: 1 PID: 30936 Comm: cat Not tainted 4.14.104 #1 +task: ffffffc0337e4880 task.stack: ffffff800cd20000 +PC is at ieee80211_if_fmt_aqm+0x34/0xa0 [mac80211] +LR is at ieee80211_if_fmt_aqm+0x34/0xa0 [mac80211] +[...] +Process cat (pid: 30936, stack limit = 0xffffff800cd20000) +[...] +[] ieee80211_if_fmt_aqm+0x34/0xa0 [mac80211] +[] ieee80211_if_read+0x60/0xbc [mac80211] +[] ieee80211_if_read_aqm+0x28/0x30 [mac80211] +[] full_proxy_read+0x2c/0x48 +[] __vfs_read+0x2c/0xd4 +[] vfs_read+0x8c/0x108 +[] SyS_read+0x40/0x7c + +Signed-off-by: Miaoqing Pan +Acked-by: Toke Høiland-Jørgensen +Link: https://lore.kernel.org/r/1569549796-8223-1-git-send-email-miaoqing@codeaurora.org +[trim useless data from commit message] +Signed-off-by: Johannes Berg +Signed-off-by: Sasha Levin +--- + net/mac80211/debugfs_netdev.c | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +diff --git a/net/mac80211/debugfs_netdev.c b/net/mac80211/debugfs_netdev.c +index c813207bb1236..928b6b0464b82 100644 +--- a/net/mac80211/debugfs_netdev.c ++++ b/net/mac80211/debugfs_netdev.c +@@ -490,9 +490,14 @@ static ssize_t ieee80211_if_fmt_aqm( + const struct ieee80211_sub_if_data *sdata, char *buf, int buflen) + { + struct ieee80211_local *local = sdata->local; +- struct txq_info *txqi = to_txq_info(sdata->vif.txq); ++ struct txq_info *txqi; + int len; + ++ if (!sdata->vif.txq) ++ return 0; ++ ++ txqi = to_txq_info(sdata->vif.txq); ++ + spin_lock_bh(&local->fq.lock); + rcu_read_lock(); + +@@ -659,7 +664,9 @@ static void add_common_files(struct ieee80211_sub_if_data *sdata) + DEBUGFS_ADD(rc_rateidx_vht_mcs_mask_5ghz); + DEBUGFS_ADD(hw_queues); + +- if (sdata->local->ops->wake_tx_queue) ++ if (sdata->local->ops->wake_tx_queue && ++ sdata->vif.type != NL80211_IFTYPE_P2P_DEVICE && ++ sdata->vif.type != NL80211_IFTYPE_NAN) + DEBUGFS_ADD(aqm); + } + +-- +2.20.1 + diff --git a/queue-4.14/mips-dts-ar9331-fix-interrupt-controller-size.patch b/queue-4.14/mips-dts-ar9331-fix-interrupt-controller-size.patch new file mode 100644 index 00000000000..4bed94a5fd5 --- /dev/null +++ b/queue-4.14/mips-dts-ar9331-fix-interrupt-controller-size.patch @@ -0,0 +1,42 @@ +From b37f66ce1c872e1c1d491f1cc288d590b86c2206 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 30 Sep 2019 11:39:52 +0200 +Subject: MIPS: dts: ar9331: fix interrupt-controller size + +From: Oleksij Rempel + +[ Upstream commit 0889d07f3e4b171c453b2aaf2b257f9074cdf624 ] + +It is two registers each of 4 byte. + +Signed-off-by: Oleksij Rempel +Signed-off-by: Paul Burton +Cc: Rob Herring +Cc: Mark Rutland +Cc: Pengutronix Kernel Team +Cc: Ralf Baechle +Cc: James Hogan +Cc: devicetree@vger.kernel.org +Cc: linux-mips@vger.kernel.org +Cc: linux-kernel@vger.kernel.org +Signed-off-by: Sasha Levin +--- + arch/mips/boot/dts/qca/ar9331.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/mips/boot/dts/qca/ar9331.dtsi b/arch/mips/boot/dts/qca/ar9331.dtsi +index efd5f07222060..39b6269610d41 100644 +--- a/arch/mips/boot/dts/qca/ar9331.dtsi ++++ b/arch/mips/boot/dts/qca/ar9331.dtsi +@@ -99,7 +99,7 @@ + + miscintc: interrupt-controller@18060010 { + compatible = "qca,ar7240-misc-intc"; +- reg = <0x18060010 0x4>; ++ reg = <0x18060010 0x8>; + + interrupt-parent = <&cpuintc>; + interrupts = <6>; +-- +2.20.1 + diff --git a/queue-4.14/mips-loongson-fix-the-link-time-qualifier-of-serial_.patch b/queue-4.14/mips-loongson-fix-the-link-time-qualifier-of-serial_.patch new file mode 100644 index 00000000000..6111d60deb0 --- /dev/null +++ b/queue-4.14/mips-loongson-fix-the-link-time-qualifier-of-serial_.patch @@ -0,0 +1,41 @@ +From 44b8adb7e90d8c3b27fa05a6e90f8db9a3686b0f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 10 Sep 2019 05:59:07 +0200 +Subject: mips: Loongson: Fix the link time qualifier of 'serial_exit()' + +From: Christophe JAILLET + +[ Upstream commit 25b69a889b638b0b7e51e2c4fe717a66bec0e566 ] + +'exit' functions should be marked as __exit, not __init. + +Fixes: 85cc028817ef ("mips: make loongsoon serial driver explicitly modular") +Signed-off-by: Christophe JAILLET +Signed-off-by: Paul Burton +Cc: chenhc@lemote.com +Cc: ralf@linux-mips.org +Cc: jhogan@kernel.org +Cc: linux-mips@vger.kernel.org +Cc: linux-kernel@vger.kernel.org +Cc: kernel-janitors@vger.kernel.org +Signed-off-by: Sasha Levin +--- + arch/mips/loongson64/common/serial.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/mips/loongson64/common/serial.c b/arch/mips/loongson64/common/serial.c +index ffefc1cb26121..98c3a7feb10f8 100644 +--- a/arch/mips/loongson64/common/serial.c ++++ b/arch/mips/loongson64/common/serial.c +@@ -110,7 +110,7 @@ static int __init serial_init(void) + } + module_init(serial_init); + +-static void __init serial_exit(void) ++static void __exit serial_exit(void) + { + platform_device_unregister(&uart8250_device); + } +-- +2.20.1 + diff --git a/queue-4.14/namespace-fix-namespace.pl-script-to-support-relativ.patch b/queue-4.14/namespace-fix-namespace.pl-script-to-support-relativ.patch new file mode 100644 index 00000000000..876647c2c87 --- /dev/null +++ b/queue-4.14/namespace-fix-namespace.pl-script-to-support-relativ.patch @@ -0,0 +1,86 @@ +From 05f90d2ceed127e03183920b3dd3bf87bd7cc30a Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 27 Sep 2019 16:30:27 -0700 +Subject: namespace: fix namespace.pl script to support relative paths + +From: Jacob Keller + +[ Upstream commit 82fdd12b95727640c9a8233c09d602e4518e71f7 ] + +The namespace.pl script does not work properly if objtree is not set to +an absolute path. The do_nm function is run from within the find +function, which changes directories. + +Because of this, appending objtree, $File::Find::dir, and $source, will +return a path which is not valid from the current directory. + +This used to work when objtree was set to an absolute path when using +"make namespacecheck". It appears to have not worked when calling +./scripts/namespace.pl directly. + +This behavior was changed in 7e1c04779efd ("kbuild: Use relative path +for $(objtree)", 2014-05-14) + +Rather than fixing the Makefile to set objtree to an absolute path, just +fix namespace.pl to work when srctree and objtree are relative. Also fix +the script to use an absolute path for these by default. + +Use the File::Spec module for this purpose. It's been part of perl +5 since 5.005. + +The curdir() function is used to get the current directory when the +objtree and srctree aren't set in the environment. + +rel2abs() is used to convert possibly relative objtree and srctree +environment variables to absolute paths. + +Finally, the catfile() function is used instead of string appending +paths together, since this is more robust when joining paths together. + +Signed-off-by: Jacob Keller +Acked-by: Randy Dunlap +Tested-by: Randy Dunlap +Signed-off-by: Masahiro Yamada +Signed-off-by: Sasha Levin +--- + scripts/namespace.pl | 13 +++++++------ + 1 file changed, 7 insertions(+), 6 deletions(-) + +diff --git a/scripts/namespace.pl b/scripts/namespace.pl +index 729c547fc9e1e..30c43e639db8a 100755 +--- a/scripts/namespace.pl ++++ b/scripts/namespace.pl +@@ -65,13 +65,14 @@ + use warnings; + use strict; + use File::Find; ++use File::Spec; + + my $nm = ($ENV{'NM'} || "nm") . " -p"; + my $objdump = ($ENV{'OBJDUMP'} || "objdump") . " -s -j .comment"; +-my $srctree = ""; +-my $objtree = ""; +-$srctree = "$ENV{'srctree'}/" if (exists($ENV{'srctree'})); +-$objtree = "$ENV{'objtree'}/" if (exists($ENV{'objtree'})); ++my $srctree = File::Spec->curdir(); ++my $objtree = File::Spec->curdir(); ++$srctree = File::Spec->rel2abs($ENV{'srctree'}) if (exists($ENV{'srctree'})); ++$objtree = File::Spec->rel2abs($ENV{'objtree'}) if (exists($ENV{'objtree'})); + + if ($#ARGV != -1) { + print STDERR "usage: $0 takes no parameters\n"; +@@ -231,9 +232,9 @@ sub do_nm + } + ($source = $basename) =~ s/\.o$//; + if (-e "$source.c" || -e "$source.S") { +- $source = "$objtree$File::Find::dir/$source"; ++ $source = File::Spec->catfile($objtree, $File::Find::dir, $source) + } else { +- $source = "$srctree$File::Find::dir/$source"; ++ $source = File::Spec->catfile($srctree, $File::Find::dir, $source) + } + if (! -e "$source.c" && ! -e "$source.S") { + # No obvious source, exclude the object if it is conglomerate +-- +2.20.1 + diff --git a/queue-4.14/net-dsa-qca8k-use-up-to-7-ports-for-all-operations.patch b/queue-4.14/net-dsa-qca8k-use-up-to-7-ports-for-all-operations.patch new file mode 100644 index 00000000000..7b888be0806 --- /dev/null +++ b/queue-4.14/net-dsa-qca8k-use-up-to-7-ports-for-all-operations.patch @@ -0,0 +1,57 @@ +From 9ce737775b5284351f75ced62b444fbccb91023d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 26 Sep 2019 10:59:17 +0200 +Subject: net: dsa: qca8k: Use up to 7 ports for all operations +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Michal Vokáč + +[ Upstream commit 7ae6d93c8f052b7a77ba56ed0f654e22a2876739 ] + +The QCA8K family supports up to 7 ports. So use the existing +QCA8K_NUM_PORTS define to allocate the switch structure and limit all +operations with the switch ports. + +This was not an issue until commit 0394a63acfe2 ("net: dsa: enable and +disable all ports") disabled all unused ports. Since the unused ports 7-11 +are outside of the correct register range on this switch some registers +were rewritten with invalid content. + +Fixes: 6b93fb46480a ("net-next: dsa: add new driver for qca8xxx family") +Fixes: a0c02161ecfc ("net: dsa: variable number of ports") +Fixes: 0394a63acfe2 ("net: dsa: enable and disable all ports") +Signed-off-by: Michal Vokáč +Reviewed-by: Andrew Lunn +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/dsa/qca8k.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c +index c3c9d7e33bd6c..8e49974ffa0ed 100644 +--- a/drivers/net/dsa/qca8k.c ++++ b/drivers/net/dsa/qca8k.c +@@ -551,7 +551,7 @@ qca8k_setup(struct dsa_switch *ds) + BIT(0) << QCA8K_GLOBAL_FW_CTRL1_UC_DP_S); + + /* Setup connection between CPU port & user ports */ +- for (i = 0; i < DSA_MAX_PORTS; i++) { ++ for (i = 0; i < QCA8K_NUM_PORTS; i++) { + /* CPU port gets connected to all user ports of the switch */ + if (dsa_is_cpu_port(ds, i)) { + qca8k_rmw(priv, QCA8K_PORT_LOOKUP_CTRL(QCA8K_CPU_PORT), +@@ -900,7 +900,7 @@ qca8k_sw_probe(struct mdio_device *mdiodev) + if (id != QCA8K_ID_QCA8337) + return -ENODEV; + +- priv->ds = dsa_switch_alloc(&mdiodev->dev, DSA_MAX_PORTS); ++ priv->ds = dsa_switch_alloc(&mdiodev->dev, QCA8K_NUM_PORTS); + if (!priv->ds) + return -ENOMEM; + +-- +2.20.1 + diff --git a/queue-4.14/net-hisilicon-fix-usage-of-uninitialized-variable-in.patch b/queue-4.14/net-hisilicon-fix-usage-of-uninitialized-variable-in.patch new file mode 100644 index 00000000000..62a63de222c --- /dev/null +++ b/queue-4.14/net-hisilicon-fix-usage-of-uninitialized-variable-in.patch @@ -0,0 +1,46 @@ +From 62d32058d31bd40b5f67ad70ef22084e3df54bc8 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 1 Oct 2019 13:24:39 -0700 +Subject: net: hisilicon: Fix usage of uninitialized variable in function + mdio_sc_cfg_reg_write() + +From: Yizhuo + +[ Upstream commit 53de429f4e88f538f7a8ec2b18be8c0cd9b2c8e1 ] + +In function mdio_sc_cfg_reg_write(), variable "reg_value" could be +uninitialized if regmap_read() fails. However, "reg_value" is used +to decide the control flow later in the if statement, which is +potentially unsafe. + +Signed-off-by: Yizhuo +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/hisilicon/hns_mdio.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/ethernet/hisilicon/hns_mdio.c b/drivers/net/ethernet/hisilicon/hns_mdio.c +index baf5cc251f329..9a3bc0994a1db 100644 +--- a/drivers/net/ethernet/hisilicon/hns_mdio.c ++++ b/drivers/net/ethernet/hisilicon/hns_mdio.c +@@ -156,11 +156,15 @@ static int mdio_sc_cfg_reg_write(struct hns_mdio_device *mdio_dev, + { + u32 time_cnt; + u32 reg_value; ++ int ret; + + regmap_write(mdio_dev->subctrl_vbase, cfg_reg, set_val); + + for (time_cnt = MDIO_TIMEOUT; time_cnt; time_cnt--) { +- regmap_read(mdio_dev->subctrl_vbase, st_reg, ®_value); ++ ret = regmap_read(mdio_dev->subctrl_vbase, st_reg, ®_value); ++ if (ret) ++ return ret; ++ + reg_value &= st_msk; + if ((!!check_st) == (!!reg_value)) + break; +-- +2.20.1 + diff --git a/queue-4.14/nl80211-fix-null-pointer-dereference.patch b/queue-4.14/nl80211-fix-null-pointer-dereference.patch new file mode 100644 index 00000000000..80cdfc5c91b --- /dev/null +++ b/queue-4.14/nl80211-fix-null-pointer-dereference.patch @@ -0,0 +1,62 @@ +From e736a5a86b733cff77e6f41b4b35a95db7917780 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 26 Sep 2019 16:16:50 +0800 +Subject: nl80211: fix null pointer dereference + +From: Miaoqing Pan + +[ Upstream commit b501426cf86e70649c983c52f4c823b3c40d72a3 ] + +If the interface is not in MESH mode, the command 'iw wlanx mpath del' +will cause kernel panic. + +The root cause is null pointer access in mpp_flush_by_proxy(), as the +pointer 'sdata->u.mesh.mpp_paths' is NULL for non MESH interface. + +Unable to handle kernel NULL pointer dereference at virtual address 00000068 +[...] +PC is at _raw_spin_lock_bh+0x20/0x5c +LR is at mesh_path_del+0x1c/0x17c [mac80211] +[...] +Process iw (pid: 4537, stack limit = 0xd83e0238) +[...] +[] (_raw_spin_lock_bh) from [] (mesh_path_del+0x1c/0x17c [mac80211]) +[] (mesh_path_del [mac80211]) from [] (extack_doit+0x20/0x68 [compat]) +[] (extack_doit [compat]) from [] (genl_rcv_msg+0x274/0x30c) +[] (genl_rcv_msg) from [] (netlink_rcv_skb+0x58/0xac) +[] (netlink_rcv_skb) from [] (genl_rcv+0x20/0x34) +[] (genl_rcv) from [] (netlink_unicast+0x11c/0x204) +[] (netlink_unicast) from [] (netlink_sendmsg+0x30c/0x370) +[] (netlink_sendmsg) from [] (sock_sendmsg+0x70/0x84) +[] (sock_sendmsg) from [] (___sys_sendmsg.part.3+0x188/0x228) +[] (___sys_sendmsg.part.3) from [] (__sys_sendmsg+0x4c/0x70) +[] (__sys_sendmsg) from [] (ret_fast_syscall+0x0/0x44) +Code: e2822c02 e2822001 e5832004 f590f000 (e1902f9f) +---[ end trace bbd717600f8f884d ]--- + +Signed-off-by: Miaoqing Pan +Link: https://lore.kernel.org/r/1569485810-761-1-git-send-email-miaoqing@codeaurora.org +[trim useless data from commit message] +Signed-off-by: Johannes Berg +Signed-off-by: Sasha Levin +--- + net/wireless/nl80211.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c +index ec504c4a397b4..ff31feeee8e3b 100644 +--- a/net/wireless/nl80211.c ++++ b/net/wireless/nl80211.c +@@ -5504,6 +5504,9 @@ static int nl80211_del_mpath(struct sk_buff *skb, struct genl_info *info) + if (!rdev->ops->del_mpath) + return -EOPNOTSUPP; + ++ if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_MESH_POINT) ++ return -EOPNOTSUPP; ++ + return rdev_del_mpath(rdev, dev, dst); + } + +-- +2.20.1 + diff --git a/queue-4.14/r8152-set-macpassthru-in-reset_resume-callback.patch b/queue-4.14/r8152-set-macpassthru-in-reset_resume-callback.patch new file mode 100644 index 00000000000..301c506a0ff --- /dev/null +++ b/queue-4.14/r8152-set-macpassthru-in-reset_resume-callback.patch @@ -0,0 +1,46 @@ +From 99da17b40cc3131be0b7a2b93e6e4b52ab8f109c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 4 Oct 2019 20:51:04 +0800 +Subject: r8152: Set macpassthru in reset_resume callback + +From: Kai-Heng Feng + +[ Upstream commit a54cdeeb04fc719e4c7f19d6e28dba7ea86cee5b ] + +r8152 may fail to establish network connection after resume from system +suspend. + +If the USB port connects to r8152 lost its power during system suspend, +the MAC address was written before is lost. The reason is that The MAC +address doesn't get written again in its reset_resume callback. + +So let's set MAC address again in reset_resume callback. Also remove +unnecessary lock as no other locking attempt will happen during +reset_resume. + +Signed-off-by: Kai-Heng Feng +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/usb/r8152.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c +index 455eec3c46942..c0964281ab983 100644 +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -4465,10 +4465,9 @@ static int rtl8152_reset_resume(struct usb_interface *intf) + struct r8152 *tp = usb_get_intfdata(intf); + + clear_bit(SELECTIVE_SUSPEND, &tp->flags); +- mutex_lock(&tp->control); + tp->rtl_ops.init(tp); + queue_delayed_work(system_long_wq, &tp->hw_phy_work, 0); +- mutex_unlock(&tp->control); ++ set_ethernet_addr(tp); + return rtl8152_resume(intf); + } + +-- +2.20.1 + diff --git a/queue-4.14/scsi-megaraid-disable-device-when-probe-failed-after.patch b/queue-4.14/scsi-megaraid-disable-device-when-probe-failed-after.patch new file mode 100644 index 00000000000..e25bedc3337 --- /dev/null +++ b/queue-4.14/scsi-megaraid-disable-device-when-probe-failed-after.patch @@ -0,0 +1,42 @@ +From df65b931c779d919d2f42cff5ae9f2902b38ffe8 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 7 Sep 2019 09:07:30 +0800 +Subject: scsi: megaraid: disable device when probe failed after enabled device + +From: Xiang Chen + +[ Upstream commit 70054aa39a013fa52eff432f2223b8bd5c0048f8 ] + +For pci device, need to disable device when probe failed after enabled +device. + +Link: https://lore.kernel.org/r/1567818450-173315-1-git-send-email-chenxiang66@hisilicon.com +Signed-off-by: Xiang Chen +Reviewed-by: John Garry +Signed-off-by: Martin K. Petersen +Signed-off-by: Sasha Levin +--- + drivers/scsi/megaraid.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c +index 9b6f5d024dbae..f5c09bbf93741 100644 +--- a/drivers/scsi/megaraid.c ++++ b/drivers/scsi/megaraid.c +@@ -4221,11 +4221,11 @@ megaraid_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) + */ + if (pdev->subsystem_vendor == PCI_VENDOR_ID_COMPAQ && + pdev->subsystem_device == 0xC000) +- return -ENODEV; ++ goto out_disable_device; + /* Now check the magic signature byte */ + pci_read_config_word(pdev, PCI_CONF_AMISIG, &magic); + if (magic != HBA_SIGNATURE_471 && magic != HBA_SIGNATURE) +- return -ENODEV; ++ goto out_disable_device; + /* Ok it is probably a megaraid */ + } + +-- +2.20.1 + diff --git a/queue-4.14/scsi-qla2xxx-fix-unbound-sleep-in-fcport-delete-path.patch b/queue-4.14/scsi-qla2xxx-fix-unbound-sleep-in-fcport-delete-path.patch new file mode 100644 index 00000000000..2b4ae453068 --- /dev/null +++ b/queue-4.14/scsi-qla2xxx-fix-unbound-sleep-in-fcport-delete-path.patch @@ -0,0 +1,47 @@ +From f624279cdacc542cc7b001c2ee3e7e84af06f9a3 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 12 Sep 2019 11:09:06 -0700 +Subject: scsi: qla2xxx: Fix unbound sleep in fcport delete path. + +From: Quinn Tran + +[ Upstream commit c3b6a1d397420a0fdd97af2f06abfb78adc370df ] + +There are instances, though rare, where a LOGO request cannot be sent out +and the thread in free session done can wait indefinitely. Fix this by +putting an upper bound to sleep. + +Link: https://lore.kernel.org/r/20190912180918.6436-3-hmadhani@marvell.com +Signed-off-by: Quinn Tran +Signed-off-by: Himanshu Madhani +Signed-off-by: Martin K. Petersen +Signed-off-by: Sasha Levin +--- + drivers/scsi/qla2xxx/qla_target.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c +index 87e04c4a49821..11753ed3433ca 100644 +--- a/drivers/scsi/qla2xxx/qla_target.c ++++ b/drivers/scsi/qla2xxx/qla_target.c +@@ -996,6 +996,7 @@ static void qlt_free_session_done(struct work_struct *work) + + if (logout_started) { + bool traced = false; ++ u16 cnt = 0; + + while (!ACCESS_ONCE(sess->logout_completed)) { + if (!traced) { +@@ -1005,6 +1006,9 @@ static void qlt_free_session_done(struct work_struct *work) + traced = true; + } + msleep(100); ++ cnt++; ++ if (cnt > 200) ++ break; + } + + ql_dbg(ql_dbg_disc, vha, 0xf087, +-- +2.20.1 + diff --git a/queue-4.14/scsi-ufs-skip-shutdown-if-hba-is-not-powered.patch b/queue-4.14/scsi-ufs-skip-shutdown-if-hba-is-not-powered.patch new file mode 100644 index 00000000000..ce1d2045da8 --- /dev/null +++ b/queue-4.14/scsi-ufs-skip-shutdown-if-hba-is-not-powered.patch @@ -0,0 +1,46 @@ +From 1b376ecc6c0e501866d96b45cbae6c4ce0b38703 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 18 Sep 2019 12:20:38 +0800 +Subject: scsi: ufs: skip shutdown if hba is not powered + +From: Stanley Chu + +[ Upstream commit f51913eef23f74c3bd07899dc7f1ed6df9e521d8 ] + +In some cases, hba may go through shutdown flow without successful +initialization and then make system hang. + +For example, if ufshcd_change_power_mode() gets error and leads to +ufshcd_hba_exit() to release resources of the host, future shutdown flow +may hang the system since the host register will be accessed in unpowered +state. + +To solve this issue, simply add checking to skip shutdown for above kind of +situation. + +Link: https://lore.kernel.org/r/1568780438-28753-1-git-send-email-stanley.chu@mediatek.com +Signed-off-by: Stanley Chu +Acked-by: Bean Huo +Signed-off-by: Martin K. Petersen +Signed-off-by: Sasha Levin +--- + drivers/scsi/ufs/ufshcd.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c +index 60c9184bad3be..07cae5ea608c7 100644 +--- a/drivers/scsi/ufs/ufshcd.c ++++ b/drivers/scsi/ufs/ufshcd.c +@@ -7755,6 +7755,9 @@ int ufshcd_shutdown(struct ufs_hba *hba) + { + int ret = 0; + ++ if (!hba->is_powered) ++ goto out; ++ + if (ufshcd_is_ufs_dev_poweroff(hba) && ufshcd_is_link_off(hba)) + goto out; + +-- +2.20.1 + diff --git a/queue-4.14/series b/queue-4.14/series new file mode 100644 index 00000000000..c214395c588 --- /dev/null +++ b/queue-4.14/series @@ -0,0 +1,15 @@ +scsi-ufs-skip-shutdown-if-hba-is-not-powered.patch +scsi-megaraid-disable-device-when-probe-failed-after.patch +scsi-qla2xxx-fix-unbound-sleep-in-fcport-delete-path.patch +arm-omap2-fix-missing-reset-done-flag-for-am3-and-am.patch +ieee802154-ca8210-prevent-memory-leak.patch +arm-dts-am4372-set-memory-bandwidth-limit-for-dispc.patch +net-dsa-qca8k-use-up-to-7-ports-for-all-operations.patch +mips-dts-ar9331-fix-interrupt-controller-size.patch +xen-efi-set-nonblocking-callbacks.patch +nl80211-fix-null-pointer-dereference.patch +mac80211-fix-txq-null-pointer-dereference.patch +mips-loongson-fix-the-link-time-qualifier-of-serial_.patch +net-hisilicon-fix-usage-of-uninitialized-variable-in.patch +r8152-set-macpassthru-in-reset_resume-callback.patch +namespace-fix-namespace.pl-script-to-support-relativ.patch diff --git a/queue-4.14/xen-efi-set-nonblocking-callbacks.patch b/queue-4.14/xen-efi-set-nonblocking-callbacks.patch new file mode 100644 index 00000000000..6d008209d10 --- /dev/null +++ b/queue-4.14/xen-efi-set-nonblocking-callbacks.patch @@ -0,0 +1,54 @@ +From e450dfda40abb98041c2d974c6c4ac2578aa1793 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 27 Sep 2019 16:49:20 +0100 +Subject: xen/efi: Set nonblocking callbacks + +From: Ross Lagerwall + +[ Upstream commit df359f0d09dc029829b66322707a2f558cb720f7 ] + +Other parts of the kernel expect these nonblocking EFI callbacks to +exist and crash when running under Xen. Since the implementations of +xen_efi_set_variable() and xen_efi_query_variable_info() do not take any +locks, use them for the nonblocking callbacks too. + +Signed-off-by: Ross Lagerwall +Reviewed-by: Juergen Gross +Signed-off-by: Juergen Gross +Signed-off-by: Sasha Levin +--- + arch/arm/xen/efi.c | 2 ++ + arch/x86/xen/efi.c | 2 ++ + 2 files changed, 4 insertions(+) + +diff --git a/arch/arm/xen/efi.c b/arch/arm/xen/efi.c +index b4d78959cadf0..bc9a37b3cecd6 100644 +--- a/arch/arm/xen/efi.c ++++ b/arch/arm/xen/efi.c +@@ -31,7 +31,9 @@ void __init xen_efi_runtime_setup(void) + efi.get_variable = xen_efi_get_variable; + efi.get_next_variable = xen_efi_get_next_variable; + efi.set_variable = xen_efi_set_variable; ++ efi.set_variable_nonblocking = xen_efi_set_variable; + efi.query_variable_info = xen_efi_query_variable_info; ++ efi.query_variable_info_nonblocking = xen_efi_query_variable_info; + efi.update_capsule = xen_efi_update_capsule; + efi.query_capsule_caps = xen_efi_query_capsule_caps; + efi.get_next_high_mono_count = xen_efi_get_next_high_mono_count; +diff --git a/arch/x86/xen/efi.c b/arch/x86/xen/efi.c +index a18703be9ead9..4769a069d5bd8 100644 +--- a/arch/x86/xen/efi.c ++++ b/arch/x86/xen/efi.c +@@ -77,7 +77,9 @@ static efi_system_table_t __init *xen_efi_probe(void) + efi.get_variable = xen_efi_get_variable; + efi.get_next_variable = xen_efi_get_next_variable; + efi.set_variable = xen_efi_set_variable; ++ efi.set_variable_nonblocking = xen_efi_set_variable; + efi.query_variable_info = xen_efi_query_variable_info; ++ efi.query_variable_info_nonblocking = xen_efi_query_variable_info; + efi.update_capsule = xen_efi_update_capsule; + efi.query_capsule_caps = xen_efi_query_capsule_caps; + efi.get_next_high_mono_count = xen_efi_get_next_high_mono_count; +-- +2.20.1 + -- 2.47.2