[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240705173931.28e8b858@kernel.org>
Date: Fri, 5 Jul 2024 17:39:31 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Ronald Wahl <rwahl@....de>
Cc: Ronald Wahl <ronald.wahl@...itan.com>, "David S. Miller"
<davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Paolo Abeni
<pabeni@...hat.com>, Simon Horman <horms@...nel.org>,
netdev@...r.kernel.org, stable@...r.kernel.org
Subject: Re: [PATCH v2] net: ks8851: Fix deadlock with the SPI chip variant
On Thu, 4 Jul 2024 19:47:56 +0200 Ronald Wahl wrote:
> --- a/drivers/net/ethernet/micrel/ks8851_spi.c
> +++ b/drivers/net/ethernet/micrel/ks8851_spi.c
> @@ -385,7 +385,7 @@ static netdev_tx_t ks8851_start_xmit_spi(struct sk_buff *skb,
> netif_dbg(ks, tx_queued, ks->netdev,
> "%s: skb %p, %d@%p\n", __func__, skb, skb->len, skb->data);
>
> - spin_lock(&ks->statelock);
> + spin_lock_bh(&ks->statelock);
>
> if (ks->queued_len + needed > ks->tx_space) {
> netif_stop_queue(dev);
> @@ -395,7 +395,7 @@ static netdev_tx_t ks8851_start_xmit_spi(struct sk_buff *skb,
> skb_queue_tail(&ks->txq, skb);
> }
>
> - spin_unlock(&ks->statelock);
> + spin_unlock_bh(&ks->statelock);
this one probably can stay as spin_lock() since networking stack only
calls xmit in BH context. But I see 2 other spin_lock(statelock) in the
driver which I'm not as sure about. Any taking of this lock has to be
_bh() unless you're sure the caller is already in BH.
Powered by blists - more mailing lists