linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] usb: gadget: serial: add supend resume support
@ 2020-04-23 11:55 Fabrice Gasnier
  2020-04-23 11:55 ` [PATCH v2 1/4] usb: dwc2: gadget: move gadget resume after the core is in L0 state Fabrice Gasnier
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Fabrice Gasnier @ 2020-04-23 11:55 UTC (permalink / raw)
  To: hminas, gregkh, balbi
  Cc: linux-usb, linux-kernel, linux-stm32, amelie.delaunay, fabrice.gasnier

This series handles an issue seen when doing basic testing using ACM or SERIAL
gadget functions like in [1], and using the DWC2 gadget driver. It occurs when
the HOST has suspended the bus before testing, in this order:
- On the device:
  cat /dev/ttyGS<Y>
  Dmesg error log is seen on device side:
  configfs-gadget gadget: acm ttyGS0 can't notify serial state, -11
- On the host:
  echo test > /dev/ttyACM<X>
  The bus resumes, but the serial link isn't functional.

So, implement suspend/resume callbacks in gadget serial drivers to handle this.
There is a precursor patch in DWC2 to enable submitting usb requests from the
gadget resume routine, once in L0 state.

[1] https://www.kernel.org/doc/html/latest/usb/gadget-testing.html#testing-the-acm-function

Changes in v2:
- update dwc2 with Minas suggestions

Fabrice Gasnier (4):
  usb: dwc2: gadget: move gadget resume after the core is in L0 state
  usb: gadget: u_serial: add suspend resume callbacks
  usb: gadget: f_serial: add suspend resume callbacks
  usb: gadget: f_acm: add suspend resume callbacks

 drivers/usb/dwc2/core_intr.c           |  7 +++--
 drivers/usb/gadget/function/f_acm.c    | 16 ++++++++++
 drivers/usb/gadget/function/f_serial.c | 16 ++++++++++
 drivers/usb/gadget/function/u_serial.c | 57 +++++++++++++++++++++++++++++-----
 drivers/usb/gadget/function/u_serial.h |  2 ++
 5 files changed, 88 insertions(+), 10 deletions(-)

-- 
2.7.4


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

end of thread, other threads:[~2020-04-23 13:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-23 11:55 [PATCH v2 0/4] usb: gadget: serial: add supend resume support Fabrice Gasnier
2020-04-23 11:55 ` [PATCH v2 1/4] usb: dwc2: gadget: move gadget resume after the core is in L0 state Fabrice Gasnier
2020-04-23 13:06   ` Minas Harutyunyan
2020-04-23 11:55 ` [PATCH v2 2/4] usb: gadget: u_serial: add suspend resume callbacks Fabrice Gasnier
2020-04-23 11:55 ` [PATCH v2 3/4] usb: gadget: f_serial: " Fabrice Gasnier
2020-04-23 11:55 ` [PATCH v2 4/4] usb: gadget: f_acm: " Fabrice Gasnier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).