[PATCH 1/2] can: flexcan: Unlock mailbox also in timestamp based offloading

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

 



If the last mailbox is not unlocked explicitly there is a small window
where an already received but not yet stored frame is overwritten in
the SMB (Serial Message Buffer) by the next CAN frame.
Although it is said to be optional, explicitly unlock the mailbox.

Signed-off-by: Alexander Stein <alexander.stein@xxxxxxxxxxxxxxxxxxxxx>
---
 drivers/net/can/flexcan.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index 8e972ef08637..c9d30480aae9 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -720,8 +720,9 @@ static unsigned int flexcan_mailbox_read(struct can_rx_offload *offload,
 			priv->write(BIT(n - 32), &regs->iflag2);
 	} else {
 		priv->write(FLEXCAN_IFLAG_RX_FIFO_AVAILABLE, &regs->iflag1);
-		priv->read(&regs->timer);
 	}
+	/* Unlock mailbox */
+	priv->read(&regs->timer);
 
 	return 1;
 }
-- 
2.18.1




[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux