diff mbox

serial: imx: Fix DCD reading

Message ID 20160926135531.31888-1-s.hauer@pengutronix.de (mailing list archive)
State New, archived
Headers show

Commit Message

Sascha Hauer Sept. 26, 2016, 1:55 p.m. UTC
The USR2_DCDIN bit is tested for in register usr1. As the name
suggests the usr2 register should be used instead. This fixes
reading the Carrier detect status.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/tty/serial/imx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Fabio Estevam Sept. 26, 2016, 2:08 p.m. UTC | #1
Hi Sascha,

On Mon, Sep 26, 2016 at 10:55 AM, Sascha Hauer <s.hauer@pengutronix.de> wrote:
> The USR2_DCDIN bit is tested for in register usr1. As the name
> suggests the usr2 register should be used instead. This fixes
> reading the Carrier detect status.
>
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>

Good catch:

Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>

Shouldn't this have stable on Cc?
Uwe Kleine-König Sept. 26, 2016, 2:09 p.m. UTC | #2
Hallo,

On Mon, Sep 26, 2016 at 03:55:31PM +0200, Sascha Hauer wrote:
> The USR2_DCDIN bit is tested for in register usr1. As the name
> suggests the usr2 register should be used instead. This fixes
> reading the Carrier detect status.
> 
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Fixes: 90ebc4838666 ("serial: imx: repair and complete handshaking")
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Thanks
Uwe
Fabio Estevam Sept. 26, 2016, 2:13 p.m. UTC | #3
On Mon, Sep 26, 2016 at 11:09 AM, Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:
> Hallo,
>
> On Mon, Sep 26, 2016 at 03:55:31PM +0200, Sascha Hauer wrote:
>> The USR2_DCDIN bit is tested for in register usr1. As the name
>> suggests the usr2 register should be used instead. This fixes
>> reading the Carrier detect status.
>>
>> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> Fixes: 90ebc4838666 ("serial: imx: repair and complete handshaking")
> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Great, so it affects 4.5+ kernels and should probably have:

Cc: <stable@vger.kernel.org> # 4.5+
Uwe Kleine-König Sept. 26, 2016, 2:25 p.m. UTC | #4
Hello Fabio,

On Mon, Sep 26, 2016 at 11:13:37AM -0300, Fabio Estevam wrote:
> On Mon, Sep 26, 2016 at 11:09 AM, Uwe Kleine-König
> <u.kleine-koenig@pengutronix.de> wrote:
> > On Mon, Sep 26, 2016 at 03:55:31PM +0200, Sascha Hauer wrote:
> >> The USR2_DCDIN bit is tested for in register usr1. As the name
> >> suggests the usr2 register should be used instead. This fixes
> >> reading the Carrier detect status.
> >>
> >> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> > Fixes: 90ebc4838666 ("serial: imx: repair and complete handshaking")
> > Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> 
> Great, so it affects 4.5+ kernels and should probably have:
> 
> Cc: <stable@vger.kernel.org> # 4.5+

This is usually not necessary if there is a Fixes: line.

Best regards
Uwe
Fabio Estevam Sept. 26, 2016, 2:28 p.m. UTC | #5
Hi Uwe,

On Mon, Sep 26, 2016 at 11:25 AM, Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:

>> Great, so it affects 4.5+ kernels and should probably have:
>>
>> Cc: <stable@vger.kernel.org> # 4.5+
>
> This is usually not necessary if there is a Fixes: line.

I thought Greg prefers the explicit Cc: stable line as documented in
Documentation/stable_kernel_rules.txt.

Greg?
Fabio Estevam Sept. 26, 2016, 3:08 p.m. UTC | #6
On Mon, Sep 26, 2016 at 11:28 AM, Fabio Estevam <festevam@gmail.com> wrote:
> Hi Uwe,
>
> On Mon, Sep 26, 2016 at 11:25 AM, Uwe Kleine-König
> <u.kleine-koenig@pengutronix.de> wrote:
>
>>> Great, so it affects 4.5+ kernels and should probably have:
>>>
>>> Cc: <stable@vger.kernel.org> # 4.5+
>>
>> This is usually not necessary if there is a Fixes: line.
>
> I thought Greg prefers the explicit Cc: stable line as documented in
> Documentation/stable_kernel_rules.txt.
>
> Greg?

Ok, in this previous discussion Greg stated that he prefers Cc: stable
to be present:
http://www.spinics.net/lists/linux-gpio/msg10659.html
diff mbox

Patch

diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 0df2b1c..615c027 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -740,12 +740,13 @@  static unsigned int imx_get_hwmctrl(struct imx_port *sport)
 {
 	unsigned int tmp = TIOCM_DSR;
 	unsigned usr1 = readl(sport->port.membase + USR1);
+	unsigned usr2 = readl(sport->port.membase + USR2);
 
 	if (usr1 & USR1_RTSS)
 		tmp |= TIOCM_CTS;
 
 	/* in DCE mode DCDIN is always 0 */
-	if (!(usr1 & USR2_DCDIN))
+	if (!(usr2 & USR2_DCDIN))
 		tmp |= TIOCM_CAR;
 
 	if (sport->dte_mode)