* [V2] drivers/tty/serial/qcom-geni-serial: Do stop_rx in suspend path for console if console_suspend is disabled
@ 2022-04-06 8:26 Vijaya Krishna Nivarthi
2022-04-06 8:32 ` Greg KH
2022-04-06 17:29 ` Matthias Kaehlcke
0 siblings, 2 replies; 3+ messages in thread
From: Vijaya Krishna Nivarthi @ 2022-04-06 8:26 UTC (permalink / raw)
To: agross, bjorn.andersson, gregkh, jirislaby, linux-arm-msm,
linux-serial, linux-kernel
Cc: quic_msavaliy, dianders, Vijaya Krishna Nivarthi
For the case of console_suspend disabled, if back to back suspend/resume
test is executed, at the end of test, sometimes console would appear to
be frozen not responding to input. This would happen because, for
console_suspend disabled, suspend/resume routines only turn resources
off/on but don't do a port close/open.
As a result, during resume, some rx transactions come in before system is
ready, malfunction of rx happens in turn resulting in console appearing
to be stuck.
Do a stop_rx in suspend sequence to prevent this. start_rx is already
present in resume sequence as part of call to set_termios which does a
stop_rx/start_rx.
Signed-off-by: Vijaya Krishna Nivarthi <quic_vnivarth@quicinc.com>
---
drivers/tty/serial/qcom_geni_serial.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c
index 1543a60..6f767c7 100644
--- a/drivers/tty/serial/qcom_geni_serial.c
+++ b/drivers/tty/serial/qcom_geni_serial.c
@@ -1481,6 +1481,10 @@ static int __maybe_unused qcom_geni_serial_sys_suspend(struct device *dev)
struct uart_port *uport = &port->uport;
struct qcom_geni_private_data *private_data = uport->private_data;
+ /* do a stop_rx here, start_rx is handled in uart_resume_port by call to setermios */
+ if (!console_suspend_enabled && uart_console(uport))
+ uport->ops->stop_rx(uport);
+
/*
* This is done so we can hit the lowest possible state in suspend
* even with no_console_suspend
--
Qualcomm INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by the Linux Foundation.
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [V2] drivers/tty/serial/qcom-geni-serial: Do stop_rx in suspend path for console if console_suspend is disabled
2022-04-06 8:26 [V2] drivers/tty/serial/qcom-geni-serial: Do stop_rx in suspend path for console if console_suspend is disabled Vijaya Krishna Nivarthi
@ 2022-04-06 8:32 ` Greg KH
2022-04-06 17:29 ` Matthias Kaehlcke
1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2022-04-06 8:32 UTC (permalink / raw)
To: Vijaya Krishna Nivarthi
Cc: agross, bjorn.andersson, jirislaby, linux-arm-msm, linux-serial,
linux-kernel, quic_msavaliy, dianders
On Wed, Apr 06, 2022 at 01:56:52PM +0530, Vijaya Krishna Nivarthi wrote:
> For the case of console_suspend disabled, if back to back suspend/resume
> test is executed, at the end of test, sometimes console would appear to
> be frozen not responding to input. This would happen because, for
> console_suspend disabled, suspend/resume routines only turn resources
> off/on but don't do a port close/open.
> As a result, during resume, some rx transactions come in before system is
> ready, malfunction of rx happens in turn resulting in console appearing
> to be stuck.
>
> Do a stop_rx in suspend sequence to prevent this. start_rx is already
> present in resume sequence as part of call to set_termios which does a
> stop_rx/start_rx.
>
> Signed-off-by: Vijaya Krishna Nivarthi <quic_vnivarth@quicinc.com>
> ---
> drivers/tty/serial/qcom_geni_serial.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c
> index 1543a60..6f767c7 100644
> --- a/drivers/tty/serial/qcom_geni_serial.c
> +++ b/drivers/tty/serial/qcom_geni_serial.c
> @@ -1481,6 +1481,10 @@ static int __maybe_unused qcom_geni_serial_sys_suspend(struct device *dev)
> struct uart_port *uport = &port->uport;
> struct qcom_geni_private_data *private_data = uport->private_data;
>
> + /* do a stop_rx here, start_rx is handled in uart_resume_port by call to setermios */
> + if (!console_suspend_enabled && uart_console(uport))
> + uport->ops->stop_rx(uport);
> +
> /*
> * This is done so we can hit the lowest possible state in suspend
> * even with no_console_suspend
> --
> Qualcomm INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by the Linux Foundation.
>
Hi,
This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him
a patch that has triggered this response. He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created. Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.
You are receiving this message because of the following common error(s)
as indicated below:
- This looks like a new version of a previously submitted patch, but you
did not list below the --- line any changes from the previous version.
Please read the section entitled "The canonical patch format" in the
kernel file, Documentation/SubmittingPatches for what needs to be done
here to properly describe this.
If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.
thanks,
greg k-h's patch email bot
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [V2] drivers/tty/serial/qcom-geni-serial: Do stop_rx in suspend path for console if console_suspend is disabled
2022-04-06 8:26 [V2] drivers/tty/serial/qcom-geni-serial: Do stop_rx in suspend path for console if console_suspend is disabled Vijaya Krishna Nivarthi
2022-04-06 8:32 ` Greg KH
@ 2022-04-06 17:29 ` Matthias Kaehlcke
1 sibling, 0 replies; 3+ messages in thread
From: Matthias Kaehlcke @ 2022-04-06 17:29 UTC (permalink / raw)
To: Vijaya Krishna Nivarthi
Cc: agross, bjorn.andersson, gregkh, jirislaby, linux-arm-msm,
linux-serial, linux-kernel, quic_msavaliy, dianders
On Wed, Apr 06, 2022 at 01:56:52PM +0530, Vijaya Krishna Nivarthi wrote:
> For the case of console_suspend disabled, if back to back suspend/resume
> test is executed, at the end of test, sometimes console would appear to
> be frozen not responding to input. This would happen because, for
> console_suspend disabled, suspend/resume routines only turn resources
> off/on but don't do a port close/open.
> As a result, during resume, some rx transactions come in before system is
> ready, malfunction of rx happens in turn resulting in console appearing
> to be stuck.
>
> Do a stop_rx in suspend sequence to prevent this. start_rx is already
> present in resume sequence as part of call to set_termios which does a
> stop_rx/start_rx.
>
> Signed-off-by: Vijaya Krishna Nivarthi <quic_vnivarth@quicinc.com>
> ---
> drivers/tty/serial/qcom_geni_serial.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c
> index 1543a60..6f767c7 100644
> --- a/drivers/tty/serial/qcom_geni_serial.c
> +++ b/drivers/tty/serial/qcom_geni_serial.c
> @@ -1481,6 +1481,10 @@ static int __maybe_unused qcom_geni_serial_sys_suspend(struct device *dev)
> struct uart_port *uport = &port->uport;
> struct qcom_geni_private_data *private_data = uport->private_data;
>
> + /* do a stop_rx here, start_rx is handled in uart_resume_port by call to setermios */
> + if (!console_suspend_enabled && uart_console(uport))
nit: I think for a human reader would be slightly clearer to swap the order
of the conditions, i.e.:
if (uart_console(uport) && !console_suspend_enabled)
> + uport->ops->stop_rx(uport);
> +
> /*
> * This is done so we can hit the lowest possible state in suspend
> * even with no_console_suspend
v1 one had additional changes which weren't directly related with
console_suspend. They looked worthwhile though, please make sure to
send them in separate patches.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-04-06 19:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-06 8:26 [V2] drivers/tty/serial/qcom-geni-serial: Do stop_rx in suspend path for console if console_suspend is disabled Vijaya Krishna Nivarthi
2022-04-06 8:32 ` Greg KH
2022-04-06 17:29 ` Matthias Kaehlcke
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).