Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: stmmac: remove support for lpi_intr_o

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>

authored by

Russell King (Oracle) and committed by
Jakub Kicinski
14eb64db 15dd03df

-59
-1
drivers/net/ethernet/stmicro/stmmac/common.h
··· 394 394 REQ_IRQ_ERR_SFTY, 395 395 REQ_IRQ_ERR_SFTY_UE, 396 396 REQ_IRQ_ERR_SFTY_CE, 397 - REQ_IRQ_ERR_LPI, 398 397 REQ_IRQ_ERR_WOL, 399 398 REQ_IRQ_ERR_MAC, 400 399 REQ_IRQ_ERR_NO,
-4
drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
··· 719 719 720 720 /* Setup MSI vector offset specific to Intel mGbE controller */ 721 721 plat->msi_mac_vec = 29; 722 - plat->msi_lpi_vec = 28; 723 722 plat->msi_sfty_ce_vec = 27; 724 723 plat->msi_sfty_ue_vec = 26; 725 724 plat->msi_rx_base_vec = 0; ··· 1176 1177 res->irq = pci_irq_vector(pdev, plat->msi_mac_vec); 1177 1178 if (plat->msi_wol_vec < STMMAC_MSI_VEC_MAX) 1178 1179 res->wol_irq = pci_irq_vector(pdev, plat->msi_wol_vec); 1179 - if (plat->msi_lpi_vec < STMMAC_MSI_VEC_MAX) 1180 - res->lpi_irq = pci_irq_vector(pdev, plat->msi_lpi_vec); 1181 1180 if (plat->msi_sfty_ce_vec < STMMAC_MSI_VEC_MAX) 1182 1181 res->sfty_ce_irq = pci_irq_vector(pdev, plat->msi_sfty_ce_vec); 1183 1182 if (plat->msi_sfty_ue_vec < STMMAC_MSI_VEC_MAX) ··· 1291 1294 */ 1292 1295 plat->msi_mac_vec = STMMAC_MSI_VEC_MAX; 1293 1296 plat->msi_wol_vec = STMMAC_MSI_VEC_MAX; 1294 - plat->msi_lpi_vec = STMMAC_MSI_VEC_MAX; 1295 1297 plat->msi_sfty_ce_vec = STMMAC_MSI_VEC_MAX; 1296 1298 plat->msi_sfty_ue_vec = STMMAC_MSI_VEC_MAX; 1297 1299 plat->msi_rx_base_vec = STMMAC_MSI_VEC_MAX;
-7
drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
··· 442 442 res->wol_irq = res->irq; 443 443 } 444 444 445 - res->lpi_irq = of_irq_get_byname(np, "eth_lpi"); 446 - if (res->lpi_irq < 0) { 447 - dev_err(&pdev->dev, "IRQ eth_lpi not found\n"); 448 - ret = -ENODEV; 449 - goto err_put_node; 450 - } 451 - 452 445 ret = device_get_phy_mode(&pdev->dev); 453 446 if (ret < 0) { 454 447 dev_err(&pdev->dev, "phy_mode not found\n");
-2
drivers/net/ethernet/stmicro/stmmac/stmmac.h
··· 31 31 void __iomem *addr; 32 32 u8 mac[ETH_ALEN]; 33 33 int wol_irq; 34 - int lpi_irq; 35 34 int irq; 36 35 int sfty_irq; 37 36 int sfty_ce_irq; ··· 296 297 int wol_irq; 297 298 u32 gmii_address_bus_config; 298 299 struct timer_list eee_ctrl_timer; 299 - int lpi_irq; 300 300 u32 tx_lpi_timer; 301 301 bool tx_lpi_clk_stop; 302 302 bool eee_enabled;
-36
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
··· 3769 3769 free_irq(priv->sfty_ce_irq, dev); 3770 3770 fallthrough; 3771 3771 case REQ_IRQ_ERR_SFTY_CE: 3772 - if (priv->lpi_irq > 0 && priv->lpi_irq != dev->irq) 3773 - free_irq(priv->lpi_irq, dev); 3774 - fallthrough; 3775 - case REQ_IRQ_ERR_LPI: 3776 3772 if (priv->wol_irq > 0 && priv->wol_irq != dev->irq) 3777 3773 free_irq(priv->wol_irq, dev); 3778 3774 fallthrough; ··· 3822 3826 "%s: alloc wol MSI %d (error: %d)\n", 3823 3827 __func__, priv->wol_irq, ret); 3824 3828 irq_err = REQ_IRQ_ERR_WOL; 3825 - goto irq_error; 3826 - } 3827 - } 3828 - 3829 - /* Request the LPI IRQ in case of another line 3830 - * is used for LPI 3831 - */ 3832 - if (priv->lpi_irq > 0 && priv->lpi_irq != dev->irq) { 3833 - int_name = priv->int_name_lpi; 3834 - sprintf(int_name, "%s:%s", dev->name, "lpi"); 3835 - ret = request_irq(priv->lpi_irq, 3836 - stmmac_mac_interrupt, 3837 - 0, int_name, dev); 3838 - if (unlikely(ret < 0)) { 3839 - netdev_err(priv->dev, 3840 - "%s: alloc lpi MSI %d (error: %d)\n", 3841 - __func__, priv->lpi_irq, ret); 3842 - irq_err = REQ_IRQ_ERR_LPI; 3843 3829 goto irq_error; 3844 3830 } 3845 3831 } ··· 3961 3983 "%s: ERROR: allocating the WoL IRQ %d (%d)\n", 3962 3984 __func__, priv->wol_irq, ret); 3963 3985 irq_err = REQ_IRQ_ERR_WOL; 3964 - goto irq_error; 3965 - } 3966 - } 3967 - 3968 - /* Request the IRQ lines */ 3969 - if (priv->lpi_irq > 0 && priv->lpi_irq != dev->irq) { 3970 - ret = request_irq(priv->lpi_irq, stmmac_interrupt, 3971 - IRQF_SHARED, dev->name, dev); 3972 - if (unlikely(ret < 0)) { 3973 - netdev_err(priv->dev, 3974 - "%s: ERROR: allocating the LPI IRQ %d (%d)\n", 3975 - __func__, priv->lpi_irq, ret); 3976 - irq_err = REQ_IRQ_ERR_LPI; 3977 3986 goto irq_error; 3978 3987 } 3979 3988 } ··· 7747 7782 7748 7783 priv->dev->irq = res->irq; 7749 7784 priv->wol_irq = res->wol_irq; 7750 - priv->lpi_irq = res->lpi_irq; 7751 7785 priv->sfty_irq = res->sfty_irq; 7752 7786 priv->sfty_ce_irq = res->sfty_ce_irq; 7753 7787 priv->sfty_ue_irq = res->sfty_ue_irq;
-8
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
··· 725 725 stmmac_res->wol_irq = stmmac_res->irq; 726 726 } 727 727 728 - stmmac_res->lpi_irq = 729 - platform_get_irq_byname_optional(pdev, "eth_lpi"); 730 - if (stmmac_res->lpi_irq < 0) { 731 - if (stmmac_res->lpi_irq == -EPROBE_DEFER) 732 - return -EPROBE_DEFER; 733 - dev_info(&pdev->dev, "IRQ eth_lpi not found\n"); 734 - } 735 - 736 728 stmmac_res->sfty_irq = 737 729 platform_get_irq_byname_optional(pdev, "sfty"); 738 730 if (stmmac_res->sfty_irq < 0) {
-1
include/linux/stmmac.h
··· 300 300 int int_snapshot_num; 301 301 int msi_mac_vec; 302 302 int msi_wol_vec; 303 - int msi_lpi_vec; 304 303 int msi_sfty_ce_vec; 305 304 int msi_sfty_ue_vec; 306 305 int msi_rx_base_vec;