From 4c34071bdbd674f94454d2d5a127229975bacb7c Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Mon, 23 Dec 2019 17:28:56 -0500 Subject: [PATCH] fixes for 5.4 Signed-off-by: Sasha Levin --- ...-regulator-to-be-always-on-for-droid.patch | 59 ++++++++ ...h10k-add-cleanup-in-ath10k_sta_state.patch | 46 +++++++ ...low-power-enter-exit-acknowledgment-.patch | 108 +++++++++++++++ ...ninitialized-variable-pasid_mapping_.patch | 43 ++++++ ...-memory-access-for-array-sb-dev_role.patch | 128 ++++++++++++++++++ ...a-siw-fix-post_recv-qp-state-locking.patch | 37 +++++ ...endless-recursion-in-function_graph-.patch | 55 ++++++++ ...ests-net-tls-remove-recv_rcvbuf-test.patch | 73 ++++++++++ queue-5.4/series | 11 ++ ...orrect-handling-of-native-chipselect.patch | 65 +++++++++ ...orrect-handling-of-native-chipselect.patch | 65 +++++++++ ...-build-warning-seen-with-config_pm-n.patch | 49 +++++++ 12 files changed, 739 insertions(+) create mode 100644 queue-5.4/arm-dts-fix-vcsi-regulator-to-be-always-on-for-droid.patch create mode 100644 queue-5.4/ath10k-revert-ath10k-add-cleanup-in-ath10k_sta_state.patch create mode 100644 queue-5.4/can-flexcan-add-low-power-enter-exit-acknowledgment-.patch create mode 100644 queue-5.4/drm-amdgpu-fix-uninitialized-variable-pasid_mapping_.patch create mode 100644 queue-5.4/md-avoid-invalid-memory-access-for-array-sb-dev_role.patch create mode 100644 queue-5.4/rdma-siw-fix-post_recv-qp-state-locking.patch create mode 100644 queue-5.4/s390-ftrace-fix-endless-recursion-in-function_graph-.patch create mode 100644 queue-5.4/selftests-net-tls-remove-recv_rcvbuf-test.patch create mode 100644 queue-5.4/spi-cadence-correct-handling-of-native-chipselect.patch create mode 100644 queue-5.4/spi-dw-correct-handling-of-native-chipselect.patch create mode 100644 queue-5.4/usb-xhci-fix-build-warning-seen-with-config_pm-n.patch diff --git a/queue-5.4/arm-dts-fix-vcsi-regulator-to-be-always-on-for-droid.patch b/queue-5.4/arm-dts-fix-vcsi-regulator-to-be-always-on-for-droid.patch new file mode 100644 index 00000000000..e5f6fa5e374 --- /dev/null +++ b/queue-5.4/arm-dts-fix-vcsi-regulator-to-be-always-on-for-droid.patch @@ -0,0 +1,59 @@ +From b0fb193cdc3063eab38fab5ca15ea29b390f90af Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 19 Nov 2019 19:50:30 -0800 +Subject: ARM: dts: Fix vcsi regulator to be always-on for droid4 to prevent + hangs + +From: Tony Lindgren + +[ Upstream commit ddb52945999dcf35787bf221b62108806182578d ] + +In addition to using vcsi regulator for the display, looks like droid4 is +using vcsi regulator to trigger off mode internally with the PMIC firmware +when the SoC enters deeper idle states. This is configured in the Motorola +Mapphone Linux kernel sources as "zerov_regulator". + +As we currently don't support off mode during idle for omap4, we must +prevent vcsi from being disabled when the display is blanked to prevent +the PMIC change to off mode. Otherwise the device will hang on entering +idle when the display is blanked. + +Before commit 089b3f61ecfc ("regulator: core: Let boot-on regulators be +powered off"), the boot-on regulators never got disabled like they should +and vcsi did not get turned off on idle. + +Let's fix the issue by setting vcsi to always-on for now. Later on we may +want to claim the vcsi regulator also in the PM code if needed. + +Fixes: 089b3f61ecfc ("regulator: core: Let boot-on regulators be powered off") +Cc: Merlijn Wajer +Cc: Pavel Machek +Cc: Sebastian Reichel +Signed-off-by: Tony Lindgren +Signed-off-by: Sasha Levin +--- + arch/arm/boot/dts/motorola-cpcap-mapphone.dtsi | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/arch/arm/boot/dts/motorola-cpcap-mapphone.dtsi b/arch/arm/boot/dts/motorola-cpcap-mapphone.dtsi +index d1eae47b83f6..82f7ae030600 100644 +--- a/arch/arm/boot/dts/motorola-cpcap-mapphone.dtsi ++++ b/arch/arm/boot/dts/motorola-cpcap-mapphone.dtsi +@@ -160,12 +160,12 @@ + regulator-enable-ramp-delay = <1000>; + }; + +- /* Used by DSS */ ++ /* Used by DSS and is the "zerov_regulator" trigger for SoC off mode */ + vcsi: VCSI { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-enable-ramp-delay = <1000>; +- regulator-boot-on; ++ regulator-always-on; + }; + + vdac: VDAC { +-- +2.20.1 + diff --git a/queue-5.4/ath10k-revert-ath10k-add-cleanup-in-ath10k_sta_state.patch b/queue-5.4/ath10k-revert-ath10k-add-cleanup-in-ath10k_sta_state.patch new file mode 100644 index 00000000000..cfb16f41d9d --- /dev/null +++ b/queue-5.4/ath10k-revert-ath10k-add-cleanup-in-ath10k_sta_state.patch @@ -0,0 +1,46 @@ +From adb9a2377acb3f0ef8fcb92a0e5d51d899e97f04 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 13 Nov 2019 12:26:44 -0800 +Subject: ath10k: Revert "ath10k: add cleanup in ath10k_sta_state()" + +From: Bjorn Andersson + +[ Upstream commit f4fe2e53349f1072d33c69f484dbf9d77bb8f45a ] + +This reverts commit 334f5b61a6f29834e881923b98d1e27e5ce9620d. + +This caused ath10k_snoc on Qualcomm MSM8998, SDM845 and QCS404 platforms to +trigger an assert in the firmware: + +err_qdi.c:456:EF:wlan_process:1:cmnos_thread.c:3900:Asserted in wlan_vdev.c:_wlan_vdev_up:3219 + +Revert the offending commit for now. + +Signed-off-by: Bjorn Andersson +Signed-off-by: Kalle Valo +Signed-off-by: Sasha Levin +--- + drivers/net/wireless/ath/ath10k/mac.c | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c +index 2b53ea6ca205..36d24ea126a2 100644 +--- a/drivers/net/wireless/ath/ath10k/mac.c ++++ b/drivers/net/wireless/ath/ath10k/mac.c +@@ -6551,12 +6551,8 @@ static int ath10k_sta_state(struct ieee80211_hw *hw, + + spin_unlock_bh(&ar->data_lock); + +- if (!sta->tdls) { +- ath10k_peer_delete(ar, arvif->vdev_id, sta->addr); +- ath10k_mac_dec_num_stations(arvif, sta); +- kfree(arsta->tx_stats); ++ if (!sta->tdls) + goto exit; +- } + + ret = ath10k_wmi_update_fw_tdls_state(ar, arvif->vdev_id, + WMI_TDLS_ENABLE_ACTIVE); +-- +2.20.1 + diff --git a/queue-5.4/can-flexcan-add-low-power-enter-exit-acknowledgment-.patch b/queue-5.4/can-flexcan-add-low-power-enter-exit-acknowledgment-.patch new file mode 100644 index 00000000000..b2f79ab5bbf --- /dev/null +++ b/queue-5.4/can-flexcan-add-low-power-enter-exit-acknowledgment-.patch @@ -0,0 +1,108 @@ +From 429ba8e9b3b3d8a220f6424fe3a0eb1b2b79c2dd Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 4 Dec 2019 11:36:11 +0000 +Subject: can: flexcan: add low power enter/exit acknowledgment helper + +From: Joakim Zhang + +[ Upstream commit b7603d080ffcf8689ec91ca300caf84d8dbed317 ] + +The MCR[LPMACK] read-only bit indicates that FlexCAN is in a lower-power +mode (Disabled mode, Doze mode, Stop mode). + +The CPU can poll this bit to know when FlexCAN has actually entered low +power mode. The low power enter/exit acknowledgment helper will reduce +code duplication for disabled mode, doze mode and stop mode. + +Tested-by: Sean Nyekjaer +Signed-off-by: Joakim Zhang +Signed-off-by: Marc Kleine-Budde +Signed-off-by: Sasha Levin +--- + drivers/net/can/flexcan.c | 46 +++++++++++++++++++++++++-------------- + 1 file changed, 30 insertions(+), 16 deletions(-) + +diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c +index 99b3492ea130..e5c207ad3c77 100644 +--- a/drivers/net/can/flexcan.c ++++ b/drivers/net/can/flexcan.c +@@ -389,6 +389,34 @@ static struct flexcan_mb __iomem *flexcan_get_mb(const struct flexcan_priv *priv + (&priv->regs->mb[bank][priv->mb_size * mb_index]); + } + ++static int flexcan_low_power_enter_ack(struct flexcan_priv *priv) ++{ ++ struct flexcan_regs __iomem *regs = priv->regs; ++ unsigned int timeout = FLEXCAN_TIMEOUT_US / 10; ++ ++ while (timeout-- && !(priv->read(®s->mcr) & FLEXCAN_MCR_LPM_ACK)) ++ udelay(10); ++ ++ if (!(priv->read(®s->mcr) & FLEXCAN_MCR_LPM_ACK)) ++ return -ETIMEDOUT; ++ ++ return 0; ++} ++ ++static int flexcan_low_power_exit_ack(struct flexcan_priv *priv) ++{ ++ struct flexcan_regs __iomem *regs = priv->regs; ++ unsigned int timeout = FLEXCAN_TIMEOUT_US / 10; ++ ++ while (timeout-- && (priv->read(®s->mcr) & FLEXCAN_MCR_LPM_ACK)) ++ udelay(10); ++ ++ if (priv->read(®s->mcr) & FLEXCAN_MCR_LPM_ACK) ++ return -ETIMEDOUT; ++ ++ return 0; ++} ++ + static void flexcan_enable_wakeup_irq(struct flexcan_priv *priv, bool enable) + { + struct flexcan_regs __iomem *regs = priv->regs; +@@ -493,39 +521,25 @@ static inline int flexcan_transceiver_disable(const struct flexcan_priv *priv) + static int flexcan_chip_enable(struct flexcan_priv *priv) + { + struct flexcan_regs __iomem *regs = priv->regs; +- unsigned int timeout = FLEXCAN_TIMEOUT_US / 10; + u32 reg; + + reg = priv->read(®s->mcr); + reg &= ~FLEXCAN_MCR_MDIS; + priv->write(reg, ®s->mcr); + +- while (timeout-- && (priv->read(®s->mcr) & FLEXCAN_MCR_LPM_ACK)) +- udelay(10); +- +- if (priv->read(®s->mcr) & FLEXCAN_MCR_LPM_ACK) +- return -ETIMEDOUT; +- +- return 0; ++ return flexcan_low_power_exit_ack(priv); + } + + static int flexcan_chip_disable(struct flexcan_priv *priv) + { + struct flexcan_regs __iomem *regs = priv->regs; +- unsigned int timeout = FLEXCAN_TIMEOUT_US / 10; + u32 reg; + + reg = priv->read(®s->mcr); + reg |= FLEXCAN_MCR_MDIS; + priv->write(reg, ®s->mcr); + +- while (timeout-- && !(priv->read(®s->mcr) & FLEXCAN_MCR_LPM_ACK)) +- udelay(10); +- +- if (!(priv->read(®s->mcr) & FLEXCAN_MCR_LPM_ACK)) +- return -ETIMEDOUT; +- +- return 0; ++ return flexcan_low_power_enter_ack(priv); + } + + static int flexcan_chip_freeze(struct flexcan_priv *priv) +-- +2.20.1 + diff --git a/queue-5.4/drm-amdgpu-fix-uninitialized-variable-pasid_mapping_.patch b/queue-5.4/drm-amdgpu-fix-uninitialized-variable-pasid_mapping_.patch new file mode 100644 index 00000000000..5badb5d9779 --- /dev/null +++ b/queue-5.4/drm-amdgpu-fix-uninitialized-variable-pasid_mapping_.patch @@ -0,0 +1,43 @@ +From 893ced7a3d083880066d8ced90b2dbc8486d152c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 3 Oct 2019 22:52:27 +0100 +Subject: drm/amdgpu: fix uninitialized variable pasid_mapping_needed +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Colin Ian King + +[ Upstream commit 17cf678a33c6196a3df4531fe5aec91384c9eeb5 ] + +The boolean variable pasid_mapping_needed is not initialized and +there are code paths that do not assign it any value before it is +is read later. Fix this by initializing pasid_mapping_needed to +false. + +Addresses-Coverity: ("Uninitialized scalar variable") +Fixes: 6817bf283b2b ("drm/amdgpu: grab the id mgr lock while accessing passid_mapping") +Reviewed-by: Christian König +Signed-off-by: Colin Ian King +Signed-off-by: Alex Deucher +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +index 7700c32dd743..c7514f743409 100644 +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +@@ -1035,7 +1035,7 @@ int amdgpu_vm_flush(struct amdgpu_ring *ring, struct amdgpu_job *job, bool need_ + id->oa_size != job->oa_size); + bool vm_flush_needed = job->vm_needs_flush; + struct dma_fence *fence = NULL; +- bool pasid_mapping_needed; ++ bool pasid_mapping_needed = false; + unsigned patch_offset = 0; + int r; + +-- +2.20.1 + diff --git a/queue-5.4/md-avoid-invalid-memory-access-for-array-sb-dev_role.patch b/queue-5.4/md-avoid-invalid-memory-access-for-array-sb-dev_role.patch new file mode 100644 index 00000000000..8500378a2c3 --- /dev/null +++ b/queue-5.4/md-avoid-invalid-memory-access-for-array-sb-dev_role.patch @@ -0,0 +1,128 @@ +From ed82d24eb7184f1d3421547a947f5bf8c868149b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 30 Oct 2019 18:47:02 +0800 +Subject: md: avoid invalid memory access for array sb->dev_roles + +From: Yufen Yu + +[ Upstream commit 228fc7d76db68732677230a3c64337908fd298e3 ] + +we need to gurantee 'desc_nr' valid before access array +of sb->dev_roles. + +In addition, we should avoid .load_super always return '0' +when level is LEVEL_MULTIPATH, which is not expected. + +Reported-by: coverity-bot +Addresses-Coverity-ID: 1487373 ("Memory - illegal accesses") +Fixes: 6a5cb53aaa4e ("md: no longer compare spare disk superblock events in super_load") +Signed-off-by: Yufen Yu +Signed-off-by: Song Liu +Signed-off-by: Sasha Levin +--- + drivers/md/md.c | 51 +++++++++++++++++++------------------------------ + 1 file changed, 20 insertions(+), 31 deletions(-) + +diff --git a/drivers/md/md.c b/drivers/md/md.c +index 6f0ecfe8eab2..805b33e27496 100644 +--- a/drivers/md/md.c ++++ b/drivers/md/md.c +@@ -1105,6 +1105,7 @@ static int super_90_load(struct md_rdev *rdev, struct md_rdev *refdev, int minor + char b[BDEVNAME_SIZE], b2[BDEVNAME_SIZE]; + mdp_super_t *sb; + int ret; ++ bool spare_disk = true; + + /* + * Calculate the position of the superblock (512byte sectors), +@@ -1155,13 +1156,15 @@ static int super_90_load(struct md_rdev *rdev, struct md_rdev *refdev, int minor + else + rdev->desc_nr = sb->this_disk.number; + ++ /* not spare disk, or LEVEL_MULTIPATH */ ++ if (sb->level == LEVEL_MULTIPATH || ++ (rdev->desc_nr >= 0 && ++ sb->disks[rdev->desc_nr].state & ++ ((1<disks[rdev->desc_nr].state & ( +- (1<disks[rdev->desc_nr].state & ( +- (1< ev2)) ++ if (!spare_disk && ev1 > ev2) + ret = 1; + else + ret = 0; +@@ -1547,7 +1544,7 @@ static int super_1_load(struct md_rdev *rdev, struct md_rdev *refdev, int minor_ + sector_t sectors; + char b[BDEVNAME_SIZE], b2[BDEVNAME_SIZE]; + int bmask; +- __u64 role; ++ bool spare_disk = true; + + /* + * Calculate the position of the superblock in 512byte sectors. +@@ -1681,17 +1678,16 @@ static int super_1_load(struct md_rdev *rdev, struct md_rdev *refdev, int minor_ + sb->level != 0) + return -EINVAL; + +- role = le16_to_cpu(sb->dev_roles[rdev->desc_nr]); ++ /* not spare disk, or LEVEL_MULTIPATH */ ++ if (sb->level == cpu_to_le32(LEVEL_MULTIPATH) || ++ (rdev->desc_nr >= 0 && ++ rdev->desc_nr < le32_to_cpu(sb->max_dev) && ++ (le16_to_cpu(sb->dev_roles[rdev->desc_nr]) < MD_DISK_ROLE_MAX || ++ le16_to_cpu(sb->dev_roles[rdev->desc_nr]) == MD_DISK_ROLE_JOURNAL))) ++ spare_disk = false; + + if (!refdev) { +- /* +- * Insist of good event counter while assembling, except for +- * spares (which don't need an event count) +- */ +- if (rdev->desc_nr >= 0 && +- rdev->desc_nr < le32_to_cpu(sb->max_dev) && +- (role < MD_DISK_ROLE_MAX || +- role == MD_DISK_ROLE_JOURNAL)) ++ if (!spare_disk) + ret = 1; + else + ret = 0; +@@ -1711,14 +1707,7 @@ static int super_1_load(struct md_rdev *rdev, struct md_rdev *refdev, int minor_ + ev1 = le64_to_cpu(sb->events); + ev2 = le64_to_cpu(refsb->events); + +- /* +- * Insist of good event counter while assembling, except for +- * spares (which don't need an event count) +- */ +- if (rdev->desc_nr >= 0 && +- rdev->desc_nr < le32_to_cpu(sb->max_dev) && +- (role < MD_DISK_ROLE_MAX || +- role == MD_DISK_ROLE_JOURNAL) && ev1 > ev2) ++ if (!spare_disk && ev1 > ev2) + ret = 1; + else + ret = 0; +-- +2.20.1 + diff --git a/queue-5.4/rdma-siw-fix-post_recv-qp-state-locking.patch b/queue-5.4/rdma-siw-fix-post_recv-qp-state-locking.patch new file mode 100644 index 00000000000..475f56d759f --- /dev/null +++ b/queue-5.4/rdma-siw-fix-post_recv-qp-state-locking.patch @@ -0,0 +1,37 @@ +From 839831ca73f191319cda23d2233f5686e628c6ea Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 25 Oct 2019 16:29:03 +0200 +Subject: RDMA/siw: Fix post_recv QP state locking + +From: Bernard Metzler + +[ Upstream commit 0edefddbae396e50eb7887d279d0c4bb4d7a6384 ] + +Do not release qp state lock if not previously acquired. + +Fixes: cf049bb31f71 ("RDMA/siw: Fix SQ/RQ drain logic") +Link: https://lore.kernel.org/r/20191025142903.20625-1-bmt@zurich.ibm.com +Reported-by: Dan Carpenter +Signed-off-by: Bernard Metzler +Reviewed-by: Leon Romanovsky +Signed-off-by: Jason Gunthorpe +Signed-off-by: Sasha Levin +--- + drivers/infiniband/sw/siw/siw_verbs.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/drivers/infiniband/sw/siw/siw_verbs.c b/drivers/infiniband/sw/siw/siw_verbs.c +index 7d0a7edc533d..1b1a40db529c 100644 +--- a/drivers/infiniband/sw/siw/siw_verbs.c ++++ b/drivers/infiniband/sw/siw/siw_verbs.c +@@ -988,7 +988,6 @@ int siw_post_receive(struct ib_qp *base_qp, const struct ib_recv_wr *wr, + } + if (!qp->kernel_verbs) { + siw_dbg_qp(qp, "no kernel post_recv for user mapped sq\n"); +- up_read(&qp->state_lock); + *bad_wr = wr; + return -EINVAL; + } +-- +2.20.1 + diff --git a/queue-5.4/s390-ftrace-fix-endless-recursion-in-function_graph-.patch b/queue-5.4/s390-ftrace-fix-endless-recursion-in-function_graph-.patch new file mode 100644 index 00000000000..ca4cbe47b74 --- /dev/null +++ b/queue-5.4/s390-ftrace-fix-endless-recursion-in-function_graph-.patch @@ -0,0 +1,55 @@ +From 216ff85864b01d1d99918dbf22be1de0883d291b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 9 Dec 2019 09:03:12 +0100 +Subject: s390/ftrace: fix endless recursion in function_graph tracer + +From: Sven Schnelle + +[ Upstream commit 6feeee8efc53035c3195b02068b58ae947538aa4 ] + +The following sequence triggers a kernel stack overflow on s390x: + +mount -t tracefs tracefs /sys/kernel/tracing +cd /sys/kernel/tracing +echo function_graph > current_tracer +[crash] + +This is because preempt_count_{add,sub} are in the list of traced +functions, which can be demonstrated by: + +echo preempt_count_add >set_ftrace_filter +echo function_graph > current_tracer +[crash] + +The stack overflow happens because get_tod_clock_monotonic() gets called +by ftrace but itself calls preempt_{disable,enable}(), which leads to a +endless recursion. Fix this by using preempt_{disable,enable}_notrace(). + +Fixes: 011620688a71 ("s390/time: ensure get_clock_monotonic() returns monotonic values") +Signed-off-by: Sven Schnelle +Reviewed-by: Vasily Gorbik +Signed-off-by: Vasily Gorbik +Signed-off-by: Sasha Levin +--- + arch/s390/include/asm/timex.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/arch/s390/include/asm/timex.h b/arch/s390/include/asm/timex.h +index 0f12a3f91282..2dc9eb4e1acc 100644 +--- a/arch/s390/include/asm/timex.h ++++ b/arch/s390/include/asm/timex.h +@@ -195,9 +195,9 @@ static inline unsigned long long get_tod_clock_monotonic(void) + { + unsigned long long tod; + +- preempt_disable(); ++ preempt_disable_notrace(); + tod = get_tod_clock() - *(unsigned long long *) &tod_clock_base[1]; +- preempt_enable(); ++ preempt_enable_notrace(); + return tod; + } + +-- +2.20.1 + diff --git a/queue-5.4/selftests-net-tls-remove-recv_rcvbuf-test.patch b/queue-5.4/selftests-net-tls-remove-recv_rcvbuf-test.patch new file mode 100644 index 00000000000..0cb9c489f12 --- /dev/null +++ b/queue-5.4/selftests-net-tls-remove-recv_rcvbuf-test.patch @@ -0,0 +1,73 @@ +From ca927d9e1b83bd35f209ef4c8b05fdc4e027608f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 13 Dec 2019 07:39:02 -0300 +Subject: selftests: net: tls: remove recv_rcvbuf test + +From: Thadeu Lima de Souza Cascardo + +[ Upstream commit 6dd504b0fd1039c6e5d391e97cf5c4ee592aefcb ] + +This test only works when [1] is applied, which was rejected. + +Basically, the errors are reported and cleared. In this particular case of +tls sockets, following reads will block. + +The test case was originally submitted with the rejected patch, but, then, +was included as part of a different patchset, possibly by mistake. + +[1] https://lore.kernel.org/netdev/20191007035323.4360-2-jakub.kicinski@netronome.com/#t + +Thanks Paolo Pisati for pointing out the original patchset where this +appeared. + +Fixes: 65190f77424d (selftests/tls: add a test for fragmented messages) +Reported-by: Paolo Pisati +Signed-off-by: Thadeu Lima de Souza Cascardo +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + tools/testing/selftests/net/tls.c | 28 ---------------------------- + 1 file changed, 28 deletions(-) + +diff --git a/tools/testing/selftests/net/tls.c b/tools/testing/selftests/net/tls.c +index 13e5ef615026..0ea44d975b6c 100644 +--- a/tools/testing/selftests/net/tls.c ++++ b/tools/testing/selftests/net/tls.c +@@ -722,34 +722,6 @@ TEST_F(tls, recv_lowat) + EXPECT_EQ(memcmp(send_mem, recv_mem + 10, 5), 0); + } + +-TEST_F(tls, recv_rcvbuf) +-{ +- char send_mem[4096]; +- char recv_mem[4096]; +- int rcv_buf = 1024; +- +- memset(send_mem, 0x1c, sizeof(send_mem)); +- +- EXPECT_EQ(setsockopt(self->cfd, SOL_SOCKET, SO_RCVBUF, +- &rcv_buf, sizeof(rcv_buf)), 0); +- +- EXPECT_EQ(send(self->fd, send_mem, 512, 0), 512); +- memset(recv_mem, 0, sizeof(recv_mem)); +- EXPECT_EQ(recv(self->cfd, recv_mem, sizeof(recv_mem), 0), 512); +- EXPECT_EQ(memcmp(send_mem, recv_mem, 512), 0); +- +- if (self->notls) +- return; +- +- EXPECT_EQ(send(self->fd, send_mem, 4096, 0), 4096); +- memset(recv_mem, 0, sizeof(recv_mem)); +- EXPECT_EQ(recv(self->cfd, recv_mem, sizeof(recv_mem), 0), -1); +- EXPECT_EQ(errno, EMSGSIZE); +- +- EXPECT_EQ(recv(self->cfd, recv_mem, sizeof(recv_mem), 0), -1); +- EXPECT_EQ(errno, EMSGSIZE); +-} +- + TEST_F(tls, bidir) + { + char const *test_str = "test_read"; +-- +2.20.1 + diff --git a/queue-5.4/series b/queue-5.4/series index b82dd17c4f8..08f8957e8ca 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -353,3 +353,14 @@ can-j1939-j1939_sk_bind-take-priv-after-lock-is-held.patch can-flexcan-fix-possible-deadlock-and-out-of-order-reception-after-wakeup.patch can-flexcan-poll-mcr_lpm_ack-instead-of-gpr-ack-for-stop-mode-acknowledgment.patch can-kvaser_usb-kvaser_usb_leaf-fix-some-info-leaks-to-usb-devices.patch +selftests-net-tls-remove-recv_rcvbuf-test.patch +spi-dw-correct-handling-of-native-chipselect.patch +spi-cadence-correct-handling-of-native-chipselect.patch +usb-xhci-fix-build-warning-seen-with-config_pm-n.patch +drm-amdgpu-fix-uninitialized-variable-pasid_mapping_.patch +ath10k-revert-ath10k-add-cleanup-in-ath10k_sta_state.patch +rdma-siw-fix-post_recv-qp-state-locking.patch +md-avoid-invalid-memory-access-for-array-sb-dev_role.patch +s390-ftrace-fix-endless-recursion-in-function_graph-.patch +arm-dts-fix-vcsi-regulator-to-be-always-on-for-droid.patch +can-flexcan-add-low-power-enter-exit-acknowledgment-.patch diff --git a/queue-5.4/spi-cadence-correct-handling-of-native-chipselect.patch b/queue-5.4/spi-cadence-correct-handling-of-native-chipselect.patch new file mode 100644 index 00000000000..d760b090d84 --- /dev/null +++ b/queue-5.4/spi-cadence-correct-handling-of-native-chipselect.patch @@ -0,0 +1,65 @@ +From 5aacca9bff954bdc9ca742c84b60844a1bc628de Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 26 Nov 2019 16:41:40 +0000 +Subject: spi: cadence: Correct handling of native chipselect + +From: Charles Keepax + +[ Upstream commit 61acd19f9c56fa0809285346bd0bd4a926ab0da0 ] + +To fix a regression on the Cadence SPI driver, this patch reverts +commit 6046f5407ff0 ("spi: cadence: Fix default polarity of native +chipselect"). + +This patch was not the correct fix for the issue. The SPI framework +calls the set_cs line with the logic level it desires on the chip select +line, as such the old is_high handling was correct. However, this was +broken by the fact that before commit 3e5ec1db8bfe ("spi: Fix SPI_CS_HIGH +setting when using native and GPIO CS") all controllers that offered +the use of a GPIO chip select had SPI_CS_HIGH applied, even for hardware +chip selects. This caused the value passed into the driver to be inverted. +Which unfortunately makes it look like a logical enable the chip select +value. + +Since the core was corrected to not unconditionally apply SPI_CS_HIGH, +the Cadence driver, whilst using the hardware chip select, will deselect +the chip select every time we attempt to communicate with the device, +which results in failed communications. + +Fixes: 3e5ec1db8bfe ("spi: Fix SPI_CS_HIGH setting when using native and GPIO CS") +Signed-off-by: Charles Keepax +Acked-by: Linus Walleij +Link: https://lore.kernel.org/r/20191126164140.6240-1-ckeepax@opensource.cirrus.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + drivers/spi/spi-cadence.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/drivers/spi/spi-cadence.c b/drivers/spi/spi-cadence.c +index c36587b42e95..82a0ee09cbe1 100644 +--- a/drivers/spi/spi-cadence.c ++++ b/drivers/spi/spi-cadence.c +@@ -168,16 +168,16 @@ static void cdns_spi_init_hw(struct cdns_spi *xspi) + /** + * cdns_spi_chipselect - Select or deselect the chip select line + * @spi: Pointer to the spi_device structure +- * @enable: Select (1) or deselect (0) the chip select line ++ * @is_high: Select(0) or deselect (1) the chip select line + */ +-static void cdns_spi_chipselect(struct spi_device *spi, bool enable) ++static void cdns_spi_chipselect(struct spi_device *spi, bool is_high) + { + struct cdns_spi *xspi = spi_master_get_devdata(spi->master); + u32 ctrl_reg; + + ctrl_reg = cdns_spi_read(xspi, CDNS_SPI_CR); + +- if (!enable) { ++ if (is_high) { + /* Deselect the slave */ + ctrl_reg |= CDNS_SPI_CR_SSCTRL; + } else { +-- +2.20.1 + diff --git a/queue-5.4/spi-dw-correct-handling-of-native-chipselect.patch b/queue-5.4/spi-dw-correct-handling-of-native-chipselect.patch new file mode 100644 index 00000000000..9f765b95a92 --- /dev/null +++ b/queue-5.4/spi-dw-correct-handling-of-native-chipselect.patch @@ -0,0 +1,65 @@ +From 706d8d29210db5248111c6cedd4ead848ab14589 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 27 Nov 2019 15:39:36 +0000 +Subject: spi: dw: Correct handling of native chipselect + +From: Charles Keepax + +[ Upstream commit ada9e3fcc175db4538f5b5e05abf5dedf626e550 ] + +This patch reverts commit 6e0a32d6f376 ("spi: dw: Fix default polarity +of native chipselect"). + +The SPI framework always called the set_cs callback with the logic +level it desired on the chip select line, which is what the drivers +original handling supported. commit f3186dd87669 ("spi: Optionally +use GPIO descriptors for CS GPIOs") changed these symantics, but only +in the case of drivers that also support GPIO chip selects, to true +meaning apply slave select rather than logic high. This left things in +an odd state where a driver that only supports hardware chip selects, +the core would handle polarity but if the driver supported GPIOs as +well the driver should handle polarity. At this point the reverted +change was applied to change the logic in the driver to match new +system. + +This was then broken by commit 3e5ec1db8bfe ("spi: Fix SPI_CS_HIGH +setting when using native and GPIO CS") which reverted the core back +to consistently calling set_cs with a logic level. + +This fix reverts the driver code back to its original state to match +the current core code. This is probably a better fix as a) the set_cs +callback is always called with consistent symantics and b) the +inversion for SPI_CS_HIGH can be handled in the core and doesn't need +to be coded in each driver supporting it. + +Fixes: 3e5ec1db8bfe ("spi: Fix SPI_CS_HIGH setting when using native and GPIO CS") +Signed-off-by: Charles Keepax +Acked-by: Linus Walleij +Link: https://lore.kernel.org/r/20191127153936.29719-1-ckeepax@opensource.cirrus.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + drivers/spi/spi-dw.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/drivers/spi/spi-dw.c b/drivers/spi/spi-dw.c +index 076652d3d051..45972056ed8c 100644 +--- a/drivers/spi/spi-dw.c ++++ b/drivers/spi/spi-dw.c +@@ -129,10 +129,11 @@ void dw_spi_set_cs(struct spi_device *spi, bool enable) + struct dw_spi *dws = spi_controller_get_devdata(spi->controller); + struct chip_data *chip = spi_get_ctldata(spi); + ++ /* Chip select logic is inverted from spi_set_cs() */ + if (chip && chip->cs_control) +- chip->cs_control(enable); ++ chip->cs_control(!enable); + +- if (enable) ++ if (!enable) + dw_writel(dws, DW_SPI_SER, BIT(spi->chip_select)); + else if (dws->cs_override) + dw_writel(dws, DW_SPI_SER, 0); +-- +2.20.1 + diff --git a/queue-5.4/usb-xhci-fix-build-warning-seen-with-config_pm-n.patch b/queue-5.4/usb-xhci-fix-build-warning-seen-with-config_pm-n.patch new file mode 100644 index 00000000000..71d99ac6d05 --- /dev/null +++ b/queue-5.4/usb-xhci-fix-build-warning-seen-with-config_pm-n.patch @@ -0,0 +1,49 @@ +From e022bd8741ce5d609d51c4a2e4e2b23eb8d80d40 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 17 Dec 2019 17:19:11 -0800 +Subject: usb: xhci: Fix build warning seen with CONFIG_PM=n + +From: Guenter Roeck + +[ Upstream commit 6056a0f8ede27b296d10ef46f7f677cc9d715371 ] + +The following build warning is seen if CONFIG_PM is disabled. + +drivers/usb/host/xhci-pci.c:498:13: warning: + unused function 'xhci_pci_shutdown' + +Fixes: f2c710f7dca8 ("usb: xhci: only set D3hot for pci device") +Cc: Henry Lin +Cc: stable@vger.kernel.org # all stable releases with f2c710f7dca8 +Signed-off-by: Guenter Roeck +Acked-by: Mathias Nyman +Link: https://lore.kernel.org/r/20191218011911.6907-1-linux@roeck-us.net +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Sasha Levin +--- + drivers/usb/host/xhci-pci.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c +index 2907fe4d78dd..4917c5b033fa 100644 +--- a/drivers/usb/host/xhci-pci.c ++++ b/drivers/usb/host/xhci-pci.c +@@ -519,7 +519,6 @@ static int xhci_pci_resume(struct usb_hcd *hcd, bool hibernated) + retval = xhci_resume(xhci, hibernated); + return retval; + } +-#endif /* CONFIG_PM */ + + static void xhci_pci_shutdown(struct usb_hcd *hcd) + { +@@ -532,6 +531,7 @@ static void xhci_pci_shutdown(struct usb_hcd *hcd) + if (xhci->quirks & XHCI_SPURIOUS_WAKEUP) + pci_set_power_state(pdev, PCI_D3hot); + } ++#endif /* CONFIG_PM */ + + /*-------------------------------------------------------------------------*/ + +-- +2.20.1 + -- 2.47.3