RE: [PATCH] tty: serial: lpuart: Fix the logic for detecting the 32-bit type UART

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: Fabio Estevam [mailto:festevam@xxxxxxxxx]
> Sent: Tuesday, July 11, 2017 7:04 PM
> To: gregkh@xxxxxxxxxxxxxxxxxxx
> Cc: A.s. Dong; vivien.didelot@xxxxxxxxxxxxxxxxxxxx; stefan@xxxxxxxx;
> linux-serial@xxxxxxxxxxxxxxx; Fabio Estevam
> Subject: [PATCH] tty: serial: lpuart: Fix the logic for detecting the 32-
> bit type UART
> 
> From: Fabio Estevam <fabio.estevam@xxxxxxx>
> 
> Commit 0d6fce904452 ("tty: serial: lpuart: introduce lpuart_soc_data to
> represent SoC property") introduced a buggy logic for detecting the 32-
> bit type UART since the condition: "if (sport->port.iotype &
> UPIO_MEM32BE)"
> is always true.
> 
> Performing such bitfield AND operation is not correct, because in the
> case of Vybrid UART iotype is UPIO_MEM (2), so:
> 
> UPIO_MEM & UPIO_MEM32BE = 010 & 110 = 010, which is true.
> 
> Such logic tells the driver to always treat the UART operations as 32-bit,
> leading to the driver misbehavior on Vybrid.
> 
> Fix the 32-bit type detection logic to avoid UART breakage on Vybrid.
> 
> While at it, introduce a lpuart_is_32() function to help readability.
> 
> Fixes: 0d6fce904452 ("tty: serial: lpuart: introduce lpuart_soc_data to
> represent SoC property")
> Reported-by: Vivien Didelot <vivien.didelot@xxxxxxxxxxxxxxxxxxxx>
> Signed-off-by: Fabio Estevam <fabio.estevam@xxxxxxx>

Reviewed-by: Dong Aisheng <aisheng.dong@xxxxxxx>

Hi Vivien and Stefan,
We do not have Vybrid board, would you help test it?

Regards
Dong Aisheng
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux