Skip to content
/ linux Public

Commit 268fd55

Browse files
Russell King (Oracle)gregkh
authored andcommitted
net: stmmac: remove support for lpi_intr_o
commit 14eb64d upstream. The dwmac databook for v3.74a states that lpi_intr_o is a sideband signal which should be used to ungate the application clock, and this signal is synchronous to the receive clock. The receive clock can run at 2.5, 25 or 125MHz depending on the media speed, and can stop under the control of the link partner. This means that the time it takes to clear is dependent on the negotiated media speed, and thus can be 8, 40, or 400ns after reading the LPI control and status register. It has been observed with some aggressive link partners, this clock can stop while lpi_intr_o is still asserted, meaning that the signal remains asserted for an indefinite period that the local system has no direct control over. The LPI interrupts will still be signalled through the main interrupt path in any case, and this path is not dependent on the receive clock. This, since we do not gate the application clock, and the chances of adding clock gating in the future are slim due to the clocks being ill-defined, lpi_intr_o serves no useful purpose. Remove the code which requests the interrupt, and all associated code. Reported-by: Ovidiu Panait <ovidiu.panait.rb@renesas.com> Tested-by: Ovidiu Panait <ovidiu.panait.rb@renesas.com> # Renesas RZ/V2H board Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Link: https://patch.msgid.link/E1vnJbt-00000007YYN-28nm@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Ovidiu Panait <ovidiu.panait.rb@renesas.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent fbab8c0 commit 268fd55

File tree

7 files changed

+0
-59
lines changed

7 files changed

+0
-59
lines changed

