Skip to content

Commit a211b1c

Browse files
committed
Merge tag 'usb-6.3-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB bugfixes from Greg KH: "Here are some small USB bugfixes for 6.3-rc6 that have been in my tree, and in linux-next, for a while. Included in here are: - new usb-serial driver device ids - xhci bugfixes for reported problems - gadget driver bugfixes for reported problems - dwc3 new device id All have been in linux-next with no reported problems" * tag 'usb-6.3-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: usb: cdnsp: Fixes error: uninitialized symbol 'len' usb: gadgetfs: Fix ep_read_iter to handle ITER_UBUF usb: gadget: f_fs: Fix ffs_epfile_read_iter to handle ITER_UBUF usb: typec: altmodes/displayport: Fix configure initial pin assignment usb: dwc3: pci: add support for the Intel Meteor Lake-S xhci: Free the command allocated for setting LPM if we return early Revert "usb: xhci-pci: Set PROBE_PREFER_ASYNCHRONOUS" xhci: also avoid the XHCI_ZERO_64B_REGS quirk with a passthrough iommu USB: serial: option: add Quectel RM500U-CN modem usb: xhci: tegra: fix sleep in atomic call USB: serial: option: add Telit FE990 compositions USB: serial: cp210x: add Silicon Labs IFS-USB-DATACABLE IDs
2 parents a79d5c7 + 1edf489 commit a211b1c

File tree

10 files changed

+35
-13
lines changed

10 files changed

+35
-13
lines changed

drivers/usb/cdns3/cdnsp-ep0.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ static int cdnsp_ep0_std_request(struct cdnsp_device *pdev,
414414
void cdnsp_setup_analyze(struct cdnsp_device *pdev)
415415
{
416416
struct usb_ctrlrequest *ctrl = &pdev->setup;
417-
int ret = 0;
417+
int ret = -EINVAL;
418418
u16 len;
419419

420420
trace_cdnsp_ctrl_req(ctrl);
@@ -424,7 +424,6 @@ void cdnsp_setup_analyze(struct cdnsp_device *pdev)
424424

425425
if (pdev->gadget.state == USB_STATE_NOTATTACHED) {
426426
dev_err(pdev->dev, "ERR: Setup detected in unattached state\n");
427-
ret = -EINVAL;
428427
goto out;
429428
}
430429

drivers/usb/dwc3/dwc3-pci.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
#define PCI_DEVICE_ID_INTEL_RPLS 0x7a61
5050
#define PCI_DEVICE_ID_INTEL_MTLM 0x7eb1
5151
#define PCI_DEVICE_ID_INTEL_MTLP 0x7ec1
52+
#define PCI_DEVICE_ID_INTEL_MTLS 0x7f6f
5253
#define PCI_DEVICE_ID_INTEL_MTL 0x7e7e
5354
#define PCI_DEVICE_ID_INTEL_TGL 0x9a15
5455
#define PCI_DEVICE_ID_AMD_MR 0x163a
@@ -474,6 +475,9 @@ static const struct pci_device_id dwc3_pci_id_table[] = {
474475
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_MTLP),
475476
(kernel_ulong_t) &dwc3_pci_intel_swnode, },
476477

478+
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_MTLS),
479+
(kernel_ulong_t) &dwc3_pci_intel_swnode, },
480+
477481
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_MTL),
478482
(kernel_ulong_t) &dwc3_pci_intel_swnode, },
479483

