From: Sasha Levin Date: Fri, 5 Jun 2020 01:12:20 +0000 (-0400) Subject: Fixes for 4.19 X-Git-Tag: v5.7.1~18 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b2e575bc07350dc4f340c5290e111f40fb69a24b;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 4.19 Signed-off-by: Sasha Levin --- diff --git a/queue-4.19/arc-fix-iccm-dccm-runtime-size-checks.patch b/queue-4.19/arc-fix-iccm-dccm-runtime-size-checks.patch new file mode 100644 index 00000000000..b50c7774c51 --- /dev/null +++ b/queue-4.19/arc-fix-iccm-dccm-runtime-size-checks.patch @@ -0,0 +1,54 @@ +From f2d877f97d0cc4f593a828a5d68d5ed4a4ae9114 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 2 Apr 2020 20:54:28 +0300 +Subject: ARC: Fix ICCM & DCCM runtime size checks + +From: Eugeniy Paltsev + +[ Upstream commit 43900edf67d7ef3ac8909854d75b8a1fba2d570c ] + +As of today the ICCM and DCCM size checks are incorrectly using +mismatched units (KiB checked against bytes). The CONFIG_ARC_DCCM_SZ +and CONFIG_ARC_ICCM_SZ are in KiB, but the size calculated in +runtime and stored in cpu->dccm.sz and cpu->iccm.sz is in bytes. + +Fix that. + +Reported-by: Paul Greco +Signed-off-by: Eugeniy Paltsev +Signed-off-by: Vineet Gupta +Signed-off-by: Sasha Levin +--- + arch/arc/kernel/setup.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/arch/arc/kernel/setup.c b/arch/arc/kernel/setup.c +index 89c97dcfa360..c10994daee39 100644 +--- a/arch/arc/kernel/setup.c ++++ b/arch/arc/kernel/setup.c +@@ -15,6 +15,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -406,12 +407,12 @@ static void arc_chk_core_config(void) + if ((unsigned int)__arc_dccm_base != cpu->dccm.base_addr) + panic("Linux built with incorrect DCCM Base address\n"); + +- if (CONFIG_ARC_DCCM_SZ != cpu->dccm.sz) ++ if (CONFIG_ARC_DCCM_SZ * SZ_1K != cpu->dccm.sz) + panic("Linux built with incorrect DCCM Size\n"); + #endif + + #ifdef CONFIG_ARC_HAS_ICCM +- if (CONFIG_ARC_ICCM_SZ != cpu->iccm.sz) ++ if (CONFIG_ARC_ICCM_SZ * SZ_1K != cpu->iccm.sz) + panic("Linux built with incorrect ICCM Size\n"); + #endif + +-- +2.25.1 + diff --git a/queue-4.19/arc-plat-eznps-restrict-to-config_isa_arcompact.patch b/queue-4.19/arc-plat-eznps-restrict-to-config_isa_arcompact.patch new file mode 100644 index 00000000000..b888b75d1a2 --- /dev/null +++ b/queue-4.19/arc-plat-eznps-restrict-to-config_isa_arcompact.patch @@ -0,0 +1,38 @@ +From 6c8c177ec9072ce16c9bb8d10c9e1e2df7fffedb Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 14 Apr 2020 11:41:51 -0700 +Subject: ARC: [plat-eznps]: Restrict to CONFIG_ISA_ARCOMPACT + +From: Vineet Gupta + +[ Upstream commit 799587d5731db9dcdafaac4002463aa7d9cd6cf7 ] + +Elide invalid configuration EZNPS + ARCv2, triggered by a +make allyesconfig build. + +Granted the root cause is in source code (asm/barrier.h) where we check +for ARCv2 before PLAT_EZNPS, but it is better to avoid such combinations +at onset rather then baking subtle nuances into code. + +Reported-by: kbuild test robot +Signed-off-by: Vineet Gupta +Signed-off-by: Sasha Levin +--- + arch/arc/plat-eznps/Kconfig | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/arc/plat-eznps/Kconfig b/arch/arc/plat-eznps/Kconfig +index ce908e2c5282..71378bfec8d0 100644 +--- a/arch/arc/plat-eznps/Kconfig ++++ b/arch/arc/plat-eznps/Kconfig +@@ -6,6 +6,7 @@ + + menuconfig ARC_PLAT_EZNPS + bool "\"EZchip\" ARC dev platform" ++ depends on ISA_ARCOMPACT + select CPU_BIG_ENDIAN + select CLKSRC_NPS if !PHYS_ADDR_T_64BIT + select EZNPS_GIC +-- +2.25.1 + diff --git a/queue-4.19/drm-edid-add-oculus-rift-s-to-non-desktop-list.patch b/queue-4.19/drm-edid-add-oculus-rift-s-to-non-desktop-list.patch new file mode 100644 index 00000000000..36e475b4e28 --- /dev/null +++ b/queue-4.19/drm-edid-add-oculus-rift-s-to-non-desktop-list.patch @@ -0,0 +1,40 @@ +From b3a1bfb46554fc2b3e1a42ff6c5533da7d80e13b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 8 May 2020 04:06:28 +1000 +Subject: drm/edid: Add Oculus Rift S to non-desktop list + +From: Jan Schmidt + +[ Upstream commit 5a3f610877e9d08968ea7237551049581f02b163 ] + +Add a quirk for the Oculus Rift S OVR0012 display so +it shows up as a non-desktop display. + +Signed-off-by: Jan Schmidt +Signed-off-by: Dave Airlie +Link: https://patchwork.freedesktop.org/patch/msgid/20200507180628.740936-1-jan@centricular.com +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/drm_edid.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c +index d5dcee7f1fc8..108f542176b8 100644 +--- a/drivers/gpu/drm/drm_edid.c ++++ b/drivers/gpu/drm/drm_edid.c +@@ -198,10 +198,11 @@ static const struct edid_quirk { + { "HVR", 0xaa01, EDID_QUIRK_NON_DESKTOP }, + { "HVR", 0xaa02, EDID_QUIRK_NON_DESKTOP }, + +- /* Oculus Rift DK1, DK2, and CV1 VR Headsets */ ++ /* Oculus Rift DK1, DK2, CV1 and Rift S VR Headsets */ + { "OVR", 0x0001, EDID_QUIRK_NON_DESKTOP }, + { "OVR", 0x0003, EDID_QUIRK_NON_DESKTOP }, + { "OVR", 0x0004, EDID_QUIRK_NON_DESKTOP }, ++ { "OVR", 0x0012, EDID_QUIRK_NON_DESKTOP }, + + /* Windows Mixed Reality Headsets */ + { "ACR", 0x7fce, EDID_QUIRK_NON_DESKTOP }, +-- +2.25.1 + diff --git a/queue-4.19/evm-fix-rcu-list-related-warnings.patch b/queue-4.19/evm-fix-rcu-list-related-warnings.patch new file mode 100644 index 00000000000..069bc022f89 --- /dev/null +++ b/queue-4.19/evm-fix-rcu-list-related-warnings.patch @@ -0,0 +1,93 @@ +From acd37c3e79c50b64dde9e30f3a91c1f19c54a8e2 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 30 Apr 2020 21:32:05 +0530 +Subject: evm: Fix RCU list related warnings + +From: Madhuparna Bhowmik + +[ Upstream commit 770f60586d2af0590be263f55fd079226313922c ] + +This patch fixes the following warning and few other instances of +traversal of evm_config_xattrnames list: + +[ 32.848432] ============================= +[ 32.848707] WARNING: suspicious RCU usage +[ 32.848966] 5.7.0-rc1-00006-ga8d5875ce5f0b #1 Not tainted +[ 32.849308] ----------------------------- +[ 32.849567] security/integrity/evm/evm_main.c:231 RCU-list traversed in non-reader section!! + +Since entries are only added to the list and never deleted, use +list_for_each_entry_lockless() instead of list_for_each_entry_rcu for +traversing the list. Also, add a relevant comment in evm_secfs.c to +indicate this fact. + +Reported-by: kernel test robot +Suggested-by: Paul E. McKenney +Signed-off-by: Madhuparna Bhowmik +Acked-by: Paul E. McKenney (RCU viewpoint) +Signed-off-by: Mimi Zohar +Signed-off-by: Sasha Levin +--- + security/integrity/evm/evm_crypto.c | 2 +- + security/integrity/evm/evm_main.c | 4 ++-- + security/integrity/evm/evm_secfs.c | 9 ++++++++- + 3 files changed, 11 insertions(+), 4 deletions(-) + +diff --git a/security/integrity/evm/evm_crypto.c b/security/integrity/evm/evm_crypto.c +index f0878d81dcef..d20f5792761c 100644 +--- a/security/integrity/evm/evm_crypto.c ++++ b/security/integrity/evm/evm_crypto.c +@@ -215,7 +215,7 @@ static int evm_calc_hmac_or_hash(struct dentry *dentry, + data->hdr.length = crypto_shash_digestsize(desc->tfm); + + error = -ENODATA; +- list_for_each_entry_rcu(xattr, &evm_config_xattrnames, list) { ++ list_for_each_entry_lockless(xattr, &evm_config_xattrnames, list) { + bool is_ima = false; + + if (strcmp(xattr->name, XATTR_NAME_IMA) == 0) +diff --git a/security/integrity/evm/evm_main.c b/security/integrity/evm/evm_main.c +index 7f3f54d89a6e..e11d860fdce4 100644 +--- a/security/integrity/evm/evm_main.c ++++ b/security/integrity/evm/evm_main.c +@@ -102,7 +102,7 @@ static int evm_find_protected_xattrs(struct dentry *dentry) + if (!(inode->i_opflags & IOP_XATTR)) + return -EOPNOTSUPP; + +- list_for_each_entry_rcu(xattr, &evm_config_xattrnames, list) { ++ list_for_each_entry_lockless(xattr, &evm_config_xattrnames, list) { + error = __vfs_getxattr(dentry, inode, xattr->name, NULL, 0); + if (error < 0) { + if (error == -ENODATA) +@@ -233,7 +233,7 @@ static int evm_protected_xattr(const char *req_xattr_name) + struct xattr_list *xattr; + + namelen = strlen(req_xattr_name); +- list_for_each_entry_rcu(xattr, &evm_config_xattrnames, list) { ++ list_for_each_entry_lockless(xattr, &evm_config_xattrnames, list) { + if ((strlen(xattr->name) == namelen) + && (strncmp(req_xattr_name, xattr->name, namelen) == 0)) { + found = 1; +diff --git a/security/integrity/evm/evm_secfs.c b/security/integrity/evm/evm_secfs.c +index 77de71b7794c..f112ca593adc 100644 +--- a/security/integrity/evm/evm_secfs.c ++++ b/security/integrity/evm/evm_secfs.c +@@ -237,7 +237,14 @@ static ssize_t evm_write_xattrs(struct file *file, const char __user *buf, + goto out; + } + +- /* Guard against races in evm_read_xattrs */ ++ /* ++ * xattr_list_mutex guards against races in evm_read_xattrs(). ++ * Entries are only added to the evm_config_xattrnames list ++ * and never deleted. Therefore, the list is traversed ++ * using list_for_each_entry_lockless() without holding ++ * the mutex in evm_calc_hmac_or_hash(), evm_find_protected_xattrs() ++ * and evm_protected_xattr(). ++ */ + mutex_lock(&xattr_list_mutex); + list_for_each_entry(tmp, &evm_config_xattrnames, list) { + if (strcmp(xattr->name, tmp->name) == 0) { +-- +2.25.1 + diff --git a/queue-4.19/i2c-altera-fix-race-between-xfer_msg-and-isr-thread.patch b/queue-4.19/i2c-altera-fix-race-between-xfer_msg-and-isr-thread.patch new file mode 100644 index 00000000000..6de4b73e54d --- /dev/null +++ b/queue-4.19/i2c-altera-fix-race-between-xfer_msg-and-isr-thread.patch @@ -0,0 +1,93 @@ +From 5055de5c2fdb1a551f1958d0a73c7637052c981f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 8 May 2020 22:12:48 +0900 +Subject: i2c: altera: Fix race between xfer_msg and isr thread + +From: Atsushi Nemoto + +[ Upstream commit 5d4c7977499a736f3f80826bdc9744344ad55589 ] + +Use a mutex to protect access to idev->msg_len, idev->buf, etc. which +are modified by both altr_i2c_xfer_msg() and altr_i2c_isr(). + +This is the minimal fix for easy backporting. A cleanup to remove the +spinlock will be added later. + +Signed-off-by: Atsushi Nemoto +Acked-by: Thor Thayer +[wsa: updated commit message] +Signed-off-by: Wolfram Sang +Signed-off-by: Sasha Levin +--- + drivers/i2c/busses/i2c-altera.c | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +diff --git a/drivers/i2c/busses/i2c-altera.c b/drivers/i2c/busses/i2c-altera.c +index 8915ee30a5b4..1d59eede537b 100644 +--- a/drivers/i2c/busses/i2c-altera.c ++++ b/drivers/i2c/busses/i2c-altera.c +@@ -81,6 +81,7 @@ + * @isr_mask: cached copy of local ISR enables. + * @isr_status: cached copy of local ISR status. + * @lock: spinlock for IRQ synchronization. ++ * @isr_mutex: mutex for IRQ thread. + */ + struct altr_i2c_dev { + void __iomem *base; +@@ -97,6 +98,7 @@ struct altr_i2c_dev { + u32 isr_mask; + u32 isr_status; + spinlock_t lock; /* IRQ synchronization */ ++ struct mutex isr_mutex; + }; + + static void +@@ -256,10 +258,11 @@ static irqreturn_t altr_i2c_isr(int irq, void *_dev) + struct altr_i2c_dev *idev = _dev; + u32 status = idev->isr_status; + ++ mutex_lock(&idev->isr_mutex); + if (!idev->msg) { + dev_warn(idev->dev, "unexpected interrupt\n"); + altr_i2c_int_clear(idev, ALTR_I2C_ALL_IRQ); +- return IRQ_HANDLED; ++ goto out; + } + read = (idev->msg->flags & I2C_M_RD) != 0; + +@@ -312,6 +315,8 @@ static irqreturn_t altr_i2c_isr(int irq, void *_dev) + complete(&idev->msg_complete); + dev_dbg(idev->dev, "Message Complete\n"); + } ++out: ++ mutex_unlock(&idev->isr_mutex); + + return IRQ_HANDLED; + } +@@ -323,6 +328,7 @@ static int altr_i2c_xfer_msg(struct altr_i2c_dev *idev, struct i2c_msg *msg) + u32 value; + u8 addr = i2c_8bit_addr_from_msg(msg); + ++ mutex_lock(&idev->isr_mutex); + idev->msg = msg; + idev->msg_len = msg->len; + idev->buf = msg->buf; +@@ -347,6 +353,7 @@ static int altr_i2c_xfer_msg(struct altr_i2c_dev *idev, struct i2c_msg *msg) + altr_i2c_int_enable(idev, imask, true); + altr_i2c_fill_tx_fifo(idev); + } ++ mutex_unlock(&idev->isr_mutex); + + time_left = wait_for_completion_timeout(&idev->msg_complete, + ALTR_I2C_XFER_TIMEOUT); +@@ -420,6 +427,7 @@ static int altr_i2c_probe(struct platform_device *pdev) + idev->dev = &pdev->dev; + init_completion(&idev->msg_complete); + spin_lock_init(&idev->lock); ++ mutex_init(&idev->isr_mutex); + + ret = device_property_read_u32(idev->dev, "fifo-size", + &idev->fifo_size); +-- +2.25.1 + diff --git a/queue-4.19/net-bmac-fix-read-of-mac-address-from-rom.patch b/queue-4.19/net-bmac-fix-read-of-mac-address-from-rom.patch new file mode 100644 index 00000000000..7a9a7f241f5 --- /dev/null +++ b/queue-4.19/net-bmac-fix-read-of-mac-address-from-rom.patch @@ -0,0 +1,43 @@ +From a2a86efa549b73b93d37a7a40a4dd8fbb79d9a3a Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 19 May 2020 09:05:58 +0800 +Subject: net: bmac: Fix read of MAC address from ROM + +From: Jeremy Kerr + +[ Upstream commit ef01cee2ee1b369c57a936166483d40942bcc3e3 ] + +In bmac_get_station_address, We're reading two bytes at a time from ROM, +but we do that six times, resulting in 12 bytes of read & writes. This +means we will write off the end of the six-byte destination buffer. + +This change fixes the for-loop to only read/write six bytes. + +Based on a proposed fix from Finn Thain . + +Signed-off-by: Jeremy Kerr +Reported-by: Stan Johnson +Tested-by: Stan Johnson +Reported-by: Finn Thain +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/apple/bmac.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/net/ethernet/apple/bmac.c b/drivers/net/ethernet/apple/bmac.c +index 6a8e2567f2bd..ab6ce85540b8 100644 +--- a/drivers/net/ethernet/apple/bmac.c ++++ b/drivers/net/ethernet/apple/bmac.c +@@ -1181,7 +1181,7 @@ bmac_get_station_address(struct net_device *dev, unsigned char *ea) + int i; + unsigned short data; + +- for (i = 0; i < 6; i++) ++ for (i = 0; i < 3; i++) + { + reset_and_select_srom(dev); + data = read_srom(dev, i + EnetAddressOffset/2, SROMAddressBits); +-- +2.25.1 + diff --git a/queue-4.19/net-ethernet-freescale-rework-quiesce-activate-for-u.patch b/queue-4.19/net-ethernet-freescale-rework-quiesce-activate-for-u.patch new file mode 100644 index 00000000000..7085112ed14 --- /dev/null +++ b/queue-4.19/net-ethernet-freescale-rework-quiesce-activate-for-u.patch @@ -0,0 +1,78 @@ +From 0b7617f8e433adaf5122a9957bfac9cb442c4e27 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 20 May 2020 17:53:50 +0200 +Subject: net/ethernet/freescale: rework quiesce/activate for ucc_geth + +From: Valentin Longchamp + +[ Upstream commit 79dde73cf9bcf1dd317a2667f78b758e9fe139ed ] + +ugeth_quiesce/activate are used to halt the controller when there is a +link change that requires to reconfigure the mac. + +The previous implementation called netif_device_detach(). This however +causes the initial activation of the netdevice to fail precisely because +it's detached. For details, see [1]. + +A possible workaround was the revert of commit +net: linkwatch: add check for netdevice being present to linkwatch_do_dev +However, the check introduced in the above commit is correct and shall be +kept. + +The netif_device_detach() is thus replaced with +netif_tx_stop_all_queues() that prevents any tranmission. This allows to +perform mac config change required by the link change, without detaching +the corresponding netdevice and thus not preventing its initial +activation. + +[1] https://lists.openwall.net/netdev/2020/01/08/201 + +Signed-off-by: Valentin Longchamp +Acked-by: Matteo Ghidoni +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/freescale/ucc_geth.c | 13 +++++++------ + 1 file changed, 7 insertions(+), 6 deletions(-) + +diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c +index a5bf02ae4bc5..5de6f7c73c1f 100644 +--- a/drivers/net/ethernet/freescale/ucc_geth.c ++++ b/drivers/net/ethernet/freescale/ucc_geth.c +@@ -45,6 +45,7 @@ + #include + #include + #include ++#include + + #include "ucc_geth.h" + +@@ -1551,11 +1552,8 @@ static int ugeth_disable(struct ucc_geth_private *ugeth, enum comm_dir mode) + + static void ugeth_quiesce(struct ucc_geth_private *ugeth) + { +- /* Prevent any further xmits, plus detach the device. */ +- netif_device_detach(ugeth->ndev); +- +- /* Wait for any current xmits to finish. */ +- netif_tx_disable(ugeth->ndev); ++ /* Prevent any further xmits */ ++ netif_tx_stop_all_queues(ugeth->ndev); + + /* Disable the interrupt to avoid NAPI rescheduling. */ + disable_irq(ugeth->ug_info->uf_info.irq); +@@ -1568,7 +1566,10 @@ static void ugeth_activate(struct ucc_geth_private *ugeth) + { + napi_enable(&ugeth->napi); + enable_irq(ugeth->ug_info->uf_info.irq); +- netif_device_attach(ugeth->ndev); ++ ++ /* allow to xmit again */ ++ netif_tx_wake_all_queues(ugeth->ndev); ++ __netdev_watchdog_up(ugeth->ndev); + } + + /* Called every time the controller might need to be made +-- +2.25.1 + diff --git a/queue-4.19/net-ethernet-stmmac-enable-interface-clocks-on-probe.patch b/queue-4.19/net-ethernet-stmmac-enable-interface-clocks-on-probe.patch new file mode 100644 index 00000000000..41c56bf6e40 --- /dev/null +++ b/queue-4.19/net-ethernet-stmmac-enable-interface-clocks-on-probe.patch @@ -0,0 +1,62 @@ +From 93a4d4bac0446de278341483b95868decaf7466f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 21 May 2020 12:49:34 +0100 +Subject: net: ethernet: stmmac: Enable interface clocks on probe for IPQ806x + +From: Jonathan McDowell + +[ Upstream commit a96ac8a0045e3cbe3e5af6d1b3c78c6c2065dec5 ] + +The ipq806x_gmac_probe() function enables the PTP clock but not the +appropriate interface clocks. This means that if the bootloader hasn't +done so attempting to bring up the interface will fail with an error +like: + +[ 59.028131] ipq806x-gmac-dwmac 37600000.ethernet: Failed to reset the dma +[ 59.028196] ipq806x-gmac-dwmac 37600000.ethernet eth1: stmmac_hw_setup: DMA engine initialization failed +[ 59.034056] ipq806x-gmac-dwmac 37600000.ethernet eth1: stmmac_open: Hw setup failed + +This patch, a slightly cleaned up version of one posted by Sergey +Sergeev in: + +https://forum.openwrt.org/t/support-for-mikrotik-rb3011uias-rm/4064/257 + +correctly enables the clock; we have already configured the source just +before this. + +Tested on a MikroTik RB3011. + +Signed-off-by: Jonathan McDowell +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c +index 0d21082ceb93..4d75158c64b2 100644 +--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c ++++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c +@@ -318,6 +318,19 @@ static int ipq806x_gmac_probe(struct platform_device *pdev) + /* Enable PTP clock */ + regmap_read(gmac->nss_common, NSS_COMMON_CLK_GATE, &val); + val |= NSS_COMMON_CLK_GATE_PTP_EN(gmac->id); ++ switch (gmac->phy_mode) { ++ case PHY_INTERFACE_MODE_RGMII: ++ val |= NSS_COMMON_CLK_GATE_RGMII_RX_EN(gmac->id) | ++ NSS_COMMON_CLK_GATE_RGMII_TX_EN(gmac->id); ++ break; ++ case PHY_INTERFACE_MODE_SGMII: ++ val |= NSS_COMMON_CLK_GATE_GMII_RX_EN(gmac->id) | ++ NSS_COMMON_CLK_GATE_GMII_TX_EN(gmac->id); ++ break; ++ default: ++ /* We don't get here; the switch above will have errored out */ ++ unreachable(); ++ } + regmap_write(gmac->nss_common, NSS_COMMON_CLK_GATE, val); + + if (gmac->phy_mode == PHY_INTERFACE_MODE_SGMII) { +-- +2.25.1 + diff --git a/queue-4.19/net-smsc911x-fix-runtime-pm-imbalance-on-error.patch b/queue-4.19/net-smsc911x-fix-runtime-pm-imbalance-on-error.patch new file mode 100644 index 00000000000..59abd604d7f --- /dev/null +++ b/queue-4.19/net-smsc911x-fix-runtime-pm-imbalance-on-error.patch @@ -0,0 +1,63 @@ +From 27702cff5d36cc002819b37ae1275c44d2fa64fd Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 23 May 2020 16:08:20 +0800 +Subject: net: smsc911x: Fix runtime PM imbalance on error + +From: Dinghao Liu + +[ Upstream commit 539d39ad0c61b35f69565a037d7586deaf6d6166 ] + +Remove runtime PM usage counter decrement when the +increment function has not been called to keep the +counter balanced. + +Signed-off-by: Dinghao Liu +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/smsc/smsc911x.c | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/drivers/net/ethernet/smsc/smsc911x.c b/drivers/net/ethernet/smsc/smsc911x.c +index ce4bfecc26c7..ae80a223975d 100644 +--- a/drivers/net/ethernet/smsc/smsc911x.c ++++ b/drivers/net/ethernet/smsc/smsc911x.c +@@ -2515,20 +2515,20 @@ static int smsc911x_drv_probe(struct platform_device *pdev) + + retval = smsc911x_init(dev); + if (retval < 0) +- goto out_disable_resources; ++ goto out_init_fail; + + netif_carrier_off(dev); + + retval = smsc911x_mii_init(pdev, dev); + if (retval) { + SMSC_WARN(pdata, probe, "Error %i initialising mii", retval); +- goto out_disable_resources; ++ goto out_init_fail; + } + + retval = register_netdev(dev); + if (retval) { + SMSC_WARN(pdata, probe, "Error %i registering device", retval); +- goto out_disable_resources; ++ goto out_init_fail; + } else { + SMSC_TRACE(pdata, probe, + "Network interface: \"%s\"", dev->name); +@@ -2569,9 +2569,10 @@ static int smsc911x_drv_probe(struct platform_device *pdev) + + return 0; + +-out_disable_resources: ++out_init_fail: + pm_runtime_put(&pdev->dev); + pm_runtime_disable(&pdev->dev); ++out_disable_resources: + (void)smsc911x_disable_resources(pdev); + out_enable_resources_fail: + smsc911x_free_resources(pdev); +-- +2.25.1 + diff --git a/queue-4.19/null_blk-return-error-for-invalid-zone-size.patch b/queue-4.19/null_blk-return-error-for-invalid-zone-size.patch new file mode 100644 index 00000000000..ae03d439a37 --- /dev/null +++ b/queue-4.19/null_blk-return-error-for-invalid-zone-size.patch @@ -0,0 +1,65 @@ +From cc36d2c5ffed3d07b1b0df5cd90b0c265e3e4cb0 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 20 May 2020 16:01:51 -0700 +Subject: null_blk: return error for invalid zone size + +From: Chaitanya Kulkarni + +[ Upstream commit e274832590211c4b1b1e807ca66fad8b5bb8b328 ] + +In null_init_zone_dev() check if the zone size is larger than device +capacity, return error if needed. + +This also fixes the following oops :- + +null_blk: changed the number of conventional zones to 4294967295 +BUG: kernel NULL pointer dereference, address: 0000000000000010 +PGD 7d76c5067 P4D 7d76c5067 PUD 7d240c067 PMD 0 +Oops: 0002 [#1] SMP NOPTI +CPU: 4 PID: 5508 Comm: nullbtests.sh Tainted: G OE 5.7.0-rc4lblk-fnext0 +Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.12.0-59-gc9ba5276e4 +RIP: 0010:null_init_zoned_dev+0x17a/0x27f [null_blk] +RSP: 0018:ffffc90007007e00 EFLAGS: 00010246 +RAX: 0000000000000020 RBX: ffff8887fb3f3c00 RCX: 0000000000000007 +RDX: 0000000000000000 RSI: ffff8887ca09d688 RDI: ffff888810fea510 +RBP: 0000000000000010 R08: ffff8887ca09d688 R09: 0000000000000000 +R10: 0000000000000000 R11: 0000000000000000 R12: ffff8887c26e8000 +R13: ffffffffa05e9390 R14: 0000000000000000 R15: 0000000000000001 +FS: 00007fcb5256f740(0000) GS:ffff888810e00000(0000) knlGS:0000000000000000 +CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 +CR2: 0000000000000010 CR3: 000000081e8fe000 CR4: 00000000003406e0 +Call Trace: + null_add_dev+0x534/0x71b [null_blk] + nullb_device_power_store.cold.41+0x8/0x2e [null_blk] + configfs_write_file+0xe6/0x150 + vfs_write+0xba/0x1e0 + ksys_write+0x5f/0xe0 + do_syscall_64+0x60/0x250 + entry_SYSCALL_64_after_hwframe+0x49/0xb3 +RIP: 0033:0x7fcb51c71840 + +Signed-off-by: Chaitanya Kulkarni +Signed-off-by: Jens Axboe +Signed-off-by: Sasha Levin +--- + drivers/block/null_blk_zoned.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/drivers/block/null_blk_zoned.c b/drivers/block/null_blk_zoned.c +index 7c6b86d98700..d1725ac636c0 100644 +--- a/drivers/block/null_blk_zoned.c ++++ b/drivers/block/null_blk_zoned.c +@@ -20,6 +20,10 @@ int null_zone_init(struct nullb_device *dev) + pr_err("null_blk: zone_size must be power-of-two\n"); + return -EINVAL; + } ++ if (dev->zone_size > dev->size) { ++ pr_err("Zone size larger than device capacity\n"); ++ return -EINVAL; ++ } + + dev->zone_size_sects = dev->zone_size << ZONE_SIZE_SHIFT; + dev->nr_zones = dev_size >> +-- +2.25.1 + diff --git a/queue-4.19/s390-mm-fix-set_huge_pte_at-for-empty-ptes.patch b/queue-4.19/s390-mm-fix-set_huge_pte_at-for-empty-ptes.patch new file mode 100644 index 00000000000..a24aed5543a --- /dev/null +++ b/queue-4.19/s390-mm-fix-set_huge_pte_at-for-empty-ptes.patch @@ -0,0 +1,58 @@ +From 60d324d8303c7f95a24e0153985f7f9f3fed07f4 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 6 May 2020 13:04:07 +0200 +Subject: s390/mm: fix set_huge_pte_at() for empty ptes + +From: Gerald Schaefer + +[ Upstream commit ac8372f3b4e41015549b331a4f350224661e7fc6 ] + +On s390, the layout of normal and large ptes (i.e. pmds/puds) differs. +Therefore, set_huge_pte_at() does a conversion from a normal pte to +the corresponding large pmd/pud. So, when converting an empty pte, this +should result in an empty pmd/pud, which would return true for +pmd/pud_none(). + +However, after conversion we also mark the pmd/pud as large, and +therefore present. For empty ptes, this will result in an empty pmd/pud +that is also marked as large, and pmd/pud_none() would not return true. + +There is currently no issue with this behaviour, as set_huge_pte_at() +does not seem to be called for empty ptes. It would be valid though, so +let's fix this by not marking empty ptes as large in set_huge_pte_at(). + +This was found by testing a patch from from Anshuman Khandual, which is +currently discussed on LKML ("mm/debug: Add more arch page table helper +tests"). + +Signed-off-by: Gerald Schaefer +Signed-off-by: Vasily Gorbik +Signed-off-by: Sasha Levin +--- + arch/s390/mm/hugetlbpage.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/arch/s390/mm/hugetlbpage.c b/arch/s390/mm/hugetlbpage.c +index 5674710a4841..7dfae86afa47 100644 +--- a/arch/s390/mm/hugetlbpage.c ++++ b/arch/s390/mm/hugetlbpage.c +@@ -159,10 +159,13 @@ void set_huge_pte_at(struct mm_struct *mm, unsigned long addr, + rste &= ~_SEGMENT_ENTRY_NOEXEC; + + /* Set correct table type for 2G hugepages */ +- if ((pte_val(*ptep) & _REGION_ENTRY_TYPE_MASK) == _REGION_ENTRY_TYPE_R3) +- rste |= _REGION_ENTRY_TYPE_R3 | _REGION3_ENTRY_LARGE; +- else ++ if ((pte_val(*ptep) & _REGION_ENTRY_TYPE_MASK) == _REGION_ENTRY_TYPE_R3) { ++ if (likely(pte_present(pte))) ++ rste |= _REGION3_ENTRY_LARGE; ++ rste |= _REGION_ENTRY_TYPE_R3; ++ } else if (likely(pte_present(pte))) + rste |= _SEGMENT_ENTRY_LARGE; ++ + clear_huge_pte_skeys(mm, rste); + pte_val(*ptep) = rste; + } +-- +2.25.1 + diff --git a/queue-4.19/series b/queue-4.19/series index a9c69154389..2c8afa76b91 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -5,3 +5,15 @@ scsi-hisi_sas-check-sas_port-before-using-it.patch powerpc-powernv-avoid-re-registration-of-imc-debugfs.patch spi-dw-use-smp_mb-to-avoid-sending-spi-data-error.patch s390-ftrace-save-traced-function-caller.patch +arc-fix-iccm-dccm-runtime-size-checks.patch +arc-plat-eznps-restrict-to-config_isa_arcompact.patch +evm-fix-rcu-list-related-warnings.patch +i2c-altera-fix-race-between-xfer_msg-and-isr-thread.patch +x86-mmiotrace-use-cpumask_available-for-cpumask_var_.patch +net-bmac-fix-read-of-mac-address-from-rom.patch +drm-edid-add-oculus-rift-s-to-non-desktop-list.patch +s390-mm-fix-set_huge_pte_at-for-empty-ptes.patch +null_blk-return-error-for-invalid-zone-size.patch +net-ethernet-freescale-rework-quiesce-activate-for-u.patch +net-ethernet-stmmac-enable-interface-clocks-on-probe.patch +net-smsc911x-fix-runtime-pm-imbalance-on-error.patch diff --git a/queue-4.19/x86-mmiotrace-use-cpumask_available-for-cpumask_var_.patch b/queue-4.19/x86-mmiotrace-use-cpumask_available-for-cpumask_var_.patch new file mode 100644 index 00000000000..532bf80be85 --- /dev/null +++ b/queue-4.19/x86-mmiotrace-use-cpumask_available-for-cpumask_var_.patch @@ -0,0 +1,67 @@ +From 7553335320dafa5147f6426f456dea04027c026f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 8 Apr 2020 13:53:23 -0700 +Subject: x86/mmiotrace: Use cpumask_available() for cpumask_var_t variables + +From: Nathan Chancellor + +[ Upstream commit d7110a26e5905ec2fe3fc88bc6a538901accb72b ] + +When building with Clang + -Wtautological-compare and +CONFIG_CPUMASK_OFFSTACK unset: + + arch/x86/mm/mmio-mod.c:375:6: warning: comparison of array 'downed_cpus' + equal to a null pointer is always false [-Wtautological-pointer-compare] + if (downed_cpus == NULL && + ^~~~~~~~~~~ ~~~~ + arch/x86/mm/mmio-mod.c:405:6: warning: comparison of array 'downed_cpus' + equal to a null pointer is always false [-Wtautological-pointer-compare] + if (downed_cpus == NULL || cpumask_weight(downed_cpus) == 0) + ^~~~~~~~~~~ ~~~~ + 2 warnings generated. + +Commit + + f7e30f01a9e2 ("cpumask: Add helper cpumask_available()") + +added cpumask_available() to fix warnings of this nature. Use that here +so that clang does not warn regardless of CONFIG_CPUMASK_OFFSTACK's +value. + +Reported-by: Sedat Dilek +Signed-off-by: Nathan Chancellor +Signed-off-by: Borislav Petkov +Reviewed-by: Nick Desaulniers +Acked-by: Steven Rostedt (VMware) +Link: https://github.com/ClangBuiltLinux/linux/issues/982 +Link: https://lkml.kernel.org/r/20200408205323.44490-1-natechancellor@gmail.com +Signed-off-by: Sasha Levin +--- + arch/x86/mm/mmio-mod.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/arch/x86/mm/mmio-mod.c b/arch/x86/mm/mmio-mod.c +index 2c1ecf4763c4..e32b003e064a 100644 +--- a/arch/x86/mm/mmio-mod.c ++++ b/arch/x86/mm/mmio-mod.c +@@ -384,7 +384,7 @@ static void enter_uniprocessor(void) + int cpu; + int err; + +- if (downed_cpus == NULL && ++ if (!cpumask_available(downed_cpus) && + !alloc_cpumask_var(&downed_cpus, GFP_KERNEL)) { + pr_notice("Failed to allocate mask\n"); + goto out; +@@ -414,7 +414,7 @@ static void leave_uniprocessor(void) + int cpu; + int err; + +- if (downed_cpus == NULL || cpumask_weight(downed_cpus) == 0) ++ if (!cpumask_available(downed_cpus) || cpumask_weight(downed_cpus) == 0) + return; + pr_notice("Re-enabling CPUs...\n"); + for_each_cpu(cpu, downed_cpus) { +-- +2.25.1 +