Skip to content

Commit fd59585

Browse files
committed
Merge tag 'usb-6.0-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB/Thunderbolt driver fixes from Greg KH: "Here are a lot of small USB and Thunderbolt driver fixes for 6.0-rc4 for reported problems. Included in here are: - new usb-serial driver ids - dwc3 driver bugfixes for reported problems with 6.0-rc1 - new device quirks, and reverts of some quirks that were incorrect - gadget driver bugfixes for reported problems - USB host controller bugfixes (xhci and others) - other small USB fixes, details in the shortlog - small thunderbolt driver fixes All of these have been in linux-next with no reported issues" * tag 'usb-6.0-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (51 commits) Revert "usb: gadget: udc-xilinx: replace memcpy with memcpy_toio" usb: storage: Add ASUS <0x0b05:0x1932> to IGNORE_UAS USB: serial: ch341: fix disabled rx timer on older devices USB: serial: ch341: fix lost character on LCR updates USB: serial: cp210x: add Decagon UCA device id Revert "usb: add quirks for Lenovo OneLink+ Dock" usb: cdns3: fix issue with rearming ISO OUT endpoint usb: cdns3: fix incorrect handling TRB_SMM flag for ISOC transfer usb: gadget: mass_storage: Fix cdrom data transfers on MAC-OS media: mceusb: Use new usb_control_msg_*() routines USB: core: Prevent nested device-reset calls USB: gadget: Fix obscure lockdep violation for udc_mutex usb: dwc2: fix wrong order of phy_power_on and phy_init usb: gadget: udc-xilinx: replace memcpy with memcpy_toio usb: typec: Remove retimers properly usb: dwc3: disable USB core PHY management usb: add quirks for Lenovo OneLink+ Dock USB: serial: option: add support for Cinterion MV32-WA/WB RmNet mode USB: serial: ftdi_sio: add Omron CS1W-CIF31 device id USB: serial: option: add Quectel EM060K modem ...
2 parents 1a2f6a3 + fe0a2ac commit fd59585

38 files changed

Lines changed: 303 additions & 167 deletions

File tree

Documentation/devicetree/bindings/usb/mediatek,mtu3.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ properties:
2424
- mediatek,mt2712-mtu3
2525
- mediatek,mt8173-mtu3
2626
- mediatek,mt8183-mtu3
27+
- mediatek,mt8188-mtu3
2728
- mediatek,mt8192-mtu3
2829
- mediatek,mt8195-mtu3
2930
- const: mediatek,mtu3

Documentation/devicetree/bindings/usb/qcom,dwc3.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ properties:
3333
- qcom,sm6115-dwc3
3434
- qcom,sm6125-dwc3
3535
- qcom,sm6350-dwc3
36+
- qcom,sm6375-dwc3
3637
- qcom,sm8150-dwc3
3738
- qcom,sm8250-dwc3
3839
- qcom,sm8350-dwc3
@@ -108,12 +109,17 @@ properties:
108109
HS/FS/LS modes are supported.
109110
type: boolean
110111

112+
wakeup-source: true
113+
111114
# Required child node:
112115

113116
patternProperties:
114117
"^usb@[0-9a-f]+$":
115118
$ref: snps,dwc3.yaml#
116119

120+
properties:
121+
wakeup-source: false
122+
117123
required:
118124
- compatible
119125
- reg

drivers/media/rc/mceusb.c

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1416,51 +1416,44 @@ static void mceusb_gen1_init(struct mceusb_dev *ir)
14161416
{
14171417
int ret;
14181418
struct device *dev = ir->dev;
1419-
char *data;
1420-
1421-
data = kzalloc(USB_CTRL_MSG_SZ, GFP_KERNEL);
1422-
if (!data) {
1423-
dev_err(dev, "%s: memory allocation failed!", __func__);
1424-
return;
1425-
}
1419+
char data[USB_CTRL_MSG_SZ];
14261420

14271421
/*
14281422
* This is a strange one. Windows issues a set address to the device
14291423
* on the receive control pipe and expect a certain value pair back
14301424
*/
1431-
ret = usb_control_msg(ir->usbdev, usb_rcvctrlpipe(ir->usbdev, 0),
1432-
USB_REQ_SET_ADDRESS, USB_TYPE_VENDOR, 0, 0,
1433-
data, USB_CTRL_MSG_SZ, 3000);
1425+
ret = usb_control_msg_recv(ir->usbdev, 0, USB_REQ_SET_ADDRESS,
1426+
USB_DIR_IN | USB_TYPE_VENDOR,
1427+
0, 0, data, USB_CTRL_MSG_SZ, 3000,
1428+
GFP_KERNEL);
14341429
dev_dbg(dev, "set address - ret = %d", ret);
14351430
dev_dbg(dev, "set address - data[0] = %d, data[1] = %d",
14361431
data[0], data[1]);
14371432

14381433
/* set feature: bit rate 38400 bps */
1439-
ret = usb_control_msg(ir->usbdev, usb_sndctrlpipe(ir->usbdev, 0),
1440-
USB_REQ_SET_FEATURE, USB_TYPE_VENDOR,
1441-
0xc04e, 0x0000, NULL, 0, 3000);
1434+
ret = usb_control_msg_send(ir->usbdev, 0,
1435+
USB_REQ_SET_FEATURE, USB_TYPE_VENDOR,
1436+
0xc04e, 0x0000, NULL, 0, 3000, GFP_KERNEL);
14421437

14431438
dev_dbg(dev, "set feature - ret = %d", ret);
14441439

14451440
/* bRequest 4: set char length to 8 bits */
1446-
ret = usb_control_msg(ir->usbdev, usb_sndctrlpipe(ir->usbdev, 0),
1447-
4, USB_TYPE_VENDOR,
1448-
0x0808, 0x0000, NULL, 0, 3000);
1441+
ret = usb_control_msg_send(ir->usbdev, 0,
1442+
4, USB_TYPE_VENDOR,
1443+
0x0808, 0x0000, NULL, 0, 3000, GFP_KERNEL);
14491444
dev_dbg(dev, "set char length - retB = %d", ret);
14501445

14511446
/* bRequest 2: set handshaking to use DTR/DSR */
1452-
ret = usb_control_msg(ir->usbdev, usb_sndctrlpipe(ir->usbdev, 0),
1453-
2, USB_TYPE_VENDOR,
1454-
0x0000, 0x0100, NULL, 0, 3000);
1447+
ret = usb_control_msg_send(ir->usbdev, 0,
1448+
2, USB_TYPE_VENDOR,
1449+
0x0000, 0x0100, NULL, 0, 3000, GFP_KERNEL);
14551450
dev_dbg(dev, "set handshake - retC = %d", ret);
14561451

14571452
/* device resume */
14581453
mce_command_out(ir, DEVICE_RESUME, sizeof(DEVICE_RESUME));
14591454

14601455
/* get hw/sw revision? */
14611456
mce_command_out(ir, GET_REVISION, sizeof(GET_REVISION));
1462-
1463-
kfree(data);
14641457
}
14651458

14661459
static void mceusb_gen2_init(struct mceusb_dev *ir)

drivers/thunderbolt/ctl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ static void tb_ctl_rx_submit(struct ctl_pkg *pkg)
407407

408408
static int tb_async_error(const struct ctl_pkg *pkg)
409409
{
410-
const struct cfg_error_pkg *error = (const struct cfg_error_pkg *)pkg;
410+
const struct cfg_error_pkg *error = pkg->buffer;
411411

412412
if (pkg->frame.eof != TB_CFG_PKG_ERROR)
413413
return false;

drivers/thunderbolt/switch.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3786,14 +3786,18 @@ int tb_switch_pcie_l1_enable(struct tb_switch *sw)
37863786
*/
37873787
int tb_switch_xhci_connect(struct tb_switch *sw)
37883788
{
3789-
bool usb_port1, usb_port3, xhci_port1, xhci_port3;
37903789
struct tb_port *port1, *port3;
37913790
int ret;
37923791

3792+
if (sw->generation != 3)
3793+
return 0;
3794+
37933795
port1 = &sw->ports[1];
37943796
port3 = &sw->ports[3];
37953797

37963798
if (tb_switch_is_alpine_ridge(sw)) {
3799+
bool usb_port1, usb_port3, xhci_port1, xhci_port3;
3800+
37973801
usb_port1 = tb_lc_is_usb_plugged(port1);
37983802
usb_port3 = tb_lc_is_usb_plugged(port3);
37993803
xhci_port1 = tb_lc_is_xhci_connected(port1);

drivers/usb/cdns3/cdns3-gadget.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1530,7 +1530,8 @@ static void cdns3_transfer_completed(struct cdns3_device *priv_dev,
15301530
TRB_LEN(le32_to_cpu(trb->length));
15311531

15321532
if (priv_req->num_of_trb > 1 &&
1533-
le32_to_cpu(trb->control) & TRB_SMM)
1533+
le32_to_cpu(trb->control) & TRB_SMM &&
1534+
le32_to_cpu(trb->control) & TRB_CHAIN)
15341535
transfer_end = true;
15351536

15361537
cdns3_ep_inc_deq(priv_ep);
@@ -1690,6 +1691,7 @@ static int cdns3_check_ep_interrupt_proceed(struct cdns3_endpoint *priv_ep)
16901691
ep_cfg &= ~EP_CFG_ENABLE;
16911692
writel(ep_cfg, &priv_dev->regs->ep_cfg);
16921693
priv_ep->flags &= ~EP_QUIRK_ISO_OUT_EN;
1694+
priv_ep->flags |= EP_UPDATE_EP_TRBADDR;
16931695
}
16941696
cdns3_transfer_completed(priv_dev, priv_ep);
16951697
} else if (!(priv_ep->flags & EP_STALLED) &&

drivers/usb/class/cdc-acm.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1810,6 +1810,9 @@ static const struct usb_device_id acm_ids[] = {
18101810
{ USB_DEVICE(0x09d8, 0x0320), /* Elatec GmbH TWN3 */
18111811
.driver_info = NO_UNION_NORMAL, /* has misplaced union descriptor */
18121812
},
1813+
{ USB_DEVICE(0x0c26, 0x0020), /* Icom ICF3400 Serie */
1814+
.driver_info = NO_UNION_NORMAL, /* reports zero length descriptor */
1815+
},
18131816
{ USB_DEVICE(0x0ca6, 0xa050), /* Castles VEGA3000 */
18141817
.driver_info = NO_UNION_NORMAL, /* reports zero length descriptor */
18151818
},

drivers/usb/core/hub.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6038,6 +6038,11 @@ static int usb_reset_and_verify_device(struct usb_device *udev)
60386038
* the reset is over (using their post_reset method).
60396039
*
60406040
* Return: The same as for usb_reset_and_verify_device().
6041+
* However, if a reset is already in progress (for instance, if a
6042+
* driver doesn't have pre_ or post_reset() callbacks, and while
6043+
* being unbound or re-bound during the ongoing reset its disconnect()
6044+
* or probe() routine tries to perform a second, nested reset), the
6045+
* routine returns -EINPROGRESS.
60416046
*
60426047
* Note:
60436048
* The caller must own the device lock. For example, it's safe to use
@@ -6071,6 +6076,10 @@ int usb_reset_device(struct usb_device *udev)
60716076
return -EISDIR;
60726077
}
60736078

6079+
if (udev->reset_in_progress)
6080+
return -EINPROGRESS;
6081+
udev->reset_in_progress = 1;
6082+
60746083
port_dev = hub->ports[udev->portnum - 1];
60756084

60766085
/*
@@ -6135,6 +6144,7 @@ int usb_reset_device(struct usb_device *udev)
61356144

61366145
usb_autosuspend_device(udev);
61376146
memalloc_noio_restore(noio_flag);
6147+
udev->reset_in_progress = 0;
61386148
return ret;
61396149
}
61406150
EXPORT_SYMBOL_GPL(usb_reset_device);

drivers/usb/dwc2/platform.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,9 @@ static int __dwc2_lowlevel_hw_enable(struct dwc2_hsotg *hsotg)
154154
} else if (hsotg->plat && hsotg->plat->phy_init) {
155155
ret = hsotg->plat->phy_init(pdev, hsotg->plat->phy_type);
156156
} else {
157-
ret = phy_power_on(hsotg->phy);
157+
ret = phy_init(hsotg->phy);
158158
if (ret == 0)
159-
ret = phy_init(hsotg->phy);
159+
ret = phy_power_on(hsotg->phy);
160160
}
161161

162162
return ret;
@@ -188,9 +188,9 @@ static int __dwc2_lowlevel_hw_disable(struct dwc2_hsotg *hsotg)
188188
} else if (hsotg->plat && hsotg->plat->phy_exit) {
189189
ret = hsotg->plat->phy_exit(pdev, hsotg->plat->phy_type);
190190
} else {
191-
ret = phy_exit(hsotg->phy);
191+
ret = phy_power_off(hsotg->phy);
192192
if (ret == 0)
193-
ret = phy_power_off(hsotg->phy);
193+
ret = phy_exit(hsotg->phy);
194194
}
195195
if (ret)
196196
return ret;

drivers/usb/dwc3/core.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -833,15 +833,16 @@ static void dwc3_core_exit(struct dwc3 *dwc)
833833
{
834834
dwc3_event_buffers_cleanup(dwc);
835835

836+
usb_phy_set_suspend(dwc->usb2_phy, 1);
837+
usb_phy_set_suspend(dwc->usb3_phy, 1);
838+
phy_power_off(dwc->usb2_generic_phy);
839+
phy_power_off(dwc->usb3_generic_phy);
840+
836841
usb_phy_shutdown(dwc->usb2_phy);
837842
usb_phy_shutdown(dwc->usb3_phy);
838843
phy_exit(dwc->usb2_generic_phy);
839844
phy_exit(dwc->usb3_generic_phy);
840845

841-
usb_phy_set_suspend(dwc->usb2_phy, 1);
842-
usb_phy_set_suspend(dwc->usb3_phy, 1);
843-
phy_power_off(dwc->usb2_generic_phy);
844-
phy_power_off(dwc->usb3_generic_phy);
845846
dwc3_clk_disable(dwc);
846847
reset_control_assert(dwc->reset);
847848
}
@@ -1821,7 +1822,6 @@ static int dwc3_probe(struct platform_device *pdev)
18211822

18221823
platform_set_drvdata(pdev, dwc);
18231824
dwc3_cache_hwparams(dwc);
1824-
device_init_wakeup(&pdev->dev, of_property_read_bool(dev->of_node, "wakeup-source"));
18251825

18261826
spin_lock_init(&dwc->lock);
18271827
mutex_init(&dwc->mutex);
@@ -1879,16 +1879,16 @@ static int dwc3_probe(struct platform_device *pdev)
18791879
dwc3_debugfs_exit(dwc);
18801880
dwc3_event_buffers_cleanup(dwc);
18811881

1882-
usb_phy_shutdown(dwc->usb2_phy);
1883-
usb_phy_shutdown(dwc->usb3_phy);
1884-
phy_exit(dwc->usb2_generic_phy);
1885-
phy_exit(dwc->usb3_generic_phy);
1886-
18871882
usb_phy_set_suspend(dwc->usb2_phy, 1);
18881883
usb_phy_set_suspend(dwc->usb3_phy, 1);
18891884
phy_power_off(dwc->usb2_generic_phy);
18901885
phy_power_off(dwc->usb3_generic_phy);
18911886

1887+
usb_phy_shutdown(dwc->usb2_phy);
1888+
usb_phy_shutdown(dwc->usb3_phy);
1889+
phy_exit(dwc->usb2_generic_phy);
1890+
phy_exit(dwc->usb3_generic_phy);
1891+
18921892
dwc3_ulpi_exit(dwc);
18931893

18941894
err4:
@@ -1983,7 +1983,7 @@ static int dwc3_suspend_common(struct dwc3 *dwc, pm_message_t msg)
19831983
dwc3_core_exit(dwc);
19841984
break;
19851985
case DWC3_GCTL_PRTCAP_HOST:
1986-
if (!PMSG_IS_AUTO(msg) && !device_can_wakeup(dwc->dev)) {
1986+
if (!PMSG_IS_AUTO(msg) && !device_may_wakeup(dwc->dev)) {
19871987
dwc3_core_exit(dwc);
19881988
break;
19891989
}
@@ -2044,7 +2044,7 @@ static int dwc3_resume_common(struct dwc3 *dwc, pm_message_t msg)
20442044
spin_unlock_irqrestore(&dwc->lock, flags);
20452045
break;
20462046
case DWC3_GCTL_PRTCAP_HOST:
2047-
if (!PMSG_IS_AUTO(msg) && !device_can_wakeup(dwc->dev)) {
2047+
if (!PMSG_IS_AUTO(msg) && !device_may_wakeup(dwc->dev)) {
20482048
ret = dwc3_core_init_for_resume(dwc);
20492049
if (ret)
20502050
return ret;

0 commit comments

Comments
 (0)