Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1182619 > unrolled thread

[PATCH v3 0/5] usb: gadget: miscellaneous fixes

Started byRobert Baldyga <r.baldyga@samsung.com>
First post2015-07-13 11:10 +0200
Last post2015-07-13 11:10 +0200
Articles 3 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH v3 0/5] usb: gadget: miscellaneous fixes Robert Baldyga <r.baldyga@samsung.com> - 2015-07-13 11:10 +0200
    [PATCH v3 3/5] usb: isp1760: udc: add missing  usb_ep_set_maxpacket_limit() Robert Baldyga <r.baldyga@samsung.com> - 2015-07-13 11:10 +0200
    [PATCH v3 2/5] usb: gadget: midi: avoid redundant f_midi_set_alt() call Robert Baldyga <r.baldyga@samsung.com> - 2015-07-13 11:10 +0200

#1182619 — [PATCH v3 0/5] usb: gadget: miscellaneous fixes

FromRobert Baldyga <r.baldyga@samsung.com>
Date2015-07-13 11:10 +0200
Subject[PATCH v3 0/5] usb: gadget: miscellaneous fixes
Message-ID<pLHUm-3aG-7@gated-at.bofh.it>
Hello,

This patch set contains few small bugfixes found in usb gadget functions
and UDC drivers. The most important is the [1] as it fixes bug causing
BUG_ON() in f_fs driver. Remaining patches contain minor fixes.

[1] usb: gadget: ffs: call functionfs_unbind() if _ffs_func_bind() fails

Best regards,
Robert Baldyga

Changelog:

v3:
- Addressed comments from Sergei Shtylyov.
- Applied Acks form Nicolas Ferre and Michal Nazarewicz.

v2: https://lkml.org/lkml/2015/7/8/285
- Addressed comments from Dan Carpenter and Sergei Shtylyov.

v1: https://lkml.org/lkml/2015/7/7/445

Robert Baldyga (5):
  usb: gadget: ffs: call functionfs_unbind() if _ffs_func_bind() fails
  usb: gadget: midi: avoid redundant f_midi_set_alt() call
  usb: isp1760: udc: add missing usb_ep_set_maxpacket_limit()
  staging: emxx_udc: add missing usb_ep_set_maxpacket_limit()
  usb: gadget: atmel_usba_udc: add missing ret value check

 drivers/staging/emxx_udc/emxx_udc.c     | 3 ++-
 drivers/usb/gadget/function/f_fs.c      | 8 +++++++-
 drivers/usb/gadget/function/f_midi.c    | 4 ++++
 drivers/usb/gadget/udc/atmel_usba_udc.c | 4 ++++
 drivers/usb/isp1760/isp1760-udc.c       | 4 ++--
 5 files changed, 19 insertions(+), 4 deletions(-)

-- 
1.9.1

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

[toc] | [next] | [standalone]


#1182622 — [PATCH v3 3/5] usb: isp1760: udc: add missing usb_ep_set_maxpacket_limit()

FromRobert Baldyga <r.baldyga@samsung.com>
Date2015-07-13 11:10 +0200
Subject[PATCH v3 3/5] usb: isp1760: udc: add missing usb_ep_set_maxpacket_limit()
Message-ID<pLHUn-3aG-31@gated-at.bofh.it>
In reply to#1182619
Since maxpacket_limit was introduced all UDC drivers should use
usb_ep_set_maxpacket_limit() function instead of setting maxpacket value
manually. ep.maxpacket_limit contains actual maximum maxpacket value
supported by hardware which is needed by epautoconf.

Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
---
 drivers/usb/isp1760/isp1760-udc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/isp1760/isp1760-udc.c b/drivers/usb/isp1760/isp1760-udc.c
index 18ebf5b1..3699962 100644
--- a/drivers/usb/isp1760/isp1760-udc.c
+++ b/drivers/usb/isp1760/isp1760-udc.c
@@ -1382,11 +1382,11 @@ static void isp1760_udc_init_eps(struct isp1760_udc *udc)
 		 * This fits in the 8kB FIFO without double-buffering.
 		 */
 		if (ep_num == 0) {
-			ep->ep.maxpacket = 64;
+			usb_ep_set_maxpacket_limit(&ep->ep, 64);
 			ep->maxpacket = 64;
 			udc->gadget.ep0 = &ep->ep;
 		} else {
-			ep->ep.maxpacket = 512;
+			usb_ep_set_maxpacket_limit(&ep->ep, 512);
 			ep->maxpacket = 0;
 			list_add_tail(&ep->ep.ep_list, &udc->gadget.ep_list);
 		}
-- 
1.9.1

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

[toc] | [prev] | [next] | [standalone]


#1182623 — [PATCH v3 2/5] usb: gadget: midi: avoid redundant f_midi_set_alt() call

FromRobert Baldyga <r.baldyga@samsung.com>
Date2015-07-13 11:10 +0200
Subject[PATCH v3 2/5] usb: gadget: midi: avoid redundant f_midi_set_alt() call
Message-ID<pLHUn-3aG-33@gated-at.bofh.it>
In reply to#1182619
Function midi registers two interfaces with single set_alt() function
which means that f_midi_set_alt() is called twice when configuration
is set. That means that endpoint initialization and ep request allocation
is done two times. To avoid this problem we do such things only once,
for interface number 1 (MIDI Streaming interface).

Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
---
 drivers/usb/gadget/function/f_midi.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/usb/gadget/function/f_midi.c b/drivers/usb/gadget/function/f_midi.c
index 6316aa5..4cef222 100644
--- a/drivers/usb/gadget/function/f_midi.c
+++ b/drivers/usb/gadget/function/f_midi.c
@@ -329,6 +329,10 @@ static int f_midi_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
 	unsigned i;
 	int err;
 
+	/* For Control Device interface we do nothing */
+	if (intf == 0)
+		return 0;
+
 	err = f_midi_start_ep(midi, f, midi->in_ep);
 	if (err)
 		return err;
-- 
1.9.1

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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web