Commit b3ee8bdc authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Merge tag 'fixes-for-v3.19-rc2' of...

Merge tag 'fixes-for-v3.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb

 into usb-linus

Felipe writes:

usb: fixes for v3.19-rc2

First set of fixes for current -rc cycle. There are
a couple of build break fixes after Tony Lindgren's
recent MUSB patchset, some memory leak fixes also
with MUSB, a use-after-free fix with the UAC1
function. Atmel UDC got a fix for a possible hang
and another for DMA setting, while dwc2 learned to
kill requests in ->udc_stop() which fixes a few leaks
too.

One new device support here, dwc3 now supports Intel's
Sunrise Point.

Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parents 97bf6af1 6785a103
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -2567,7 +2567,7 @@ error:
 * s3c_hsotg_ep_disable - disable given endpoint
 * @ep: The endpoint to disable.
 */
static int s3c_hsotg_ep_disable(struct usb_ep *ep)
static int s3c_hsotg_ep_disable_force(struct usb_ep *ep, bool force)
{
	struct s3c_hsotg_ep *hs_ep = our_ep(ep);
	struct dwc2_hsotg *hsotg = hs_ep->parent;
@@ -2588,7 +2588,7 @@ static int s3c_hsotg_ep_disable(struct usb_ep *ep)

	spin_lock_irqsave(&hsotg->lock, flags);
	/* terminate all requests with shutdown */
	kill_all_requests(hsotg, hs_ep, -ESHUTDOWN, false);
	kill_all_requests(hsotg, hs_ep, -ESHUTDOWN, force);

	hsotg->fifo_map &= ~(1<<hs_ep->fifo_index);
	hs_ep->fifo_index = 0;
@@ -2609,6 +2609,10 @@ static int s3c_hsotg_ep_disable(struct usb_ep *ep)
	return 0;
}

static int s3c_hsotg_ep_disable(struct usb_ep *ep)
{
	return s3c_hsotg_ep_disable_force(ep, false);
}
/**
 * on_list - check request is on the given endpoint
 * @ep: The endpoint to check.
@@ -2924,7 +2928,7 @@ static int s3c_hsotg_udc_stop(struct usb_gadget *gadget)

	/* all endpoints should be shutdown */
	for (ep = 1; ep < hsotg->num_of_eps; ep++)
		s3c_hsotg_ep_disable(&hsotg->eps[ep].ep);
		s3c_hsotg_ep_disable_force(&hsotg->eps[ep].ep, true);

	spin_lock_irqsave(&hsotg->lock, flags);

+4 −0
Original line number Diff line number Diff line
@@ -33,6 +33,8 @@
#define PCI_DEVICE_ID_INTEL_BYT		0x0f37
#define PCI_DEVICE_ID_INTEL_MRFLD	0x119e
#define PCI_DEVICE_ID_INTEL_BSW		0x22B7
#define PCI_DEVICE_ID_INTEL_SPTLP	0x9d30
#define PCI_DEVICE_ID_INTEL_SPTH	0xa130

struct dwc3_pci {
	struct device		*dev;
@@ -219,6 +221,8 @@ static const struct pci_device_id dwc3_pci_id_table[] = {
	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BSW), },
	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BYT), },
	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_MRFLD), },
	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SPTLP), },
	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SPTH), },
	{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_NL_USB), },
	{  }	/* Terminating Entry */
};
+3 −2
Original line number Diff line number Diff line
@@ -399,8 +399,9 @@ static int hidg_setup(struct usb_function *f,
	value	= __le16_to_cpu(ctrl->wValue);
	length	= __le16_to_cpu(ctrl->wLength);

	VDBG(cdev, "hid_setup crtl_request : bRequestType:0x%x bRequest:0x%x "
		"Value:0x%x\n", ctrl->bRequestType, ctrl->bRequest, value);
	VDBG(cdev,
	     "%s crtl_request : bRequestType:0x%x bRequest:0x%x Value:0x%x\n",
	     __func__, ctrl->bRequestType, ctrl->bRequest, value);

	switch ((ctrl->bRequestType << 8) | ctrl->bRequest) {
	case ((USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE) << 8
+1 −1
Original line number Diff line number Diff line
@@ -520,7 +520,7 @@ static void f_midi_transmit(struct f_midi *midi, struct usb_request *req)
		req = midi_alloc_ep_req(ep, midi->buflen);

	if (!req) {
		ERROR(midi, "gmidi_transmit: alloc_ep_request failed\n");
		ERROR(midi, "%s: alloc_ep_request failed\n", __func__);
		return;
	}
	req->length = 0;
+1 −1
Original line number Diff line number Diff line
@@ -897,7 +897,6 @@ static void f_audio_free_inst(struct usb_function_instance *f)
	struct f_uac1_opts *opts;

	opts = container_of(f, struct f_uac1_opts, func_inst);
	gaudio_cleanup(opts->card);
	if (opts->fn_play_alloc)
		kfree(opts->fn_play);
	if (opts->fn_cap_alloc)
@@ -935,6 +934,7 @@ static void f_audio_free(struct usb_function *f)
	struct f_audio *audio = func_to_audio(f);
	struct f_uac1_opts *opts;

	gaudio_cleanup(&audio->card);
	opts = container_of(f->fi, struct f_uac1_opts, func_inst);
	kfree(audio);
	mutex_lock(&opts->lock);
Loading