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

Commit d7940b04 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6:
  USB: unbind all interfaces before rebinding them
  USB: serial: digi_acceleport: Eliminate a NULL pointer dereference
  usb: fix ehci_hcd build failure when both generic-OF and xilinx is selected
  USB: cdc-acm: fix resource reclaim in error path of acm_probe
  USB: ftdi_sio: fix DTR/RTS line modes
  USB: s3c-hsotg: Ensure FIFOs are fully flushed after layout
  USB: s3c-hsotg: SoftDisconnect minimum 3ms
  USB: s3c-hsotg: Ensure TX FIFO addresses setup when initialising FIFOs
  USB: s3c_hsotg: define USB_GADGET_DUALSPEED in Kconfig
  USB: s3c: Enable soft disconnect during initialization
  USB: xhci: Print NEC firmware version.
  USB: xhci: Wait for host to start running.
  USB: xhci: Wait for controller to be ready after reset.
  USB: isp1362: fix inw warning on Blackfin systems
  USB: mos7840: fix null-pointer dereference
parents 683eb947 c043f124
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -1201,7 +1201,7 @@ static int acm_probe(struct usb_interface *intf,
		if (rcv->urb == NULL) {
		if (rcv->urb == NULL) {
			dev_dbg(&intf->dev,
			dev_dbg(&intf->dev,
				"out of memory (read urbs usb_alloc_urb)\n");
				"out of memory (read urbs usb_alloc_urb)\n");
			goto alloc_fail7;
			goto alloc_fail6;
		}
		}


		rcv->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
		rcv->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
@@ -1225,7 +1225,7 @@ static int acm_probe(struct usb_interface *intf,
		if (snd->urb == NULL) {
		if (snd->urb == NULL) {
			dev_dbg(&intf->dev,
			dev_dbg(&intf->dev,
				"out of memory (write urbs usb_alloc_urb)");
				"out of memory (write urbs usb_alloc_urb)");
			goto alloc_fail7;
			goto alloc_fail8;
		}
		}


		if (usb_endpoint_xfer_int(epwrite))
		if (usb_endpoint_xfer_int(epwrite))
@@ -1264,6 +1264,7 @@ static int acm_probe(struct usb_interface *intf,
		i = device_create_file(&intf->dev,
		i = device_create_file(&intf->dev,
						&dev_attr_iCountryCodeRelDate);
						&dev_attr_iCountryCodeRelDate);
		if (i < 0) {
		if (i < 0) {
			device_remove_file(&intf->dev, &dev_attr_wCountryCodes);
			kfree(acm->country_codes);
			kfree(acm->country_codes);
			goto skip_countries;
			goto skip_countries;
		}
		}
@@ -1300,6 +1301,7 @@ static int acm_probe(struct usb_interface *intf,
		usb_free_urb(acm->wb[i].urb);
		usb_free_urb(acm->wb[i].urb);
alloc_fail7:
alloc_fail7:
	acm_read_buffers_free(acm);
	acm_read_buffers_free(acm);
alloc_fail6:
	for (i = 0; i < num_rx_buf; i++)
	for (i = 0; i < num_rx_buf; i++)
		usb_free_urb(acm->ru[i].urb);
		usb_free_urb(acm->ru[i].urb);
	usb_free_urb(acm->ctrlurb);
	usb_free_urb(acm->ctrlurb);
+2 −0
Original line number Original line Diff line number Diff line
@@ -1328,6 +1328,7 @@ int usb_resume(struct device *dev, pm_message_t msg)


	/* For all other calls, take the device back to full power and
	/* For all other calls, take the device back to full power and
	 * tell the PM core in case it was autosuspended previously.
	 * tell the PM core in case it was autosuspended previously.
	 * Unbind the interfaces that will need rebinding later.
	 */
	 */
	} else {
	} else {
		status = usb_resume_both(udev, msg);
		status = usb_resume_both(udev, msg);
@@ -1336,6 +1337,7 @@ int usb_resume(struct device *dev, pm_message_t msg)
			pm_runtime_set_active(dev);
			pm_runtime_set_active(dev);
			pm_runtime_enable(dev);
			pm_runtime_enable(dev);
			udev->last_busy = jiffies;
			udev->last_busy = jiffies;
			do_unbind_rebind(udev, DO_REBIND);
		}
		}
	}
	}


