net: stmmac: enable/disable irq LPM

Free_irq on suspend and request_irq on resume.

Change-Id: I5340b16b21eeb11aa3d950d22d64c7681efc2293
Signed-off-by: Srinath Pandey <quic_srinpand@quicinc.com>
Signed-off-by: Vivek Yadav <quic_viveyada@quicinc.com>
This commit is contained in:
Srinath Pandey
2023-10-26 19:42:09 +05:30
committed by Vivek Yadav
parent f0a5f91c2a
commit dceb8b6fb7
2 changed files with 19 additions and 0 deletions

View File

@@ -205,6 +205,7 @@ struct stmmac_priv {
int tx_coalesce;
int hwts_tx_en;
int irq_number;
bool tx_path_in_lpi_mode;
bool tso;
int sph;

View File

@@ -3956,6 +3956,8 @@ static int stmmac_open(struct net_device *dev)
if (ret)
goto irq_error;
priv->irq_number = dev->irq;
stmmac_enable_all_queues(priv);
netif_tx_start_all_queues(priv->dev);
stmmac_enable_all_dma_irq(priv);
@@ -7659,6 +7661,12 @@ int stmmac_suspend(struct device *dev)
hrtimer_cancel(&priv->tx_queue[chan].txtimer);
}
/* Free the IRQ lines */
if (priv->irq_number != 0) {
free_irq(ndev->irq, ndev);
priv->irq_number = 0;
}
if (priv->eee_enabled) {
priv->tx_path_in_lpi_mode = false;
del_timer_sync(&priv->eee_ctrl_timer);
@@ -7813,6 +7821,16 @@ int stmmac_resume(struct device *dev)
stmmac_restore_hw_vlan_rx_fltr(priv, ndev, priv->hw);
if (priv->irq_number == 0) {
ret = request_irq(ndev->irq, stmmac_interrupt,
IRQF_SHARED, ndev->name, ndev);
if (unlikely(ret < 0))
netdev_err(priv->dev,
"%s: ERROR: allocating the IRQ %d (error: %d)\n",
__func__, ndev->irq, ret);
priv->irq_number = ndev->irq;
}
stmmac_enable_all_queues(priv);
stmmac_enable_all_dma_irq(priv);