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

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

Merge tag 'fixes-for-v4.6-rc3' of...

Merge tag 'fixes-for-v4.6-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-linus

Felipe writes:

usb: fixes for v4.6-rc3

We have two more fixes to f_midi. It should now
behave much better.

dwc3-keystone.c has gotten a fix which now allows it
to work on keystone device when running in
peripheral mode. A similar fix for DMA configuration
was made for udc-core, too.

We have a new PCI ID for Intel's Broxton
platform. DWC3 can run on those platforms as well.

And we also have some dwc2 got a fix for dr_mode
usage, while renesas controller got 3 important
fixes: a NULL pointer deref fix, IRQ <-> DMA race
fix, and a fix to prevent a situation where we would
queue a request to a disabled endpoint.
parents 5a07975a adf9a3ab
Loading
Loading
Loading
Loading
+18 −5
Original line number Original line Diff line number Diff line
@@ -2254,6 +2254,7 @@ void dwc2_hsotg_core_init_disconnected(struct dwc2_hsotg *hsotg,
{
{
	u32 intmsk;
	u32 intmsk;
	u32 val;
	u32 val;
	u32 usbcfg;


	/* Kill any ep0 requests as controller will be reinitialized */
	/* Kill any ep0 requests as controller will be reinitialized */
	kill_all_requests(hsotg, hsotg->eps_out[0], -ECONNRESET);
	kill_all_requests(hsotg, hsotg->eps_out[0], -ECONNRESET);
@@ -2267,10 +2268,16 @@ void dwc2_hsotg_core_init_disconnected(struct dwc2_hsotg *hsotg,
	 * set configuration.
	 * set configuration.
	 */
	 */


	/* keep other bits untouched (so e.g. forced modes are not lost) */
	usbcfg = dwc2_readl(hsotg->regs + GUSBCFG);
	usbcfg &= ~(GUSBCFG_TOUTCAL_MASK | GUSBCFG_PHYIF16 | GUSBCFG_SRPCAP |
		GUSBCFG_HNPCAP);

	/* set the PLL on, remove the HNP/SRP and set the PHY */
	/* set the PLL on, remove the HNP/SRP and set the PHY */
	val = (hsotg->phyif == GUSBCFG_PHYIF8) ? 9 : 5;
	val = (hsotg->phyif == GUSBCFG_PHYIF8) ? 9 : 5;
	dwc2_writel(hsotg->phyif | GUSBCFG_TOUTCAL(7) |
	usbcfg |= hsotg->phyif | GUSBCFG_TOUTCAL(7) |
	       (val << GUSBCFG_USBTRDTIM_SHIFT), hsotg->regs + GUSBCFG);
		(val << GUSBCFG_USBTRDTIM_SHIFT);
	dwc2_writel(usbcfg, hsotg->regs + GUSBCFG);


	dwc2_hsotg_init_fifo(hsotg);
	dwc2_hsotg_init_fifo(hsotg);


@@ -3031,6 +3038,7 @@ static struct usb_ep_ops dwc2_hsotg_ep_ops = {
static void dwc2_hsotg_init(struct dwc2_hsotg *hsotg)
static void dwc2_hsotg_init(struct dwc2_hsotg *hsotg)
{
{
	u32 trdtim;
	u32 trdtim;
	u32 usbcfg;
	/* unmask subset of endpoint interrupts */
	/* unmask subset of endpoint interrupts */


	dwc2_writel(DIEPMSK_TIMEOUTMSK | DIEPMSK_AHBERRMSK |
	dwc2_writel(DIEPMSK_TIMEOUTMSK | DIEPMSK_AHBERRMSK |
@@ -3054,11 +3062,16 @@ static void dwc2_hsotg_init(struct dwc2_hsotg *hsotg)


	dwc2_hsotg_init_fifo(hsotg);
	dwc2_hsotg_init_fifo(hsotg);


	/* keep other bits untouched (so e.g. forced modes are not lost) */
	usbcfg = dwc2_readl(hsotg->regs + GUSBCFG);
	usbcfg &= ~(GUSBCFG_TOUTCAL_MASK | GUSBCFG_PHYIF16 | GUSBCFG_SRPCAP |
		GUSBCFG_HNPCAP);

	/* set the PLL on, remove the HNP/SRP and set the PHY */
	/* set the PLL on, remove the HNP/SRP and set the PHY */
	trdtim = (hsotg->phyif == GUSBCFG_PHYIF8) ? 9 : 5;
	trdtim = (hsotg->phyif == GUSBCFG_PHYIF8) ? 9 : 5;
	dwc2_writel(hsotg->phyif | GUSBCFG_TOUTCAL(7) |
	usbcfg |= hsotg->phyif | GUSBCFG_TOUTCAL(7) |
		(trdtim << GUSBCFG_USBTRDTIM_SHIFT),
		(trdtim << GUSBCFG_USBTRDTIM_SHIFT);
		hsotg->regs + GUSBCFG);
	dwc2_writel(usbcfg, hsotg->regs + GUSBCFG);


	if (using_dma(hsotg))
	if (using_dma(hsotg))
		__orr32(hsotg->regs + GAHBCFG, GAHBCFG_DMA_EN);
		__orr32(hsotg->regs + GAHBCFG, GAHBCFG_DMA_EN);
+0 −5
Original line number Original line Diff line number Diff line
@@ -39,8 +39,6 @@
#define USBSS_IRQ_COREIRQ_EN	BIT(0)
#define USBSS_IRQ_COREIRQ_EN	BIT(0)
#define USBSS_IRQ_COREIRQ_CLR	BIT(0)
#define USBSS_IRQ_COREIRQ_CLR	BIT(0)


static u64 kdwc3_dma_mask;

struct dwc3_keystone {
struct dwc3_keystone {
	struct device			*dev;
	struct device			*dev;
	struct clk			*clk;
	struct clk			*clk;
@@ -108,9 +106,6 @@ static int kdwc3_probe(struct platform_device *pdev)
	if (IS_ERR(kdwc->usbss))
	if (IS_ERR(kdwc->usbss))
		return PTR_ERR(kdwc->usbss);
		return PTR_ERR(kdwc->usbss);


	kdwc3_dma_mask = dma_get_mask(dev);
	dev->dma_mask = &kdwc3_dma_mask;

	kdwc->clk = devm_clk_get(kdwc->dev, "usb");
	kdwc->clk = devm_clk_get(kdwc->dev, "usb");


	error = clk_prepare_enable(kdwc->clk);
	error = clk_prepare_enable(kdwc->clk);
+2 −0
Original line number Original line Diff line number Diff line
@@ -35,6 +35,7 @@
#define PCI_DEVICE_ID_INTEL_SPTLP		0x9d30
#define PCI_DEVICE_ID_INTEL_SPTLP		0x9d30
#define PCI_DEVICE_ID_INTEL_SPTH		0xa130
#define PCI_DEVICE_ID_INTEL_SPTH		0xa130
#define PCI_DEVICE_ID_INTEL_BXT			0x0aaa
#define PCI_DEVICE_ID_INTEL_BXT			0x0aaa
#define PCI_DEVICE_ID_INTEL_BXT_M		0x1aaa
#define PCI_DEVICE_ID_INTEL_APL			0x5aaa
#define PCI_DEVICE_ID_INTEL_APL			0x5aaa


static const struct acpi_gpio_params reset_gpios = { 0, 0, false };
static const struct acpi_gpio_params reset_gpios = { 0, 0, false };
@@ -213,6 +214,7 @@ static const struct pci_device_id dwc3_pci_id_table[] = {
	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SPTLP), },
	{ 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_INTEL, PCI_DEVICE_ID_INTEL_SPTH), },
	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BXT), },
	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BXT), },
	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BXT_M), },
	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_APL), },
	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_APL), },
	{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_NL_USB), },
	{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_NL_USB), },
	{  }	/* Terminating Entry */
	{  }	/* Terminating Entry */
+6 −2
Original line number Original line Diff line number Diff line
@@ -360,7 +360,9 @@ static int f_midi_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
	/* allocate a bunch of read buffers and queue them all at once. */
	/* allocate a bunch of read buffers and queue them all at once. */
	for (i = 0; i < midi->qlen && err == 0; i++) {
	for (i = 0; i < midi->qlen && err == 0; i++) {
		struct usb_request *req =
		struct usb_request *req =
			midi_alloc_ep_req(midi->out_ep, midi->buflen);
			midi_alloc_ep_req(midi->out_ep,
				max_t(unsigned, midi->buflen,
					bulk_out_desc.wMaxPacketSize));
		if (req == NULL)
		if (req == NULL)
			return -ENOMEM;
			return -ENOMEM;


@@ -609,8 +611,10 @@ static void f_midi_transmit(struct f_midi *midi)


	do {
	do {
		ret = f_midi_do_transmit(midi, ep);
		ret = f_midi_do_transmit(midi, ep);
		if (ret < 0)
		if (ret < 0) {
			spin_unlock_irqrestore(&midi->transmit_lock, flags);
			goto drop_out;
			goto drop_out;
		}
	} while (ret);
	} while (ret);


	spin_unlock_irqrestore(&midi->transmit_lock, flags);
	spin_unlock_irqrestore(&midi->transmit_lock, flags);
+0 −6
Original line number Original line Diff line number Diff line
@@ -371,12 +371,6 @@ int usb_add_gadget_udc_release(struct device *parent, struct usb_gadget *gadget,
	INIT_WORK(&gadget->work, usb_gadget_state_work);
	INIT_WORK(&gadget->work, usb_gadget_state_work);
	gadget->dev.parent = parent;
	gadget->dev.parent = parent;


#ifdef	CONFIG_HAS_DMA
	dma_set_coherent_mask(&gadget->dev, parent->coherent_dma_mask);
	gadget->dev.dma_parms = parent->dma_parms;
	gadget->dev.dma_mask = parent->dma_mask;
#endif

	if (release)
	if (release)
		gadget->dev.release = release;
		gadget->dev.release = release;
	else
	else
Loading