+1 −0
Original line number Original line Diff line number Diff line
@@ -295,6 +295,7 @@ config USB_GADGET_S3C_HSOTG
	boolean "S3C HS/OtG USB Device controller"
	boolean "S3C HS/OtG USB Device controller"
	depends on S3C_DEV_USB_HSOTG
	depends on S3C_DEV_USB_HSOTG
	select USB_GADGET_S3C_HSOTG_PIO
	select USB_GADGET_S3C_HSOTG_PIO
	select USB_GADGET_DUALSPEED
	help
	help
	  The Samsung S3C64XX USB2.0 high-speed gadget controller
	  The Samsung S3C64XX USB2.0 high-speed gadget controller
	  integrated into the S3C64XX series SoC.
	  integrated into the S3C64XX series SoC.
+57 −0
Original line number Original line Diff line number Diff line
@@ -297,6 +297,12 @@ static void s3c_hsotg_ctrl_epint(struct s3c_hsotg *hsotg,
 */
 */
static void s3c_hsotg_init_fifo(struct s3c_hsotg *hsotg)
static void s3c_hsotg_init_fifo(struct s3c_hsotg *hsotg)
{
{
	unsigned int ep;
	unsigned int addr;
	unsigned int size;
	int timeout;
	u32 val;

	/* the ryu 2.6.24 release ahs
	/* the ryu 2.6.24 release ahs
	   writel(0x1C0, hsotg->regs + S3C_GRXFSIZ);
	   writel(0x1C0, hsotg->regs + S3C_GRXFSIZ);
	   writel(S3C_GNPTXFSIZ_NPTxFStAddr(0x200) |
	   writel(S3C_GNPTXFSIZ_NPTxFStAddr(0x200) |
@@ -310,6 +316,51 @@ static void s3c_hsotg_init_fifo(struct s3c_hsotg *hsotg)
	writel(S3C_GNPTXFSIZ_NPTxFStAddr(2048) |
	writel(S3C_GNPTXFSIZ_NPTxFStAddr(2048) |
	       S3C_GNPTXFSIZ_NPTxFDep(0x1C0),
	       S3C_GNPTXFSIZ_NPTxFDep(0x1C0),
	       hsotg->regs + S3C_GNPTXFSIZ);
	       hsotg->regs + S3C_GNPTXFSIZ);

	/* arange all the rest of the TX FIFOs, as some versions of this
	 * block have overlapping default addresses. This also ensures
	 * that if the settings have been changed, then they are set to
	 * known values. */

	/* start at the end of the GNPTXFSIZ, rounded up */
	addr = 2048 + 1024;
	size = 768;

	/* currently we allocate TX FIFOs for all possible endpoints,
	 * and assume that they are all the same size. */

	for (ep = 0; ep <= 15; ep++) {
		val = addr;
		val |= size << S3C_DPTXFSIZn_DPTxFSize_SHIFT;
		addr += size;

		writel(val, hsotg->regs + S3C_DPTXFSIZn(ep));
	}

	/* according to p428 of the design guide, we need to ensure that
	 * all fifos are flushed before continuing */

	writel(S3C_GRSTCTL_TxFNum(0x10) | S3C_GRSTCTL_TxFFlsh |
	       S3C_GRSTCTL_RxFFlsh, hsotg->regs + S3C_GRSTCTL);

	/* wait until the fifos are both flushed */
	timeout = 100;
	while (1) {
		val = readl(hsotg->regs + S3C_GRSTCTL);

		if ((val & (S3C_GRSTCTL_TxFFlsh | S3C_GRSTCTL_RxFFlsh)) == 0)
			break;

		if (--timeout == 0) {
			dev_err(hsotg->dev,
				"%s: timeout flushing fifos (GRSTCTL=%08x)\n",
				__func__, val);
		}

		udelay(1);
	}

	dev_dbg(hsotg->dev, "FIFOs reset, timeout at %d\n", timeout);
}
}


/**
/**
@@ -2574,6 +2625,9 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
	writel(S3C_DCTL_CGOUTNak | S3C_DCTL_CGNPInNAK,
	writel(S3C_DCTL_CGOUTNak | S3C_DCTL_CGNPInNAK,
	       hsotg->regs + S3C_DCTL);
	       hsotg->regs + S3C_DCTL);


	/* must be at-least 3ms to allow bus to see disconnect */
	msleep(3);

	/* remove the soft-disconnect and let's go */
	/* remove the soft-disconnect and let's go */
	__bic32(hsotg->regs + S3C_DCTL, S3C_DCTL_SftDiscon);
	__bic32(hsotg->regs + S3C_DCTL, S3C_DCTL_SftDiscon);


@@ -2730,6 +2784,9 @@ static void s3c_hsotg_init(struct s3c_hsotg *hsotg)


	writel(0, hsotg->regs + S3C_DAINTMSK);
	writel(0, hsotg->regs + S3C_DAINTMSK);


	/* Be in disconnected state until gadget is registered */
	__orr32(hsotg->regs + S3C_DCTL, S3C_DCTL_SftDiscon);

	if (0) {
	if (0) {
		/* post global nak until we're ready */
		/* post global nak until we're ready */
		writel(S3C_DCTL_SGNPInNAK | S3C_DCTL_SGOUTNak,
		writel(S3C_DCTL_SGNPInNAK | S3C_DCTL_SGOUTNak,
+17 −3
Original line number Original line Diff line number Diff line
@@ -1135,7 +1135,7 @@ MODULE_LICENSE ("GPL");


#ifdef CONFIG_XPS_USB_HCD_XILINX
#ifdef CONFIG_XPS_USB_HCD_XILINX
#include "ehci-xilinx-of.c"
#include "ehci-xilinx-of.c"
#define OF_PLATFORM_DRIVER	ehci_hcd_xilinx_of_driver
#define XILINX_OF_PLATFORM_DRIVER	ehci_hcd_xilinx_of_driver
#endif
#endif


#ifdef CONFIG_PLAT_ORION
#ifdef CONFIG_PLAT_ORION
@@ -1159,7 +1159,8 @@ MODULE_LICENSE ("GPL");
#endif
#endif


#if !defined(PCI_DRIVER) && !defined(PLATFORM_DRIVER) && \
#if !defined(PCI_DRIVER) && !defined(PLATFORM_DRIVER) && \
    !defined(PS3_SYSTEM_BUS_DRIVER) && !defined(OF_PLATFORM_DRIVER)
    !defined(PS3_SYSTEM_BUS_DRIVER) && !defined(OF_PLATFORM_DRIVER) && \
    !defined(XILINX_OF_PLATFORM_DRIVER)
#error "missing bus glue for ehci-hcd"
#error "missing bus glue for ehci-hcd"
#endif
#endif


@@ -1213,10 +1214,20 @@ static int __init ehci_hcd_init(void)
	if (retval < 0)
	if (retval < 0)
		goto clean3;
		goto clean3;
#endif
#endif

#ifdef XILINX_OF_PLATFORM_DRIVER
	retval = of_register_platform_driver(&XILINX_OF_PLATFORM_DRIVER);
	if (retval < 0)
		goto clean4;
#endif
	return retval;
	return retval;


#ifdef XILINX_OF_PLATFORM_DRIVER
	/* of_unregister_platform_driver(&XILINX_OF_PLATFORM_DRIVER); */
clean4:
#endif
#ifdef OF_PLATFORM_DRIVER
#ifdef OF_PLATFORM_DRIVER
	/* of_unregister_platform_driver(&OF_PLATFORM_DRIVER); */
	of_unregister_platform_driver(&OF_PLATFORM_DRIVER);
clean3:
clean3:
#endif
#endif
#ifdef PS3_SYSTEM_BUS_DRIVER
#ifdef PS3_SYSTEM_BUS_DRIVER
@@ -1243,6 +1254,9 @@ module_init(ehci_hcd_init);


static void __exit ehci_hcd_cleanup(void)
static void __exit ehci_hcd_cleanup(void)
{
{
#ifdef XILINX_OF_PLATFORM_DRIVER
	of_unregister_platform_driver(&XILINX_OF_PLATFORM_DRIVER);
#endif
#ifdef OF_PLATFORM_DRIVER
#ifdef OF_PLATFORM_DRIVER
	of_unregister_platform_driver(&OF_PLATFORM_DRIVER);
	of_unregister_platform_driver(&OF_PLATFORM_DRIVER);
#endif
#endif
Loading