Skip to content

Commit 67f34fa

Browse files
committed
Merge tag 'usb-5.10-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB / PHY driver fixes from Greg KH: "Here are a few small USB and PHY driver fixes for 5.10-rc6. They include: - small PHY driver fixes to resolve reported issues - USB quirks added for "broken" devices - typec fixes for reported problems - USB gadget fixes for small issues Full details are in the shortlog, nothing major in here and all have been in linux-next with no reported issues" * tag 'usb-5.10-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: usb: typec: stusb160x: fix power-opmode property with typec-power-opmode USB: core: Change %pK for __user pointers to %px USB: core: Fix regression in Hercules audio card usb: gadget: Fix memleak in gadgetfs_fill_super usb: gadget: f_midi: Fix memleak in f_midi_alloc USB: quirks: Add USB_QUIRK_DISCONNECT_SUSPEND quirk for Lenovo A630Z TIO built-in usb-audio card usb: typec: qcom-pmic-typec: fix builtin build errors phy: mediatek: fix spelling mistake in Kconfig "veriosn" -> "version" phy: qualcomm: Fix 28 nm Hi-Speed USB PHY OF dependency phy: qualcomm: usb: Fix SuperSpeed PHY OF dependency phy: intel: PHY_INTEL_KEEMBAY_EMMC should depend on ARCH_KEEMBAY usb: cdns3: gadget: calculate TD_SIZE based on TD usb: cdns3: gadget: initialize link_trb as NULL phy: cpcap-usb: Use IRQF_ONESHOT phy: qcom-qmp: Initialize another pointer to NULL phy: tegra: xusb: Fix dangling pointer on probe failure phy: usb: Fix incorrect clearing of tca_drv_sel bit in SETUP reg for 7211
2 parents 7b2c800 + 484cfbe commit 67f34fa

14 files changed

Lines changed: 51 additions & 34 deletions

File tree

drivers/phy/broadcom/phy-brcm-usb-init-synopsys.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -270,11 +270,6 @@ static void usb_init_common_7211b0(struct brcm_usb_init_params *params)
270270
reg |= params->mode << USB_PHY_UTMI_CTL_1_PHY_MODE_SHIFT;
271271
brcm_usb_writel(reg, usb_phy + USB_PHY_UTMI_CTL_1);
272272

273-
/* Fix the incorrect default */
274-
reg = brcm_usb_readl(ctrl + USB_CTRL_SETUP);
275-
reg &= ~USB_CTRL_SETUP_tca_drv_sel_MASK;
276-
brcm_usb_writel(reg, ctrl + USB_CTRL_SETUP);
277-
278273
usb_init_common(params);
279274

