All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jookia <contact@jookia.org>
To: linux-usb@vger.kernel.org
Subject: acm_port_shutdown hangs for 30 seconds
Date: Sun, 13 Mar 2022 00:58:28 +1100	[thread overview]
Message-ID: <YiynBKeGJCMEkgyO@novena-choice-citizen> (raw)

Hello there,

I've been banging my head against this issue over the years but sat down
and started to debug it today.

When I try to quit GNU screen, minicom or another serial program it
sometimes hangs for around 30 seconds.

To reproduce I do this:

1. Connect an Arduino Micro with stock LED blink firmware
2. Run 'screen /dev/ttyACM1 9600'
3. Type some letters (no response from the board is given)
4. Quit in some way

If I skip step 3 (typing letters), the hang does not happen.

In userspace the hang happens at a call to close() on the TTY, and using
perf and ftrace it looks to be spending a lot of time poisoning urbs in
acm_port_shutdown.
This kind of makes sense to me as there is some in flight data to be
sent and there's no acknowledgement coming from the chip.

I've had this issue with embedded Linux boards too that for some reason
or another have stopped functioning.
The current solution I have is to forcefully unplug the board, but
that's not ideal.

My questions are:

- Is this a bug?
- Can I reduce the timeout somehow?

Thanks for your time,
Jookia.

             reply	other threads:[~2022-03-12 13:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-12 13:58 Jookia [this message]
2022-06-27 12:57 ` acm_port_shutdown hangs for 30 seconds Greg KH
2022-06-28  9:21   ` Jookia
2022-06-29  8:37     ` Greg KH
2022-06-29 10:20       ` Jookia
2022-06-29 12:01 ` Oliver Neukum
2022-06-30 12:31   ` Jookia

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YiynBKeGJCMEkgyO@novena-choice-citizen \
    --to=contact@jookia.org \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.