Commit 2a600d97 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by David S. Miller

pch_gbe: Switch to new PCI IRQ allocation API

This removes custom flag handling.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9185a610
...@@ -613,7 +613,6 @@ struct pch_gbe_privdata { ...@@ -613,7 +613,6 @@ struct pch_gbe_privdata {
* @rx_ring: Pointer of Rx descriptor ring structure * @rx_ring: Pointer of Rx descriptor ring structure
* @rx_buffer_len: Receive buffer length * @rx_buffer_len: Receive buffer length
* @tx_queue_len: Transmit queue length * @tx_queue_len: Transmit queue length
* @have_msi: PCI MSI mode flag
* @pch_gbe_privdata: PCI Device ID driver_data * @pch_gbe_privdata: PCI Device ID driver_data
*/ */
...@@ -623,6 +622,7 @@ struct pch_gbe_adapter { ...@@ -623,6 +622,7 @@ struct pch_gbe_adapter {
atomic_t irq_sem; atomic_t irq_sem;
struct net_device *netdev; struct net_device *netdev;
struct pci_dev *pdev; struct pci_dev *pdev;
int irq;
struct net_device *polling_netdev; struct net_device *polling_netdev;
struct napi_struct napi; struct napi_struct napi;
struct pch_gbe_hw hw; struct pch_gbe_hw hw;
...@@ -637,7 +637,6 @@ struct pch_gbe_adapter { ...@@ -637,7 +637,6 @@ struct pch_gbe_adapter {
struct pch_gbe_rx_ring *rx_ring; struct pch_gbe_rx_ring *rx_ring;
unsigned long rx_buffer_len; unsigned long rx_buffer_len;
unsigned long tx_queue_len; unsigned long tx_queue_len;
bool have_msi;
bool rx_stop_flag; bool rx_stop_flag;
int hwts_tx_en; int hwts_tx_en;
int hwts_rx_en; int hwts_rx_en;
......
...@@ -781,11 +781,8 @@ static void pch_gbe_free_irq(struct pch_gbe_adapter *adapter) ...@@ -781,11 +781,8 @@ static void pch_gbe_free_irq(struct pch_gbe_adapter *adapter)
{ {
struct net_device *netdev = adapter->netdev; struct net_device *netdev = adapter->netdev;
free_irq(adapter->pdev->irq, netdev); free_irq(adapter->irq, netdev);
if (adapter->have_msi) { pci_free_irq_vectors(adapter->pdev);
pci_disable_msi(adapter->pdev);
netdev_dbg(netdev, "call pci_disable_msi\n");
}
} }
/** /**
...@@ -799,7 +796,7 @@ static void pch_gbe_irq_disable(struct pch_gbe_adapter *adapter) ...@@ -799,7 +796,7 @@ static void pch_gbe_irq_disable(struct pch_gbe_adapter *adapter)
atomic_inc(&adapter->irq_sem); atomic_inc(&adapter->irq_sem);
iowrite32(0, &hw->reg->INT_EN); iowrite32(0, &hw->reg->INT_EN);
ioread32(&hw->reg->INT_ST); ioread32(&hw->reg->INT_ST);
synchronize_irq(adapter->pdev->irq); synchronize_irq(adapter->irq);
netdev_dbg(adapter->netdev, "INT_EN reg : 0x%08x\n", netdev_dbg(adapter->netdev, "INT_EN reg : 0x%08x\n",
ioread32(&hw->reg->INT_EN)); ioread32(&hw->reg->INT_EN));
...@@ -1903,30 +1900,23 @@ static int pch_gbe_request_irq(struct pch_gbe_adapter *adapter) ...@@ -1903,30 +1900,23 @@ static int pch_gbe_request_irq(struct pch_gbe_adapter *adapter)
{ {
struct net_device *netdev = adapter->netdev; struct net_device *netdev = adapter->netdev;
int err; int err;
int flags;
flags = IRQF_SHARED; err = pci_alloc_irq_vectors(adapter->pdev, 1, 1, PCI_IRQ_ALL_TYPES);
adapter->have_msi = false; if (err < 0)
err = pci_enable_msi(adapter->pdev); return err;
netdev_dbg(netdev, "call pci_enable_msi\n");
if (err) { adapter->irq = pci_irq_vector(adapter->pdev, 0);
netdev_dbg(netdev, "call pci_enable_msi - Error: %d\n", err);
} else { err = request_irq(adapter->irq, &pch_gbe_intr, IRQF_SHARED,
flags = 0; netdev->name, netdev);
adapter->have_msi = true;
}
err = request_irq(adapter->pdev->irq, &pch_gbe_intr,
flags, netdev->name, netdev);
if (err) if (err)
netdev_err(netdev, "Unable to allocate interrupt Error: %d\n", netdev_err(netdev, "Unable to allocate interrupt Error: %d\n",
err); err);
netdev_dbg(netdev, netdev_dbg(netdev, "have_msi : %d return : 0x%04x\n",
"adapter->have_msi : %d flags : 0x%04x return : 0x%04x\n", pci_dev_msi_enabled(adapter->pdev), err);
adapter->have_msi, flags, err);
return err; return err;
} }
/** /**
* pch_gbe_up - Up GbE network device * pch_gbe_up - Up GbE network device
* @adapter: Board private structure * @adapter: Board private structure
...@@ -2399,9 +2389,9 @@ static void pch_gbe_netpoll(struct net_device *netdev) ...@@ -2399,9 +2389,9 @@ static void pch_gbe_netpoll(struct net_device *netdev)
{ {
struct pch_gbe_adapter *adapter = netdev_priv(netdev); struct pch_gbe_adapter *adapter = netdev_priv(netdev);
disable_irq(adapter->pdev->irq); disable_irq(adapter->irq);
pch_gbe_intr(adapter->pdev->irq, netdev); pch_gbe_intr(adapter->irq, netdev);
enable_irq(adapter->pdev->irq); enable_irq(adapter->irq);
} }
#endif #endif
......
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