Thinking about this more, I don't understand this explanation. Won't the interrupt level of the cpu still be IPL_NET while detach is sleeping? BTW, in my crash detach is waiting on a cv in softint_disestablish()
On Sat, Feb 6, 2016 at 8:52 AM, Manuel Bouyer <bou...@antioche.eu.org> wrote: > On Fri, Feb 05, 2016 at 01:09:28PM -0800, Rohan Desai wrote: > > I'm getting a panic due to a race between the detach path > > (xennet_xenbus_detach) and event handling (xennet_handler called from > > triggered event channel). xennet_xenbus_detach frees up the tx ring and > > xennet_handler tries to access it. I'm not sure what event the event > > channel is being poked for (tx complete, rx ready, other). Does anybody > > know how these two code-paths are supposed to be synchronized ? > > xennet_xenbus_detach() runs at splnet(), so this should be enough to > prevent > the event handler from being called. > > But I see where the race could be: we sleep waiting for the rx grant > ref to be released, the event handler could be called at this time. > I guess just removing the interrupt handler earlier, like in the > attached patch, is enough to fix it. Can you test ? > > -- > Manuel Bouyer <bou...@antioche.eu.org> > NetBSD: 26 ans d'experience feront toujours la difference > -- >