qtnfmac: lock access to h/w in tx path
Fix tx path regression. Lock should be held when queuing packets to h/w fifos in order to properly handle configurations with multiple enabled interfaces. Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This commit is contained in:
parent
35f62727df
commit
20da2ec06b
|
@ -661,14 +661,18 @@ static int qtnf_pcie_data_tx(struct qtnf_bus *bus, struct sk_buff *skb)
|
||||||
struct qtnf_pcie_bus_priv *priv = (void *)get_bus_priv(bus);
|
struct qtnf_pcie_bus_priv *priv = (void *)get_bus_priv(bus);
|
||||||
dma_addr_t txbd_paddr, skb_paddr;
|
dma_addr_t txbd_paddr, skb_paddr;
|
||||||
struct qtnf_tx_bd *txbd;
|
struct qtnf_tx_bd *txbd;
|
||||||
|
unsigned long flags;
|
||||||
int len, i;
|
int len, i;
|
||||||
u32 info;
|
u32 info;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
|
spin_lock_irqsave(&priv->tx0_lock, flags);
|
||||||
|
|
||||||
if (!qtnf_tx_queue_ready(priv)) {
|
if (!qtnf_tx_queue_ready(priv)) {
|
||||||
if (skb->dev)
|
if (skb->dev)
|
||||||
netif_stop_queue(skb->dev);
|
netif_stop_queue(skb->dev);
|
||||||
|
|
||||||
|
spin_unlock_irqrestore(&priv->tx0_lock, flags);
|
||||||
return NETDEV_TX_BUSY;
|
return NETDEV_TX_BUSY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -717,8 +721,10 @@ tx_done:
|
||||||
dev_kfree_skb_any(skb);
|
dev_kfree_skb_any(skb);
|
||||||
}
|
}
|
||||||
|
|
||||||
qtnf_pcie_data_tx_reclaim(priv);
|
|
||||||
priv->tx_done_count++;
|
priv->tx_done_count++;
|
||||||
|
spin_unlock_irqrestore(&priv->tx0_lock, flags);
|
||||||
|
|
||||||
|
qtnf_pcie_data_tx_reclaim(priv);
|
||||||
|
|
||||||
return NETDEV_TX_OK;
|
return NETDEV_TX_OK;
|
||||||
}
|
}
|
||||||
|
@ -1247,6 +1253,7 @@ static int qtnf_pcie_probe(struct pci_dev *pdev, const struct pci_device_id *id)
|
||||||
strcpy(bus->fwname, QTN_PCI_PEARL_FW_NAME);
|
strcpy(bus->fwname, QTN_PCI_PEARL_FW_NAME);
|
||||||
init_completion(&bus->request_firmware_complete);
|
init_completion(&bus->request_firmware_complete);
|
||||||
mutex_init(&bus->bus_lock);
|
mutex_init(&bus->bus_lock);
|
||||||
|
spin_lock_init(&pcie_priv->tx0_lock);
|
||||||
spin_lock_init(&pcie_priv->irq_lock);
|
spin_lock_init(&pcie_priv->irq_lock);
|
||||||
spin_lock_init(&pcie_priv->tx_reclaim_lock);
|
spin_lock_init(&pcie_priv->tx_reclaim_lock);
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,8 @@ struct qtnf_pcie_bus_priv {
|
||||||
|
|
||||||
/* lock for tx reclaim operations */
|
/* lock for tx reclaim operations */
|
||||||
spinlock_t tx_reclaim_lock;
|
spinlock_t tx_reclaim_lock;
|
||||||
|
/* lock for tx0 operations */
|
||||||
|
spinlock_t tx0_lock;
|
||||||
u8 msi_enabled;
|
u8 msi_enabled;
|
||||||
int mps;
|
int mps;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue