All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Jiri Slaby <jirislaby@kernel.org>,
	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:35:57 -0700	[thread overview]
Message-ID: <f422b4f7-75ca-8337-e099-fea9cf879b4c@gmail.com> (raw)
In-Reply-To: <a7104148-2c11-8235-9282-5731639316f5@kernel.org>



On 7/3/2022 11:40 PM, Jiri Slaby wrote:
> 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.

Good point, I will check with Doug whether this was intentional and if 
so, why, and if not why should we move it up under the spinlock.

Thanks!
-- 
Florian

      reply	other threads:[~2022-07-04 15:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-29 16:02 [PATCH v2] serial: 8250_bcm7271: Save/restore RTS in suspend/resume Florian Fainelli
2022-06-29 16:51 ` Greg Kroah-Hartman
2022-07-04  6:40 ` Jiri Slaby
2022-07-04 15:35   ` Florian Fainelli [this message]

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=f422b4f7-75ca-8337-e099-fea9cf879b4c@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=alcooperx@gmail.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.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 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.