Skip to content

Commit e9b8ffa

Browse files
committed
Merge tag 'usb-6.13-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB / Thunderbolt fixes from Greg KH: "Here are some important, and small, fixes for USB and Thunderbolt issues that have come up in the -rc releases. And some new device ids for good measure. Included in here are: - Much reported xhci bugfix for usb-storage devices (and other devices as well, tripped me up on a video camera) - thunderbolt fixes for some small reported issues - new usb-serial device ids All of these have been in linux-next this week with no reported issues" * tag 'usb-6.13-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: usb: xhci: fix ring expansion regression in 6.13-rc1 xhci: Turn NEC specific quirk for handling Stop Endpoint errors generic thunderbolt: Improve redrive mode handling USB: serial: option: add Telit FE910C04 rmnet compositions USB: serial: option: add MediaTek T7XX compositions USB: serial: option: add Netprisma LCUK54 modules for WWAN Ready USB: serial: option: add MeiG Smart SLM770A USB: serial: option: add TCL IK512 MBIM & ECM thunderbolt: Don't display nvm_version unless upgrade supported thunderbolt: Add support for Intel Panther Lake-M/P
2 parents 5127e14 + 1b62f3c commit e9b8ffa

File tree

7 files changed

+96
-7
lines changed

7 files changed

+96
-7
lines changed

drivers/thunderbolt/nhi.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1520,6 +1520,14 @@ static struct pci_device_id nhi_ids[] = {
15201520
.driver_data = (kernel_ulong_t)&icl_nhi_ops },
15211521
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_LNL_NHI1),
15221522
.driver_data = (kernel_ulong_t)&icl_nhi_ops },
1523+
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_PTL_M_NHI0),
1524+
.driver_data = (kernel_ulong_t)&icl_nhi_ops },
1525+
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_PTL_M_NHI1),
1526+
.driver_data = (kernel_ulong_t)&icl_nhi_ops },
1527+
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_PTL_P_NHI0),
1528+
.driver_data = (kernel_ulong_t)&icl_nhi_ops },
1529+
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_PTL_P_NHI1),
1530+
.driver_data = (kernel_ulong_t)&icl_nhi_ops },
15231531
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_BARLOW_RIDGE_HOST_80G_NHI) },
15241532
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_BARLOW_RIDGE_HOST_40G_NHI) },
15251533

drivers/thunderbolt/nhi.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ extern const struct tb_nhi_ops icl_nhi_ops;
9292
#define PCI_DEVICE_ID_INTEL_RPL_NHI1 0xa76d
9393
#define PCI_DEVICE_ID_INTEL_LNL_NHI0 0xa833
9494
#define PCI_DEVICE_ID_INTEL_LNL_NHI1 0xa834
95+
#define PCI_DEVICE_ID_INTEL_PTL_M_NHI0 0xe333
96+
#define PCI_DEVICE_ID_INTEL_PTL_M_NHI1 0xe334
97+
#define PCI_DEVICE_ID_INTEL_PTL_P_NHI0 0xe433
98+
#define PCI_DEVICE_ID_INTEL_PTL_P_NHI1 0xe434
9599

96100
#define PCI_CLASS_SERIAL_USB_USB4 0x0c0340
97101

drivers/thunderbolt/retimer.c

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ static int tb_retimer_nvm_add(struct tb_retimer *rt)
103103

104104
err_nvm:
105105
dev_dbg(&rt->dev, "NVM upgrade disabled\n");
106+
rt->no_nvm_upgrade = true;
106107
if (!IS_ERR(nvm))
107108
tb_nvm_free(nvm);
108109

