]> git.baikalelectronics.ru Git - kernel.git/commit
can: m_can: fix iomap_read_fifo() and iomap_write_fifo()
authorAswath Govindraju <a-govindraju@ti.com>
Mon, 20 Sep 2021 12:33:43 +0000 (18:03 +0530)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Sun, 17 Oct 2021 20:51:43 +0000 (22:51 +0200)
commitd5fc7a3b44528e82bb687152e6df61b0817fd288
treedd0363363eee9dde0d9ba3d5833dd8f896eb80f9
parent8527446204d7a248dc8ec6459e61089ffe3b0834
can: m_can: fix iomap_read_fifo() and iomap_write_fifo()

The read and writes from the fifo are from a buffer, with various
fields and data at predefined offsets. So, they should not be done to
the same address(or port) in case of val_count greater than 1.
Therefore, fix this by using iowrite32()/ioread32() instead of
ioread32_rep()/iowrite32_rep().

Also, the write into FIFO must be performed with an offset from the
message ram base address. Therefore, fix the base address to
mram_base.

Fixes: 81caecb72d42 ("can: m_can: Disable IRQs on FIFO bus errors")
Link: https://lore.kernel.org/all/20210920123344.2320-1-a-govindraju@ti.com
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/m_can/m_can_platform.c