Skip to content

Commit

Permalink
r8169: don't use pci_irq_vector() in atomic context
Browse files Browse the repository at this point in the history
Since referenced change pci_irq_vector() can't be used in atomic
context any longer. This conflicts with our usage of this function
in rtl8169_netpoll(). Therefore store the interrupt number in
struct rtl8169_private.

Fixes: 495c66a ("genirq/msi: Convert to new functions")
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Link: https://lore.kernel.org/r/3cd24763-f307-78f5-76ed-a5fbf315fb28@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Thomas Gleixner authored and Jakub Kicinski committed Dec 28, 2021
1 parent 0f1eae8 commit 1bd3277
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions drivers/net/ethernet/realtek/r8169_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,7 @@ struct rtl8169_private {
struct ring_info tx_skb[NUM_TX_DESC]; /* Tx data buffers */
u16 cp_cmd;
u32 irq_mask;
int irq;
struct clk *clk;

struct {
Expand Down Expand Up @@ -4712,7 +4713,7 @@ static int rtl8169_close(struct net_device *dev)

cancel_work_sync(&tp->wk.work);

free_irq(pci_irq_vector(pdev, 0), tp);
free_irq(tp->irq, tp);

phy_disconnect(tp->phydev);

Expand All @@ -4733,7 +4734,7 @@ static void rtl8169_netpoll(struct net_device *dev)
{
struct rtl8169_private *tp = netdev_priv(dev);

rtl8169_interrupt(pci_irq_vector(tp->pci_dev, 0), tp);
rtl8169_interrupt(tp->irq, tp);
}
#endif

Expand Down Expand Up @@ -4767,8 +4768,7 @@ static int rtl_open(struct net_device *dev)
rtl_request_firmware(tp);

irqflags = pci_dev_msi_enabled(pdev) ? IRQF_NO_THREAD : IRQF_SHARED;
retval = request_irq(pci_irq_vector(pdev, 0), rtl8169_interrupt,
irqflags, dev->name, tp);
retval = request_irq(tp->irq, rtl8169_interrupt, irqflags, dev->name, tp);
if (retval < 0)
goto err_release_fw_2;

Expand All @@ -4785,7 +4785,7 @@ static int rtl_open(struct net_device *dev)
return retval;

err_free_irq:
free_irq(pci_irq_vector(pdev, 0), tp);
free_irq(tp->irq, tp);
err_release_fw_2:
rtl_release_firmware(tp);
rtl8169_rx_clear(tp);
Expand Down Expand Up @@ -5360,6 +5360,7 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
dev_err(&pdev->dev, "Can't allocate interrupt\n");
return rc;
}
tp->irq = pci_irq_vector(pdev, 0);

INIT_WORK(&tp->wk.work, rtl_task);

Expand Down Expand Up @@ -5435,8 +5436,7 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
return rc;

netdev_info(dev, "%s, %pM, XID %03x, IRQ %d\n",
rtl_chip_infos[chipset].name, dev->dev_addr, xid,
pci_irq_vector(pdev, 0));
rtl_chip_infos[chipset].name, dev->dev_addr, xid, tp->irq);

if (jumbo_max)
netdev_info(dev, "jumbo features [frames: %d bytes, tx checksumming: %s]\n",
Expand Down

0 comments on commit 1bd3277

Please sign in to comment.