@@ -182,8 +183,6 @@ static ssize_t nvm_authenticate_show(struct device *dev,
182183

183184
if (!rt->nvm)
184185
ret = -EAGAIN;
185-
else if (rt->no_nvm_upgrade)
186-
ret = -EOPNOTSUPP;
187186
else
188187
ret = sysfs_emit(buf, "%#x\n", rt->auth_status);
189188

@@ -323,8 +322,6 @@ static ssize_t nvm_version_show(struct device *dev,
323322

324323
if (!rt->nvm)
325324
ret = -EAGAIN;
326-
else if (rt->no_nvm_upgrade)
327-
ret = -EOPNOTSUPP;
328325
else
329326
ret = sysfs_emit(buf, "%x.%x\n", rt->nvm->major, rt->nvm->minor);
330327

@@ -342,6 +339,19 @@ static ssize_t vendor_show(struct device *dev, struct device_attribute *attr,
342339
}
343340
static DEVICE_ATTR_RO(vendor);
344341

342+
static umode_t retimer_is_visible(struct kobject *kobj, struct attribute *attr,
343+
int n)
344+
{
345+
struct device *dev = kobj_to_dev(kobj);
346+
struct tb_retimer *rt = tb_to_retimer(dev);
347+
348+
if (attr == &dev_attr_nvm_authenticate.attr ||
349+
attr == &dev_attr_nvm_version.attr)
350+
return rt->no_nvm_upgrade ? 0 : attr->mode;
351+
352+
return attr->mode;
353+
}
354+
345355
static struct attribute *retimer_attrs[] = {
346356
&dev_attr_device.attr,
347357
&dev_attr_nvm_authenticate.attr,
@@ -351,6 +361,7 @@ static struct attribute *retimer_attrs[] = {
351361
};
352362

353363
static const struct attribute_group retimer_group = {
364+
.is_visible = retimer_is_visible,
354365
.attrs = retimer_attrs,
355366
};
356367

drivers/thunderbolt/tb.c

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2059,6 +2059,37 @@ static void tb_exit_redrive(struct tb_port *port)
20592059
}
20602060
}
20612061

2062+
static void tb_switch_enter_redrive(struct tb_switch *sw)
2063+
{
2064+
struct tb_port *port;
2065+
2066+
tb_switch_for_each_port(sw, port)
2067+
tb_enter_redrive(port);
2068+
}
2069+
2070+
/*
2071+
* Called during system and runtime suspend to forcefully exit redrive
2072+
* mode without querying whether the resource is available.
2073+
*/
2074+
static void tb_switch_exit_redrive(struct tb_switch *sw)
2075+
{
2076+
struct tb_port *port;
2077+
2078+
if (!(sw->quirks & QUIRK_KEEP_POWER_IN_DP_REDRIVE))
2079+
return;
2080+
2081+
tb_switch_for_each_port(sw, port) {
2082+
if (!tb_port_is_dpin(port))
2083+
continue;
2084+
2085+
if (port->redrive) {
2086+
port->redrive = false;
2087+
pm_runtime_put(&sw->dev);
2088+
tb_port_dbg(port, "exit redrive mode\n");
2089+
}
2090+
}
2091+
}
2092+
20622093
static void tb_dp_resource_unavailable(struct tb *tb, struct tb_port *port)
20632094
{
20642095
struct tb_port *in, *out;
@@ -2909,6 +2940,7 @@ static int tb_start(struct tb *tb, bool reset)
29092940
tb_create_usb3_tunnels(tb->root_switch);
29102941
/* Add DP IN resources for the root switch */
29112942
tb_add_dp_resources(tb->root_switch);
2943+
tb_switch_enter_redrive(tb->root_switch);
29122944
/* Make the discovered switches available to the userspace */
29132945
device_for_each_child(&tb->root_switch->dev, NULL,
29142946
tb_scan_finalize_switch);
@@ -2924,6 +2956,7 @@ static int tb_suspend_noirq(struct tb *tb)
29242956

29252957
tb_dbg(tb, "suspending...\n");
29262958
tb_disconnect_and_release_dp(tb);
2959+
tb_switch_exit_redrive(tb->root_switch);
29272960
tb_switch_suspend(tb->root_switch, false);
29282961
tcm->hotplug_active = false; /* signal tb_handle_hotplug to quit */
29292962
tb_dbg(tb, "suspend finished\n");
@@ -3016,6 +3049,7 @@ static int tb_resume_noirq(struct tb *tb)
30163049
tb_dbg(tb, "tunnels restarted, sleeping for 100ms\n");
30173050
msleep(100);
30183051
}
3052+
tb_switch_enter_redrive(tb->root_switch);
30193053
/* Allow tb_handle_hotplug to progress events */
30203054
tcm->hotplug_active = true;
30213055
tb_dbg(tb, "resume finished\n");
@@ -3079,6 +3113,12 @@ static int tb_runtime_suspend(struct tb *tb)
30793113
struct tb_cm *tcm = tb_priv(tb);
30803114

30813115
mutex_lock(&tb->lock);
3116+
/*
3117+
* The below call only releases DP resources to allow exiting and
3118+
* re-entering redrive mode.
3119+
*/
3120+
tb_disconnect_and_release_dp(tb);
3121+
tb_switch_exit_redrive(tb->root_switch);
30823122
tb_switch_suspend(tb->root_switch, true);
30833123
tcm->hotplug_active = false;
30843124
mutex_unlock(&tb->lock);
@@ -3110,6 +3150,7 @@ static int tb_runtime_resume(struct tb *tb)
31103150
tb_restore_children(tb->root_switch);
31113151
list_for_each_entry_safe(tunnel, n, &tcm->tunnel_list, list)
31123152
tb_tunnel_restart(tunnel);
3153+
tb_switch_enter_redrive(tb->root_switch);
31133154
tcm->hotplug_active = true;
31143155
mutex_unlock(&tb->lock);
31153156

drivers/usb/host/xhci-mem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ int xhci_ring_expansion(struct xhci_hcd *xhci, struct xhci_ring *ring,
436436
goto free_segments;
437437
}
438438

439-
xhci_link_rings(xhci, ring, &new_ring);
439+
xhci_link_rings(xhci, &new_ring, ring);
440440
trace_xhci_ring_expansion(ring);
441441
xhci_dbg_trace(xhci, trace_xhci_dbg_ring_expansion,
442442
"ring expansion succeed, now has %d segments",

drivers/usb/host/xhci-ring.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1199,8 +1199,6 @@ static void xhci_handle_cmd_stop_ep(struct xhci_hcd *xhci, int slot_id,
11991199
* Keep retrying until the EP starts and stops again, on
12001200
* chips where this is known to help. Wait for 100ms.
12011201
*/
1202-
if (!(xhci->quirks & XHCI_NEC_HOST))
1203-
break;
12041202
if (time_is_before_jiffies(ep->stop_time + msecs_to_jiffies(100)))
12051203
break;
12061204
fallthrough;

drivers/usb/serial/option.c

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,8 @@ static void option_instat_callback(struct urb *urb);
625625
#define MEIGSMART_PRODUCT_SRM825L 0x4d22
626626
/* MeiG Smart SLM320 based on UNISOC UIS8910 */
627627
#define MEIGSMART_PRODUCT_SLM320 0x4d41
628+
/* MeiG Smart SLM770A based on ASR1803 */
629+
#define MEIGSMART_PRODUCT_SLM770A 0x4d57
628630

629631
/* Device flags */
630632

@@ -1395,6 +1397,12 @@ static const struct usb_device_id option_ids[] = {
13951397
.driver_info = RSVD(0) | NCTRL(2) | RSVD(3) | RSVD(4) },
13961398
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x10aa, 0xff), /* Telit FN920C04 (MBIM) */
13971399
.driver_info = NCTRL(3) | RSVD(4) | RSVD(5) },
1400+
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x10c0, 0xff), /* Telit FE910C04 (rmnet) */
1401+
.driver_info = RSVD(0) | NCTRL(3) },
1402+
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x10c4, 0xff), /* Telit FE910C04 (rmnet) */
1403+
.driver_info = RSVD(0) | NCTRL(3) },
1404+
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x10c8, 0xff), /* Telit FE910C04 (rmnet) */
1405+
.driver_info = RSVD(0) | NCTRL(2) | RSVD(3) | RSVD(4) },
13981406
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910),
13991407
.driver_info = NCTRL(0) | RSVD(1) | RSVD(3) },
14001408
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910_DUAL_MODEM),
@@ -2247,6 +2255,8 @@ static const struct usb_device_id option_ids[] = {
22472255
.driver_info = NCTRL(2) },
22482256
{ USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, 0x7127, 0xff, 0x00, 0x00),
22492257
.driver_info = NCTRL(2) | NCTRL(3) | NCTRL(4) },
2258+
{ USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, 0x7129, 0xff, 0x00, 0x00), /* MediaTek T7XX */
2259+
.driver_info = NCTRL(2) | NCTRL(3) | NCTRL(4) },
22502260
{ USB_DEVICE(CELLIENT_VENDOR_ID, CELLIENT_PRODUCT_MEN200) },
22512261
{ USB_DEVICE(CELLIENT_VENDOR_ID, CELLIENT_PRODUCT_MPL200),
22522262
.driver_info = RSVD(1) | RSVD(4) },
@@ -2375,16 +2385,33 @@ static const struct usb_device_id option_ids[] = {
23752385
{ USB_DEVICE_AND_INTERFACE_INFO(0x3731, 0x0116, 0xff, 0xff, 0x30) }, /* NetPrisma LCUK54-WWD for Golbal EDU */
23762386
{ USB_DEVICE_AND_INTERFACE_INFO(0x3731, 0x0116, 0xff, 0x00, 0x40) },
23772387
{ USB_DEVICE_AND_INTERFACE_INFO(0x3731, 0x0116, 0xff, 0xff, 0x40) },
2388+
{ USB_DEVICE_AND_INTERFACE_INFO(0x3731, 0x010a, 0xff, 0xff, 0x30) }, /* NetPrisma LCUK54-WRD for WWAN Ready */
2389+
{ USB_DEVICE_AND_INTERFACE_INFO(0x3731, 0x010a, 0xff, 0x00, 0x40) },
2390+
{ USB_DEVICE_AND_INTERFACE_INFO(0x3731, 0x010a, 0xff, 0xff, 0x40) },
2391+
{ USB_DEVICE_AND_INTERFACE_INFO(0x3731, 0x010b, 0xff, 0xff, 0x30) }, /* NetPrisma LCUK54-WWD for WWAN Ready */
2392+
{ USB_DEVICE_AND_INTERFACE_INFO(0x3731, 0x010b, 0xff, 0x00, 0x40) },
2393+
{ USB_DEVICE_AND_INTERFACE_INFO(0x3731, 0x010b, 0xff, 0xff, 0x40) },
2394+
{ USB_DEVICE_AND_INTERFACE_INFO(0x3731, 0x010c, 0xff, 0xff, 0x30) }, /* NetPrisma LCUK54-WRD for WWAN Ready */
2395+
{ USB_DEVICE_AND_INTERFACE_INFO(0x3731, 0x010c, 0xff, 0x00, 0x40) },
2396+
{ USB_DEVICE_AND_INTERFACE_INFO(0x3731, 0x010c, 0xff, 0xff, 0x40) },
2397+
{ USB_DEVICE_AND_INTERFACE_INFO(0x3731, 0x010d, 0xff, 0xff, 0x30) }, /* NetPrisma LCUK54-WWD for WWAN Ready */
2398+
{ USB_DEVICE_AND_INTERFACE_INFO(0x3731, 0x010d, 0xff, 0x00, 0x40) },
2399+
{ USB_DEVICE_AND_INTERFACE_INFO(0x3731, 0x010d, 0xff, 0xff, 0x40) },
23782400
{ USB_DEVICE_AND_INTERFACE_INFO(OPPO_VENDOR_ID, OPPO_PRODUCT_R11, 0xff, 0xff, 0x30) },
23792401
{ USB_DEVICE_AND_INTERFACE_INFO(SIERRA_VENDOR_ID, SIERRA_PRODUCT_EM9191, 0xff, 0xff, 0x30) },
23802402
{ USB_DEVICE_AND_INTERFACE_INFO(SIERRA_VENDOR_ID, SIERRA_PRODUCT_EM9191, 0xff, 0xff, 0x40) },
23812403
{ USB_DEVICE_AND_INTERFACE_INFO(SIERRA_VENDOR_ID, SIERRA_PRODUCT_EM9191, 0xff, 0, 0) },
23822404
{ USB_DEVICE_AND_INTERFACE_INFO(UNISOC_VENDOR_ID, TOZED_PRODUCT_LT70C, 0xff, 0, 0) },
23832405
{ USB_DEVICE_AND_INTERFACE_INFO(UNISOC_VENDOR_ID, LUAT_PRODUCT_AIR720U, 0xff, 0, 0) },
23842406
{ USB_DEVICE_AND_INTERFACE_INFO(MEIGSMART_VENDOR_ID, MEIGSMART_PRODUCT_SLM320, 0xff, 0, 0) },
2407+
{ USB_DEVICE_AND_INTERFACE_INFO(MEIGSMART_VENDOR_ID, MEIGSMART_PRODUCT_SLM770A, 0xff, 0, 0) },
23852408
{ USB_DEVICE_AND_INTERFACE_INFO(MEIGSMART_VENDOR_ID, MEIGSMART_PRODUCT_SRM825L, 0xff, 0xff, 0x30) },
23862409
{ USB_DEVICE_AND_INTERFACE_INFO(MEIGSMART_VENDOR_ID, MEIGSMART_PRODUCT_SRM825L, 0xff, 0xff, 0x40) },
23872410
{ USB_DEVICE_AND_INTERFACE_INFO(MEIGSMART_VENDOR_ID, MEIGSMART_PRODUCT_SRM825L, 0xff, 0xff, 0x60) },
2411+
{ USB_DEVICE_INTERFACE_CLASS(0x1bbb, 0x0530, 0xff), /* TCL IK512 MBIM */
2412+
.driver_info = NCTRL(1) },
2413+
{ USB_DEVICE_INTERFACE_CLASS(0x1bbb, 0x0640, 0xff), /* TCL IK512 ECM */
2414+
.driver_info = NCTRL(3) },
23882415
{ } /* Terminating entry */
23892416
};
23902417
MODULE_DEVICE_TABLE(usb, option_ids);

0 commit comments

Comments
 (0)