Hi Kurt, see below. > -----Original Message----- > From: Kurt Van Dijck <dev.kurt@xxxxxxxxxxxxxxxxxxxxxx> > Sent: Friday, June 12, 2020 9:43 AM > Subject: Re: [PATCH] can: c_can: Handle lost bus-off interrupt while IRQs are > disabled > > Hi Felix, > > Next question comes up. > See inline. > > On vr, 12 jun 2020 09:10:44 +0200, Kurt Van Dijck wrote: > > Thanks for verifying, > > > > I'll take a look how that can happen. > > > > I think packet loss is better (less packets lost) than before. > > > > Kurt > > > > On wo, 10 jun 2020 08:08:28 +0000, Felix Riemann wrote: > > > Hi Kurt, > > > > > > > -----Original Message----- > > > > > > > > I have the impression that the recv path is covered, at least the > > > > null ptr would have caused issued earlier already. > > > > Would the problem arise in c_can_do_tx fetching a NULL echo_skb? > > > > > > It really looks like it. > > > > > > Adding a BUG_ON to the loop in c_can_do_tx triggers with a NULL skb > returned by __can_get_echo_skb(). > > > > > > For testing I replaced the BUG_ON with a check that skips the skb if that > happens (not sure if that would be a valid fix in that place): > > > > > > while ((obj = c_can_ffs64(pend))) { > > > pend &= ~((u64)1 << (obj - 1)); > > > c_can_inval_tx_object(dev, IF_RX, obj); idx = obj - > > > priv->obj.send_frst; skb = __can_get_echo_skb(dev, idx, &len); > > > if(!skb) > > It would be interesting to know idx and priv->tx_active here. That's the statistic over about 1600 lines I captured. First number is number of occurrences: 992 can0: Skip @ idx 0, tx_active: 0x1 255 can0: Skip @ idx 0, tx_active: 0x3 250 can0: Skip @ idx 1, tx_active: 0x2 11 can0: Skip @ idx 0, tx_active: 0x7 10 can0: Skip @ idx 1, tx_active: 0x6 8 can0: Skip @ idx 7, tx_active: 0x80 8 can0: Skip @ idx 6, tx_active: 0xc0 8 can0: Skip @ idx 2, tx_active: 0x6 6 can0: Skip @ idx 1, tx_active: 0xe 5 can0: Skip @ idx 2, tx_active: 0x4 5 can0: Skip @ idx 0, tx_active: 0xf 4 can0: Skip @ idx 2, tx_active: 0xc 4 can0: Skip @ idx 0, tx_active: 0x3f 3 can0: Skip @ idx 6, tx_active: 0x40 3 can0: Skip @ idx 3, tx_active: 0xc 3 can0: Skip @ idx 2, tx_active: 0xfc 3 can0: Skip @ idx 2, tx_active: 0x3c 3 can0: Skip @ idx 0, tx_active: 0x1f 2 can0: Skip @ idx 5, tx_active: 0x3e 2 can0: Skip @ idx 4, tx_active: 0x3e 2 can0: Skip @ idx 3, tx_active: 0xf8 2 can0: Skip @ idx 3, tx_active: 0x3e 2 can0: Skip @ idx 2, tx_active: 0x3e 2 can0: Skip @ idx 1, tx_active: 0x3e 2 can0: Skip @ idx 1, tx_active: 0x1e 1 can0: Skip @ idx 7, tx_active: 0xf0 1 can0: Skip @ idx 6, tx_active: 0xf0 1 can0: Skip @ idx 6, tx_active: 0x78 1 can0: Skip @ idx 6, tx_active: 0x70 1 can0: Skip @ idx 5, tx_active: 0xf0 1 can0: Skip @ idx 5, tx_active: 0x78 1 can0: Skip @ idx 5, tx_active: 0x70 1 can0: Skip @ idx 5, tx_active: 0x38 1 can0: Skip @ idx 5, tx_active: 0x20 1 can0: Skip @ idx 4, tx_active: 0xf0 1 can0: Skip @ idx 4, tx_active: 0x38 1 can0: Skip @ idx 4, tx_active: 0x1c 1 can0: Skip @ idx 3, tx_active: 0xfc 1 can0: Skip @ idx 3, tx_active: 0xe 1 can0: Skip @ idx 3, tx_active: 0x8 1 can0: Skip @ idx 3, tx_active: 0x78 1 can0: Skip @ idx 3, tx_active: 0x38 1 can0: Skip @ idx 3, tx_active: 0x1c 1 can0: Skip @ idx 2, tx_active: 0xe 1 can0: Skip @ idx 2, tx_active: 0x7c 1 can0: Skip @ idx 2, tx_active: 0x1c 1 can0: Skip @ idx 1, tx_active: 0xfe 1 can0: Skip @ idx 0, tx_active: 0xff 1 can0: Skip @ idx 0, tx_active: 0x7f I used atomic_read to get the value of tx_active. Regards, Felix ___________________________________________________ SMA Solar Technology AG Aufsichtsrat: Uwe Kleinkauf (Vorsitzender) Vorstand: Ulrich Hadding, Dr.-Ing. Juergen Reinert Handelsregister: Amtsgericht Kassel HRB 3972 Sitz der Gesellschaft: 34266 Niestetal USt-ID-Nr. DE 113 08 59 54 WEEE-Reg.-Nr. DE 95881150 ___________________________________________________