Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 61c3dae6 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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"
parents 98ac9a60 6b98174b
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -949,6 +949,15 @@ static int isr_setup_status_phase(struct ci_hdrc *ci)
	int retval;
	struct ci_hw_ep *hwep;

	/*
	 * Unexpected USB controller behavior, caused by bad signal integrity
	 * or ground reference problems, can lead to isr_setup_status_phase
	 * being called with ci->status equal to NULL.
	 * If this situation occurs, you should review your USB hardware design.
	 */
	if (WARN_ON_ONCE(!ci->status))
		return -EPIPE;

	hwep = (ci->ep0_dir == TX) ? ci->ep0out : ci->ep0in;
	ci->status->context = ci;
	ci->status->complete = isr_setup_status_complete;
+3 −1
Original line number Diff line number Diff line
@@ -249,7 +249,9 @@ static int dwc3_pci_runtime_resume(struct device *dev)

	return pm_runtime_get(&dwc3->dev);
}
#endif /* CONFIG_PM */

#ifdef CONFIG_PM_SLEEP
static int dwc3_pci_pm_dummy(struct device *dev)
{
	/*
@@ -262,7 +264,7 @@ static int dwc3_pci_pm_dummy(struct device *dev)
	 */
	return 0;
}
#endif /* CONFIG_PM */
#endif /* CONFIG_PM_SLEEP */

static struct dev_pm_ops dwc3_pci_dev_pm_ops = {
	SET_SYSTEM_SLEEP_PM_OPS(dwc3_pci_pm_dummy, dwc3_pci_pm_dummy)
+4 −1
Original line number Diff line number Diff line
@@ -884,9 +884,12 @@ static u32 dwc3_calc_trbs_left(struct dwc3_ep *dep)
		return DWC3_TRB_NUM - 1;
	}

	trbs_left = dep->trb_dequeue - dep->trb_enqueue - 1;
	trbs_left = dep->trb_dequeue - dep->trb_enqueue;
	trbs_left &= (DWC3_TRB_NUM - 1);

	if (dep->trb_dequeue < dep->trb_enqueue)
		trbs_left--;

	return trbs_left;
}

+1 −1
Original line number Diff line number Diff line
@@ -342,7 +342,7 @@ static struct sk_buff *eem_wrap(struct gether *port, struct sk_buff *skb)
	struct sk_buff	*skb2 = NULL;
	struct usb_ep	*in = port->in_ep;
	int		headroom, tailroom, padlen = 0;
	u16		len = skb->len;
	u16		len;

	if (!skb)
		return NULL;
+2 −0
Original line number Diff line number Diff line
@@ -106,6 +106,7 @@

/* DRD_CON */
#define DRD_CON_PERI_CON	BIT(24)
#define DRD_CON_VBOUT		BIT(0)

/* USB_INT_ENA_1 and USB_INT_STA_1 */
#define USB_INT_1_B3_PLLWKUP	BIT(31)
@@ -363,6 +364,7 @@ static void usb3_init_epc_registers(struct renesas_usb3 *usb3)
{
	/* FIXME: How to change host / peripheral mode as well? */
	usb3_set_bit(usb3, DRD_CON_PERI_CON, USB3_DRD_CON);
	usb3_clear_bit(usb3, DRD_CON_VBOUT, USB3_DRD_CON);

	usb3_write(usb3, ~0, USB3_USB_INT_STA_1);
	usb3_enable_irq_1(usb3, USB_INT_1_VBUS_CNG);
Loading