280275
/*

drivers/phy/intel/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
config PHY_INTEL_KEEMBAY_EMMC
66
tristate "Intel Keem Bay EMMC PHY driver"
7-
depends on (OF && ARM64) || COMPILE_TEST
7+
depends on ARCH_KEEMBAY || COMPILE_TEST
88
depends on HAS_IOMEM
99
select GENERIC_PHY
1010
select REGMAP_MMIO

drivers/phy/mediatek/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ config PHY_MTK_TPHY
1212
it supports multiple usb2.0, usb3.0 ports, PCIe and
1313
SATA, and meanwhile supports two version T-PHY which have
1414
different banks layout, the T-PHY with shared banks between
15-
multi-ports is first version, otherwise is second veriosn,
15+
multi-ports is first version, otherwise is second version,
1616
so you can easily distinguish them by banks layout.
1717

1818
config PHY_MTK_UFS

drivers/phy/motorola/phy-cpcap-usb.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,8 @@ static int cpcap_usb_init_irq(struct platform_device *pdev,
364364

365365
error = devm_request_threaded_irq(ddata->dev, irq, NULL,
366366
cpcap_phy_irq_thread,
367-
IRQF_SHARED,
367+
IRQF_SHARED |
368+
IRQF_ONESHOT,
368369
name, ddata);
369370
if (error) {
370371
dev_err(ddata->dev, "could not get irq %s: %i\n",

drivers/phy/qualcomm/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ config PHY_QCOM_USB_HSIC
8787

8888
config PHY_QCOM_USB_HS_28NM
8989
tristate "Qualcomm 28nm High-Speed PHY"
90-
depends on ARCH_QCOM || COMPILE_TEST
90+
depends on OF && (ARCH_QCOM || COMPILE_TEST)
9191
depends on EXTCON || !EXTCON # if EXTCON=m, this cannot be built-in
9292
select GENERIC_PHY
9393
help
@@ -98,7 +98,7 @@ config PHY_QCOM_USB_HS_28NM
9898

9999
config PHY_QCOM_USB_SS
100100
tristate "Qualcomm USB Super-Speed PHY driver"
101-
depends on ARCH_QCOM || COMPILE_TEST
101+
depends on OF && (ARCH_QCOM || COMPILE_TEST)
102102
depends on EXTCON || !EXTCON # if EXTCON=m, this cannot be built-in
103103
select GENERIC_PHY
104104
help

drivers/phy/qualcomm/phy-qcom-qmp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3926,7 +3926,7 @@ static int qcom_qmp_phy_probe(struct platform_device *pdev)
39263926
struct phy_provider *phy_provider;
39273927
void __iomem *serdes;
39283928
void __iomem *usb_serdes;
3929-
void __iomem *dp_serdes;
3929+
void __iomem *dp_serdes = NULL;
39303930
const struct qmp_phy_combo_cfg *combo_cfg = NULL;
39313931
const struct qmp_phy_cfg *cfg = NULL;
39323932
const struct qmp_phy_cfg *usb_cfg = NULL;

drivers/phy/tegra/xusb.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1242,6 +1242,7 @@ static int tegra_xusb_padctl_probe(struct platform_device *pdev)
12421242
reset:
12431243
reset_control_assert(padctl->rst);
12441244
remove:
1245+
platform_set_drvdata(pdev, NULL);
12451246
soc->ops->remove(padctl);
12461247
return err;
12471248
}

drivers/usb/cdns3/gadget.c

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,7 +1114,7 @@ static int cdns3_ep_run_transfer(struct cdns3_endpoint *priv_ep,
11141114
struct cdns3_device *priv_dev = priv_ep->cdns3_dev;
11151115
struct cdns3_request *priv_req;
11161116
struct cdns3_trb *trb;
1117-
struct cdns3_trb *link_trb;
1117+
struct cdns3_trb *link_trb = NULL;
11181118
dma_addr_t trb_dma;
11191119
u32 togle_pcs = 1;
11201120
int sg_iter = 0;
@@ -1193,10 +1193,20 @@ static int cdns3_ep_run_transfer(struct cdns3_endpoint *priv_ep,
11931193

11941194
/* set incorrect Cycle Bit for first trb*/
11951195
control = priv_ep->pcs ? 0 : TRB_CYCLE;
1196+
trb->length = 0;
1197+
if (priv_dev->dev_ver >= DEV_VER_V2) {
1198+
u16 td_size;
1199+
1200+
td_size = DIV_ROUND_UP(request->length,
1201+
priv_ep->endpoint.maxpacket);
1202+
if (priv_dev->gadget.speed == USB_SPEED_SUPER)
1203+
trb->length = TRB_TDL_SS_SIZE(td_size);
1204+
else
1205+
control |= TRB_TDL_HS_SIZE(td_size);
1206+
}
11961207

