lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID:
 <PAXPR04MB84253F2ECB04AA3B799D2CC4921DA@PAXPR04MB8425.eurprd04.prod.outlook.com>
Date: Tue, 23 Sep 2025 07:36:49 +0000
From: Sherry Sun <sherry.sun@....com>
To: "Peng Fan (OSS)" <peng.fan@....nxp.com>
CC: "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
	"jirislaby@...nel.org" <jirislaby@...nel.org>, "shawnguo@...nel.org"
	<shawnguo@...nel.org>, "s.hauer@...gutronix.de" <s.hauer@...gutronix.de>,
	"kernel@...gutronix.de" <kernel@...gutronix.de>, "festevam@...il.com"
	<festevam@...il.com>, Shenwei Wang <shenwei.wang@....com>,
	"linux-serial@...r.kernel.org" <linux-serial@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"imx@...ts.linux.dev" <imx@...ts.linux.dev>
Subject: RE: [PATCH 1/2] tty: serial: imx: Only configure the wake register
 when device is set as wakeup source



> -----Original Message-----
> From: Peng Fan (OSS) <peng.fan@....nxp.com>
> Sent: Tuesday, September 23, 2025 4:32 PM
> To: Sherry Sun <sherry.sun@....com>
> Cc: gregkh@...uxfoundation.org; jirislaby@...nel.org; shawnguo@...nel.org;
> s.hauer@...gutronix.de; kernel@...gutronix.de; festevam@...il.com;
> Shenwei Wang <shenwei.wang@....com>; linux-serial@...r.kernel.org;
> linux-kernel@...r.kernel.org; imx@...ts.linux.dev
> Subject: Re: [PATCH 1/2] tty: serial: imx: Only configure the wake register when
> device is set as wakeup source
> 
> On Tue, Sep 23, 2025 at 11:16:12AM +0800, Sherry Sun wrote:
> >Currently, imx uart defaults to enabling the wake related registers for
> >all uart devices. However, it is unnecessary for those devices not
> >configured as wakeup source, so add device_may_wakeup() check before
> >configuring the uart wake related registers.
> 
> I would rewrite as this:
> Currently, the i.MX UART driver enables wake-related registers for all UART
> devices by default. However, this is unnecessary for devices that are not
> configured as wakeup sources. To address this, add a device_may_wakeup()
> check before configuring the UART wake-related registers.

Thanks, that's much clearer.

> 
> >
> >Fixes: db1a9b55004c ("tty: serial: imx: Allow UART to be a source for
> >wakeup")
> >Signed-off-by: Sherry Sun <sherry.sun@....com>
> >---
> > drivers/tty/serial/imx.c | 15 +++++++++++++++
> > 1 file changed, 15 insertions(+)
> >
> >diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index
> >500dfc009d03..4ddfc89816bf 100644
> >--- a/drivers/tty/serial/imx.c
> >+++ b/drivers/tty/serial/imx.c
> >@@ -2697,7 +2697,22 @@ static void imx_uart_save_context(struct
> >imx_port *sport)
> > /* called with irq off */
> > static void imx_uart_enable_wakeup(struct imx_port *sport, bool on)  {
> >+	struct tty_port *port = &sport->port.state->port;
> >+	struct tty_struct *tty;
> >+	struct device *tty_dev;
> > 	u32 ucr3;
> >+	bool may_wake;
> 
> 'bool may_wake = false;' otherwise there might be report on using an
> uninitalized value by coverity or other tools.

Ok, will fix this in V2.

Best Regards
Sherry

> 
> >+
> >+	tty = tty_port_tty_get(port);
> >+	if (tty) {
> >+		tty_dev = tty->dev;
> >+		may_wake = tty_dev && device_may_wakeup(tty_dev);
> >+		tty_kref_put(tty);
> >+	}
> >+
> >+	/* only configure the wake register when device set as wakeup source
> */
> >+	if (!may_wake)
> >+		return;
> 
> Regards,
> Peng

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