All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Jookia <contact@jookia.org>
Cc: linux-usb@vger.kernel.org
Subject: Re: acm_port_shutdown hangs for 30 seconds
Date: Mon, 27 Jun 2022 14:57:17 +0200	[thread overview]
Message-ID: <YrmpLXcPeHW4fnvz@kroah.com> (raw)
In-Reply-To: <YiynBKeGJCMEkgyO@novena-choice-citizen>

On Sun, Mar 13, 2022 at 12:58:28AM +1100, Jookia wrote:
> 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?

It's a bug in your hardware, yes.

> - Can I reduce the timeout somehow?

You could, but then you risk the problem of hardware that needs delays
to not work properly.

What host controller driver is this showing up on?

thanks,

greg k-h

  reply	other threads:[~2022-06-27 12:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-12 13:58 acm_port_shutdown hangs for 30 seconds Jookia
2022-06-27 12:57 ` Greg KH [this message]
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=YrmpLXcPeHW4fnvz@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=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.