Skip to contentSkip to conversation

can: cc770: store echo skb before starting the transfer

PATCH Applied Wolfgang Grandegger 2 participants 2 messages Dec 12, 2011 – Jan 31, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/net/can/cc770/cc770.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/net/can/cc770/cc770.c +3 -1
index 7668967..c30f0e6 100644
@@ -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
Signature · 1 line
1.7.4.1
maintainer Applied
#1 lore raw
Quoted 5 lines · Wolfgang Grandegger

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.

Applied to can-next.
tnx Marc

Signature · 4 lines
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |