Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'usb-4.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

Pull USB fixes from Greg KH:
"Here are some small USB gadget, phy, and xhci fixes for 4.8-rc6.

All of these resolve minor issues that have been reported, and all
have been in linux-next with no reported issues"

* tag 'usb-4.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
usb: chipidea: udc: fix NULL ptr dereference in isr_setup_status_phase
xhci: fix null pointer dereference in stop command timeout function
usb: dwc3: pci: fix build warning on !PM_SLEEP
usb: gadget: prevent potenial null pointer dereference on skb->len
usb: renesas_usbhs: fix clearing the {BRDY,BEMP}STS condition
usb: phy: phy-generic: Check clk_prepare_enable() error
usb: gadget: udc: renesas-usb3: clear VBOUT bit in DRD_CON
Revert "usb: dwc3: gadget: always decrement by 1"

+39 -8
+9
drivers/usb/chipidea/udc.c
··· 949 949 int retval; 950 950 struct ci_hw_ep *hwep; 951 951 952 + /* 953 + * Unexpected USB controller behavior, caused by bad signal integrity 954 + * or ground reference problems, can lead to isr_setup_status_phase 955 + * being called with ci->status equal to NULL. 956 + * If this situation occurs, you should review your USB hardware design. 957 + */ 958 + if (WARN_ON_ONCE(!ci->status)) 959 + return -EPIPE; 960 + 952 961 hwep = (ci->ep0_dir == TX) ? ci->ep0out : ci->ep0in; 953 962 ci->status->context = ci; 954 963 ci->status->complete = isr_setup_status_complete;
+3 -1
drivers/usb/dwc3/dwc3-pci.c
··· 249 249 250 250 return pm_runtime_get(&dwc3->dev); 251 251 } 252 + #endif /* CONFIG_PM */ 252 253 254 + #ifdef CONFIG_PM_SLEEP 253 255 static int dwc3_pci_pm_dummy(struct device *dev) 254 256 { 255 257 /* ··· 264 262 */ 265 263 return 0; 266 264 } 267 - #endif /* CONFIG_PM */ 265 + #endif /* CONFIG_PM_SLEEP */ 268 266 269 267 static struct dev_pm_ops dwc3_pci_dev_pm_ops = { 270 268 SET_SYSTEM_SLEEP_PM_OPS(dwc3_pci_pm_dummy, dwc3_pci_pm_dummy)
+4 -1
drivers/usb/dwc3/gadget.c
··· 884 884 return DWC3_TRB_NUM - 1; 885 885 } 886 886 887 - trbs_left = dep->trb_dequeue - dep->trb_enqueue - 1; 887 + trbs_left = dep->trb_dequeue - dep->trb_enqueue; 888 888 trbs_left &= (DWC3_TRB_NUM - 1); 889 + 890 + if (dep->trb_dequeue < dep->trb_enqueue) 891 + trbs_left--; 889 892 890 893 return trbs_left; 891 894 }
+1 -1
drivers/usb/gadget/function/f_eem.c
··· 342 342 struct sk_buff *skb2 = NULL; 343 343 struct usb_ep *in = port->in_ep; 344 344 int headroom, tailroom, padlen = 0; 345 - u16 len = skb->len; 345 + u16 len; 346 346 347 347 if (!skb) 348 348 return NULL;
+2
drivers/usb/gadget/udc/renesas_usb3.c
··· 106 106 107 107 /* DRD_CON */ 108 108 #define DRD_CON_PERI_CON BIT(24) 109 + #define DRD_CON_VBOUT BIT(0) 109 110 110 111 /* USB_INT_ENA_1 and USB_INT_STA_1 */ 111 112 #define USB_INT_1_B3_PLLWKUP BIT(31) ··· 364 363 { 365 364 /* FIXME: How to change host / peripheral mode as well? */ 366 365 usb3_set_bit(usb3, DRD_CON_PERI_CON, USB3_DRD_CON); 366 + usb3_clear_bit(usb3, DRD_CON_VBOUT, USB3_DRD_CON); 367 367 368 368 usb3_write(usb3, ~0, USB3_USB_INT_STA_1); 369 369 usb3_enable_irq_1(usb3, USB_INT_1_VBUS_CNG);
+5 -1
drivers/usb/host/xhci-ring.c
··· 850 850 spin_lock_irqsave(&xhci->lock, flags); 851 851 852 852 ep->stop_cmds_pending--; 853 + if (xhci->xhc_state & XHCI_STATE_REMOVING) { 854 + spin_unlock_irqrestore(&xhci->lock, flags); 855 + return; 856 + } 853 857 if (xhci->xhc_state & XHCI_STATE_DYING) { 854 858 xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb, 855 859 "Stop EP timer ran, but another timer marked " ··· 907 903 spin_unlock_irqrestore(&xhci->lock, flags); 908 904 xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb, 909 905 "Calling usb_hc_died()"); 910 - usb_hc_died(xhci_to_hcd(xhci)->primary_hcd); 906 + usb_hc_died(xhci_to_hcd(xhci)); 911 907 xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb, 912 908 "xHCI host controller is dead."); 913 909 }
+6 -2
drivers/usb/phy/phy-generic.c
··· 144 144 int usb_gen_phy_init(struct usb_phy *phy) 145 145 { 146 146 struct usb_phy_generic *nop = dev_get_drvdata(phy->dev); 147 + int ret; 147 148 148 149 if (!IS_ERR(nop->vcc)) { 149 150 if (regulator_enable(nop->vcc)) 150 151 dev_err(phy->dev, "Failed to enable power\n"); 151 152 } 152 153 153 - if (!IS_ERR(nop->clk)) 154 - clk_prepare_enable(nop->clk); 154 + if (!IS_ERR(nop->clk)) { 155 + ret = clk_prepare_enable(nop->clk); 156 + if (ret) 157 + return ret; 158 + } 155 159 156 160 nop_reset(nop); 157 161
+9 -2
drivers/usb/renesas_usbhs/mod.c
··· 282 282 if (usbhs_mod_is_host(priv)) 283 283 usbhs_write(priv, INTSTS1, ~irq_state.intsts1 & INTSTS1_MAGIC); 284 284 285 - usbhs_write(priv, BRDYSTS, ~irq_state.brdysts); 285 + /* 286 + * The driver should not clear the xxxSTS after the line of 287 + * "call irq callback functions" because each "if" statement is 288 + * possible to call the callback function for avoiding any side effects. 289 + */ 290 + if (irq_state.intsts0 & BRDY) 291 + usbhs_write(priv, BRDYSTS, ~irq_state.brdysts); 286 292 usbhs_write(priv, NRDYSTS, ~irq_state.nrdysts); 287 - usbhs_write(priv, BEMPSTS, ~irq_state.bempsts); 293 + if (irq_state.intsts0 & BEMP) 294 + usbhs_write(priv, BEMPSTS, ~irq_state.bempsts); 288 295 289 296 /* 290 297 * call irq callback functions