All of lore.kernel.org
 help / color / mirror / Atom feed
* [Bug 212045] New: dwc2 gadget mode read call blocks
@ 2021-03-03 23:51 bugzilla-daemon
  2021-03-05  9:30 ` [Bug 212045] " bugzilla-daemon
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: bugzilla-daemon @ 2021-03-03 23:51 UTC (permalink / raw)
  To: linux-usb

https://bugzilla.kernel.org/show_bug.cgi?id=212045

            Bug ID: 212045
           Summary: dwc2 gadget mode read call blocks
           Product: Drivers
           Version: 2.5
    Kernel Version: 5.9
          Hardware: All
                OS: Linux
              Tree: Mainline
            Status: NEW
          Severity: normal
          Priority: P1
         Component: USB
          Assignee: drivers_usb@kernel-bugs.kernel.org
          Reporter: tomasz@grobelny.net
        Regression: No

When implementing USB gadget on Odroid N2 I write descriptors for two endpoints
so I get ep0, ep1 and ep2 files. I open those files and try to read from ep0
and ep2. While ep0 more or less works, for ep2 I get weird behaviour: the
select() call returns 1 indicating that there is data to read and then read()
call blocks. It happens even if I set the file descriptor to O_NONBLOCK. Here
is the kernel log: https://pastebin.pl/view/aaa2d7f0

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug 212045] dwc2 gadget mode read call blocks
  2021-03-03 23:51 [Bug 212045] New: dwc2 gadget mode read call blocks bugzilla-daemon
@ 2021-03-05  9:30 ` bugzilla-daemon
  2021-03-05 10:37 ` bugzilla-daemon
  2021-03-10 10:13 ` bugzilla-daemon
  2 siblings, 0 replies; 4+ messages in thread
From: bugzilla-daemon @ 2021-03-05  9:30 UTC (permalink / raw)
  To: linux-usb

https://bugzilla.kernel.org/show_bug.cgi?id=212045

Minas Harutyunyan (Minas.Harutyunyan@synopsys.com) changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |Minas.Harutyunyan@synopsys.
                   |                            |com

--- Comment #4 from Minas Harutyunyan (Minas.Harutyunyan@synopsys.com) ---
According to dmesg, you use follow EP's: ep0in, ep0out, ep1in and ep1out. Why
you refer to not used ep2?

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug 212045] dwc2 gadget mode read call blocks
  2021-03-03 23:51 [Bug 212045] New: dwc2 gadget mode read call blocks bugzilla-daemon
  2021-03-05  9:30 ` [Bug 212045] " bugzilla-daemon
@ 2021-03-05 10:37 ` bugzilla-daemon
  2021-03-10 10:13 ` bugzilla-daemon
  2 siblings, 0 replies; 4+ messages in thread
From: bugzilla-daemon @ 2021-03-05 10:37 UTC (permalink / raw)
  To: linux-usb

https://bugzilla.kernel.org/show_bug.cgi?id=212045

--- Comment #5 from Tomasz Grobelny (tomasz@grobelny.net) ---
The files that functionfs exposes are ep0 (for reading, events), ep1 (for
writing, direction: to host) and ep2 (for reading, direction: to gadget). Not
sure how and why they are named in dmesg. You can find the gadget configuration
here:
https://github.com/tomasz-grobelny/AACS/blob/master/AAServer/src/descriptors.cpp
- line 75 and 84:
                    .bEndpointAddress = 1 | USB_DIR_IN,
                    .bEndpointAddress = 2 | USB_DIR_OUT,

The code that fails/hangs is readWraper function here:
https://github.com/tomasz-grobelny/AACS/blob/master/AAServer/src/AaCommunicator.cpp:493

select succeeds for ep2 and the read blocks. Exactly same function works ok for
ep0 for all 3 hosts that I tested on and the code works fully ok for 2 out of 3
hosts that I tested on. I also know that in principle the 3rd host also should
work because it works with other devices.

Maybe lack of ep2 in the logs is something interesting?

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug 212045] dwc2 gadget mode read call blocks
  2021-03-03 23:51 [Bug 212045] New: dwc2 gadget mode read call blocks bugzilla-daemon
  2021-03-05  9:30 ` [Bug 212045] " bugzilla-daemon
  2021-03-05 10:37 ` bugzilla-daemon
@ 2021-03-10 10:13 ` bugzilla-daemon
  2 siblings, 0 replies; 4+ messages in thread
From: bugzilla-daemon @ 2021-03-10 10:13 UTC (permalink / raw)
  To: linux-usb

https://bugzilla.kernel.org/show_bug.cgi?id=212045

--- Comment #7 from Tomasz Grobelny (tomasz@grobelny.net) ---
What do you mean by "function driver"? The userspace code that actually opens
the ep0/ep1/ep2 files exposed by functionfs? It works correctly for other
hosts.

I don't have any more data to argue it is dwc2, but still seems like an issue
in kernel USB subsystem.

Another question that might help debugging it: is it the host that should open
the ep2 endpoint? In other words: is it the host that is directly responsible
for lack of any mention of ep2 in dmesg output after the device was
reinitialized?

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-03-10 10:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-03 23:51 [Bug 212045] New: dwc2 gadget mode read call blocks bugzilla-daemon
2021-03-05  9:30 ` [Bug 212045] " bugzilla-daemon
2021-03-05 10:37 ` bugzilla-daemon
2021-03-10 10:13 ` bugzilla-daemon

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.