RE: [PATCH net v2 1/2] net: ethernet: oa_tc6: Protect skb pointer used by two different kernel instances

From: Selvamani Rajagopal

Date: Wed Jul 01 2026 - 00:17:30 EST


> -----Original Message-----
> From: Jakub Kicinski <kuba@xxxxxxxxxx>
> Sent: Tuesday, June 30, 2026 3:47 PM
> Subject: Re: [PATCH net v2 1/2] net: ethernet: oa_tc6: Protect skb pointer used by two
> different kernel instances
>
> > I believe xmit path and IRQ thread would run in different kernel
> > instances. Imagine oa_tc6_try_spi_transfer call fails in threaded
> > IRQ. It would set disable_irq. If xmit function didn't see that when
> > it checked, but it is set before placing skb buffer in the
> > waiting_tx_skb pointer (due to skb_linearize for example), the skb
> > would be stuck in waiting_tx_skb.
>
> Perhaps, but wouldn't that cause a stall not a leak?

I should have mentioned disable_traffic flag instead of disable_irq, though
Irq would be disabled when this flag is set.

Once it is set, there won't be anymore traffic, unless driver is unloaded and
reloaded. At this state, tx queue would be blocked The skb pointer
would be held in waiting_tx_skb for ever. (skb lost as far as kernel is concerned)

> Please do your digging and submit high quality patches which don't

While I appreciate you spending time to review this, I do believe the changes in the patch
is the right approach. Not sure what I am missing here.