mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiri Slaby <jirislaby@kernel.org>
To: Florian Fainelli <f.fainelli@gmail.com>, linux-serial@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Doug Berger <opendmb@gmail.com>,
	Al Cooper <alcooperx@gmail.com>,
	Broadcom internal kernel review list 
	<bcm-kernel-feedback-list@broadcom.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH v2] serial: 8250_bcm7271: Save/restore RTS in suspend/resume
Date: Mon, 4 Jul 2022 08:40:05 +0200	[thread overview]
Message-ID: <a7104148-2c11-8235-9282-5731639316f5@kernel.org> (raw)
In-Reply-To: <20220629160208.3167955-1-f.fainelli@gmail.com>

On 29. 06. 22, 18:02, Florian Fainelli wrote:
> From: Doug Berger <opendmb@gmail.com>
> 
> Commit 9cabe26e65a8 ("serial: 8250_bcm7271: UART errors after resuming
> from S2") prevented an early enabling of RTS during resume, but it did
> not actively restore the RTS state after resume.
> 
> Fixes: 9cabe26e65a8 ("serial: 8250_bcm7271: UART errors after resuming from S2")
> Signed-off-by: Doug Berger <opendmb@gmail.com>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
>   drivers/tty/serial/8250/8250_bcm7271.c | 24 ++++++++++++++++++------
>   1 file changed, 18 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/tty/serial/8250/8250_bcm7271.c b/drivers/tty/serial/8250/8250_bcm7271.c
> index 9b878d023dac..b9cea38c8aff 100644
> --- a/drivers/tty/serial/8250/8250_bcm7271.c
> +++ b/drivers/tty/serial/8250/8250_bcm7271.c
...
> @@ -1180,7 +1184,15 @@ static int __maybe_unused brcmuart_resume(struct device *dev)
>   		start_rx_dma(serial8250_get_port(priv->line));
>   	}
>   	serial8250_resume_port(priv->line);
> -	port->mctrl = priv->saved_mctrl;
> +
> +	if (priv->saved_mctrl & TIOCM_RTS) {
> +		/* Restore RTS */
> +		spin_lock_irqsave(&port->lock, flags);
> +		port->mctrl |= TIOCM_RTS;
> +		spin_unlock_irqrestore(&port->lock, flags);
> +		port->ops->set_mctrl(port, port->mctrl);

Calling ->set_mctrl w/o port->lock doesn't look really safe.

regards,
-- 
js
suse labs

  parent reply	other threads:[~2022-07-04  6:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-29 16:02 Florian Fainelli
2022-06-29 16:51 ` Greg Kroah-Hartman
2022-07-04  6:40 ` Jiri Slaby [this message]
2022-07-04 15:35   ` Florian Fainelli

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=a7104148-2c11-8235-9282-5731639316f5@kernel.org \
    --to=jirislaby@kernel.org \
    --cc=alcooperx@gmail.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=f.fainelli@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=opendmb@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®