drivers/usb/gadget/function/f_fs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1251,7 +1251,7 @@ static ssize_t ffs_epfile_read_iter(struct kiocb *kiocb, struct iov_iter *to)
12511251
p->kiocb = kiocb;
12521252
if (p->aio) {
12531253
p->to_free = dup_iter(&p->data, to, GFP_KERNEL);
1254-
if (!p->to_free) {
1254+
if (!iter_is_ubuf(&p->data) && !p->to_free) {
12551255
kfree(p);
12561256
return -ENOMEM;
12571257
}

drivers/usb/gadget/legacy/inode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ ep_read_iter(struct kiocb *iocb, struct iov_iter *to)
614614
if (!priv)
615615
goto fail;
616616
priv->to_free = dup_iter(&priv->to, to, GFP_KERNEL);
617-
if (!priv->to_free) {
617+
if (!iter_is_ubuf(&priv->to) && !priv->to_free) {
618618
kfree(priv);
619619
goto fail;
620620
}

drivers/usb/host/xhci-pci.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -771,12 +771,11 @@ static struct pci_driver xhci_pci_driver = {
771771
/* suspend and resume implemented later */
772772

773773
.shutdown = usb_hcd_pci_shutdown,
774-
.driver = {
775774
#ifdef CONFIG_PM
776-
.pm = &usb_hcd_pci_pm_ops,
777-
#endif
778-
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
775+
.driver = {
776+
.pm = &usb_hcd_pci_pm_ops
779777
},
778+
#endif
780779
};
781780

782781
static int __init xhci_pci_init(void)

drivers/usb/host/xhci-tegra.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1360,6 +1360,9 @@ static void tegra_xhci_id_work(struct work_struct *work)
13601360

13611361
mutex_unlock(&tegra->lock);
13621362

1363+
tegra->otg_usb3_port = tegra_xusb_padctl_get_usb3_companion(tegra->padctl,
1364+
tegra->otg_usb2_port);
1365+
13631366
if (tegra->host_mode) {
13641367
/* switch to host mode */
13651368
if (tegra->otg_usb3_port >= 0) {
@@ -1474,9 +1477,6 @@ static int tegra_xhci_id_notify(struct notifier_block *nb,
14741477
}
14751478

14761479
tegra->otg_usb2_port = tegra_xusb_get_usb2_port(tegra, usbphy);
1477-
tegra->otg_usb3_port = tegra_xusb_padctl_get_usb3_companion(
1478-
tegra->padctl,
1479-
tegra->otg_usb2_port);
14801480

14811481
tegra->host_mode = (usbphy->last_event == USB_EVENT_ID) ? true : false;
14821482

drivers/usb/host/xhci.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
*/
1010

1111
#include <linux/pci.h>
12+
#include <linux/iommu.h>
1213
#include <linux/iopoll.h>
1314
#include <linux/irq.h>
1415
#include <linux/log2.h>
@@ -228,6 +229,7 @@ int xhci_reset(struct xhci_hcd *xhci, u64 timeout_us)
228229
static void xhci_zero_64b_regs(struct xhci_hcd *xhci)
229230
{
230231
struct device *dev = xhci_to_hcd(xhci)->self.sysdev;
232+
struct iommu_domain *domain;
231233
int err, i;
232234
u64 val;
233235
u32 intrs;
@@ -246,7 +248,9 @@ static void xhci_zero_64b_regs(struct xhci_hcd *xhci)
246248
* an iommu. Doing anything when there is no iommu is definitely
247249
* unsafe...
248250
*/
249-
if (!(xhci->quirks & XHCI_ZERO_64B_REGS) || !device_iommu_mapped(dev))
251+
domain = iommu_get_domain_for_dev(dev);
252+
if (!(xhci->quirks & XHCI_ZERO_64B_REGS) || !domain ||
253+
domain->type == IOMMU_DOMAIN_IDENTITY)
250254
return;
251255

252256
xhci_info(xhci, "Zeroing 64bit base registers, expecting fault\n");
@@ -4438,6 +4442,7 @@ static int __maybe_unused xhci_change_max_exit_latency(struct xhci_hcd *xhci,
44384442

44394443
if (!virt_dev || max_exit_latency == virt_dev->current_mel) {
44404444
spin_unlock_irqrestore(&xhci->lock, flags);
4445+
xhci_free_command(xhci, command);
44414446
return 0;
44424447
}
44434448

drivers/usb/serial/cp210x.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ static const struct usb_device_id id_table[] = {
120120
{ USB_DEVICE(0x10C4, 0x826B) }, /* Cygnal Integrated Products, Inc., Fasttrax GPS demonstration module */
121121
{ USB_DEVICE(0x10C4, 0x8281) }, /* Nanotec Plug & Drive */
122122
{ USB_DEVICE(0x10C4, 0x8293) }, /* Telegesis ETRX2USB */
123+
{ USB_DEVICE(0x10C4, 0x82AA) }, /* Silicon Labs IFS-USB-DATACABLE used with Quint UPS */
123124
{ USB_DEVICE(0x10C4, 0x82EF) }, /* CESINEL FALCO 6105 AC Power Supply */
124125
{ USB_DEVICE(0x10C4, 0x82F1) }, /* CESINEL MEDCAL EFD Earth Fault Detector */
125126
{ USB_DEVICE(0x10C4, 0x82F2) }, /* CESINEL MEDCAL ST Network Analyzer */

drivers/usb/serial/option.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,6 +1198,8 @@ static const struct usb_device_id option_ids[] = {
11981198
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM520N, 0xff, 0xff, 0x30) },
11991199
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM520N, 0xff, 0, 0x40) },
12001200
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM520N, 0xff, 0, 0) },
1201+
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, 0x0900, 0xff, 0, 0), /* RM500U-CN */
1202+
.driver_info = ZLP },
12011203
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200U, 0xff, 0, 0) },
12021204
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200S_CN, 0xff, 0, 0) },
12031205
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200T, 0xff, 0, 0) },
@@ -1300,6 +1302,14 @@ static const struct usb_device_id option_ids[] = {
13001302
.driver_info = NCTRL(0) | RSVD(1) },
13011303
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1075, 0xff), /* Telit FN990 (PCIe) */
13021304
.driver_info = RSVD(0) },
1305+
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1080, 0xff), /* Telit FE990 (rmnet) */
1306+
.driver_info = NCTRL(0) | RSVD(1) | RSVD(2) },
1307+
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1081, 0xff), /* Telit FE990 (MBIM) */
1308+
.driver_info = NCTRL(0) | RSVD(1) },
1309+
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1082, 0xff), /* Telit FE990 (RNDIS) */
1310+
.driver_info = NCTRL(2) | RSVD(3) },
1311+
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1083, 0xff), /* Telit FE990 (ECM) */
1312+
.driver_info = NCTRL(0) | RSVD(1) },
13031313
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910),
13041314
.driver_info = NCTRL(0) | RSVD(1) | RSVD(3) },
13051315
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910_DUAL_MODEM),

drivers/usb/typec/altmodes/displayport.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,12 @@ static int dp_altmode_configure(struct dp_altmode *dp, u8 con)
112112
if (dp->data.status & DP_STATUS_PREFER_MULTI_FUNC &&
113113
pin_assign & DP_PIN_ASSIGN_MULTI_FUNC_MASK)
114114
pin_assign &= DP_PIN_ASSIGN_MULTI_FUNC_MASK;
115-
else if (pin_assign & DP_PIN_ASSIGN_DP_ONLY_MASK)
115+
else if (pin_assign & DP_PIN_ASSIGN_DP_ONLY_MASK) {
116116
pin_assign &= DP_PIN_ASSIGN_DP_ONLY_MASK;
117+
/* Default to pin assign C if available */
118+
if (pin_assign & BIT(DP_PIN_ASSIGN_C))
119+
pin_assign = BIT(DP_PIN_ASSIGN_C);
120+
}
117121

118122
if (!pin_assign)
119123
return -EINVAL;

0 commit comments

Comments
 (0)