Skip to content

Commit

Permalink
net: vertexcom: mse102x: Fix possible stuck of SPI interrupt
Browse files Browse the repository at this point in the history
[ Upstream commit 55f3628 ]

The MSE102x doesn't provide any SPI commands for interrupt handling.
So in case the interrupt fired before the driver requests the IRQ,
the interrupt will never fire again. In order to fix this always poll
for pending packets after opening the interface.

Fixes: 2f207cb ("net: vertexcom: Add MSE102x SPI support")
Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/20250430133043.7722-2-wahrenst@gmx.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Stefan Wahren authored and Greg Kroah-Hartman committed May 9, 2025
1 parent a77325e commit 4712e0e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/net/ethernet/vertexcom/mse102x.c
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,7 @@ static irqreturn_t mse102x_irq(int irq, void *_mse)
static int mse102x_net_open(struct net_device *ndev)
{
struct mse102x_net *mse = netdev_priv(ndev);
struct mse102x_net_spi *mses = to_mse102x_spi(mse);
int ret;

ret = request_threaded_irq(ndev->irq, NULL, mse102x_irq, IRQF_ONESHOT,
Expand All @@ -524,6 +525,13 @@ static int mse102x_net_open(struct net_device *ndev)

netif_carrier_on(ndev);

/* The SPI interrupt can stuck in case of pending packet(s).
* So poll for possible packet(s) to re-arm the interrupt.
*/
mutex_lock(&mses->lock);
mse102x_rx_pkt_spi(mse);
mutex_unlock(&mses->lock);

netif_dbg(mse, ifup, ndev, "network device up\n");

return 0;
Expand Down

0 comments on commit 4712e0e

Please sign in to comment.