]> git.itanic.dy.fi Git - linux-stable/commit
serial: lantiq: Do not swap register read/writes
authorHauke Mehrtens <hauke@hauke-m.de>
Sun, 6 Jan 2019 18:50:37 +0000 (19:50 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Jun 2023 08:15:27 +0000 (10:15 +0200)
commitac49cf95d8046881692c2f8320c8728a037354f9
treeb940d11110f952045f5470dee8dc2bff1c1c5156
parent61b247c253d3711411f9fe9e1c005278ed4302be
serial: lantiq: Do not swap register read/writes

[ Upstream commit d3a28a53630e1ca10f59562ef560e3f70785cb09 ]

The ltq_r32() and ltq_w32() macros use the __raw_readl() and
__raw_writel() functions which do not swap the value to little endian.
On the big endian vrx200 SoC the UART is operated in big endian IO mode,
the readl() and write() functions convert the value to little endian
first and then the driver does not work any more on this SoC.
Currently the vrx200 SoC selects the CONFIG_SWAP_IO_SPACE option,
without this option the serial driver would work, but PCI devices do not
work any more.

This patch makes the driver use the __raw_readl() and __raw_writel()
functions which do not swap the endianness. On big endian system it is
assumed that the device should be access in big endian IO mode and on a
little endian system it would be access in little endian mode.

Fixes: 89b8bd2082bb ("serial: lantiq: Use readl/writel instead of ltq_r32/ltq_w32")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Acked-by: John Crispin <john@phrozen.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stable-dep-of: 306320034e8f ("serial: lantiq: add missing interrupt ack")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/tty/serial/lantiq.c