* [PATCH 1/2] USB: dummy-hcd: increase max number of devices to 32
@ 2019-10-18 14:55 Andrey Konovalov
2019-10-18 14:55 ` [PATCH 2/2] USB: dummy-hcd: use usb_urb_dir_in instead of usb_pipein Andrey Konovalov
2019-10-18 18:06 ` [PATCH 1/2] USB: dummy-hcd: increase max number of devices to 32 Greg Kroah-Hartman
0 siblings, 2 replies; 4+ messages in thread
From: Andrey Konovalov @ 2019-10-18 14:55 UTC (permalink / raw)
To: linux-usb, linux-kernel, Greg Kroah-Hartman, Alan Stern
Cc: Felipe Balbi, Chunfeng Yun, Jacky . Cao @ sony . com,
Dmitry Vyukov, Andrey Konovalov
This patch increases the maximum number of Dummy UDC/HCD devices to 32.
---
drivers/usb/gadget/udc/dummy_hcd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/udc/dummy_hcd.c b/drivers/usb/gadget/udc/dummy_hcd.c
index 3d499d93c083..a8f1e5707c14 100644
--- a/drivers/usb/gadget/udc/dummy_hcd.c
+++ b/drivers/usb/gadget/udc/dummy_hcd.c
@@ -2725,7 +2725,7 @@ static struct platform_driver dummy_hcd_driver = {
};
/*-------------------------------------------------------------------------*/
-#define MAX_NUM_UDC 2
+#define MAX_NUM_UDC 32
static struct platform_device *the_udc_pdev[MAX_NUM_UDC];
static struct platform_device *the_hcd_pdev[MAX_NUM_UDC];
--
2.23.0.866.gb869b98d4c-goog
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] USB: dummy-hcd: use usb_urb_dir_in instead of usb_pipein
2019-10-18 14:55 [PATCH 1/2] USB: dummy-hcd: increase max number of devices to 32 Andrey Konovalov
@ 2019-10-18 14:55 ` Andrey Konovalov
2019-10-18 18:06 ` [PATCH 1/2] USB: dummy-hcd: increase max number of devices to 32 Greg Kroah-Hartman
1 sibling, 0 replies; 4+ messages in thread
From: Andrey Konovalov @ 2019-10-18 14:55 UTC (permalink / raw)
To: linux-usb, linux-kernel, Greg Kroah-Hartman, Alan Stern
Cc: Felipe Balbi, Chunfeng Yun, Jacky . Cao @ sony . com,
Dmitry Vyukov, Andrey Konovalov
Commit fea3409112a9 ("USB: add direction bit to urb->transfer_flags") has
added a usb_urb_dir_in() helper function that can be used to determine
the direction of the URB. With that patch USB_DIR_IN control requests with
wLength == 0 are considered out requests by real USB HCDs. This patch
changes dummy-hcd to use the usb_urb_dir_in() helper to match that
behavior.
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
---
drivers/usb/gadget/udc/dummy_hcd.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/usb/gadget/udc/dummy_hcd.c b/drivers/usb/gadget/udc/dummy_hcd.c
index a8f1e5707c14..4c9d1e49d5ed 100644
--- a/drivers/usb/gadget/udc/dummy_hcd.c
+++ b/drivers/usb/gadget/udc/dummy_hcd.c
@@ -1321,7 +1321,7 @@ static int dummy_perform_transfer(struct urb *urb, struct dummy_request *req,
u32 this_sg;
bool next_sg;
- to_host = usb_pipein(urb->pipe);
+ to_host = usb_urb_dir_in(urb);
rbuf = req->req.buf + req->req.actual;
if (!urb->num_sgs) {
@@ -1409,7 +1409,7 @@ static int transfer(struct dummy_hcd *dum_hcd, struct urb *urb,
/* FIXME update emulated data toggle too */
- to_host = usb_pipein(urb->pipe);
+ to_host = usb_urb_dir_in(urb);
if (unlikely(len == 0))
is_short = 1;
else {
@@ -1830,7 +1830,7 @@ static void dummy_timer(struct timer_list *t)
/* find the gadget's ep for this request (if configured) */
address = usb_pipeendpoint (urb->pipe);
- if (usb_pipein(urb->pipe))
+ if (usb_urb_dir_in(urb))
address |= USB_DIR_IN;
ep = find_endpoint(dum, address);
if (!ep) {
@@ -2385,7 +2385,7 @@ static inline ssize_t show_urb(char *buf, size_t size, struct urb *urb)
s = "?";
break;
} s; }),
- ep, ep ? (usb_pipein(urb->pipe) ? "in" : "out") : "",
+ ep, ep ? (usb_urb_dir_in(urb) ? "in" : "out") : "",
({ char *s; \
switch (usb_pipetype(urb->pipe)) { \
case PIPE_CONTROL: \
--
2.23.0.866.gb869b98d4c-goog
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] USB: dummy-hcd: increase max number of devices to 32
2019-10-18 14:55 [PATCH 1/2] USB: dummy-hcd: increase max number of devices to 32 Andrey Konovalov
2019-10-18 14:55 ` [PATCH 2/2] USB: dummy-hcd: use usb_urb_dir_in instead of usb_pipein Andrey Konovalov
@ 2019-10-18 18:06 ` Greg Kroah-Hartman
2019-10-21 12:35 ` Andrey Konovalov
1 sibling, 1 reply; 4+ messages in thread
From: Greg Kroah-Hartman @ 2019-10-18 18:06 UTC (permalink / raw)
To: Andrey Konovalov
Cc: linux-usb, linux-kernel, Alan Stern, Felipe Balbi, Chunfeng Yun,
Jacky . Cao @ sony . com, Dmitry Vyukov
On Fri, Oct 18, 2019 at 04:55:56PM +0200, Andrey Konovalov wrote:
> This patch increases the maximum number of Dummy UDC/HCD devices to 32.
Yes, that is a good description of _what_ the patch does, but it does
not tell us _why_ you want to do that.
Also, no signed-off-by, are you sure you ran your patches through
scripts/checkpatch.pl before sending it out? It's a good idea to do
so...
thanks,
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] USB: dummy-hcd: increase max number of devices to 32
2019-10-18 18:06 ` [PATCH 1/2] USB: dummy-hcd: increase max number of devices to 32 Greg Kroah-Hartman
@ 2019-10-21 12:35 ` Andrey Konovalov
0 siblings, 0 replies; 4+ messages in thread
From: Andrey Konovalov @ 2019-10-21 12:35 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: USB list, LKML, Alan Stern, Felipe Balbi, Chunfeng Yun,
Jacky . Cao @ sony . com, Dmitry Vyukov
On Fri, Oct 18, 2019 at 8:07 PM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> On Fri, Oct 18, 2019 at 04:55:56PM +0200, Andrey Konovalov wrote:
> > This patch increases the maximum number of Dummy UDC/HCD devices to 32.
>
> Yes, that is a good description of _what_ the patch does, but it does
> not tell us _why_ you want to do that.
Will do in v2, thanks!
> Also, no signed-off-by, are you sure you ran your patches through
> scripts/checkpatch.pl before sending it out? It's a good idea to do
> so...
Sorry, missed this, I thought the patch is small enough to not do that :)
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-10-21 12:35 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-18 14:55 [PATCH 1/2] USB: dummy-hcd: increase max number of devices to 32 Andrey Konovalov
2019-10-18 14:55 ` [PATCH 2/2] USB: dummy-hcd: use usb_urb_dir_in instead of usb_pipein Andrey Konovalov
2019-10-18 18:06 ` [PATCH 1/2] USB: dummy-hcd: increase max number of devices to 32 Greg Kroah-Hartman
2019-10-21 12:35 ` Andrey Konovalov
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.