Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: 9a899a35b0d6 ("r8169: switch to napi_schedule_irqoff")
Link: https://lkml.org/lkml/2020/10/18/19
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Link: https://lore.kernel.org/r/4d3ef84a-c812-5072-918a-22a6f6468310@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Heiner Kallweit and committed by
Jakub Kicinski
424a646e 0e8b8d6a

+4 -4
+4 -4
drivers/net/ethernet/realtek/r8169_main.c
··· 4694 4694 4695 4695 phy_disconnect(tp->phydev); 4696 4696 4697 - pci_free_irq(pdev, 0, tp); 4697 + free_irq(pci_irq_vector(pdev, 0), tp); 4698 4698 4699 4699 dma_free_coherent(&pdev->dev, R8169_RX_RING_BYTES, tp->RxDescArray, 4700 4700 tp->RxPhyAddr); ··· 4745 4745 4746 4746 rtl_request_firmware(tp); 4747 4747 4748 - retval = pci_request_irq(pdev, 0, rtl8169_interrupt, NULL, tp, 4749 - dev->name); 4748 + retval = request_irq(pci_irq_vector(pdev, 0), rtl8169_interrupt, 4749 + IRQF_NO_THREAD | IRQF_SHARED, dev->name, tp); 4750 4750 if (retval < 0) 4751 4751 goto err_release_fw_2; 4752 4752 ··· 4763 4763 return retval; 4764 4764 4765 4765 err_free_irq: 4766 - pci_free_irq(pdev, 0, tp); 4766 + free_irq(pci_irq_vector(pdev, 0), tp); 4767 4767 err_release_fw_2: 4768 4768 rtl_release_firmware(tp); 4769 4769 rtl8169_rx_clear(tp);