diff options
author | Fabio Estevam <fabio.estevam@nxp.com> | 2017-07-11 13:03:43 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-07-17 14:14:24 +0200 |
commit | 3ee5447e8cd9a65d08fbb49fa9767cbf7fef6d91 (patch) | |
tree | bb96b6c9eec940fd0ecc86e14fc92f6b6a099943 /drivers/tty/rocket_int.h | |
parent | serial: imx: Prevent TX buffer PIO write when a DMA has been started (diff) | |
download | linux-3ee5447e8cd9a65d08fbb49fa9767cbf7fef6d91.tar.xz linux-3ee5447e8cd9a65d08fbb49fa9767cbf7fef6d91.zip |
tty: serial: lpuart: Fix the logic for detecting the 32-bit type UART
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@savoirfairelinux.com>
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Reviewed-by: Dong Aisheng <aisheng.dong@nxp.com>
Tested-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/rocket_int.h')
0 files changed, 0 insertions, 0 deletions