Skip to content

Commit a558cc3

Browse files
committed
Merge tag 'usb-6.12-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB/Thunderbolt fixes from Greg KH: "Here are some small remaining USB and Thunderbolt fixes and device ids for 6.12-rc7. Included in here are: - new USB serial driver device ids - thunderbolt driver fixes for reported problems - typec bugfixes - dwc3 driver fix - musb driver fix All of these have been in linux-next this past week with no reported issues" * tag 'usb-6.12-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: USB: serial: qcserial: add support for Sierra Wireless EM86xx thunderbolt: Fix connection issue with Pluggable UD-4VPD dock usb: typec: fix potential out of bounds in ucsi_ccg_update_set_new_cam_cmd() usb: dwc3: fix fault at system suspend if device was already runtime suspended usb: typec: qcom-pmic: init value of hdr_len/txbuf_len earlier usb: musb: sunxi: Fix accessing an released usb phy USB: serial: io_edgeport: fix use after free in debug printk USB: serial: option: add Quectel RG650V USB: serial: option: add Fibocom FG132 0x0112 composition thunderbolt: Add only on-board retimers when !CONFIG_USB4_DEBUGFS_MARGINING
2 parents 023d4fc + 742afcc commit a558cc3

File tree

9 files changed

+33
-24
lines changed

9 files changed

+33
-24
lines changed

drivers/thunderbolt/retimer.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,8 @@ int tb_retimer_scan(struct tb_port *port, bool add)
532532
}
533533

534534
ret = 0;
535+
if (!IS_ENABLED(CONFIG_USB4_DEBUGFS_MARGINING))
536+
max = min(last_idx, max);
535537

536538
/* Add retimers if they do not exist already */
537539
for (i = 1; i <= max; i++) {

drivers/thunderbolt/usb4.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ enum usb4_ba_index {
4848

4949
/* Delays in us used with usb4_port_wait_for_bit() */
5050
#define USB4_PORT_DELAY 50
51-
#define USB4_PORT_SB_DELAY 5000
51+
#define USB4_PORT_SB_DELAY 1000
5252

5353
static int usb4_native_switch_op(struct tb_switch *sw, u16 opcode,
5454
u32 *metadata, u8 *status,

drivers/usb/dwc3/core.c

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2342,10 +2342,18 @@ static int dwc3_suspend_common(struct dwc3 *dwc, pm_message_t msg)
23422342
u32 reg;
23432343
int i;
23442344

2345-
dwc->susphy_state = (dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(0)) &
2346-
DWC3_GUSB2PHYCFG_SUSPHY) ||
2347-
(dwc3_readl(dwc->regs, DWC3_GUSB3PIPECTL(0)) &
2348-
DWC3_GUSB3PIPECTL_SUSPHY);
2345+
if (!pm_runtime_suspended(dwc->dev) && !PMSG_IS_AUTO(msg)) {
2346+
dwc->susphy_state = (dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(0)) &
2347+
DWC3_GUSB2PHYCFG_SUSPHY) ||
2348+
(dwc3_readl(dwc->regs, DWC3_GUSB3PIPECTL(0)) &
2349+
DWC3_GUSB3PIPECTL_SUSPHY);
2350+
/*
2351+
* TI AM62 platform requires SUSPHY to be
2352+
* enabled for system suspend to work.
2353+
*/
2354+
if (!dwc->susphy_state)
2355+
dwc3_enable_susphy(dwc, true);
2356+
}
23492357

23502358
switch (dwc->current_dr_role) {
23512359
case DWC3_GCTL_PRTCAP_DEVICE:
@@ -2398,15 +2406,6 @@ static int dwc3_suspend_common(struct dwc3 *dwc, pm_message_t msg)
23982406
break;
23992407
}
24002408

2401-
if (!PMSG_IS_AUTO(msg)) {
2402-
/*
2403-
* TI AM62 platform requires SUSPHY to be
2404-
* enabled for system suspend to work.
2405-
*/
2406-
if (!dwc->susphy_state)
2407-
dwc3_enable_susphy(dwc, true);
2408-
}
2409-
24102409
return 0;
24112410
}
24122411

drivers/usb/musb/sunxi.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,6 @@ static int sunxi_musb_exit(struct musb *musb)
293293
if (test_bit(SUNXI_MUSB_FL_HAS_SRAM, &glue->flags))
294294
sunxi_sram_release(musb->controller->parent);
295295

296-
devm_usb_put_phy(glue->dev, glue->xceiv);
297-
298296
return 0;
299297
}
300298

drivers/usb/serial/io_edgeport.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -770,11 +770,12 @@ static void edge_bulk_out_data_callback(struct urb *urb)
770770
static void edge_bulk_out_cmd_callback(struct urb *urb)
771771
{
772772
struct edgeport_port *edge_port = urb->context;
773+
struct device *dev = &urb->dev->dev;
773774
int status = urb->status;
774775

775776
atomic_dec(&CmdUrbs);
776-
dev_dbg(&urb->dev->dev, "%s - FREE URB %p (outstanding %d)\n",
777-
__func__, urb, atomic_read(&CmdUrbs));
777+
dev_dbg(dev, "%s - FREE URB %p (outstanding %d)\n", __func__, urb,
778+
atomic_read(&CmdUrbs));
778779

779780

780781
/* clean up the transfer buffer */
@@ -784,8 +785,7 @@ static void edge_bulk_out_cmd_callback(struct urb *urb)
784785
usb_free_urb(urb);
785786

786787
if (status) {
787-
dev_dbg(&urb->dev->dev,
788-
"%s - nonzero write bulk status received: %d\n",
788+
dev_dbg(dev, "%s - nonzero write bulk status received: %d\n",
789789
__func__, status);
790790
return;
791791
}

drivers/usb/serial/option.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ static void option_instat_callback(struct urb *urb);
251251
#define QUECTEL_VENDOR_ID 0x2c7c
252252
/* These Quectel products use Quectel's vendor ID */
253253
#define QUECTEL_PRODUCT_EC21 0x0121
254+
#define QUECTEL_PRODUCT_RG650V 0x0122
254255
#define QUECTEL_PRODUCT_EM061K_LTA 0x0123
255256
#define QUECTEL_PRODUCT_EM061K_LMS 0x0124
256257
#define QUECTEL_PRODUCT_EC25 0x0125
@@ -1273,6 +1274,8 @@ static const struct usb_device_id option_ids[] = {
12731274
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EG912Y, 0xff, 0, 0) },
12741275
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EG916Q, 0xff, 0x00, 0x00) },
12751276
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500K, 0xff, 0x00, 0x00) },
1277+
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RG650V, 0xff, 0xff, 0x30) },
1278+
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RG650V, 0xff, 0, 0) },
12761279

12771280
{ USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6001) },
12781281
{ USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CMU_300) },
@@ -2320,6 +2323,9 @@ static const struct usb_device_id option_ids[] = {
23202323
{ USB_DEVICE_AND_INTERFACE_INFO(0x2cb7, 0x010b, 0xff, 0xff, 0x30) }, /* Fibocom FG150 Diag */
23212324
{ USB_DEVICE_AND_INTERFACE_INFO(0x2cb7, 0x010b, 0xff, 0, 0) }, /* Fibocom FG150 AT */
23222325
{ USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x0111, 0xff) }, /* Fibocom FM160 (MBIM mode) */
2326+
{ USB_DEVICE_AND_INTERFACE_INFO(0x2cb7, 0x0112, 0xff, 0xff, 0x30) }, /* Fibocom FG132 Diag */
2327+
{ USB_DEVICE_AND_INTERFACE_INFO(0x2cb7, 0x0112, 0xff, 0xff, 0x40) }, /* Fibocom FG132 AT */
2328+
{ USB_DEVICE_AND_INTERFACE_INFO(0x2cb7, 0x0112, 0xff, 0, 0) }, /* Fibocom FG132 NMEA */
23232329
{ USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x0115, 0xff), /* Fibocom FM135 (laptop MBIM) */
23242330
.driver_info = RSVD(5) },
23252331
{ USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a0, 0xff) }, /* Fibocom NL668-AM/NL652-EU (laptop MBIM) */

drivers/usb/serial/qcserial.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,8 @@ static const struct usb_device_id id_table[] = {
166166
{DEVICE_SWI(0x1199, 0x9090)}, /* Sierra Wireless EM7565 QDL */
167167
{DEVICE_SWI(0x1199, 0x9091)}, /* Sierra Wireless EM7565 */
168168
{DEVICE_SWI(0x1199, 0x90d2)}, /* Sierra Wireless EM9191 QDL */
169+
{DEVICE_SWI(0x1199, 0x90e4)}, /* Sierra Wireless EM86xx QDL*/
170+
{DEVICE_SWI(0x1199, 0x90e5)}, /* Sierra Wireless EM86xx */
169171
{DEVICE_SWI(0x1199, 0xc080)}, /* Sierra Wireless EM7590 QDL */
170172
{DEVICE_SWI(0x1199, 0xc081)}, /* Sierra Wireless EM7590 */
171173
{DEVICE_SWI(0x413c, 0x81a2)}, /* Dell Wireless 5806 Gobi(TM) 4G LTE Mobile Broadband Card */

drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_pdphy.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,10 @@ qcom_pmic_typec_pdphy_pd_transmit_payload(struct pmic_typec_pdphy *pmic_typec_pd
227227

228228
spin_lock_irqsave(&pmic_typec_pdphy->lock, flags);
229229

230+
hdr_len = sizeof(msg->header);
231+
txbuf_len = pd_header_cnt_le(msg->header) * 4;
232+
txsize_len = hdr_len + txbuf_len - 1;
233+
230234
ret = regmap_read(pmic_typec_pdphy->regmap,
231235
pmic_typec_pdphy->base + USB_PDPHY_RX_ACKNOWLEDGE_REG,
232236
&val);
@@ -244,10 +248,6 @@ qcom_pmic_typec_pdphy_pd_transmit_payload(struct pmic_typec_pdphy *pmic_typec_pd
244248
if (ret)
245249
goto done;
246250

247-
hdr_len = sizeof(msg->header);
248-
txbuf_len = pd_header_cnt_le(msg->header) * 4;
249-
txsize_len = hdr_len + txbuf_len - 1;
250-
251251
/* Write message header sizeof(u16) to USB_PDPHY_TX_BUFFER_HDR_REG */
252252
ret = regmap_bulk_write(pmic_typec_pdphy->regmap,
253253
pmic_typec_pdphy->base + USB_PDPHY_TX_BUFFER_HDR_REG,

drivers/usb/typec/ucsi/ucsi_ccg.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,8 @@ static void ucsi_ccg_update_set_new_cam_cmd(struct ucsi_ccg *uc,
482482

483483
port = uc->orig;
484484
new_cam = UCSI_SET_NEW_CAM_GET_AM(*cmd);
485+
if (new_cam >= ARRAY_SIZE(uc->updated))
486+
return;
485487
new_port = &uc->updated[new_cam];
486488
cam = new_port->linked_idx;
487489
enter_new_mode = UCSI_SET_NEW_CAM_ENTER(*cmd);

0 commit comments

Comments
 (0)