Pavitrakumar Managutte | 22 Oct 15:54 2014
Picon

[PATCH v3] usb: gadget: function: Remove redundant usb_free_all_descriptors

Removed usb_free_all_descriptors in the bind functions, which
results in double-free corruption of the descriptors on error path.
The usb descriptors are allocated by usb_assign_descriptors.

Signed-off-by: Pavitrakumar Managutte <pavitra1729@...>
Reviewed-by: Robert Baldyga <r.baldyga@...>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@...>
---
 drivers/usb/gadget/function/f_eem.c    |  1 -
 drivers/usb/gadget/function/f_hid.c    |  5 +++--
 drivers/usb/gadget/function/f_ncm.c    |  1 -
 drivers/usb/gadget/function/f_obex.c   |  1 -
 drivers/usb/gadget/function/f_phonet.c |  2 +-
 drivers/usb/gadget/function/f_rndis.c  |  5 +++--
 drivers/usb/gadget/function/f_subset.c |  1 -
 drivers/usb/gadget/function/f_uac2.c   | 10 ++++++----
 8 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/usb/gadget/function/f_eem.c b/drivers/usb/gadget/function/f_eem.c
index 4d8b236..c9e90de 100644
--- a/drivers/usb/gadget/function/f_eem.c
+++ b/drivers/usb/gadget/function/f_eem.c
 <at>  <at>  -325,7 +325,6  <at>  <at>  static int eem_bind(struct usb_configuration *c, struct usb_function *f)
 	return 0;

 fail:
-	usb_free_all_descriptors(f);
 	if (eem->port.out_ep)
 		eem->port.out_ep->driver_data = NULL;
 	if (eem->port.in_ep)
(Continue reading)

Pavitrakumar Managutte | 22 Oct 15:51 2014
Picon

[PATCH] usb: gadget: function: Remove redundant usb_free_all_descriptors

Removed usb_free_all_descriptors in the bind functions, which
results in double-free corruption of the descriptors on error path.
The usb descriptors are allocated by usb_assign_descriptors.

Signed-off-by: Pavitrakumar Managutte <pavitra1729@...>
Reviewed-by: Robert Baldyga <r.baldyga@...>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@...>
---
 drivers/usb/gadget/function/f_eem.c    |  1 -
 drivers/usb/gadget/function/f_hid.c    |  5 +++--
 drivers/usb/gadget/function/f_ncm.c    |  1 -
 drivers/usb/gadget/function/f_obex.c   |  1 -
 drivers/usb/gadget/function/f_phonet.c |  2 +-
 drivers/usb/gadget/function/f_rndis.c  |  5 +++--
 drivers/usb/gadget/function/f_subset.c |  1 -
 drivers/usb/gadget/function/f_uac2.c   | 10 ++++++----
 8 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/usb/gadget/function/f_eem.c b/drivers/usb/gadget/function/f_eem.c
index 4d8b236..c9e90de 100644
--- a/drivers/usb/gadget/function/f_eem.c
+++ b/drivers/usb/gadget/function/f_eem.c
 <at>  <at>  -325,7 +325,6  <at>  <at>  static int eem_bind(struct usb_configuration *c, struct usb_function *f)
 	return 0;

 fail:
-	usb_free_all_descriptors(f);
 	if (eem->port.out_ep)
 		eem->port.out_ep->driver_data = NULL;
 	if (eem->port.in_ep)
(Continue reading)

Peter Chen | 22 Oct 14:18 2014

[PATCH v2 0/4] chipidea: add basic system power management support

Changes for v2:

Patch[2/4]: since we have already added hw_wait_phy_stable at ci_usb_phy_init,
the same delay after ci_usb_phy_init at probe is duplicated.

This patch set adds the basic system power management. For glue layer,
I only add it for imx which I am familar with it and have hardware for it.
For msm, it has pm management at its phy driver, zevio and pci has no
pm (clock & phy) information for its driver, so I leave these three
glue layer driver no change, I add these three glue layer users to
cc list, and will wait one month for comments.

Peter Chen (4):
  usb: chipidea: remove the unnecessary delay after clear portsc.phcd
  usb: chipidea: add hw_wait_phy_stable for getting stable status
  usb: chipidea: add system power management support
  usb: chipidea: imx: add system power management support

 drivers/usb/chipidea/ci_hdrc_imx.c |   36 ++++++++++++++++
 drivers/usb/chipidea/core.c        |   82 +++++++++++++++++++++++++++++-------
 2 files changed, 102 insertions(+), 16 deletions(-)

--

-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@...
More majordomo info at  http://vger.kernel.org/majordomo-info.html

(Continue reading)

Peter Chen | 22 Oct 14:01 2014

[PATCH 1/3] usb: chipidea: remove flag CI_HDRC_REQUIRE_TRANSCEIVER

Now, USB PHY is mandatory for chipidea core, the flag
CI_HDRC_REQUIRE_TRANSCEIVER is useless.

Signed-off-by: Peter Chen <peter.chen@...>
---
 drivers/usb/chipidea/ci_hdrc_imx.c |    3 +--
 drivers/usb/chipidea/ci_hdrc_msm.c |    1 -
 include/linux/usb/chipidea.h       |    1 -
 3 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c
index aa66199..5341fe7 100644
--- a/drivers/usb/chipidea/ci_hdrc_imx.c
+++ b/drivers/usb/chipidea/ci_hdrc_imx.c
 <at>  <at>  -106,8 +106,7  <at>  <at>  static int ci_hdrc_imx_probe(struct platform_device *pdev)
 	struct ci_hdrc_platform_data pdata = {
 		.name		= dev_name(&pdev->dev),
 		.capoffset	= DEF_CAPOFFSET,
-		.flags		= CI_HDRC_REQUIRE_TRANSCEIVER |
-				  CI_HDRC_DISABLE_STREAMING,
+		.flags		= CI_HDRC_DISABLE_STREAMING,
 	};
 	int ret;
 	const struct of_device_id *of_id =
diff --git a/drivers/usb/chipidea/ci_hdrc_msm.c b/drivers/usb/chipidea/ci_hdrc_msm.c
index 4935ac3..74dcb3d 100644
--- a/drivers/usb/chipidea/ci_hdrc_msm.c
+++ b/drivers/usb/chipidea/ci_hdrc_msm.c
 <at>  <at>  -46,7 +46,6  <at>  <at>  static struct ci_hdrc_platform_data ci_hdrc_msm_platdata = {
 	.name			= "ci_hdrc_msm",
(Continue reading)

Andreas Sundstrom | 22 Oct 13:17 2014

HP switch USB serial console

Some newer switch models from HP has a usb2serial port in them.
I just got to try one out and it sort of works with the generic
usbserial driver.

The problem I am seeing is that it always use 9600 bps, even if I
specify 115200 or 19200.

Is it possible to troubleshoot this in any way, I can test patches if
needed.
This is on a vanilla 3.17.1 kernel.

Here are the details:
modprobe usbserial vendor=0x3f0 product=0x13f

[  188.018495] usbcore: registered new interface driver usbserial
[  188.018522] usbcore: registered new interface driver usbserial_generic
[  188.018547] usbserial: USB Serial support registered for generic
[  188.018575] usbserial_generic 3-2:1.0: Generic device with no bulk
out, not allowed.
[  188.018591] usbserial_generic: probe of 3-2:1.0 failed with error -5
[  188.018607] usbserial_generic 3-2:1.1: The "generic" usb-serial
driver is only for testing and one-off prototypes.
[  188.018612] usbserial_generic 3-2:1.1: Tell linux-usb@...
to add your device to a proper driver.
[  188.018617] usbserial_generic 3-2:1.1: generic converter detected
[  188.018828] usb 3-2: generic converter now attached to ttyUSB0

root <at> computer:/tmp# lsusb -vvv -d 03f0:013f

Bus 003 Device 003: ID 03f0:013f Hewlett-Packard
(Continue reading)

Jingoo Han | 22 Oct 04:52 2014

[PATCH] USB: imx21-hcd: use %pad for dma_addr_t

Use %pad for dma_addr_t, because a dma_addr_t type can vary
based on build options. So, it prevents the following build
warnings in printks.

drivers/usb/host/imx21-hcd.c:1175:2: warning: format '%X' expects argument of type 'unsigned int',
but argument 8 has type
'dma_addr_t' [-Wformat]
drivers/usb/host/imx21-hcd.c:1175:2: warning: format '%X' expects argument of type 'unsigned int',
but argument 10 has type
'dma_addr_t' [-Wformat]

Signed-off-by: Jingoo Han <jg1.han@...>
---
 drivers/usb/host/imx21-hcd.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/host/imx21-hcd.c b/drivers/usb/host/imx21-hcd.c
index 207bad9..eb4efba 100644
--- a/drivers/usb/host/imx21-hcd.c
+++ b/drivers/usb/host/imx21-hcd.c
 <at>  <at>  -1174,11 +1174,11  <at>  <at>  static int imx21_hc_urb_enqueue(struct usb_hcd *hcd,

 	dev_vdbg(imx21->dev,
 		"enqueue urb=%p ep=%p len=%d "
-		"buffer=%p dma=%08X setupBuf=%p setupDma=%08X\n",
+		"buffer=%p dma=%pad setupBuf=%p setupDma=%pad\n",
 		urb, ep,
 		urb->transfer_buffer_length,
-		urb->transfer_buffer, urb->transfer_dma,
-		urb->setup_packet, urb->setup_dma);
(Continue reading)

Jack Pham | 22 Oct 01:31 2014

[PATCH] usb: dwc3: gadget: Properly initialize LINK TRB

On ISOC endpoints the last trb_pool entry used as a
LINK TRB is not getting zeroed out correctly due to
memset being called incorrectly and in the wrong place.
If pool allocated from DMA was not zero-initialized
to begin with this will result in the size and ctrl
values being random garbage. Call memset correctly after
assignment of the trb_link pointer.

Fixes: f6bafc6a1c ("usb: dwc3: convert TRBs into bitshifts")
Signed-off-by: Jack Pham <jackp@...>
Cc: stable@...
---
 drivers/usb/dwc3/gadget.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 3818b26..f231b51 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
 <at>  <at>  -525,12 +525,11  <at>  <at>  static int __dwc3_gadget_ep_enable(struct dwc3_ep *dep,
 		if (!usb_endpoint_xfer_isoc(desc))
 			return 0;

-		memset(&trb_link, 0, sizeof(trb_link));
dinguyen | 21 Oct 22:31 2014

[PATCH] usb: dwc2: allow dwc2 to get built when USB_GADGET=m

From: Dinh Nguyen <dinguyen@...>

This patch allows the gadget portion of the DWC2 driver to get built when
(!USB && USB_GADGET) condition is encountered.

Signed-off-by: Dinh Nguyen <dinguyen@...>
---
 drivers/usb/dwc2/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/dwc2/Kconfig b/drivers/usb/dwc2/Kconfig
index f93807b..4d02718 100644
--- a/drivers/usb/dwc2/Kconfig
+++ b/drivers/usb/dwc2/Kconfig
 <at>  <at>  -1,6 +1,6  <at>  <at> 
 config USB_DWC2
 	bool "DesignWare USB2 DRD Core Support"
-	depends on USB
+	depends on USB || USB_GADGET
 	help
 	  Say Y here if your system has a Dual Role Hi-Speed USB
 	  controller based on the DesignWare HSOTG IP Core.
--

-- 
2.0.3

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@...
More majordomo info at  http://vger.kernel.org/majordomo-info.html

(Continue reading)

Joe Perches | 21 Oct 05:51 2014

[PATCH] usb: storage: Convert usb_stor_dbg to return void

No caller or macro uses the return value so make it void.

Signed-off-by: Joe Perches <joe@...>
---
This change is associated to a desire to eventually
change printk to return void.

 drivers/usb/storage/debug.c |  7 ++-----
 drivers/usb/storage/debug.h | 10 ++++++----
 2 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/drivers/usb/storage/debug.c b/drivers/usb/storage/debug.c
index e08f647..05bc379 100644
--- a/drivers/usb/storage/debug.c
+++ b/drivers/usb/storage/debug.c
 <at>  <at>  -179,17 +179,14  <at>  <at>  void usb_stor_show_sense(const struct us_data *us,
 	US_DEBUGPX("\n");
 }

-int usb_stor_dbg(const struct us_data *us, const char *fmt, ...)
+void usb_stor_dbg(const struct us_data *us, const char *fmt, ...)
 {
 	va_list args;
-	int r;

 	va_start(args, fmt);

-	r = dev_vprintk_emit(7, &us->pusb_dev->dev, fmt, args);
+	dev_vprintk_emit(7, &us->pusb_dev->dev, fmt, args);

(Continue reading)

Fabio Estevam | 21 Oct 03:50 2014
Picon

[PATCH] usb: chipidea: usbmisc_imx: Read MX53_USB_OTG_PHY_CTRL_1_OFFSET directly

From: Fabio Estevam <fabio.estevam@...>

There is no need to do an intermediate step for reading the 
MX53_USB_OTG_PHY_CTRL_1_OFFSET register.

Read it directly instead.

Signed-off-by: Fabio Estevam <fabio.estevam@...>
---
 drivers/usb/chipidea/usbmisc_imx.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
index 29200eb..58591e9 100644
--- a/drivers/usb/chipidea/usbmisc_imx.c
+++ b/drivers/usb/chipidea/usbmisc_imx.c
 <at>  <at>  -171,8 +171,7  <at>  <at>  static int usbmisc_imx53_init(struct imx_usbmisc_data *data)
 		return -EINVAL;

 	/* Select a 24 MHz reference clock for the PHY  */
-	reg = usbmisc->base + MX53_USB_OTG_PHY_CTRL_1_OFFSET;
-	val = readl(reg);
+	val = readl(usbmisc->base + MX53_USB_OTG_PHY_CTRL_1_OFFSET);
 	val &= ~MX53_USB_PHYCTRL1_PLLDIV_MASK;
 	val |= MX53_USB_PLL_DIV_24_MHZ;
 	writel(val, usbmisc->base + MX53_USB_OTG_PHY_CTRL_1_OFFSET);
--

-- 
1.9.1

--
(Continue reading)

dinguyen | 20 Oct 20:51 2014

[PATCHv5 0/7] usb: dwc2: Add support for dual-role

From: Dinh Nguyen <dinguyen@...>

Hello,

This is version 5 of the patch series that combines the dwc2 gadget and host
driver into a single dual role driver. Here are the main differences from V4:

- Squashed 5 patches from V4 into patch 2. Patchset is now only 7 patches.
- Makefile moved to be the last patch in the series.
- When building for kernel modules, dwc2.ko will get built for all modes(host,
  gadget, and dual-role). dwc2_platform.ko and dwc2_pci.ko will get built
  for platform SOC and PCI.

For v5, the series is rebased on top of v3.18-rc1.

As usual, tested on SOCFPGA(host, gadget, and dual-role) and on Rpi-B
(host mode only).

I have pushed this series to a git repo to make it more convenient for people
to test/review.

git://git.rocketboards.org/linux-socfpga-next.git dwc2_dual_role_v5

Thanks,

Dinh Nguyen (7):
  usb: dwc2: Update the gadget driver to use common dwc2_hsotg structure
  usb: dwc2: Move gadget probe function into platform code
  usb: dwc2: Initialize the USB core for peripheral mode
  usb: dwc2: Update common interrupt handler to call gadget interrupt
(Continue reading)


Gmane