Commit 424a646e authored by Heiner Kallweit's avatar Heiner Kallweit Committed by Jakub Kicinski

r8169: fix operation under forced interrupt threading

For several network drivers it was reported that using
__napi_schedule_irqoff() is unsafe with forced threading. One way to
fix this is switching back to __napi_schedule, but then we lose the
benefit of the irqoff version in general. As stated by Eric it doesn't
make sense to make the minimal hard irq handlers in drivers using NAPI
a thread. Therefore ensure that the hard irq handler is never
thread-ified.

Fixes: 9a899a35 ("r8169: switch to napi_schedule_irqoff")
Link: https://lkml.org/lkml/2020/10/18/19Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
Link: https://lore.kernel.org/r/4d3ef84a-c812-5072-918a-22a6f6468310@gmail.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 0e8b8d6a
...@@ -4694,7 +4694,7 @@ static int rtl8169_close(struct net_device *dev) ...@@ -4694,7 +4694,7 @@ static int rtl8169_close(struct net_device *dev)
phy_disconnect(tp->phydev); phy_disconnect(tp->phydev);
pci_free_irq(pdev, 0, tp); free_irq(pci_irq_vector(pdev, 0), tp);
dma_free_coherent(&pdev->dev, R8169_RX_RING_BYTES, tp->RxDescArray, dma_free_coherent(&pdev->dev, R8169_RX_RING_BYTES, tp->RxDescArray,
tp->RxPhyAddr); tp->RxPhyAddr);
...@@ -4745,8 +4745,8 @@ static int rtl_open(struct net_device *dev) ...@@ -4745,8 +4745,8 @@ static int rtl_open(struct net_device *dev)
rtl_request_firmware(tp); rtl_request_firmware(tp);
retval = pci_request_irq(pdev, 0, rtl8169_interrupt, NULL, tp, retval = request_irq(pci_irq_vector(pdev, 0), rtl8169_interrupt,
dev->name); IRQF_NO_THREAD | IRQF_SHARED, dev->name, tp);
if (retval < 0) if (retval < 0)
goto err_release_fw_2; goto err_release_fw_2;
...@@ -4763,7 +4763,7 @@ static int rtl_open(struct net_device *dev) ...@@ -4763,7 +4763,7 @@ static int rtl_open(struct net_device *dev)
return retval; return retval;
err_free_irq: err_free_irq:
pci_free_irq(pdev, 0, tp); free_irq(pci_irq_vector(pdev, 0), tp);
err_release_fw_2: err_release_fw_2:
rtl_release_firmware(tp); rtl_release_firmware(tp);
rtl8169_rx_clear(tp); rtl8169_rx_clear(tp);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment