From: Greg KH <gregkh@linuxfoundation.org>
To: Dmitry Smirnov <d.smirnov@inbox.lv>
Cc: linux-usb@vger.kernel.org
Subject: Re: [PATCH V3] usb: mos7840: Fix hangup after suspend
Date: Wed, 12 Jun 2024 09:56:53 +0200 [thread overview]
Message-ID: <2024061214-concerned-retention-a91c@gregkh> (raw)
In-Reply-To: <20240611172311.2498-1-d.smirnov@inbox.lv>
On Tue, Jun 11, 2024 at 08:23:11PM +0300, Dmitry Smirnov wrote:
> This patch addresses a kernel hang issue with the mos7840 driver when
> PC resuming from a suspend with a device connected to the serial port.
>
> This patch introduces two new functions: mos7840_suspend() and mos7840_resume().
>
> Tested with Delock 87414 USB 2.0 to 4x serial adapter.
>
> Signed-off-by: Dmitry Smirnov <d.smirnov@inbox.lv>
> ---
> V3: Addressed review comments from previous submits
>
> drivers/usb/serial/mos7840.c | 51 ++++++++++++++++++++++++++++++++++++
> 1 file changed, 51 insertions(+)
>
> diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c
> index 8b0308d84270..3e5f761f4925 100644
> --- a/drivers/usb/serial/mos7840.c
> +++ b/drivers/usb/serial/mos7840.c
> @@ -1737,6 +1737,55 @@ static void mos7840_port_remove(struct usb_serial_port *port)
> kfree(mos7840_port);
> }
>
> +static int mos7840_suspend(struct usb_serial *serial, pm_message_t message)
> +{
> + struct moschip_port *mos7840_port;
> + struct usb_serial_port *port;
> + int i;
> +
> + dev_dbg(&serial->interface->dev, "mos7840_suspend\n");
ftrace is your friend, there is no need for debug lines like this
anymore.
> +
> + for (i = 0; i < serial->num_ports; ++i) {
> + port = serial->port[i];
> + if (!tty_port_initialized(&port->port))
> + continue;
> +
> + mos7840_port = usb_get_serial_port_data(port);
> +
> + usb_kill_urb(mos7840_port->read_urb);
> + mos7840_port->read_urb_busy = false;
> + }
> + return 0;
> +}
> +
> +static int mos7840_resume(struct usb_serial *serial)
> +{
> + struct moschip_port *mos7840_port;
> + struct usb_serial_port *port;
> + int res;
> + int i;
> +
> + dev_dbg(&serial->interface->dev, "mos7840_resume\n");
Same here, not needed.
thanks,
greg k-h
next prev parent reply other threads:[~2024-06-12 7:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-11 17:23 [PATCH V3] usb: mos7840: Fix hangup after suspend Dmitry Smirnov
2024-06-12 7:56 ` Greg KH [this message]
2024-06-12 12:00 ` Dmitry Smirnov
2024-06-12 12:24 ` Greg KH
2024-06-12 13:19 ` Dmitry Smirnov
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=2024061214-concerned-retention-a91c@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=d.smirnov@inbox.lv \
--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.