From: Pankaj Bansal Date: Wed, 1 Aug 2018 14:06:46 +0000 (+0530) Subject: can: flexcan: Unlock the MB unconditionally X-Git-Tag: rel_imx_4.19.35_1.1.0~8296 X-Git-Url: https://git.somdevices.com/?a=commitdiff_plain;h=8d2aed6439cf41bcaee3d44eff5bfacb2bfb3039;p=linux.git can: flexcan: Unlock the MB unconditionally commit 5178b7cd8e42448b1041716f124734eaaa36ca50 upstream. Unlock the MB irrespective of reception method being FIFO or timestamp based. It is optional but recommended to unlock Mailbox as soon as possible and make it available for reception. Reported-by: Alexander Stein Signed-off-by: Pankaj Bansal Cc: linux-stable Signed-off-by: Marc Kleine-Budde Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c index 8e972ef08637..0431f8d05518 100644 --- a/drivers/net/can/flexcan.c +++ b/drivers/net/can/flexcan.c @@ -720,9 +720,14 @@ static unsigned int flexcan_mailbox_read(struct can_rx_offload *offload, priv->write(BIT(n - 32), ®s->iflag2); } else { priv->write(FLEXCAN_IFLAG_RX_FIFO_AVAILABLE, ®s->iflag1); - priv->read(®s->timer); } + /* Read the Free Running Timer. It is optional but recommended + * to unlock Mailbox as soon as possible and make it available + * for reception. + */ + priv->read(®s->timer); + return 1; }