forked from Minki/linux
usb: fixes for v4.2-rc4
Only four fixes this time so I'll describe them all. We have an iomen resource leak fix in mv_udc_core. This bug exists since v3.3. Renesas got a fix for how they use dma_map_single() with IOMMU. The new ulpi bus got an ordering fix, so drivers don't try to probe ahead of the bus. And finally, we have a fix for a really old regression with dwc3, one which could only be exposed by a recent patch from Subbaraya. Basically, we were startving the controller of transfer resources. Signed-off-by: Felipe Balbi <balbi@ti.com> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAABAgAGBQJVr6KCAAoJEIaOsuA1yqREx4cP/RolxrMYns+Buo0cXJppqN4I xN4iKtFN91GEp6+QV+KCeo5fNEtbsMeJEKoj0Xo0L5gk5ArKaChY9AqPAbepsA0J mO6fqMFJMzJiwc9aH/VBisEcmx44SogyH2wke/BSdQLYrQO4Tgs0trNLVu5IWPaw WGOwrsdcGu18swW3mzLe+bqL69GRENIiOcZJD3it0NBUDUNaaWwLXKz6ncu651iE DsDMef0Ib2JQj23pWYMYsz727Cj1rwciy4pf5iuNBY44/TltuRNCSTavf3MZfQtP DxaVQhySGr4Bv+312JEBEbx+lxzQg3qHCUd2T2CSTFzGHpqjuzpmYpXuCPuYifcv mJZPymqiLxDJgSgu5bIvBZif+7SGvg5AEoYUQsQildwSrcW2lpxtkhCFWnPzkrEj YYdh7wGEYtiUpLB3paa5HjaoFVkopXDlg1YcTCoPVsnLmV22q2ciSigYDTsfh4oV hEU95RiIN+Qm3HPcnPyYGqr30OlH/lDfxGnaSOTeMtWCPu82mR5opTsW+bzQa463 HzF7thJf4AjZqdCczi3YELo7sAjUa77ANa2KDxu0DlbPB5AsFOTP/4Hy8eNb7MsO b91dSQipQuixeeHJqYo3G+jp1Gtt7KuqwrrG+0l8oM5YTapRONKf6d4JiFPG2A56 iBkACDBoZiXH7idSX48b =eKH4 -----END PGP SIGNATURE----- Merge tag 'fixes-for-v4.2-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-linus Felipe writes: usb: fixes for v4.2-rc4 Only four fixes this time so I'll describe them all. We have an iomen resource leak fix in mv_udc_core. This bug exists since v3.3. Renesas got a fix for how they use dma_map_single() with IOMMU. The new ulpi bus got an ordering fix, so drivers don't try to probe ahead of the bus. And finally, we have a fix for a really old regression with dwc3, one which could only be exposed by a recent patch from Subbaraya. Basically, we were startving the controller of transfer resources. Signed-off-by: Felipe Balbi <balbi@ti.com>
This commit is contained in:
commit
ed877b130d
@ -242,7 +242,7 @@ static int __init ulpi_init(void)
|
||||
{
|
||||
return bus_register(&ulpi_bus);
|
||||
}
|
||||
module_init(ulpi_init);
|
||||
subsys_initcall(ulpi_init);
|
||||
|
||||
static void __exit ulpi_exit(void)
|
||||
{
|
||||
|
@ -727,6 +727,10 @@ static int dwc3_ep0_std_request(struct dwc3 *dwc, struct usb_ctrlrequest *ctrl)
|
||||
dwc3_trace(trace_dwc3_ep0, "USB_REQ_SET_ISOCH_DELAY");
|
||||
ret = dwc3_ep0_set_isoch_delay(dwc, ctrl);
|
||||
break;
|
||||
case USB_REQ_SET_INTERFACE:
|
||||
dwc3_trace(trace_dwc3_ep0, "USB_REQ_SET_INTERFACE");
|
||||
dwc->start_config_issued = false;
|
||||
/* Fall through */
|
||||
default:
|
||||
dwc3_trace(trace_dwc3_ep0, "Forwarding to gadget driver");
|
||||
ret = dwc3_ep0_delegate_req(dwc, ctrl);
|
||||
|
@ -2167,7 +2167,7 @@ static int mv_udc_probe(struct platform_device *pdev)
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
udc->phy_regs = ioremap(r->start, resource_size(r));
|
||||
udc->phy_regs = devm_ioremap(&pdev->dev, r->start, resource_size(r));
|
||||
if (udc->phy_regs == NULL) {
|
||||
dev_err(&pdev->dev, "failed to map phy I/O memory\n");
|
||||
return -EBUSY;
|
||||
|
@ -60,13 +60,15 @@ static DEFINE_MUTEX(udc_lock);
|
||||
int usb_gadget_map_request(struct usb_gadget *gadget,
|
||||
struct usb_request *req, int is_in)
|
||||
{
|
||||
struct device *dev = gadget->dev.parent;
|
||||
|
||||
if (req->length == 0)
|
||||
return 0;
|
||||
|
||||
if (req->num_sgs) {
|
||||
int mapped;
|
||||
|
||||
mapped = dma_map_sg(&gadget->dev, req->sg, req->num_sgs,
|
||||
mapped = dma_map_sg(dev, req->sg, req->num_sgs,
|
||||
is_in ? DMA_TO_DEVICE : DMA_FROM_DEVICE);
|
||||
if (mapped == 0) {
|
||||
dev_err(&gadget->dev, "failed to map SGs\n");
|
||||
@ -75,11 +77,11 @@ int usb_gadget_map_request(struct usb_gadget *gadget,
|
||||
|
||||
req->num_mapped_sgs = mapped;
|
||||
} else {
|
||||
req->dma = dma_map_single(&gadget->dev, req->buf, req->length,
|
||||
req->dma = dma_map_single(dev, req->buf, req->length,
|
||||
is_in ? DMA_TO_DEVICE : DMA_FROM_DEVICE);
|
||||
|
||||
if (dma_mapping_error(&gadget->dev, req->dma)) {
|
||||
dev_err(&gadget->dev, "failed to map buffer\n");
|
||||
if (dma_mapping_error(dev, req->dma)) {
|
||||
dev_err(dev, "failed to map buffer\n");
|
||||
return -EFAULT;
|
||||
}
|
||||
}
|
||||
@ -95,12 +97,12 @@ void usb_gadget_unmap_request(struct usb_gadget *gadget,
|
||||
return;
|
||||
|
||||
if (req->num_mapped_sgs) {
|
||||
dma_unmap_sg(&gadget->dev, req->sg, req->num_mapped_sgs,
|
||||
dma_unmap_sg(gadget->dev.parent, req->sg, req->num_mapped_sgs,
|
||||
is_in ? DMA_TO_DEVICE : DMA_FROM_DEVICE);
|
||||
|
||||
req->num_mapped_sgs = 0;
|
||||
} else {
|
||||
dma_unmap_single(&gadget->dev, req->dma, req->length,
|
||||
dma_unmap_single(gadget->dev.parent, req->dma, req->length,
|
||||
is_in ? DMA_TO_DEVICE : DMA_FROM_DEVICE);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user