summaryrefslogtreecommitdiff
path: root/drivers/net/can/cc770/cc770.h
diff options
context:
space:
mode:
authorAndri Yngvason <andri.yngvason@marel.com>2018-03-14 14:52:57 +0300
committerMarc Kleine-Budde <mkl@pengutronix.de>2018-03-14 15:01:22 +0300
commit746201235b3f876792099079f4c6fea941d76183 (patch)
tree7238fcd524a676531bfa61f7f7580bf61088b645 /drivers/net/can/cc770/cc770.h
parentf4353daf4905c0099fd25fa742e2ffd4a4bab26a (diff)
downloadlinux-746201235b3f876792099079f4c6fea941d76183.tar.xz
can: cc770: Fix queue stall & dropped RTR reply
While waiting for the TX object to send an RTR, an external message with a matching id can overwrite the TX data. In this case we must call the rx routine and then try transmitting the message that was overwritten again. The queue was being stalled because the RX event did not generate an interrupt to wake up the queue again and the TX event did not happen because the TXRQST flag is reset by the chip when new data is received. According to the CC770 datasheet the id of a message object should not be changed while the MSGVAL bit is set. This has been fixed by resetting the MSGVAL bit before modifying the object in the transmit function and setting it after. It is not enough to set & reset CPUUPD. It is important to keep the MSGVAL bit reset while the message object is being modified. Otherwise, during RTR transmission, a frame with matching id could trigger an rx-interrupt, which would cause a race condition between the interrupt routine and the transmit function. Signed-off-by: Andri Yngvason <andri.yngvason@marel.com> Tested-by: Richard Weinberger <richard@nod.at> Cc: linux-stable <stable@vger.kernel.org> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/can/cc770/cc770.h')
-rw-r--r--drivers/net/can/cc770/cc770.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/can/cc770/cc770.h b/drivers/net/can/cc770/cc770.h
index a1739db98d91..95752e1d1283 100644
--- a/drivers/net/can/cc770/cc770.h
+++ b/drivers/net/can/cc770/cc770.h
@@ -193,6 +193,8 @@ struct cc770_priv {
u8 cpu_interface; /* CPU interface register */
u8 clkout; /* Clock out register */
u8 bus_config; /* Bus conffiguration register */
+
+ struct sk_buff *tx_skb;
};
struct net_device *alloc_cc770dev(int sizeof_priv);