11971208
do {
11981209
u32 length;
1199-
u16 td_size = 0;
12001210

12011211
/* fill TRB */
12021212
control |= TRB_TYPE(TRB_NORMAL);
@@ -1208,20 +1218,12 @@ static int cdns3_ep_run_transfer(struct cdns3_endpoint *priv_ep,
12081218
length = request->length;
12091219
}
12101220

1211-
if (likely(priv_dev->dev_ver >= DEV_VER_V2))
1212-
td_size = DIV_ROUND_UP(length,
1213-
priv_ep->endpoint.maxpacket);
1214-
else if (priv_ep->flags & EP_TDLCHK_EN)
1221+
if (priv_ep->flags & EP_TDLCHK_EN)
12151222
total_tdl += DIV_ROUND_UP(length,
12161223
priv_ep->endpoint.maxpacket);
12171224

1218-
trb->length = cpu_to_le32(TRB_BURST_LEN(priv_ep->trb_burst_size) |
1225+
trb->length |= cpu_to_le32(TRB_BURST_LEN(priv_ep->trb_burst_size) |
12191226
TRB_LEN(length));
1220-
if (priv_dev->gadget.speed == USB_SPEED_SUPER)
1221-
trb->length |= cpu_to_le32(TRB_TDL_SS_SIZE(td_size));
1222-
else
1223-
control |= TRB_TDL_HS_SIZE(td_size);
1224-
12251227
pcs = priv_ep->pcs ? TRB_CYCLE : 0;
12261228

12271229
/*

drivers/usb/core/devio.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -482,11 +482,11 @@ static void snoop_urb(struct usb_device *udev,
482482

483483
if (userurb) { /* Async */
484484
if (when == SUBMIT)
485-
dev_info(&udev->dev, "userurb %pK, ep%d %s-%s, "
485+
dev_info(&udev->dev, "userurb %px, ep%d %s-%s, "
486486
"length %u\n",
487487
userurb, ep, t, d, length);
488488
else
489-
dev_info(&udev->dev, "userurb %pK, ep%d %s-%s, "
489+
dev_info(&udev->dev, "userurb %px, ep%d %s-%s, "
490490
"actual_length %u status %d\n",
491491
userurb, ep, t, d, length,
492492
timeout_or_status);
@@ -1997,7 +1997,7 @@ static int proc_reapurb(struct usb_dev_state *ps, void __user *arg)
19971997
if (as) {
19981998
int retval;
19991999

2000-
snoop(&ps->dev->dev, "reap %pK\n", as->userurb);
2000+
snoop(&ps->dev->dev, "reap %px\n", as->userurb);
20012001
retval = processcompl(as, (void __user * __user *)arg);
20022002
free_async(as);
20032003
return retval;
@@ -2014,7 +2014,7 @@ static int proc_reapurbnonblock(struct usb_dev_state *ps, void __user *arg)
20142014

20152015
as = async_getcompleted(ps);
20162016
if (as) {
2017-
snoop(&ps->dev->dev, "reap %pK\n", as->userurb);
2017+
snoop(&ps->dev->dev, "reap %px\n", as->userurb);
20182018
retval = processcompl(as, (void __user * __user *)arg);
20192019
free_async(as);
20202020
} else {
@@ -2142,7 +2142,7 @@ static int proc_reapurb_compat(struct usb_dev_state *ps, void __user *arg)
21422142
if (as) {
21432143
int retval;
21442144

2145-
snoop(&ps->dev->dev, "reap %pK\n", as->userurb);
2145+
snoop(&ps->dev->dev, "reap %px\n", as->userurb);
21462146
retval = processcompl_compat(as, (void __user * __user *)arg);
21472147
free_async(as);
21482148
return retval;
@@ -2159,7 +2159,7 @@ static int proc_reapurbnonblock_compat(struct usb_dev_state *ps, void __user *ar
21592159

21602160
as = async_getcompleted(ps);
21612161
if (as) {
2162-
snoop(&ps->dev->dev, "reap %pK\n", as->userurb);
2162+
snoop(&ps->dev->dev, "reap %px\n", as->userurb);
21632163
retval = processcompl_compat(as, (void __user * __user *)arg);
21642164
free_async(as);
21652165
} else {
@@ -2624,7 +2624,7 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd,
26242624
#endif
26252625

26262626
case USBDEVFS_DISCARDURB:
2627-
snoop(&dev->dev, "%s: DISCARDURB %pK\n", __func__, p);
2627+
snoop(&dev->dev, "%s: DISCARDURB %px\n", __func__, p);
26282628
ret = proc_unlinkurb(ps, p);
26292629
break;
26302630

drivers/usb/core/quirks.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,10 @@ static const struct usb_device_id usb_quirk_list[] = {
348348
/* Guillemot Webcam Hercules Dualpix Exchange*/
349349
{ USB_DEVICE(0x06f8, 0x3005), .driver_info = USB_QUIRK_RESET_RESUME },
350350

351+
/* Guillemot Hercules DJ Console audio card (BZ 208357) */
352+
{ USB_DEVICE(0x06f8, 0xb000), .driver_info =
353+
USB_QUIRK_ENDPOINT_IGNORE },
354+
351355
/* Midiman M-Audio Keystation 88es */
352356
{ USB_DEVICE(0x0763, 0x0192), .driver_info = USB_QUIRK_RESET_RESUME },
353357

@@ -421,6 +425,10 @@ static const struct usb_device_id usb_quirk_list[] = {
421425
{ USB_DEVICE(0x1532, 0x0116), .driver_info =
422426
USB_QUIRK_LINEAR_UFRAME_INTR_BINTERVAL },
423427

428+
/* Lenovo ThinkCenter A630Z TI024Gen3 usb-audio */
429+
{ USB_DEVICE(0x17ef, 0xa012), .driver_info =
430+
USB_QUIRK_DISCONNECT_SUSPEND },
431+
424432
/* BUILDWIN Photo Frame */
425433
{ USB_DEVICE(0x1908, 0x1315), .driver_info =
426434
USB_QUIRK_HONOR_BNUMINTERFACES },
@@ -521,6 +529,8 @@ static const struct usb_device_id usb_amd_resume_quirk_list[] = {
521529
* Matched for devices with USB_QUIRK_ENDPOINT_IGNORE.
522530
*/
523531
static const struct usb_device_id usb_endpoint_ignore[] = {
532+
{ USB_DEVICE_INTERFACE_NUMBER(0x06f8, 0xb000, 5), .driver_info = 0x01 },
533+
{ USB_DEVICE_INTERFACE_NUMBER(0x06f8, 0xb000, 5), .driver_info = 0x81 },
524534
{ USB_DEVICE_INTERFACE_NUMBER(0x0926, 0x0202, 1), .driver_info = 0x85 },
525535
{ USB_DEVICE_INTERFACE_NUMBER(0x0926, 0x0208, 1), .driver_info = 0x85 },
526536
{ }

0 commit comments

Comments
 (0)