linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Sherry Sun <sherry.sun@nxp.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jirislaby@kernel.org>, Lukas Wunner <lukas@wunner.de>,
	linux-serial <linux-serial@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	dl-linux-imx <linux-imx@nxp.com>
Subject: RE: [PATCH] Revert "serial: fsl_lpuart: Reset prior to registration"
Date: Thu, 29 Sep 2022 14:19:06 +0300 (EEST)	[thread overview]
Message-ID: <39c68295-947-2353-d9b-3bd654c38c7@linux.intel.com> (raw)
In-Reply-To: <AS8PR04MB84044F397918A3475B5D8D1D92579@AS8PR04MB8404.eurprd04.prod.outlook.com>

On Thu, 29 Sep 2022, Sherry Sun wrote:

> > > This reverts commit 60f361722ad2ae5ee667d0b0545d40c42f754daf.
> > >
> > > commit 60f361722ad2 ("serial: fsl_lpuart: Reset prior to
> > > registration") causes the lpuart console cannot work any more. Since
> > > the console is registered in the uart_add_one_port(), the driver
> > > cannot identify the console port before call uart_add_one_port(),
> > > which causes all the uart ports including the console port will be global
> > reset.
> > > So need to revert this patch to avoid breaking the lpuart console.
> > >
> > > Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
> > > ---
> > >  drivers/tty/serial/fsl_lpuart.c | 10 +++++-----
> > >  1 file changed, 5 insertions(+), 5 deletions(-)
> > >
> > > diff --git a/drivers/tty/serial/fsl_lpuart.c
> > > b/drivers/tty/serial/fsl_lpuart.c index 67fa113f77d4..7da46557fcb3
> > > 100644
> > > --- a/drivers/tty/serial/fsl_lpuart.c
> > > +++ b/drivers/tty/serial/fsl_lpuart.c
> > > @@ -2722,10 +2722,6 @@ static int lpuart_probe(struct platform_device
> > *pdev)
> > >  		handler = lpuart_int;
> > >  	}
> > >
> > > -	ret = lpuart_global_reset(sport);
> > > -	if (ret)
> > > -		goto failed_reset;
> > > -
> > 
> > So the problem with this being so early is uart_console() in
> > lpuart_global_reset() that doesn't detect a console because sport->cons is
> > not yet assigned? Couldn't that be worked around differently?
> > 
> > Or is there something else in addition to that I'm missing?
> > 
> Hi Ilpo,
> 
> Yes, the root cause of the console cannot work after apply the commit 
> 60f361722ad2 ("serial: fsl_lpuart: Reset prior to registration") is 
> lpuart_global_reset() cannot identify the console port, so reset all 
> uart ports. 

This didn't answer my question. Is the main cause just lacking the ->cons
from sport at this point which, I guess, could be just assigned from 
lpuart_reg similar to what uart_add_one_port() does before calling to 
reset?

-- 
 i.

> Actually I've been thinking about any other workaround all afternoon, 
 seems no other good options to me till now. And after a further check, I 
 think the original patch is not needed, as uart_add_one_port() won't open 
 the tty device, it should be safe to global reset the non-console ports 
 after uart_add_one_port().
> 
> Best Regards
> Sherry
> 


  reply	other threads:[~2022-09-29 11:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-29  8:53 [PATCH] Revert "serial: fsl_lpuart: Reset prior to registration" Sherry Sun
2022-09-29 10:51 ` Ilpo Järvinen
2022-09-29 11:10   ` Sherry Sun
2022-09-29 11:19     ` Ilpo Järvinen [this message]
2022-09-30  8:02       ` Sherry Sun
2022-09-30 12:59         ` Ilpo Järvinen
2022-10-09 10:23           ` Sherry Sun
2022-10-10  9:09             ` Lukas Wunner
2022-10-11  8:07               ` Sherry Sun
2022-12-06 14:51 ` Francesco Dolcini
2022-12-06 15:08   ` Francesco Dolcini

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=39c68295-947-2353-d9b-3bd654c38c7@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=sherry.sun@nxp.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;
as well as URLs for NNTP newsgroup(s).