]> git.baikalelectronics.ru Git - kernel.git/commit
can: flexcan: flexcan_read_reg_iflag_rx(): optimize reading
authorMarc Kleine-Budde <mkl@pengutronix.de>
Fri, 1 Mar 2019 14:38:05 +0000 (15:38 +0100)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Mon, 11 Nov 2019 20:58:11 +0000 (21:58 +0100)
commitf32824f4a4bfa208ac4013a4c6ec22ea974b5ca5
treed99abaaaff472b9a28f7315bd62d9a118a97b5f4
parent82454c8230045a95e8aa84b61818ed5e7704a913
can: flexcan: flexcan_read_reg_iflag_rx(): optimize reading

The flexcan IP core has up to 64 mailboxes, each one has a corresponding
interrupt bit in the iflag1 or iflag2 registers and a mask bit in the
imask1 or imask2 registers.

In the timestamp (i.e. non FIFO) mode the driver needs to mask all non RX
interrupt sources, it uses the precomputed value rx_mask of struct flexcan_priv
for this.

In certain use cases, for example the CANFD mode, the contents of the iflag2
register is completely masked.

This patch optimizes the flexcan_read_reg_iflag_rx() function by not reading
the iflag1 or iflag2 register if the contents is masked.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/flexcan.c