Skip to content

Commit 8f3bfd2

Browse files
committed
Merge tag 'usb-5.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB fixes from Greg KH: "Here are some small USB driver fixes for 5.11-rc5. They resolve: - xhci issues for some reported problems - ehci driver issue for one specific device - USB gadget fixes for some reported problems - cdns3 driver fixes for issues reported - MAINTAINERS file update - thunderbolt minor fix All of these have been in linux-next with no reported issues" * tag 'usb-5.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: usb: bdc: Make bdc pci driver depend on BROKEN xhci: tegra: Delay for disabling LFPS detector xhci: make sure TRB is fully written before giving it to the controller usb: udc: core: Use lock when write to soft_connect USB: gadget: dummy-hcd: Fix errors in port-reset handling usb: gadget: aspeed: fix stop dma register setting. USB: ehci: fix an interrupt calltrace error ehci: fix EHCI host controller initialization sequence MAINTAINERS: update Peter Chen's email address thunderbolt: Drop duplicated 0x prefix from format string MAINTAINERS: Update address for Cadence USB3 driver usb: cdns3: imx: improve driver .remove API usb: cdns3: imx: fix can't create core device the second time issue usb: cdns3: imx: fix writing read-only memory issue
2 parents e680613 + ef02684 commit 8f3bfd2

File tree

11 files changed

+61
-23
lines changed

11 files changed

+61
-23
lines changed

MAINTAINERS

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3879,7 +3879,7 @@ F: Documentation/devicetree/bindings/mtd/cadence-nand-controller.txt
38793879
F: drivers/mtd/nand/raw/cadence-nand-controller.c
38803880

38813881
CADENCE USB3 DRD IP DRIVER
3882-
M: Peter Chen <peter.chen@nxp.com>
3882+
M: Peter Chen <peter.chen@kernel.org>
38833883
M: Pawel Laszczak <[email protected]>
38843884
R: Roger Quadros <[email protected]>
38853885
R: Aswath Govindraju <[email protected]>
@@ -4161,7 +4161,7 @@ S: Maintained
41614161
F: Documentation/translations/zh_CN/
41624162

41634163
CHIPIDEA USB HIGH SPEED DUAL ROLE CONTROLLER
4164-
M: Peter Chen <[email protected]>
4164+
M: Peter Chen <[email protected]>
41654165
41664166
S: Maintained
41674167
T: git git://git.kernel.org/pub/scm/linux/kernel/git/peter.chen/usb.git
@@ -18420,7 +18420,7 @@ F: Documentation/usb/ohci.rst
1842018420
F: drivers/usb/host/ohci*
1842118421

1842218422
USB OTG FSM (Finite State Machine)
18423-
M: Peter Chen <[email protected]>
18423+
M: Peter Chen <[email protected]>
1842418424
1842518425
S: Maintained
1842618426
T: git git://git.kernel.org/pub/scm/linux/kernel/git/peter.chen/usb.git

