Merge branch 'stmmac-fixes'
Jose Abreu says: ==================== net: stmmac: Misc Fixes Some small fixes for stmmac targeting -net. Detailed info in commit log. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
commit
5fea7f1091
@ -263,6 +263,7 @@ static int dwxgmac2_dma_interrupt(void __iomem *ioaddr,
|
|||||||
struct stmmac_extra_stats *x, u32 chan)
|
struct stmmac_extra_stats *x, u32 chan)
|
||||||
{
|
{
|
||||||
u32 intr_status = readl(ioaddr + XGMAC_DMA_CH_STATUS(chan));
|
u32 intr_status = readl(ioaddr + XGMAC_DMA_CH_STATUS(chan));
|
||||||
|
u32 intr_en = readl(ioaddr + XGMAC_DMA_CH_INT_EN(chan));
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
/* ABNORMAL interrupts */
|
/* ABNORMAL interrupts */
|
||||||
@ -282,8 +283,7 @@ static int dwxgmac2_dma_interrupt(void __iomem *ioaddr,
|
|||||||
x->normal_irq_n++;
|
x->normal_irq_n++;
|
||||||
|
|
||||||
if (likely(intr_status & XGMAC_RI)) {
|
if (likely(intr_status & XGMAC_RI)) {
|
||||||
u32 value = readl(ioaddr + XGMAC_DMA_CH_INT_EN(chan));
|
if (likely(intr_en & XGMAC_RIE)) {
|
||||||
if (likely(value & XGMAC_RIE)) {
|
|
||||||
x->rx_normal_irq_n++;
|
x->rx_normal_irq_n++;
|
||||||
ret |= handle_rx;
|
ret |= handle_rx;
|
||||||
}
|
}
|
||||||
@ -295,7 +295,7 @@ static int dwxgmac2_dma_interrupt(void __iomem *ioaddr,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Clear interrupts */
|
/* Clear interrupts */
|
||||||
writel(~0x0, ioaddr + XGMAC_DMA_CH_STATUS(chan));
|
writel(intr_en & intr_status, ioaddr + XGMAC_DMA_CH_STATUS(chan));
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -3525,27 +3525,28 @@ static int stmmac_napi_poll(struct napi_struct *napi, int budget)
|
|||||||
struct stmmac_channel *ch =
|
struct stmmac_channel *ch =
|
||||||
container_of(napi, struct stmmac_channel, napi);
|
container_of(napi, struct stmmac_channel, napi);
|
||||||
struct stmmac_priv *priv = ch->priv_data;
|
struct stmmac_priv *priv = ch->priv_data;
|
||||||
int work_done = 0, work_rem = budget;
|
int work_done, rx_done = 0, tx_done = 0;
|
||||||
u32 chan = ch->index;
|
u32 chan = ch->index;
|
||||||
|
|
||||||
priv->xstats.napi_poll++;
|
priv->xstats.napi_poll++;
|
||||||
|
|
||||||
if (ch->has_tx) {
|
if (ch->has_tx)
|
||||||
int done = stmmac_tx_clean(priv, work_rem, chan);
|
tx_done = stmmac_tx_clean(priv, budget, chan);
|
||||||
|
if (ch->has_rx)
|
||||||
|
rx_done = stmmac_rx(priv, budget, chan);
|
||||||
|
|
||||||
work_done += done;
|
work_done = max(rx_done, tx_done);
|
||||||
work_rem -= done;
|
work_done = min(work_done, budget);
|
||||||
}
|
|
||||||
|
|
||||||
if (ch->has_rx) {
|
if (work_done < budget && napi_complete_done(napi, work_done)) {
|
||||||
int done = stmmac_rx(priv, work_rem, chan);
|
int stat;
|
||||||
|
|
||||||
work_done += done;
|
|
||||||
work_rem -= done;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (work_done < budget && napi_complete_done(napi, work_done))
|
|
||||||
stmmac_enable_dma_irq(priv, priv->ioaddr, chan);
|
stmmac_enable_dma_irq(priv, priv->ioaddr, chan);
|
||||||
|
stat = stmmac_dma_interrupt_status(priv, priv->ioaddr,
|
||||||
|
&priv->xstats, chan);
|
||||||
|
if (stat && napi_reschedule(napi))
|
||||||
|
stmmac_disable_dma_irq(priv, priv->ioaddr, chan);
|
||||||
|
}
|
||||||
|
|
||||||
return work_done;
|
return work_done;
|
||||||
}
|
}
|
||||||
@ -4168,6 +4169,18 @@ static int stmmac_hw_init(struct stmmac_priv *priv)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Rx Watchdog is available in the COREs newer than the 3.40.
|
||||||
|
* In some case, for example on bugged HW this feature
|
||||||
|
* has to be disable and this can be done by passing the
|
||||||
|
* riwt_off field from the platform.
|
||||||
|
*/
|
||||||
|
if (((priv->synopsys_id >= DWMAC_CORE_3_50) ||
|
||||||
|
(priv->plat->has_xgmac)) && (!priv->plat->riwt_off)) {
|
||||||
|
priv->use_riwt = 1;
|
||||||
|
dev_info(priv->device,
|
||||||
|
"Enable RX Mitigation via HW Watchdog Timer\n");
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4300,18 +4313,6 @@ int stmmac_dvr_probe(struct device *device,
|
|||||||
if (flow_ctrl)
|
if (flow_ctrl)
|
||||||
priv->flow_ctrl = FLOW_AUTO; /* RX/TX pause on */
|
priv->flow_ctrl = FLOW_AUTO; /* RX/TX pause on */
|
||||||
|
|
||||||
/* Rx Watchdog is available in the COREs newer than the 3.40.
|
|
||||||
* In some case, for example on bugged HW this feature
|
|
||||||
* has to be disable and this can be done by passing the
|
|
||||||
* riwt_off field from the platform.
|
|
||||||
*/
|
|
||||||
if (((priv->synopsys_id >= DWMAC_CORE_3_50) ||
|
|
||||||
(priv->plat->has_xgmac)) && (!priv->plat->riwt_off)) {
|
|
||||||
priv->use_riwt = 1;
|
|
||||||
dev_info(priv->device,
|
|
||||||
"Enable RX Mitigation via HW Watchdog Timer\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Setup channels NAPI */
|
/* Setup channels NAPI */
|
||||||
maxq = max(priv->plat->rx_queues_to_use, priv->plat->tx_queues_to_use);
|
maxq = max(priv->plat->rx_queues_to_use, priv->plat->tx_queues_to_use);
|
||||||
|
|
||||||
|
@ -299,7 +299,17 @@ static int stmmac_pci_probe(struct pci_dev *pdev,
|
|||||||
*/
|
*/
|
||||||
static void stmmac_pci_remove(struct pci_dev *pdev)
|
static void stmmac_pci_remove(struct pci_dev *pdev)
|
||||||
{
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
stmmac_dvr_remove(&pdev->dev);
|
stmmac_dvr_remove(&pdev->dev);
|
||||||
|
|
||||||
|
for (i = 0; i <= PCI_STD_RESOURCE_END; i++) {
|
||||||
|
if (pci_resource_len(pdev, i) == 0)
|
||||||
|
continue;
|
||||||
|
pcim_iounmap_regions(pdev, BIT(i));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
pci_disable_device(pdev);
|
pci_disable_device(pdev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -301,6 +301,8 @@ static int tc_setup_cbs(struct stmmac_priv *priv,
|
|||||||
/* Queue 0 is not AVB capable */
|
/* Queue 0 is not AVB capable */
|
||||||
if (queue <= 0 || queue >= tx_queues_count)
|
if (queue <= 0 || queue >= tx_queues_count)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
if (!priv->dma_cap.av)
|
||||||
|
return -EOPNOTSUPP;
|
||||||
if (priv->speed != SPEED_100 && priv->speed != SPEED_1000)
|
if (priv->speed != SPEED_100 && priv->speed != SPEED_1000)
|
||||||
return -EOPNOTSUPP;
|
return -EOPNOTSUPP;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user