From: Greg Kroah-Hartman Date: Mon, 16 May 2022 08:28:59 +0000 (+0200) Subject: 5.10-stable patches X-Git-Tag: v4.9.315~30 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=086aba1407766a36b221e4b82bee9a1dc30fac20;p=thirdparty%2Fkernel%2Fstable-queue.git 5.10-stable patches added patches: ceph-fix-setting-of-xattrs-on-async-created-inodes.patch cgroup-cpuset-remove-cpus_allowed-mems_allowed-setup-in-cpuset_init_smp.patch drm-nouveau-tegra-stop-using-iommu_present.patch i40e-i40e_main-fix-a-missing-check-on-list-iterator.patch net-atlantic-always-deep-reset-on-pm-op-fixing-up-my-null-deref-regression.patch serial-8250_mtk-fix-register-address-for-xon-xoff-character.patch serial-8250_mtk-fix-uart_efr-register-address.patch serial-8250_mtk-make-sure-to-select-the-right-feature_sel.patch slimbus-qcom-fix-irq-check-in-qcom_slim_probe.patch usb-serial-option-add-fibocom-l610-modem.patch usb-serial-option-add-fibocom-ma510-modem.patch usb-serial-pl2303-add-device-id-for-hp-lm930-display.patch usb-serial-qcserial-add-support-for-sierra-wireless-em7590.patch usb-typec-tcpci-don-t-skip-cleanup-in-.remove-on-error.patch usb-typec-tcpci_mt6360-update-for-bmc-phy-setting.patch --- diff --git a/queue-5.10/ceph-fix-setting-of-xattrs-on-async-created-inodes.patch b/queue-5.10/ceph-fix-setting-of-xattrs-on-async-created-inodes.patch new file mode 100644 index 00000000000..5b818cbc4ee --- /dev/null +++ b/queue-5.10/ceph-fix-setting-of-xattrs-on-async-created-inodes.patch @@ -0,0 +1,62 @@ +From 620239d9a32e9fe27c9204ec11e40058671aeeb6 Mon Sep 17 00:00:00 2001 +From: Jeff Layton +Date: Mon, 25 Apr 2022 15:54:27 -0400 +Subject: ceph: fix setting of xattrs on async created inodes + +From: Jeff Layton + +commit 620239d9a32e9fe27c9204ec11e40058671aeeb6 upstream. + +Currently when we create a file, we spin up an xattr buffer to send +along with the create request. If we end up doing an async create +however, then we currently pass down a zero-length xattr buffer. + +Fix the code to send down the xattr buffer in req->r_pagelist. If the +xattrs span more than a page, however give up and don't try to do an +async create. + +Cc: stable@vger.kernel.org +URL: https://bugzilla.redhat.com/show_bug.cgi?id=2063929 +Fixes: 9a8d03ca2e2c ("ceph: attempt to do async create when possible") +Reported-by: John Fortin +Reported-by: Sri Ramanujam +Signed-off-by: Jeff Layton +Reviewed-by: Xiubo Li +Signed-off-by: Ilya Dryomov +Signed-off-by: Greg Kroah-Hartman +--- + fs/ceph/file.c | 16 +++++++++++++--- + 1 file changed, 13 insertions(+), 3 deletions(-) + +--- a/fs/ceph/file.c ++++ b/fs/ceph/file.c +@@ -592,9 +592,15 @@ static int ceph_finish_async_create(stru + iinfo.change_attr = 1; + ceph_encode_timespec64(&iinfo.btime, &now); + +- iinfo.xattr_len = ARRAY_SIZE(xattr_buf); +- iinfo.xattr_data = xattr_buf; +- memset(iinfo.xattr_data, 0, iinfo.xattr_len); ++ if (req->r_pagelist) { ++ iinfo.xattr_len = req->r_pagelist->length; ++ iinfo.xattr_data = req->r_pagelist->mapped_tail; ++ } else { ++ /* fake it */ ++ iinfo.xattr_len = ARRAY_SIZE(xattr_buf); ++ iinfo.xattr_data = xattr_buf; ++ memset(iinfo.xattr_data, 0, iinfo.xattr_len); ++ } + + in.ino = cpu_to_le64(vino.ino); + in.snapid = cpu_to_le64(CEPH_NOSNAP); +@@ -706,6 +712,10 @@ int ceph_atomic_open(struct inode *dir, + err = ceph_security_init_secctx(dentry, mode, &as_ctx); + if (err < 0) + goto out_ctx; ++ /* Async create can't handle more than a page of xattrs */ ++ if (as_ctx.pagelist && ++ !list_is_singular(&as_ctx.pagelist->head)) ++ try_async = false; + } else if (!d_in_lookup(dentry)) { + /* If it's not being looked up, it's negative */ + return -ENOENT; diff --git a/queue-5.10/cgroup-cpuset-remove-cpus_allowed-mems_allowed-setup-in-cpuset_init_smp.patch b/queue-5.10/cgroup-cpuset-remove-cpus_allowed-mems_allowed-setup-in-cpuset_init_smp.patch new file mode 100644 index 00000000000..be7dd13e300 --- /dev/null +++ b/queue-5.10/cgroup-cpuset-remove-cpus_allowed-mems_allowed-setup-in-cpuset_init_smp.patch @@ -0,0 +1,73 @@ +From 2685027fca387b602ae565bff17895188b803988 Mon Sep 17 00:00:00 2001 +From: Waiman Long +Date: Wed, 27 Apr 2022 10:54:28 -0400 +Subject: cgroup/cpuset: Remove cpus_allowed/mems_allowed setup in cpuset_init_smp() +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Waiman Long + +commit 2685027fca387b602ae565bff17895188b803988 upstream. + +There are 3 places where the cpu and node masks of the top cpuset can +be initialized in the order they are executed: + 1) start_kernel -> cpuset_init() + 2) start_kernel -> cgroup_init() -> cpuset_bind() + 3) kernel_init_freeable() -> do_basic_setup() -> cpuset_init_smp() + +The first cpuset_init() call just sets all the bits in the masks. +The second cpuset_bind() call sets cpus_allowed and mems_allowed to the +default v2 values. The third cpuset_init_smp() call sets them back to +v1 values. + +For systems with cgroup v2 setup, cpuset_bind() is called once. As a +result, cpu and memory node hot add may fail to update the cpu and node +masks of the top cpuset to include the newly added cpu or node in a +cgroup v2 environment. + +For systems with cgroup v1 setup, cpuset_bind() is called again by +rebind_subsystem() when the v1 cpuset filesystem is mounted as shown +in the dmesg log below with an instrumented kernel. + + [ 2.609781] cpuset_bind() called - v2 = 1 + [ 3.079473] cpuset_init_smp() called + [ 7.103710] cpuset_bind() called - v2 = 0 + +smp_init() is called after the first two init functions. So we don't +have a complete list of active cpus and memory nodes until later in +cpuset_init_smp() which is the right time to set up effective_cpus +and effective_mems. + +To fix this cgroup v2 mask setup problem, the potentially incorrect +cpus_allowed & mems_allowed setting in cpuset_init_smp() are removed. +For cgroup v2 systems, the initial cpuset_bind() call will set the masks +correctly. For cgroup v1 systems, the second call to cpuset_bind() +will do the right setup. + +cc: stable@vger.kernel.org +Signed-off-by: Waiman Long +Tested-by: Feng Tang +Reviewed-by: Michal Koutný +Signed-off-by: Tejun Heo +Signed-off-by: Greg Kroah-Hartman +--- + kernel/cgroup/cpuset.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +--- a/kernel/cgroup/cpuset.c ++++ b/kernel/cgroup/cpuset.c +@@ -3301,8 +3301,11 @@ static struct notifier_block cpuset_trac + */ + void __init cpuset_init_smp(void) + { +- cpumask_copy(top_cpuset.cpus_allowed, cpu_active_mask); +- top_cpuset.mems_allowed = node_states[N_MEMORY]; ++ /* ++ * cpus_allowd/mems_allowed set to v2 values in the initial ++ * cpuset_bind() call will be reset to v1 values in another ++ * cpuset_bind() call when v1 cpuset is mounted. ++ */ + top_cpuset.old_mems_allowed = top_cpuset.mems_allowed; + + cpumask_copy(top_cpuset.effective_cpus, cpu_active_mask); diff --git a/queue-5.10/drm-nouveau-tegra-stop-using-iommu_present.patch b/queue-5.10/drm-nouveau-tegra-stop-using-iommu_present.patch new file mode 100644 index 00000000000..209d6b7ee77 --- /dev/null +++ b/queue-5.10/drm-nouveau-tegra-stop-using-iommu_present.patch @@ -0,0 +1,35 @@ +From 87fd2b091fb33871a7f812658a0971e8e26f903f Mon Sep 17 00:00:00 2001 +From: Robin Murphy +Date: Tue, 5 Apr 2022 15:21:34 +0100 +Subject: drm/nouveau/tegra: Stop using iommu_present() + +From: Robin Murphy + +commit 87fd2b091fb33871a7f812658a0971e8e26f903f upstream. + +Even if some IOMMU has registered itself on the platform "bus", that +doesn't necessarily mean it provides translation for the device we +care about. Replace iommu_present() with a more appropriate check. + +Signed-off-by: Robin Murphy +Reviewed-by: Lyude Paul +[added cc for stable] +Signed-off-by: Lyude Paul +Cc: stable@vger.kernel.org # v5.0+ +Link: https://patchwork.freedesktop.org/patch/msgid/70d40ea441da3663c2824d54102b471e9a621f8a.1649168494.git.robin.murphy@arm.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c ++++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c +@@ -123,7 +123,7 @@ nvkm_device_tegra_probe_iommu(struct nvk + + mutex_init(&tdev->iommu.mutex); + +- if (iommu_present(&platform_bus_type)) { ++ if (device_iommu_mapped(dev)) { + tdev->iommu.domain = iommu_domain_alloc(&platform_bus_type); + if (!tdev->iommu.domain) + goto error; diff --git a/queue-5.10/i40e-i40e_main-fix-a-missing-check-on-list-iterator.patch b/queue-5.10/i40e-i40e_main-fix-a-missing-check-on-list-iterator.patch new file mode 100644 index 00000000000..b5038239da7 --- /dev/null +++ b/queue-5.10/i40e-i40e_main-fix-a-missing-check-on-list-iterator.patch @@ -0,0 +1,92 @@ +From 3f95a7472d14abef284d8968734fe2ae7ff4845f Mon Sep 17 00:00:00 2001 +From: Xiaomeng Tong +Date: Tue, 10 May 2022 13:48:46 -0700 +Subject: i40e: i40e_main: fix a missing check on list iterator + +From: Xiaomeng Tong + +commit 3f95a7472d14abef284d8968734fe2ae7ff4845f upstream. + +The bug is here: + ret = i40e_add_macvlan_filter(hw, ch->seid, vdev->dev_addr, &aq_err); + +The list iterator 'ch' will point to a bogus position containing +HEAD if the list is empty or no element is found. This case must +be checked before any use of the iterator, otherwise it will +lead to a invalid memory access. + +To fix this bug, use a new variable 'iter' as the list iterator, +while use the origin variable 'ch' as a dedicated pointer to +point to the found element. + +Cc: stable@vger.kernel.org +Fixes: 1d8d80b4e4ff6 ("i40e: Add macvlan support on i40e") +Signed-off-by: Xiaomeng Tong +Tested-by: Gurucharan (A Contingent worker at Intel) +Signed-off-by: Tony Nguyen +Link: https://lore.kernel.org/r/20220510204846.2166999-1-anthony.l.nguyen@intel.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/intel/i40e/i40e_main.c | 27 ++++++++++++++------------- + 1 file changed, 14 insertions(+), 13 deletions(-) + +--- a/drivers/net/ethernet/intel/i40e/i40e_main.c ++++ b/drivers/net/ethernet/intel/i40e/i40e_main.c +@@ -7175,42 +7175,43 @@ static void i40e_free_macvlan_channels(s + static int i40e_fwd_ring_up(struct i40e_vsi *vsi, struct net_device *vdev, + struct i40e_fwd_adapter *fwd) + { ++ struct i40e_channel *ch = NULL, *ch_tmp, *iter; + int ret = 0, num_tc = 1, i, aq_err; +- struct i40e_channel *ch, *ch_tmp; + struct i40e_pf *pf = vsi->back; + struct i40e_hw *hw = &pf->hw; + +- if (list_empty(&vsi->macvlan_list)) +- return -EINVAL; +- + /* Go through the list and find an available channel */ +- list_for_each_entry_safe(ch, ch_tmp, &vsi->macvlan_list, list) { +- if (!i40e_is_channel_macvlan(ch)) { +- ch->fwd = fwd; ++ list_for_each_entry_safe(iter, ch_tmp, &vsi->macvlan_list, list) { ++ if (!i40e_is_channel_macvlan(iter)) { ++ iter->fwd = fwd; + /* record configuration for macvlan interface in vdev */ + for (i = 0; i < num_tc; i++) + netdev_bind_sb_channel_queue(vsi->netdev, vdev, + i, +- ch->num_queue_pairs, +- ch->base_queue); +- for (i = 0; i < ch->num_queue_pairs; i++) { ++ iter->num_queue_pairs, ++ iter->base_queue); ++ for (i = 0; i < iter->num_queue_pairs; i++) { + struct i40e_ring *tx_ring, *rx_ring; + u16 pf_q; + +- pf_q = ch->base_queue + i; ++ pf_q = iter->base_queue + i; + + /* Get to TX ring ptr */ + tx_ring = vsi->tx_rings[pf_q]; +- tx_ring->ch = ch; ++ tx_ring->ch = iter; + + /* Get the RX ring ptr */ + rx_ring = vsi->rx_rings[pf_q]; +- rx_ring->ch = ch; ++ rx_ring->ch = iter; + } ++ ch = iter; + break; + } + } + ++ if (!ch) ++ return -EINVAL; ++ + /* Guarantee all rings are updated before we update the + * MAC address filter. + */ diff --git a/queue-5.10/net-atlantic-always-deep-reset-on-pm-op-fixing-up-my-null-deref-regression.patch b/queue-5.10/net-atlantic-always-deep-reset-on-pm-op-fixing-up-my-null-deref-regression.patch new file mode 100644 index 00000000000..ec9c02bff4b --- /dev/null +++ b/queue-5.10/net-atlantic-always-deep-reset-on-pm-op-fixing-up-my-null-deref-regression.patch @@ -0,0 +1,62 @@ +From 1809c30b6e5a83a1de1435fe01aaa4de4d626a7c Mon Sep 17 00:00:00 2001 +From: Manuel Ullmann +Date: Wed, 4 May 2022 21:30:44 +0200 +Subject: net: atlantic: always deep reset on pm op, fixing up my null deref regression + +From: Manuel Ullmann + +commit 1809c30b6e5a83a1de1435fe01aaa4de4d626a7c upstream. + +The impact of this regression is the same for resume that I saw on +thaw: the kernel hangs and nothing except SysRq rebooting can be done. + +Fixes regression in commit cbe6c3a8f8f4 ("net: atlantic: invert deep +par in pm functions, preventing null derefs"), where I disabled deep +pm resets in suspend and resume, trying to make sense of the +atl_resume_common() deep parameter in the first place. + +It turns out, that atlantic always has to deep reset on pm +operations. Even though I expected that and tested resume, I screwed +up by kexec-rebooting into an unpatched kernel, thus missing the +breakage. + +This fixup obsoletes the deep parameter of atl_resume_common, but I +leave the cleanup for the maintainers to post to mainline. + +Suspend and hibernation were successfully tested by the reporters. + +Fixes: cbe6c3a8f8f4 ("net: atlantic: invert deep par in pm functions, preventing null derefs") +Link: https://lore.kernel.org/regressions/9-Ehc_xXSwdXcvZqKD5aSqsqeNj5Izco4MYEwnx5cySXVEc9-x_WC4C3kAoCqNTi-H38frroUK17iobNVnkLtW36V6VWGSQEOHXhmVMm5iQ=@protonmail.com/ +Reported-by: Jordan Leppert +Reported-by: Holger Hoffstaette +Tested-by: Jordan Leppert +Tested-by: Holger Hoffstaette +CC: # 5.10+ +Signed-off-by: Manuel Ullmann +Link: https://lore.kernel.org/r/87bkw8dfmp.fsf@posteo.de +Signed-off-by: Paolo Abeni +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c ++++ b/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c +@@ -455,7 +455,7 @@ static int aq_pm_freeze(struct device *d + + static int aq_pm_suspend_poweroff(struct device *dev) + { +- return aq_suspend_common(dev, false); ++ return aq_suspend_common(dev, true); + } + + static int aq_pm_thaw(struct device *dev) +@@ -465,7 +465,7 @@ static int aq_pm_thaw(struct device *dev + + static int aq_pm_resume_restore(struct device *dev) + { +- return atl_resume_common(dev, false); ++ return atl_resume_common(dev, true); + } + + static const struct dev_pm_ops aq_pm_ops = { diff --git a/queue-5.10/serial-8250_mtk-fix-register-address-for-xon-xoff-character.patch b/queue-5.10/serial-8250_mtk-fix-register-address-for-xon-xoff-character.patch new file mode 100644 index 00000000000..975d2e1b360 --- /dev/null +++ b/queue-5.10/serial-8250_mtk-fix-register-address-for-xon-xoff-character.patch @@ -0,0 +1,44 @@ +From e1bfdbc7daca171c74a577b3dd0b36d76bb0ffcc Mon Sep 17 00:00:00 2001 +From: AngeloGioacchino Del Regno +Date: Wed, 27 Apr 2022 15:23:28 +0200 +Subject: serial: 8250_mtk: Fix register address for XON/XOFF character + +From: AngeloGioacchino Del Regno + +commit e1bfdbc7daca171c74a577b3dd0b36d76bb0ffcc upstream. + +The XON1/XOFF1 character registers are at offset 0xa0 and 0xa8 +respectively, so we cannot use the definition in serial_port.h. + +Fixes: bdbd0a7f8f03 ("serial: 8250-mtk: modify baudrate setting") +Signed-off-by: AngeloGioacchino Del Regno +Cc: stable +Link: https://lore.kernel.org/r/20220427132328.228297-4-angelogioacchino.delregno@collabora.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/tty/serial/8250/8250_mtk.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +--- a/drivers/tty/serial/8250/8250_mtk.c ++++ b/drivers/tty/serial/8250/8250_mtk.c +@@ -54,6 +54,9 @@ + #define MTK_UART_TX_TRIGGER 1 + #define MTK_UART_RX_TRIGGER MTK_UART_RX_SIZE + ++#define MTK_UART_XON1 40 /* I/O: Xon character 1 */ ++#define MTK_UART_XOFF1 42 /* I/O: Xoff character 1 */ ++ + #ifdef CONFIG_SERIAL_8250_DMA + enum dma_rx_status { + DMA_RX_START = 0, +@@ -275,8 +278,8 @@ static void mtk8250_set_flow_ctrl(struct + (serial_in(up, MTK_UART_EFR) & + (~(MTK_UART_EFR_HW_FC | MTK_UART_EFR_SW_FC_MASK)))); + +- serial_out(up, UART_XON1, START_CHAR(port->state->port.tty)); +- serial_out(up, UART_XOFF1, STOP_CHAR(port->state->port.tty)); ++ serial_out(up, MTK_UART_XON1, START_CHAR(port->state->port.tty)); ++ serial_out(up, MTK_UART_XOFF1, STOP_CHAR(port->state->port.tty)); + serial_out(up, UART_LCR, lcr); + mtk8250_disable_intrs(up, MTK_UART_IER_CTSI|MTK_UART_IER_RTSI); + mtk8250_enable_intrs(up, MTK_UART_IER_XOFFI); diff --git a/queue-5.10/serial-8250_mtk-fix-uart_efr-register-address.patch b/queue-5.10/serial-8250_mtk-fix-uart_efr-register-address.patch new file mode 100644 index 00000000000..60702d14d8d --- /dev/null +++ b/queue-5.10/serial-8250_mtk-fix-uart_efr-register-address.patch @@ -0,0 +1,92 @@ +From bb0b197aadd928f52ce6f01f0ee977f0a08cf1be Mon Sep 17 00:00:00 2001 +From: AngeloGioacchino Del Regno +Date: Wed, 27 Apr 2022 15:23:26 +0200 +Subject: serial: 8250_mtk: Fix UART_EFR register address + +From: AngeloGioacchino Del Regno + +commit bb0b197aadd928f52ce6f01f0ee977f0a08cf1be upstream. + +On MediaTek SoCs, the UART IP is 16550A compatible, but there are some +specific quirks: we are declaring a register shift of 2, but this is +only valid for the majority of the registers, as there are some that +are out of the standard layout. + +Specifically, this driver is using definitions from serial_reg.h, where +we have a UART_EFR register defined as 2: this results in a 0x8 offset, +but there we have the FCR register instead. + +The right offset for the EFR register on MediaTek UART is at 0x98, +so, following the decimal definition convention in serial_reg.h and +accounting for the register left shift of two, add and use the correct +register address for this IP, defined as decimal 38, so that the final +calculation results in (0x26 << 2) = 0x98. + +Fixes: bdbd0a7f8f03 ("serial: 8250-mtk: modify baudrate setting") +Signed-off-by: AngeloGioacchino Del Regno +Cc: stable +Link: https://lore.kernel.org/r/20220427132328.228297-2-angelogioacchino.delregno@collabora.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/tty/serial/8250/8250_mtk.c | 15 ++++++++------- + 1 file changed, 8 insertions(+), 7 deletions(-) + +--- a/drivers/tty/serial/8250/8250_mtk.c ++++ b/drivers/tty/serial/8250/8250_mtk.c +@@ -37,6 +37,7 @@ + #define MTK_UART_IER_RTSI 0x40 /* Enable RTS Modem status interrupt */ + #define MTK_UART_IER_CTSI 0x80 /* Enable CTS Modem status interrupt */ + ++#define MTK_UART_EFR 38 /* I/O: Extended Features Register */ + #define MTK_UART_EFR_EN 0x10 /* Enable enhancement feature */ + #define MTK_UART_EFR_RTS 0x40 /* Enable hardware rx flow control */ + #define MTK_UART_EFR_CTS 0x80 /* Enable hardware tx flow control */ +@@ -169,7 +170,7 @@ static void mtk8250_dma_enable(struct ua + MTK_UART_DMA_EN_RX | MTK_UART_DMA_EN_TX); + + serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); +- serial_out(up, UART_EFR, UART_EFR_ECB); ++ serial_out(up, MTK_UART_EFR, UART_EFR_ECB); + serial_out(up, UART_LCR, lcr); + + if (dmaengine_slave_config(dma->rxchan, &dma->rxconf) != 0) +@@ -232,7 +233,7 @@ static void mtk8250_set_flow_ctrl(struct + int lcr = serial_in(up, UART_LCR); + + serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); +- serial_out(up, UART_EFR, UART_EFR_ECB); ++ serial_out(up, MTK_UART_EFR, UART_EFR_ECB); + serial_out(up, UART_LCR, lcr); + lcr = serial_in(up, UART_LCR); + +@@ -241,7 +242,7 @@ static void mtk8250_set_flow_ctrl(struct + serial_out(up, MTK_UART_ESCAPE_DAT, MTK_UART_ESCAPE_CHAR); + serial_out(up, MTK_UART_ESCAPE_EN, 0x00); + serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); +- serial_out(up, UART_EFR, serial_in(up, UART_EFR) & ++ serial_out(up, MTK_UART_EFR, serial_in(up, MTK_UART_EFR) & + (~(MTK_UART_EFR_HW_FC | MTK_UART_EFR_SW_FC_MASK))); + serial_out(up, UART_LCR, lcr); + mtk8250_disable_intrs(up, MTK_UART_IER_XOFFI | +@@ -255,8 +256,8 @@ static void mtk8250_set_flow_ctrl(struct + serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); + + /*enable hw flow control*/ +- serial_out(up, UART_EFR, MTK_UART_EFR_HW_FC | +- (serial_in(up, UART_EFR) & ++ serial_out(up, MTK_UART_EFR, MTK_UART_EFR_HW_FC | ++ (serial_in(up, MTK_UART_EFR) & + (~(MTK_UART_EFR_HW_FC | MTK_UART_EFR_SW_FC_MASK)))); + + serial_out(up, UART_LCR, lcr); +@@ -270,8 +271,8 @@ static void mtk8250_set_flow_ctrl(struct + serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); + + /*enable sw flow control */ +- serial_out(up, UART_EFR, MTK_UART_EFR_XON1_XOFF1 | +- (serial_in(up, UART_EFR) & ++ serial_out(up, MTK_UART_EFR, MTK_UART_EFR_XON1_XOFF1 | ++ (serial_in(up, MTK_UART_EFR) & + (~(MTK_UART_EFR_HW_FC | MTK_UART_EFR_SW_FC_MASK)))); + + serial_out(up, UART_XON1, START_CHAR(port->state->port.tty)); diff --git a/queue-5.10/serial-8250_mtk-make-sure-to-select-the-right-feature_sel.patch b/queue-5.10/serial-8250_mtk-make-sure-to-select-the-right-feature_sel.patch new file mode 100644 index 00000000000..39f1eff0621 --- /dev/null +++ b/queue-5.10/serial-8250_mtk-make-sure-to-select-the-right-feature_sel.patch @@ -0,0 +1,44 @@ +From 6f81fdded0d024c7d4084d434764f30bca1cd6b1 Mon Sep 17 00:00:00 2001 +From: AngeloGioacchino Del Regno +Date: Wed, 27 Apr 2022 15:23:27 +0200 +Subject: serial: 8250_mtk: Make sure to select the right FEATURE_SEL + +From: AngeloGioacchino Del Regno + +commit 6f81fdded0d024c7d4084d434764f30bca1cd6b1 upstream. + +Set the FEATURE_SEL at probe time to make sure that BIT(0) is enabled: +this guarantees that when the port is configured as AP UART, the +right register layout is interpreted by the UART IP. + +Signed-off-by: AngeloGioacchino Del Regno +Cc: stable +Link: https://lore.kernel.org/r/20220427132328.228297-3-angelogioacchino.delregno@collabora.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/tty/serial/8250/8250_mtk.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/drivers/tty/serial/8250/8250_mtk.c ++++ b/drivers/tty/serial/8250/8250_mtk.c +@@ -57,6 +57,9 @@ + #define MTK_UART_XON1 40 /* I/O: Xon character 1 */ + #define MTK_UART_XOFF1 42 /* I/O: Xoff character 1 */ + ++#define MTK_UART_FEATURE_SEL 39 /* Feature Selection register */ ++#define MTK_UART_FEAT_NEWRMAP BIT(0) /* Use new register map */ ++ + #ifdef CONFIG_SERIAL_8250_DMA + enum dma_rx_status { + DMA_RX_START = 0, +@@ -572,6 +575,10 @@ static int mtk8250_probe(struct platform + uart.dma = data->dma; + #endif + ++ /* Set AP UART new register map */ ++ writel(MTK_UART_FEAT_NEWRMAP, uart.port.membase + ++ (MTK_UART_FEATURE_SEL << uart.port.regshift)); ++ + /* Disable Rate Fix function */ + writel(0x0, uart.port.membase + + (MTK_UART_RATE_FIX << uart.port.regshift)); diff --git a/queue-5.10/series b/queue-5.10/series index c36b5546cb3..a24b3506e02 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -40,3 +40,18 @@ firmware_loader-use-kernel-credentials-when-reading-firmware.patch tty-serial-digicolor-fix-possible-null-ptr-deref-in-digicolor_uart_probe.patch tty-n_gsm-fix-mux-activation-issues-in-gsm_config.patch usb-cdc-wdm-fix-reading-stuck-on-device-close.patch +usb-typec-tcpci-don-t-skip-cleanup-in-.remove-on-error.patch +usb-typec-tcpci_mt6360-update-for-bmc-phy-setting.patch +usb-serial-pl2303-add-device-id-for-hp-lm930-display.patch +usb-serial-qcserial-add-support-for-sierra-wireless-em7590.patch +usb-serial-option-add-fibocom-l610-modem.patch +usb-serial-option-add-fibocom-ma510-modem.patch +slimbus-qcom-fix-irq-check-in-qcom_slim_probe.patch +serial-8250_mtk-fix-uart_efr-register-address.patch +serial-8250_mtk-fix-register-address-for-xon-xoff-character.patch +serial-8250_mtk-make-sure-to-select-the-right-feature_sel.patch +ceph-fix-setting-of-xattrs-on-async-created-inodes.patch +drm-nouveau-tegra-stop-using-iommu_present.patch +i40e-i40e_main-fix-a-missing-check-on-list-iterator.patch +net-atlantic-always-deep-reset-on-pm-op-fixing-up-my-null-deref-regression.patch +cgroup-cpuset-remove-cpus_allowed-mems_allowed-setup-in-cpuset_init_smp.patch diff --git a/queue-5.10/slimbus-qcom-fix-irq-check-in-qcom_slim_probe.patch b/queue-5.10/slimbus-qcom-fix-irq-check-in-qcom_slim_probe.patch new file mode 100644 index 00000000000..1e8600cd908 --- /dev/null +++ b/queue-5.10/slimbus-qcom-fix-irq-check-in-qcom_slim_probe.patch @@ -0,0 +1,43 @@ +From fe503887eed6ea528e144ec8dacfa1d47aa701ac Mon Sep 17 00:00:00 2001 +From: Miaoqian Lin +Date: Fri, 29 Apr 2022 17:49:17 +0100 +Subject: slimbus: qcom: Fix IRQ check in qcom_slim_probe + +From: Miaoqian Lin + +commit fe503887eed6ea528e144ec8dacfa1d47aa701ac upstream. + +platform_get_irq() returns non-zero IRQ number on success, +negative error number on failure. +And the doc of platform_get_irq() provides a usage example: + + int irq = platform_get_irq(pdev, 0); + if (irq < 0) + return irq; + +Fix the check of return value to catch errors correctly. + +Fixes: ad7fcbc308b0 ("slimbus: qcom: Add Qualcomm Slimbus controller driver") +Cc: stable@vger.kernel.org +Signed-off-by: Miaoqian Lin +Signed-off-by: Srinivas Kandagatla +Link: https://lore.kernel.org/r/20220429164917.5202-2-srinivas.kandagatla@linaro.org +Signed-off-by: Greg Kroah-Hartman +--- + drivers/slimbus/qcom-ctrl.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/slimbus/qcom-ctrl.c ++++ b/drivers/slimbus/qcom-ctrl.c +@@ -510,9 +510,9 @@ static int qcom_slim_probe(struct platfo + } + + ctrl->irq = platform_get_irq(pdev, 0); +- if (!ctrl->irq) { ++ if (ctrl->irq < 0) { + dev_err(&pdev->dev, "no slimbus IRQ\n"); +- return -ENODEV; ++ return ctrl->irq; + } + + sctrl = &ctrl->ctrl; diff --git a/queue-5.10/usb-serial-option-add-fibocom-l610-modem.patch b/queue-5.10/usb-serial-option-add-fibocom-l610-modem.patch new file mode 100644 index 00000000000..bc3010c7c2e --- /dev/null +++ b/queue-5.10/usb-serial-option-add-fibocom-l610-modem.patch @@ -0,0 +1,141 @@ +From 714adff9a6271b5f1664b04c944b598141ebfe73 Mon Sep 17 00:00:00 2001 +From: Sven Schwermer +Date: Mon, 25 Apr 2022 16:34:49 +0200 +Subject: USB: serial: option: add Fibocom L610 modem + +From: Sven Schwermer + +commit 714adff9a6271b5f1664b04c944b598141ebfe73 upstream. + +The L610 modem has 3 USB configurations that are configurable via the AT +command AT+GTUSBMODE={31,32,33} which make the modem enumerate with the +following interfaces, respectively: + +31: Modem + NV + MOS + Diag + LOG + AT + AT +32: ECM + Modem + NV + MOS + Diag + LOG + AT + AT +33: RNDIS + Modem + NV + MOS + Diag + LOG + AT + AT + +A detailed description of the USB configuration for each mode follows: + ++GTUSBMODE: 31 +-------------- +T: Bus=03 Lev=01 Prnt=01 Port=06 Cnt=04 Dev#=124 Spd=480 MxCh= 0 +D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 +P: Vendor=1782 ProdID=4d10 Rev= 0.00 +S: Manufacturer=FIBOCOM +S: Product=L610 +C:* #Ifs= 7 Cfg#= 1 Atr=e0 MxPwr=400mA +I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option +E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option +E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option +E: Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +I:* If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option +E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +I:* If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option +E: Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +I:* If#= 5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option +E: Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=06(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +I:* If#= 6 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option +E: Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=07(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms + ++GTUSBMODE: 32 +-------------- +T: Bus=03 Lev=01 Prnt=01 Port=06 Cnt=04 Dev#=122 Spd=480 MxCh= 0 +D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 +P: Vendor=1782 ProdID=4d11 Rev= 0.00 +S: Manufacturer=FIBOCOM +S: Product=L610 +C:* #Ifs= 9 Cfg#= 1 Atr=e0 MxPwr=400mA +A: FirstIf#= 0 IfCount= 2 Cls=02(comm.) Sub=06 Prot=00 +I:* If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=06 Prot=00 Driver=cdc_ether +E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=32ms +I: If#= 1 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether +I:* If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether +E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option +E: Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +I:* If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option +E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +I:* If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option +E: Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +I:* If#= 5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option +E: Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +I:* If#= 6 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option +E: Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=06(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +I:* If#= 7 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option +E: Ad=88(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=07(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +I:* If#= 8 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option +E: Ad=89(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=08(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms + ++GTUSBMODE: 33 +-------------- +T: Bus=03 Lev=01 Prnt=01 Port=06 Cnt=04 Dev#=126 Spd=480 MxCh= 0 +D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 +P: Vendor=1782 ProdID=4d11 Rev= 0.00 +S: Manufacturer=FIBOCOM +S: Product=L610 +C:* #Ifs= 9 Cfg#= 1 Atr=e0 MxPwr=400mA +A: FirstIf#= 0 IfCount= 2 Cls=e0(wlcon) Sub=01 Prot=03 +I:* If#= 0 Alt= 0 #EPs= 1 Cls=e0(wlcon) Sub=01 Prot=03 Driver=rndis_host +E: Ad=82(I) Atr=03(Int.) MxPS= 8 Ivl=4096ms +I:* If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=rndis_host +E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option +E: Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +I:* If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option +E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +I:* If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option +E: Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +I:* If#= 5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option +E: Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +I:* If#= 6 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option +E: Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=06(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +I:* If#= 7 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option +E: Ad=88(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=07(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +I:* If#= 8 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option +E: Ad=89(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=08(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms + +Signed-off-by: Sven Schwermer +Cc: stable@vger.kernel.org +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/serial/option.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/usb/serial/option.c ++++ b/drivers/usb/serial/option.c +@@ -2123,6 +2123,8 @@ static const struct usb_device_id option + .driver_info = RSVD(3) }, + { USB_DEVICE(0x1508, 0x1001), /* Fibocom NL668 (IOT version) */ + .driver_info = RSVD(4) | RSVD(5) | RSVD(6) }, ++ { USB_DEVICE(0x1782, 0x4d10) }, /* Fibocom L610 (AT mode) */ ++ { USB_DEVICE_INTERFACE_CLASS(0x1782, 0x4d11, 0xff) }, /* Fibocom L610 (ECM/RNDIS mode) */ + { USB_DEVICE(0x2cb7, 0x0104), /* Fibocom NL678 series */ + .driver_info = RSVD(4) | RSVD(5) }, + { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x0105, 0xff), /* Fibocom NL678 series */ diff --git a/queue-5.10/usb-serial-option-add-fibocom-ma510-modem.patch b/queue-5.10/usb-serial-option-add-fibocom-ma510-modem.patch new file mode 100644 index 00000000000..eeed75f04a6 --- /dev/null +++ b/queue-5.10/usb-serial-option-add-fibocom-ma510-modem.patch @@ -0,0 +1,117 @@ +From 07989eb981d862f7f2be68d233d753f2e7ccc119 Mon Sep 17 00:00:00 2001 +From: Sven Schwermer +Date: Mon, 25 Apr 2022 16:34:50 +0200 +Subject: USB: serial: option: add Fibocom MA510 modem + +From: Sven Schwermer + +commit 07989eb981d862f7f2be68d233d753f2e7ccc119 upstream. + +The MA510 modem has 3 USB configurations that are configurable via the AT +command AT+GTUSBMODE={30,31,32} which make the modem enumerate with the +following interfaces, respectively: + +30: Diag + QDSS + Modem + RMNET +31: Diag + Modem + AT + ECM +32: Modem + AT + ECM + +The first configuration (30) reuses u-blox R410M's VID/PID with +identical interface configuration. + +A detailed description of the USB configuration for each mode follows: + ++GTUSBMODE: 30 +-------------- +T: Bus=03 Lev=01 Prnt=01 Port=06 Cnt=04 Dev#= 19 Spd=480 MxCh= 0 +D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 +P: Vendor=05c6 ProdID=90b2 Rev= 0.00 +S: Manufacturer=Fibocom MA510 Modem +S: Product=Fibocom MA510 Modem +S: SerialNumber=55e2695b +C:* #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr=500mA +I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option +E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +I:* If#= 1 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none) +E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option +E: Ad=83(I) Atr=03(Int.) MxPS= 64 Ivl=2ms +E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan +E: Ad=85(I) Atr=03(Int.) MxPS= 64 Ivl=2ms +E: Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms + ++GTUSBMODE: 31 +-------------- +T: Bus=03 Lev=01 Prnt=01 Port=06 Cnt=04 Dev#= 99 Spd=480 MxCh= 0 +D: Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 +P: Vendor=2cb7 ProdID=0106 Rev= 0.00 +S: Manufacturer=Fibocom MA510 Modem +S: Product=Fibocom MA510 Modem +S: SerialNumber=55e2695b +C:* #Ifs= 5 Cfg#= 1 Atr=e0 MxPwr=500mA +A: FirstIf#= 3 IfCount= 2 Cls=02(comm.) Sub=00 Prot=00 +I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option +E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +I:* If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option +E: Ad=82(I) Atr=03(Int.) MxPS= 64 Ivl=2ms +E: Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=fe Prot=ff Driver=option +E: Ad=84(I) Atr=03(Int.) MxPS= 64 Ivl=2ms +E: Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +I:* If#= 3 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=06 Prot=00 Driver=cdc_ether +E: Ad=86(I) Atr=03(Int.) MxPS= 64 Ivl=2ms +I: If#= 4 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether +I:* If#= 4 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether +E: Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms + ++GTUSBMODE: 32 +-------------- +T: Bus=03 Lev=01 Prnt=01 Port=06 Cnt=04 Dev#=100 Spd=480 MxCh= 0 +D: Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 +P: Vendor=2cb7 ProdID=010a Rev= 0.00 +S: Manufacturer=Fibocom MA510 Modem +S: Product=Fibocom MA510 Modem +S: SerialNumber=55e2695b +C:* #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr=500mA +A: FirstIf#= 2 IfCount= 2 Cls=02(comm.) Sub=00 Prot=00 +I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option +E: Ad=81(I) Atr=03(Int.) MxPS= 64 Ivl=2ms +E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +I:* If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=fe Prot=ff Driver=option +E: Ad=83(I) Atr=03(Int.) MxPS= 64 Ivl=2ms +E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +I:* If#= 2 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=06 Prot=00 Driver=cdc_ether +E: Ad=85(I) Atr=03(Int.) MxPS= 64 Ivl=2ms +I: If#= 3 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether +I:* If#= 3 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether +E: Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms + +Signed-off-by: Sven Schwermer +Cc: stable@vger.kernel.org +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/serial/option.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/usb/serial/option.c ++++ b/drivers/usb/serial/option.c +@@ -2129,6 +2129,8 @@ static const struct usb_device_id option + .driver_info = RSVD(4) | RSVD(5) }, + { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x0105, 0xff), /* Fibocom NL678 series */ + .driver_info = RSVD(6) }, ++ { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x0106, 0xff) }, /* Fibocom MA510 (ECM mode w/ diag intf.) */ ++ { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x010a, 0xff) }, /* Fibocom MA510 (ECM mode) */ + { USB_DEVICE_AND_INTERFACE_INFO(0x2cb7, 0x010b, 0xff, 0xff, 0x30) }, /* Fibocom FG150 Diag */ + { USB_DEVICE_AND_INTERFACE_INFO(0x2cb7, 0x010b, 0xff, 0, 0) }, /* Fibocom FG150 AT */ + { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a0, 0xff) }, /* Fibocom NL668-AM/NL652-EU (laptop MBIM) */ diff --git a/queue-5.10/usb-serial-pl2303-add-device-id-for-hp-lm930-display.patch b/queue-5.10/usb-serial-pl2303-add-device-id-for-hp-lm930-display.patch new file mode 100644 index 00000000000..74b11a3a60c --- /dev/null +++ b/queue-5.10/usb-serial-pl2303-add-device-id-for-hp-lm930-display.patch @@ -0,0 +1,41 @@ +From 26a08f8bad3e1f98d3153f939fb8cd330da4cb26 Mon Sep 17 00:00:00 2001 +From: Scott Chen +Date: Mon, 25 Apr 2022 17:00:20 +0800 +Subject: USB: serial: pl2303: add device id for HP LM930 Display + +From: Scott Chen + +commit 26a08f8bad3e1f98d3153f939fb8cd330da4cb26 upstream. + +Add the device id for the HPLM930Display which is a PL2303GC based +device. + +Signed-off-by: Scott Chen +Cc: stable@vger.kernel.org +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/serial/pl2303.c | 1 + + drivers/usb/serial/pl2303.h | 1 + + 2 files changed, 2 insertions(+) + +--- a/drivers/usb/serial/pl2303.c ++++ b/drivers/usb/serial/pl2303.c +@@ -106,6 +106,7 @@ static const struct usb_device_id id_tab + { USB_DEVICE(HP_VENDOR_ID, HP_LCM220_PRODUCT_ID) }, + { USB_DEVICE(HP_VENDOR_ID, HP_LCM960_PRODUCT_ID) }, + { USB_DEVICE(HP_VENDOR_ID, HP_LM920_PRODUCT_ID) }, ++ { USB_DEVICE(HP_VENDOR_ID, HP_LM930_PRODUCT_ID) }, + { USB_DEVICE(HP_VENDOR_ID, HP_LM940_PRODUCT_ID) }, + { USB_DEVICE(HP_VENDOR_ID, HP_TD620_PRODUCT_ID) }, + { USB_DEVICE(CRESSI_VENDOR_ID, CRESSI_EDY_PRODUCT_ID) }, +--- a/drivers/usb/serial/pl2303.h ++++ b/drivers/usb/serial/pl2303.h +@@ -135,6 +135,7 @@ + #define HP_TD620_PRODUCT_ID 0x0956 + #define HP_LD960_PRODUCT_ID 0x0b39 + #define HP_LD381_PRODUCT_ID 0x0f7f ++#define HP_LM930_PRODUCT_ID 0x0f9b + #define HP_LCM220_PRODUCT_ID 0x3139 + #define HP_LCM960_PRODUCT_ID 0x3239 + #define HP_LD220_PRODUCT_ID 0x3524 diff --git a/queue-5.10/usb-serial-qcserial-add-support-for-sierra-wireless-em7590.patch b/queue-5.10/usb-serial-qcserial-add-support-for-sierra-wireless-em7590.patch new file mode 100644 index 00000000000..1abb3aae781 --- /dev/null +++ b/queue-5.10/usb-serial-qcserial-add-support-for-sierra-wireless-em7590.patch @@ -0,0 +1,31 @@ +From 870b1eee2d844727b06e238c121d260bc5645580 Mon Sep 17 00:00:00 2001 +From: Ethan Yang +Date: Mon, 25 Apr 2022 13:58:40 +0800 +Subject: USB: serial: qcserial: add support for Sierra Wireless EM7590 + +From: Ethan Yang + +commit 870b1eee2d844727b06e238c121d260bc5645580 upstream. + +Add support for Sierra Wireless EM7590 0xc080/0xc081 compositions. + +Signed-off-by: Ethan Yang +Link: https://lore.kernel.org/r/20220425055840.5693-1-etyang@sierrawireless.com +Cc: stable@vger.kernel.org +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/serial/qcserial.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/usb/serial/qcserial.c ++++ b/drivers/usb/serial/qcserial.c +@@ -166,6 +166,8 @@ static const struct usb_device_id id_tab + {DEVICE_SWI(0x1199, 0x9090)}, /* Sierra Wireless EM7565 QDL */ + {DEVICE_SWI(0x1199, 0x9091)}, /* Sierra Wireless EM7565 */ + {DEVICE_SWI(0x1199, 0x90d2)}, /* Sierra Wireless EM9191 QDL */ ++ {DEVICE_SWI(0x1199, 0xc080)}, /* Sierra Wireless EM7590 QDL */ ++ {DEVICE_SWI(0x1199, 0xc081)}, /* Sierra Wireless EM7590 */ + {DEVICE_SWI(0x413c, 0x81a2)}, /* Dell Wireless 5806 Gobi(TM) 4G LTE Mobile Broadband Card */ + {DEVICE_SWI(0x413c, 0x81a3)}, /* Dell Wireless 5570 HSPA+ (42Mbps) Mobile Broadband Card */ + {DEVICE_SWI(0x413c, 0x81a4)}, /* Dell Wireless 5570e HSPA+ (42Mbps) Mobile Broadband Card */ diff --git a/queue-5.10/usb-typec-tcpci-don-t-skip-cleanup-in-.remove-on-error.patch b/queue-5.10/usb-typec-tcpci-don-t-skip-cleanup-in-.remove-on-error.patch new file mode 100644 index 00000000000..48bb11cf6e7 --- /dev/null +++ b/queue-5.10/usb-typec-tcpci-don-t-skip-cleanup-in-.remove-on-error.patch @@ -0,0 +1,53 @@ +From bbc126ae381cf0a27822c1f822d0aeed74cc40d9 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= +Date: Mon, 2 May 2022 10:04:56 +0200 +Subject: usb: typec: tcpci: Don't skip cleanup in .remove() on error +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Uwe Kleine-König + +commit bbc126ae381cf0a27822c1f822d0aeed74cc40d9 upstream. + +Returning an error value in an i2c remove callback results in an error +message being emitted by the i2c core, but otherwise it doesn't make a +difference. The device goes away anyhow and the devm cleanups are +called. + +In this case the remove callback even returns early without stopping the +tcpm worker thread and various timers. A work scheduled on the work +queue, or a firing timer after tcpci_remove() returned probably results +in a use-after-free situation because the regmap and driver data were +freed. So better make sure that tcpci_unregister_port() is called even +if disabling the irq failed. + +Also emit a more specific error message instead of the i2c core's +"remove failed (EIO), will be ignored" and return 0 to suppress the +core's warning. + +This patch is (also) a preparation for making i2c remove callbacks +return void. + +Fixes: 3ba76256fc4e ("usb: typec: tcpci: mask event interrupts when remove driver") +Signed-off-by: Uwe Kleine-König +Cc: stable +Acked-by: Heikki Krogerus +Reviewed-by: Guenter Roeck +Link: https://lore.kernel.org/r/20220502080456.21568-1-u.kleine-koenig@pengutronix.de +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/typec/tcpm/tcpci.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/usb/typec/tcpm/tcpci.c ++++ b/drivers/usb/typec/tcpm/tcpci.c +@@ -709,7 +709,7 @@ static int tcpci_remove(struct i2c_clien + /* Disable chip interrupts before unregistering port */ + err = tcpci_write16(chip->tcpci, TCPC_ALERT_MASK, 0); + if (err < 0) +- return err; ++ dev_warn(&client->dev, "Failed to disable irqs (%pe)\n", ERR_PTR(err)); + + tcpci_unregister_port(chip->tcpci); + diff --git a/queue-5.10/usb-typec-tcpci_mt6360-update-for-bmc-phy-setting.patch b/queue-5.10/usb-typec-tcpci_mt6360-update-for-bmc-phy-setting.patch new file mode 100644 index 00000000000..10c6e7dfe45 --- /dev/null +++ b/queue-5.10/usb-typec-tcpci_mt6360-update-for-bmc-phy-setting.patch @@ -0,0 +1,106 @@ +From 4031cd95cba70c72e4cadc2d46624bcd31e5a6c0 Mon Sep 17 00:00:00 2001 +From: ChiYuan Huang +Date: Tue, 10 May 2022 13:13:00 +0800 +Subject: usb: typec: tcpci_mt6360: Update for BMC PHY setting + +From: ChiYuan Huang + +commit 4031cd95cba70c72e4cadc2d46624bcd31e5a6c0 upstream. + +Update MT6360 BMC PHY Tx/Rx setting for the compatibility. + +Macpaul reported this CtoDP cable attention message cannot be received from +MT6360 TCPC. But actually, attention message really sent from UFP_D +device. + +After RD's comment, there may be BMC PHY Tx/Rx setting causes this issue. + +Below's the detailed TCPM log and DP attention message didn't received from 6360 +TCPCI. +[ 1206.367775] Identity: 0000:0000.0000 +[ 1206.416570] Alternate mode 0: SVID 0xff01, VDO 1: 0x00000405 +[ 1206.447378] AMS DFP_TO_UFP_ENTER_MODE start +[ 1206.447383] PD TX, header: 0x1d6f +[ 1206.449393] PD TX complete, status: 0 +[ 1206.454110] PD RX, header: 0x184f [1] +[ 1206.456867] Rx VDM cmd 0xff018144 type 1 cmd 4 len 1 +[ 1206.456872] AMS DFP_TO_UFP_ENTER_MODE finished +[ 1206.456873] cc:=4 +[ 1206.473100] AMS STRUCTURED_VDMS start +[ 1206.473103] PD TX, header: 0x2f6f +[ 1206.475397] PD TX complete, status: 0 +[ 1206.480442] PD RX, header: 0x2a4f [1] +[ 1206.483145] Rx VDM cmd 0xff018150 type 1 cmd 16 len 2 +[ 1206.483150] AMS STRUCTURED_VDMS finished +[ 1206.483151] cc:=4 +[ 1206.505643] AMS STRUCTURED_VDMS start +[ 1206.505646] PD TX, header: 0x216f +[ 1206.507933] PD TX complete, status: 0 +[ 1206.512664] PD RX, header: 0x1c4f [1] +[ 1206.515456] Rx VDM cmd 0xff018151 type 1 cmd 17 len 1 +[ 1206.515460] AMS STRUCTURED_VDMS finished +[ 1206.515461] cc:=4 + +Fixes: e1aefcdd394fd ("usb typec: mt6360: Add support for mt6360 Type-C driver") +Cc: stable +Reported-by: Macpaul Lin +Tested-by: Macpaul Lin +Reviewed-by: Guenter Roeck +Acked-by: Heikki Krogerus +Signed-off-by: ChiYuan Huang +Signed-off-by: Fabien Parent +Link: https://lore.kernel.org/r/1652159580-30959-1-git-send-email-u0084500@gmail.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/typec/tcpm/tcpci_mt6360.c | 26 ++++++++++++++++++++++++++ + 1 file changed, 26 insertions(+) + +--- a/drivers/usb/typec/tcpm/tcpci_mt6360.c ++++ b/drivers/usb/typec/tcpm/tcpci_mt6360.c +@@ -15,6 +15,9 @@ + + #include "tcpci.h" + ++#define MT6360_REG_PHYCTRL1 0x80 ++#define MT6360_REG_PHYCTRL3 0x82 ++#define MT6360_REG_PHYCTRL7 0x86 + #define MT6360_REG_VCONNCTRL1 0x8C + #define MT6360_REG_MODECTRL2 0x8F + #define MT6360_REG_SWRESET 0xA0 +@@ -22,6 +25,8 @@ + #define MT6360_REG_DRPCTRL1 0xA2 + #define MT6360_REG_DRPCTRL2 0xA3 + #define MT6360_REG_I2CTORST 0xBF ++#define MT6360_REG_PHYCTRL11 0xCA ++#define MT6360_REG_RXCTRL1 0xCE + #define MT6360_REG_RXCTRL2 0xCF + #define MT6360_REG_CTDCTRL2 0xEC + +@@ -106,6 +111,27 @@ static int mt6360_tcpc_init(struct tcpci + if (ret) + return ret; + ++ /* BMC PHY */ ++ ret = mt6360_tcpc_write16(regmap, MT6360_REG_PHYCTRL1, 0x3A70); ++ if (ret) ++ return ret; ++ ++ ret = regmap_write(regmap, MT6360_REG_PHYCTRL3, 0x82); ++ if (ret) ++ return ret; ++ ++ ret = regmap_write(regmap, MT6360_REG_PHYCTRL7, 0x36); ++ if (ret) ++ return ret; ++ ++ ret = mt6360_tcpc_write16(regmap, MT6360_REG_PHYCTRL11, 0x3C60); ++ if (ret) ++ return ret; ++ ++ ret = regmap_write(regmap, MT6360_REG_RXCTRL1, 0xE8); ++ if (ret) ++ return ret; ++ + /* Set shipping mode off, AUTOIDLE on */ + return regmap_write(regmap, MT6360_REG_MODECTRL2, 0x7A); + }