summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWolfgang Grandegger <wg@grandegger.com>2011-12-12 16:07:16 +0100
committerMarc Kleine-Budde <mkl@pengutronix.de>2012-02-03 00:24:59 +0100
commit7bb4db93ae59e0faf810a83a8578f56bc968ab01 (patch)
tree416de109d52a28d60759d0dd44b18416a8c4d445
parent6e9d554fa6e481a848358c215f129432262123c0 (diff)
downloadop-kernel-dev-7bb4db93ae59e0faf810a83a8578f56bc968ab01.zip
op-kernel-dev-7bb4db93ae59e0faf810a83a8578f56bc968ab01.tar.gz
can: cc770: store echo skb before starting the transfer
On slow systems and high CAN bitrates, the error message "can_put_echo_skb: BUG! echo_skb is occupied!" did show up because can_put_echo_skb() was called after starting the transfer. Signed-off-by: Wolfgang Grandegger <wg@grandegger.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-rw-r--r--drivers/net/can/cc770/cc770.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/can/cc770/cc770.c b/drivers/net/can/cc770/cc770.c
index 7668967..c30f0e6 100644
--- a/drivers/net/can/cc770/cc770.c
+++ b/drivers/net/can/cc770/cc770.c
@@ -440,12 +440,14 @@ static netdev_tx_t cc770_start_xmit(struct sk_buff *skb, struct net_device *dev)
for (i = 0; i < dlc; i++)
cc770_write_reg(priv, msgobj[mo].data[i], cf->data[i]);
+ /* Store echo skb before starting the transfer */
+ can_put_echo_skb(skb, dev, 0);
+
cc770_write_reg(priv, msgobj[mo].ctrl1,
RMTPND_RES | TXRQST_SET | CPUUPD_RES | NEWDAT_UNC);
stats->tx_bytes += dlc;
- can_put_echo_skb(skb, dev, 0);
/*
* HM: We had some cases of repeated IRQs so make sure the
OpenPOWER on IntegriCloud