From a365871eb4a97864f124948f9644d74ad6f268ee Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sat, 11 Apr 2020 13:51:47 +0200 Subject: [PATCH] 4.19-stable patches added patches: arm64-fix-size-of-__early_cpu_boot_status.patch clk-qcom-rcg-return-failure-for-rcg-update.patch drm-msm-stop-abusing-dma_map-unmap-for-cache.patch drm_dp_mst_topology-fix-broken-drm_dp_sideband_parse_remote_dpcd_read.patch rpmsg-glink-remove-chunk-size-word-align-warning.patch usb-dwc3-don-t-set-gadget-is_otg-flag.patch --- ...-fix-size-of-__early_cpu_boot_status.patch | 33 ++++++++ ...om-rcg-return-failure-for-rcg-update.patch | 33 ++++++++ ...stop-abusing-dma_map-unmap-for-cache.patch | 82 +++++++++++++++++++ ...m_dp_sideband_parse_remote_dpcd_read.patch | 36 ++++++++ ...remove-chunk-size-word-align-warning.patch | 35 ++++++++ queue-4.19/series | 6 ++ ...sb-dwc3-don-t-set-gadget-is_otg-flag.patch | 55 +++++++++++++ 7 files changed, 280 insertions(+) create mode 100644 queue-4.19/arm64-fix-size-of-__early_cpu_boot_status.patch create mode 100644 queue-4.19/clk-qcom-rcg-return-failure-for-rcg-update.patch create mode 100644 queue-4.19/drm-msm-stop-abusing-dma_map-unmap-for-cache.patch create mode 100644 queue-4.19/drm_dp_mst_topology-fix-broken-drm_dp_sideband_parse_remote_dpcd_read.patch create mode 100644 queue-4.19/rpmsg-glink-remove-chunk-size-word-align-warning.patch create mode 100644 queue-4.19/usb-dwc3-don-t-set-gadget-is_otg-flag.patch diff --git a/queue-4.19/arm64-fix-size-of-__early_cpu_boot_status.patch b/queue-4.19/arm64-fix-size-of-__early_cpu_boot_status.patch new file mode 100644 index 00000000000..c6cf7f1b344 --- /dev/null +++ b/queue-4.19/arm64-fix-size-of-__early_cpu_boot_status.patch @@ -0,0 +1,33 @@ +From 61cf61d81e326163ce1557ceccfca76e11d0e57c Mon Sep 17 00:00:00 2001 +From: Arun KS +Date: Tue, 30 Apr 2019 16:05:04 +0530 +Subject: arm64: Fix size of __early_cpu_boot_status + +From: Arun KS + +commit 61cf61d81e326163ce1557ceccfca76e11d0e57c upstream. + +__early_cpu_boot_status is of type long. Use quad +assembler directive to allocate proper size. + +Acked-by: Mark Rutland +Signed-off-by: Arun KS +Signed-off-by: Will Deacon +Signed-off-by: Lee Jones +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm64/kernel/head.S | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/arm64/kernel/head.S ++++ b/arch/arm64/kernel/head.S +@@ -667,7 +667,7 @@ ENTRY(__boot_cpu_mode) + * with MMU turned off. + */ + ENTRY(__early_cpu_boot_status) +- .long 0 ++ .quad 0 + + .popsection + diff --git a/queue-4.19/clk-qcom-rcg-return-failure-for-rcg-update.patch b/queue-4.19/clk-qcom-rcg-return-failure-for-rcg-update.patch new file mode 100644 index 00000000000..9af30a5f268 --- /dev/null +++ b/queue-4.19/clk-qcom-rcg-return-failure-for-rcg-update.patch @@ -0,0 +1,33 @@ +From 21ea4b62e1f3dc258001a68da98c9663a9dbd6c7 Mon Sep 17 00:00:00 2001 +From: Taniya Das +Date: Wed, 8 May 2019 23:54:53 +0530 +Subject: clk: qcom: rcg: Return failure for RCG update + +From: Taniya Das + +commit 21ea4b62e1f3dc258001a68da98c9663a9dbd6c7 upstream. + +In case of update config failure, return -EBUSY, so that consumers could +handle the failure gracefully. + +Signed-off-by: Taniya Das +Link: https://lkml.kernel.org/r/1557339895-21952-2-git-send-email-tdas@codeaurora.org +Signed-off-by: Stephen Boyd +Signed-off-by: Lee Jones +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/clk/qcom/clk-rcg2.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/clk/qcom/clk-rcg2.c ++++ b/drivers/clk/qcom/clk-rcg2.c +@@ -105,7 +105,7 @@ static int update_config(struct clk_rcg2 + } + + WARN(1, "%s: rcg didn't update its configuration.", name); +- return 0; ++ return -EBUSY; + } + + static int clk_rcg2_set_parent(struct clk_hw *hw, u8 index) diff --git a/queue-4.19/drm-msm-stop-abusing-dma_map-unmap-for-cache.patch b/queue-4.19/drm-msm-stop-abusing-dma_map-unmap-for-cache.patch new file mode 100644 index 00000000000..fafce5c6df4 --- /dev/null +++ b/queue-4.19/drm-msm-stop-abusing-dma_map-unmap-for-cache.patch @@ -0,0 +1,82 @@ +From 0036bc73ccbe7e600a3468bf8e8879b122252274 Mon Sep 17 00:00:00 2001 +From: Rob Clark +Date: Sun, 30 Jun 2019 05:47:22 -0700 +Subject: drm/msm: stop abusing dma_map/unmap for cache + +From: Rob Clark + +commit 0036bc73ccbe7e600a3468bf8e8879b122252274 upstream. + +Recently splats like this started showing up: + + WARNING: CPU: 4 PID: 251 at drivers/iommu/dma-iommu.c:451 __iommu_dma_unmap+0xb8/0xc0 + Modules linked in: ath10k_snoc ath10k_core fuse msm ath mac80211 uvcvideo cfg80211 videobuf2_vmalloc videobuf2_memops vide + CPU: 4 PID: 251 Comm: kworker/u16:4 Tainted: G W 5.2.0-rc5-next-20190619+ #2317 + Hardware name: LENOVO 81JL/LNVNB161216, BIOS 9UCN23WW(V1.06) 10/25/2018 + Workqueue: msm msm_gem_free_work [msm] + pstate: 80c00005 (Nzcv daif +PAN +UAO) + pc : __iommu_dma_unmap+0xb8/0xc0 + lr : __iommu_dma_unmap+0x54/0xc0 + sp : ffff0000119abce0 + x29: ffff0000119abce0 x28: 0000000000000000 + x27: ffff8001f9946648 x26: ffff8001ec271068 + x25: 0000000000000000 x24: ffff8001ea3580a8 + x23: ffff8001f95ba010 x22: ffff80018e83ba88 + x21: ffff8001e548f000 x20: fffffffffffff000 + x19: 0000000000001000 x18: 00000000c00001fe + x17: 0000000000000000 x16: 0000000000000000 + x15: ffff000015b70068 x14: 0000000000000005 + x13: 0003142cc1be1768 x12: 0000000000000001 + x11: ffff8001f6de9100 x10: 0000000000000009 + x9 : ffff000015b78000 x8 : 0000000000000000 + x7 : 0000000000000001 x6 : fffffffffffff000 + x5 : 0000000000000fff x4 : ffff00001065dbc8 + x3 : 000000000000000d x2 : 0000000000001000 + x1 : fffffffffffff000 x0 : 0000000000000000 + Call trace: + __iommu_dma_unmap+0xb8/0xc0 + iommu_dma_unmap_sg+0x98/0xb8 + put_pages+0x5c/0xf0 [msm] + msm_gem_free_work+0x10c/0x150 [msm] + process_one_work+0x1e0/0x330 + worker_thread+0x40/0x438 + kthread+0x12c/0x130 + ret_from_fork+0x10/0x18 + ---[ end trace afc0dc5ab81a06bf ]--- + +Not quite sure what triggered that, but we really shouldn't be abusing +dma_{map,unmap}_sg() for cache maint. + +Cc: Stephen Boyd +Tested-by: Stephen Boyd +Reviewed-by: Jordan Crouse +Signed-off-by: Rob Clark +Signed-off-by: Sean Paul +Link: https://patchwork.freedesktop.org/patch/msgid/20190630124735.27786-1-robdclark@gmail.com +Signed-off-by: Lee Jones +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/msm/msm_gem.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/gpu/drm/msm/msm_gem.c ++++ b/drivers/gpu/drm/msm/msm_gem.c +@@ -108,7 +108,7 @@ static struct page **get_pages(struct dr + * because display controller, GPU, etc. are not coherent: + */ + if (msm_obj->flags & (MSM_BO_WC|MSM_BO_UNCACHED)) +- dma_map_sg(dev->dev, msm_obj->sgt->sgl, ++ dma_sync_sg_for_device(dev->dev, msm_obj->sgt->sgl, + msm_obj->sgt->nents, DMA_BIDIRECTIONAL); + } + +@@ -138,7 +138,7 @@ static void put_pages(struct drm_gem_obj + * GPU, etc. are not coherent: + */ + if (msm_obj->flags & (MSM_BO_WC|MSM_BO_UNCACHED)) +- dma_unmap_sg(obj->dev->dev, msm_obj->sgt->sgl, ++ dma_sync_sg_for_cpu(obj->dev->dev, msm_obj->sgt->sgl, + msm_obj->sgt->nents, + DMA_BIDIRECTIONAL); + diff --git a/queue-4.19/drm_dp_mst_topology-fix-broken-drm_dp_sideband_parse_remote_dpcd_read.patch b/queue-4.19/drm_dp_mst_topology-fix-broken-drm_dp_sideband_parse_remote_dpcd_read.patch new file mode 100644 index 00000000000..2fbe2df514e --- /dev/null +++ b/queue-4.19/drm_dp_mst_topology-fix-broken-drm_dp_sideband_parse_remote_dpcd_read.patch @@ -0,0 +1,36 @@ +From a4c30a4861c54af78c4eb8b7855524c1a96d9f80 Mon Sep 17 00:00:00 2001 +From: Hans Verkuil +Date: Mon, 27 Aug 2018 10:07:42 +0200 +Subject: drm_dp_mst_topology: fix broken drm_dp_sideband_parse_remote_dpcd_read() + +From: Hans Verkuil + +commit a4c30a4861c54af78c4eb8b7855524c1a96d9f80 upstream. + +When parsing the reply of a DP_REMOTE_DPCD_READ DPCD command the +result is wrong due to a missing idx increment. + +This was never noticed since DP_REMOTE_DPCD_READ is currently not +used, but if you enable it, then it is all wrong. + +Signed-off-by: Hans Verkuil +Reviewed-by: Lyude Paul +Acked-by: Alex Deucher +Link: https://patchwork.freedesktop.org/patch/msgid/e72ddac2-1dc0-100a-d816-9ac98ac009dd@xs4all.nl +Signed-off-by: Lee Jones +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/drm_dp_mst_topology.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/gpu/drm/drm_dp_mst_topology.c ++++ b/drivers/gpu/drm/drm_dp_mst_topology.c +@@ -439,6 +439,7 @@ static bool drm_dp_sideband_parse_remote + if (idx > raw->curlen) + goto fail_len; + repmsg->u.remote_dpcd_read_ack.num_bytes = raw->msg[idx]; ++ idx++; + if (idx > raw->curlen) + goto fail_len; + diff --git a/queue-4.19/rpmsg-glink-remove-chunk-size-word-align-warning.patch b/queue-4.19/rpmsg-glink-remove-chunk-size-word-align-warning.patch new file mode 100644 index 00000000000..46ff0be1ad6 --- /dev/null +++ b/queue-4.19/rpmsg-glink-remove-chunk-size-word-align-warning.patch @@ -0,0 +1,35 @@ +From f0beb4ba9b185d497c8efe7b349363700092aee0 Mon Sep 17 00:00:00 2001 +From: Chris Lew +Date: Fri, 27 Jul 2018 17:47:27 +0530 +Subject: rpmsg: glink: Remove chunk size word align warning + +From: Chris Lew + +commit f0beb4ba9b185d497c8efe7b349363700092aee0 upstream. + +It is possible for the chunk sizes coming from the non RPM remote procs +to not be word aligned. Remove the alignment warning and continue to +read from the FIFO so execution is not stalled. + +Signed-off-by: Chris Lew +Signed-off-by: Arun Kumar Neelakantam +Signed-off-by: Bjorn Andersson +Signed-off-by: Lee Jones +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/rpmsg/qcom_glink_native.c | 3 --- + 1 file changed, 3 deletions(-) + +--- a/drivers/rpmsg/qcom_glink_native.c ++++ b/drivers/rpmsg/qcom_glink_native.c +@@ -813,9 +813,6 @@ static int qcom_glink_rx_data(struct qco + return -EAGAIN; + } + +- if (WARN(chunk_size % 4, "Incoming data must be word aligned\n")) +- return -EINVAL; +- + rcid = le16_to_cpu(hdr.msg.param1); + spin_lock_irqsave(&glink->idr_lock, flags); + channel = idr_find(&glink->rcids, rcid); diff --git a/queue-4.19/series b/queue-4.19/series index 8bd5e4ee626..0924d89a5ae 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -46,3 +46,9 @@ rdma-cma-teach-lockdep-about-the-order-of-rtnl-and-lock.patch bluetooth-rfcomm-fix-odebug-bug-in-rfcomm_dev_ioctl.patch rdma-cm-update-num_paths-in-cma_resolve_iboe_route-error-flow.patch fbcon-fix-null-ptr-deref-in-fbcon_switch.patch +clk-qcom-rcg-return-failure-for-rcg-update.patch +drm-msm-stop-abusing-dma_map-unmap-for-cache.patch +arm64-fix-size-of-__early_cpu_boot_status.patch +rpmsg-glink-remove-chunk-size-word-align-warning.patch +usb-dwc3-don-t-set-gadget-is_otg-flag.patch +drm_dp_mst_topology-fix-broken-drm_dp_sideband_parse_remote_dpcd_read.patch diff --git a/queue-4.19/usb-dwc3-don-t-set-gadget-is_otg-flag.patch b/queue-4.19/usb-dwc3-don-t-set-gadget-is_otg-flag.patch new file mode 100644 index 00000000000..05b3ebe1406 --- /dev/null +++ b/queue-4.19/usb-dwc3-don-t-set-gadget-is_otg-flag.patch @@ -0,0 +1,55 @@ +From c09b73cfac2a9317f1104169045c519c6021aa1d Mon Sep 17 00:00:00 2001 +From: Roger Quadros +Date: Mon, 26 Aug 2019 16:10:58 +0300 +Subject: usb: dwc3: don't set gadget->is_otg flag + +From: Roger Quadros + +commit c09b73cfac2a9317f1104169045c519c6021aa1d upstream. + +This reverts +commit 6a4290cc28be1 ("usb: dwc3: gadget: set the OTG flag in dwc3 gadget driver.") + +We don't yet support any of the OTG mechanisms (HNP/SRP/ADP) +and are not setting gadget->otg_caps, so don't set gadget->is_otg +flag. + +If we do then we end up publishing a OTG1.0 descriptor in +the gadget descriptor which causes device enumeration to fail +if we are connected to a host with CONFIG_USB_OTG enabled. + +Host side log without this patch + +[ 96.720453] usb 1-1: new high-speed USB device number 2 using xhci-hcd +[ 96.901391] usb 1-1: Dual-Role OTG device on non-HNP port +[ 96.907552] usb 1-1: set a_alt_hnp_support failed: -32 +[ 97.060447] usb 1-1: new high-speed USB device number 3 using xhci-hcd +[ 97.241378] usb 1-1: Dual-Role OTG device on non-HNP port +[ 97.247536] usb 1-1: set a_alt_hnp_support failed: -32 +[ 97.253606] usb usb1-port1: attempt power cycle +[ 97.960449] usb 1-1: new high-speed USB device number 4 using xhci-hcd +[ 98.141383] usb 1-1: Dual-Role OTG device on non-HNP port +[ 98.147540] usb 1-1: set a_alt_hnp_support failed: -32 +[ 98.300453] usb 1-1: new high-speed USB device number 5 using xhci-hcd +[ 98.481391] usb 1-1: Dual-Role OTG device on non-HNP port +[ 98.487545] usb 1-1: set a_alt_hnp_support failed: -32 +[ 98.493532] usb usb1-port1: unable to enumerate USB device + +Signed-off-by: Roger Quadros +Signed-off-by: Felipe Balbi +Signed-off-by: Lee Jones +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/dwc3/gadget.c | 1 - + 1 file changed, 1 deletion(-) + +--- a/drivers/usb/dwc3/gadget.c ++++ b/drivers/usb/dwc3/gadget.c +@@ -3166,7 +3166,6 @@ int dwc3_gadget_init(struct dwc3 *dwc) + dwc->gadget.speed = USB_SPEED_UNKNOWN; + dwc->gadget.sg_supported = true; + dwc->gadget.name = "dwc3-gadget"; +- dwc->gadget.is_otg = dwc->dr_mode == USB_DR_MODE_OTG; + + /* + * FIXME We might be setting max_speed to