drivers/net/ethernet/stmicro/stmmac/common.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,6 @@ enum request_irq_err {
371371
REQ_IRQ_ERR_RX,
372372
REQ_IRQ_ERR_SFTY_UE,
373373
REQ_IRQ_ERR_SFTY_CE,
374-
REQ_IRQ_ERR_LPI,
375374
REQ_IRQ_ERR_WOL,
376375
REQ_IRQ_ERR_MAC,
377376
REQ_IRQ_ERR_NO,

drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,6 @@ static int intel_mgbe_common_data(struct pci_dev *pdev,
612612

613613
/* Setup MSI vector offset specific to Intel mGbE controller */
614614
plat->msi_mac_vec = 29;
615-
plat->msi_lpi_vec = 28;
616615
plat->msi_sfty_ce_vec = 27;
617616
plat->msi_sfty_ue_vec = 26;
618617
plat->msi_rx_base_vec = 0;
@@ -998,8 +997,6 @@ static int stmmac_config_multi_msi(struct pci_dev *pdev,
998997
res->irq = pci_irq_vector(pdev, plat->msi_mac_vec);
999998
if (plat->msi_wol_vec < STMMAC_MSI_VEC_MAX)
1000999
res->wol_irq = pci_irq_vector(pdev, plat->msi_wol_vec);
1001-
if (plat->msi_lpi_vec < STMMAC_MSI_VEC_MAX)
1002-
res->lpi_irq = pci_irq_vector(pdev, plat->msi_lpi_vec);
10031000
if (plat->msi_sfty_ce_vec < STMMAC_MSI_VEC_MAX)
10041001
res->sfty_ce_irq = pci_irq_vector(pdev, plat->msi_sfty_ce_vec);
10051002
if (plat->msi_sfty_ue_vec < STMMAC_MSI_VEC_MAX)
@@ -1081,7 +1078,6 @@ static int intel_eth_pci_probe(struct pci_dev *pdev,
10811078
*/
10821079
plat->msi_mac_vec = STMMAC_MSI_VEC_MAX;
10831080
plat->msi_wol_vec = STMMAC_MSI_VEC_MAX;
1084-
plat->msi_lpi_vec = STMMAC_MSI_VEC_MAX;
10851081
plat->msi_sfty_ce_vec = STMMAC_MSI_VEC_MAX;
10861082
plat->msi_sfty_ue_vec = STMMAC_MSI_VEC_MAX;
10871083
plat->msi_rx_base_vec = STMMAC_MSI_VEC_MAX;

drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,6 @@ static int loongson_dwmac_probe(struct pci_dev *pdev, const struct pci_device_id
138138
res.wol_irq = res.irq;
139139
}
140140

141-
res.lpi_irq = of_irq_get_byname(np, "eth_lpi");
142-
if (res.lpi_irq < 0) {
143-
dev_err(&pdev->dev, "IRQ eth_lpi not found\n");
144-
ret = -ENODEV;
145-
goto err_disable_msi;
146-
}
147-
148141
ret = stmmac_dvr_probe(&pdev->dev, plat, &res);
149142
if (ret)
150143
goto err_disable_msi;

drivers/net/ethernet/stmicro/stmmac/stmmac.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ struct stmmac_resources {
2929
void __iomem *addr;
3030
u8 mac[ETH_ALEN];
3131
int wol_irq;
32-
int lpi_irq;
3332
int irq;
3433
int sfty_ce_irq;
3534
int sfty_ue_irq;
@@ -260,7 +259,6 @@ struct stmmac_priv {
260259
bool wol_irq_disabled;
261260
int clk_csr;
262261
struct timer_list eee_ctrl_timer;
263-
int lpi_irq;
264262
int eee_enabled;
265263
int eee_active;
266264
int tx_lpi_timer;

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -3496,10 +3496,6 @@ static void stmmac_free_irq(struct net_device *dev,
34963496
free_irq(priv->sfty_ce_irq, dev);
34973497
fallthrough;
34983498
case REQ_IRQ_ERR_SFTY_CE:
3499-
if (priv->lpi_irq > 0 && priv->lpi_irq != dev->irq)
3500-
free_irq(priv->lpi_irq, dev);
3501-
fallthrough;
3502-
case REQ_IRQ_ERR_LPI:
35033499
if (priv->wol_irq > 0 && priv->wol_irq != dev->irq)
35043500
free_irq(priv->wol_irq, dev);
35053501
fallthrough;
@@ -3554,24 +3550,6 @@ static int stmmac_request_irq_multi_msi(struct net_device *dev)
35543550
}
35553551
}
35563552

3557-
/* Request the LPI IRQ in case of another line
3558-
* is used for LPI
3559-
*/
3560-
if (priv->lpi_irq > 0 && priv->lpi_irq != dev->irq) {
3561-
int_name = priv->int_name_lpi;
3562-
sprintf(int_name, "%s:%s", dev->name, "lpi");
3563-
ret = request_irq(priv->lpi_irq,
3564-
stmmac_mac_interrupt,
3565-
0, int_name, dev);
3566-
if (unlikely(ret < 0)) {
3567-
netdev_err(priv->dev,
3568-
"%s: alloc lpi MSI %d (error: %d)\n",
3569-
__func__, priv->lpi_irq, ret);
3570-
irq_err = REQ_IRQ_ERR_LPI;
3571-
goto irq_error;
3572-
}
3573-
}
3574-
35753553
/* Request the Safety Feature Correctible Error line in
35763554
* case of another line is used
35773555
*/
@@ -3695,19 +3673,6 @@ static int stmmac_request_irq_single(struct net_device *dev)
36953673
}
36963674
}
36973675

3698-
/* Request the IRQ lines */
3699-
if (priv->lpi_irq > 0 && priv->lpi_irq != dev->irq) {
3700-
ret = request_irq(priv->lpi_irq, stmmac_interrupt,
3701-
IRQF_SHARED, dev->name, dev);
3702-
if (unlikely(ret < 0)) {
3703-
netdev_err(priv->dev,
3704-
"%s: ERROR: allocating the LPI IRQ %d (%d)\n",
3705-
__func__, priv->lpi_irq, ret);
3706-
irq_err = REQ_IRQ_ERR_LPI;
3707-
goto irq_error;
3708-
}
3709-
}
3710-
37113676
return 0;
37123677

37133678
irq_error:
@@ -7436,7 +7401,6 @@ int stmmac_dvr_probe(struct device *device,
74367401

74377402
priv->dev->irq = res->irq;
74387403
priv->wol_irq = res->wol_irq;
7439-
priv->lpi_irq = res->lpi_irq;
74407404
priv->sfty_ce_irq = res->sfty_ce_irq;
74417405
priv->sfty_ue_irq = res->sfty_ue_irq;
74427406
for (i = 0; i < MTL_MAX_RX_QUEUES; i++)

drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -762,14 +762,6 @@ int stmmac_get_platform_resources(struct platform_device *pdev,
762762
stmmac_res->wol_irq = stmmac_res->irq;
763763
}
764764

765-
stmmac_res->lpi_irq =
766-
platform_get_irq_byname_optional(pdev, "eth_lpi");
767-
if (stmmac_res->lpi_irq < 0) {
768-
if (stmmac_res->lpi_irq == -EPROBE_DEFER)
769-
return -EPROBE_DEFER;
770-
dev_info(&pdev->dev, "IRQ eth_lpi not found\n");
771-
}
772-
773765
stmmac_res->addr = devm_platform_ioremap_resource(pdev, 0);
774766

775767
return PTR_ERR_OR_ZERO(stmmac_res->addr);

include/linux/stmmac.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,6 @@ struct plat_stmmacenet_data {
306306
int ext_snapshot_num;
307307
int msi_mac_vec;
308308
int msi_wol_vec;
309-
int msi_lpi_vec;
310309
int msi_sfty_ce_vec;
311310
int msi_sfty_ue_vec;
312311
int msi_rx_base_vec;

0 commit comments

Comments
 (0)