drivers/thunderbolt/icm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2316,7 +2316,7 @@ static int icm_usb4_switch_nvm_authenticate_status(struct tb_switch *sw,
23162316

23172317
if (auth && auth->reply.route_hi == sw->config.route_hi &&
23182318
auth->reply.route_lo == sw->config.route_lo) {
2319-
tb_dbg(tb, "NVM_AUTH found for %llx flags 0x%#x status %#x\n",
2319+
tb_dbg(tb, "NVM_AUTH found for %llx flags %#x status %#x\n",
23202320
tb_route(sw), auth->reply.hdr.flags, auth->reply.status);
23212321
if (auth->reply.hdr.flags & ICM_FLAGS_ERROR)
23222322
ret = -EIO;

drivers/usb/cdns3/cdns3-imx.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,11 @@ static int cdns_imx_probe(struct platform_device *pdev)
185185
}
186186

187187
data->num_clks = ARRAY_SIZE(imx_cdns3_core_clks);
188-
data->clks = (struct clk_bulk_data *)imx_cdns3_core_clks;
188+
data->clks = devm_kmemdup(dev, imx_cdns3_core_clks,
189+
sizeof(imx_cdns3_core_clks), GFP_KERNEL);
190+
if (!data->clks)
191+
return -ENOMEM;
192+
189193
ret = devm_clk_bulk_get(dev, data->num_clks, data->clks);
190194
if (ret)
191195
return ret;
@@ -214,20 +218,16 @@ static int cdns_imx_probe(struct platform_device *pdev)
214218
return ret;
215219
}
216220

217-
static int cdns_imx_remove_core(struct device *dev, void *data)
218-
{
219-
struct platform_device *pdev = to_platform_device(dev);
220-
221-
platform_device_unregister(pdev);
222-
223-
return 0;
224-
}
225-
226221
static int cdns_imx_remove(struct platform_device *pdev)
227222
{
228223
struct device *dev = &pdev->dev;
224+
struct cdns_imx *data = dev_get_drvdata(dev);
229225

230-
device_for_each_child(dev, NULL, cdns_imx_remove_core);
226+
pm_runtime_get_sync(dev);
227+
of_platform_depopulate(dev);
228+
clk_bulk_disable_unprepare(data->num_clks, data->clks);
229+
pm_runtime_disable(dev);
230+
pm_runtime_put_noidle(dev);
231231
platform_set_drvdata(pdev, NULL);
232232

233233
return 0;

drivers/usb/gadget/udc/aspeed-vhub/epn.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,10 @@ static void ast_vhub_stop_active_req(struct ast_vhub_ep *ep,
420420
u32 state, reg, loops;
421421

422422
/* Stop DMA activity */
423-
writel(0, ep->epn.regs + AST_VHUB_EP_DMA_CTLSTAT);
423+
if (ep->epn.desc_mode)
424+
writel(VHUB_EP_DMA_CTRL_RESET, ep->epn.regs + AST_VHUB_EP_DMA_CTLSTAT);
425+
else
426+
writel(0, ep->epn.regs + AST_VHUB_EP_DMA_CTLSTAT);
424427

425428
/* Wait for it to complete */
426429
for (loops = 0; loops < 1000; loops++) {

drivers/usb/gadget/udc/bdc/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ if USB_BDC_UDC
1717
comment "Platform Support"
1818
config USB_BDC_PCI
1919
tristate "BDC support for PCIe based platforms"
20-
depends on USB_PCI
20+
depends on USB_PCI && BROKEN
2121
default USB_BDC_UDC
2222
help
2323
Enable support for platforms which have BDC connected through PCIe, such as Lego3 FPGA platform.

drivers/usb/gadget/udc/core.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1529,10 +1529,13 @@ static ssize_t soft_connect_store(struct device *dev,
15291529
struct device_attribute *attr, const char *buf, size_t n)
15301530
{
15311531
struct usb_udc *udc = container_of(dev, struct usb_udc, dev);
1532+
ssize_t ret;
15321533

1534+
mutex_lock(&udc_lock);
15331535
if (!udc->driver) {
15341536
dev_err(dev, "soft-connect without a gadget driver\n");
1535-
return -EOPNOTSUPP;
1537+
ret = -EOPNOTSUPP;
1538+
goto out;
15361539
}
15371540

15381541
if (sysfs_streq(buf, "connect")) {
@@ -1543,10 +1546,14 @@ static ssize_t soft_connect_store(struct device *dev,
15431546
usb_gadget_udc_stop(udc);
15441547
} else {
15451548
dev_err(dev, "unsupported command '%s'\n", buf);
1546-
return -EINVAL;
1549+
ret = -EINVAL;
1550+
goto out;
15471551
}
15481552

1549-
return n;
1553+
ret = n;
1554+
out:
1555+
mutex_unlock(&udc_lock);
1556+
return ret;
15501557
}
15511558
static DEVICE_ATTR_WO(soft_connect);
15521559

drivers/usb/gadget/udc/dummy_hcd.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2270,17 +2270,20 @@ static int dummy_hub_control(
22702270
}
22712271
fallthrough;
22722272
case USB_PORT_FEAT_RESET:
2273+
if (!(dum_hcd->port_status & USB_PORT_STAT_CONNECTION))
2274+
break;
22732275
/* if it's already enabled, disable */
22742276
if (hcd->speed == HCD_USB3) {
2275-
dum_hcd->port_status = 0;
22762277
dum_hcd->port_status =
22772278
(USB_SS_PORT_STAT_POWER |
22782279
USB_PORT_STAT_CONNECTION |
22792280
USB_PORT_STAT_RESET);
2280-
} else
2281+
} else {
22812282
dum_hcd->port_status &= ~(USB_PORT_STAT_ENABLE
22822283
| USB_PORT_STAT_LOW_SPEED
22832284
| USB_PORT_STAT_HIGH_SPEED);
2285+
dum_hcd->port_status |= USB_PORT_STAT_RESET;
2286+
}
22842287
/*
22852288
* We want to reset device status. All but the
22862289
* Self powered feature
@@ -2292,7 +2295,8 @@ static int dummy_hub_control(
22922295
* interval? Is it still 50msec as for HS?
22932296
*/
22942297
dum_hcd->re_timeout = jiffies + msecs_to_jiffies(50);
2295-
fallthrough;
2298+
set_link_state(dum_hcd);
2299+
break;
22962300
case USB_PORT_FEAT_C_CONNECTION:
22972301
case USB_PORT_FEAT_C_RESET:
22982302
case USB_PORT_FEAT_C_ENABLE:

drivers/usb/host/ehci-hcd.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,7 @@ static int ehci_run (struct usb_hcd *hcd)
574574
struct ehci_hcd *ehci = hcd_to_ehci (hcd);
575575
u32 temp;
576576
u32 hcc_params;
577+
int rc;
577578

578579
hcd->uses_new_polling = 1;
579580

@@ -629,9 +630,20 @@ static int ehci_run (struct usb_hcd *hcd)
629630
down_write(&ehci_cf_port_reset_rwsem);
630631
ehci->rh_state = EHCI_RH_RUNNING;
631632
ehci_writel(ehci, FLAG_CF, &ehci->regs->configured_flag);
633+
634+
/* Wait until HC become operational */
632635
ehci_readl(ehci, &ehci->regs->command); /* unblock posted writes */
633636
msleep(5);
637+
rc = ehci_handshake(ehci, &ehci->regs->status, STS_HALT, 0, 100 * 1000);
638+
634639
up_write(&ehci_cf_port_reset_rwsem);
640+
641+
if (rc) {
642+
ehci_err(ehci, "USB %x.%x, controller refused to start: %d\n",
643+
((ehci->sbrn & 0xf0)>>4), (ehci->sbrn & 0x0f), rc);
644+
return rc;
645+
}
646+
635647
ehci->last_periodic_enable = ktime_get_real();
636648

637649
temp = HC_VERSION(ehci, ehci_readl(ehci, &ehci->caps->hc_capbase));

drivers/usb/host/ehci-hub.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,9 @@ static int ehci_bus_suspend (struct usb_hcd *hcd)
345345

346346
unlink_empty_async_suspended(ehci);
347347

348+
/* Some Synopsys controllers mistakenly leave IAA turned on */
349+
ehci_writel(ehci, STS_IAA, &ehci->regs->status);
350+
348351
/* Any IAA cycle that started before the suspend is now invalid */
349352
end_iaa_cycle(ehci);
350353
ehci_handle_start_intr_unlinks(ehci);

drivers/usb/host/xhci-ring.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2931,6 +2931,8 @@ static void queue_trb(struct xhci_hcd *xhci, struct xhci_ring *ring,
29312931
trb->field[0] = cpu_to_le32(field1);
29322932
trb->field[1] = cpu_to_le32(field2);
29332933
trb->field[2] = cpu_to_le32(field3);
2934+
/* make sure TRB is fully written before giving it to the controller */
2935+
wmb();
29342936
trb->field[3] = cpu_to_le32(field4);
29352937

29362938
trace_xhci_queue_trb(ring, trb);

0 commit comments

Comments
 (0)