From: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>
To: Serge Semin <fancer.lancer@gmail.com>
Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>,
Alexei Starovoitov <ast@kernel.org>,
Andrew Halaney <ahalaney@redhat.com>,
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>,
bpf@vger.kernel.org, Daniel Borkmann <daniel@iogearbox.net>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
Jesper Dangaard Brouer <hawk@kernel.org>,
John Fastabend <john.fastabend@gmail.com>,
Jose Abreu <joabreu@synopsys.com>,
linux-arm-kernel@lists.infradead.org,
linux-arm-msm@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
netdev@vger.kernel.org, Paolo Abeni <pabeni@redhat.com>,
Sneh Shah <quic_snehshah@quicinc.com>,
Vinod Koul <vkoul@kernel.org>
Subject: [PATCH RFC net-next v4 11/14] net: stmmac: pass stmmac_pcs into dwmac_pcs_isr()
Date: Mon, 05 Aug 2024 11:25:32 +0100 [thread overview]
Message-ID: <E1sauuC-000tvg-R6@rmk-PC.armlinux.org.uk> (raw)
In-Reply-To: <ZrCoQZKo74zvKMhT@shell.armlinux.org.uk>
As the stmmac_pcs has the base address of the PCS registers, pass
this into dwmac_pcs_isr() to avoid recalculating the base address.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c | 2 +-
drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c | 3 ++-
drivers/net/ethernet/stmicro/stmmac/stmmac_pcs.h | 7 +++----
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
index d2defa2e4996..2bed04403baa 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
@@ -296,7 +296,7 @@ static int dwmac1000_irq_status(struct mac_device_info *hw,
x->irq_rx_path_exit_lpi_mode_n++;
}
- dwmac_pcs_isr(ioaddr, GMAC_PCS_BASE, intr_status, x);
+ dwmac_pcs_isr(&hw->mac_pcs, intr_status, x);
if (intr_status & PCS_RGSMIIIS_IRQ) {
/* TODO Dummy-read to clear the IRQ status */
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
index 2f02bb47c952..12b7b93ce71e 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
@@ -873,7 +873,8 @@ static int dwmac4_irq_status(struct mac_device_info *hw,
x->irq_rx_path_exit_lpi_mode_n++;
}
- dwmac_pcs_isr(ioaddr, GMAC_PCS_BASE, intr_status, x);
+ dwmac_pcs_isr(&hw->mac_pcs, intr_status, x);
+
if (intr_status & PCS_RGSMIIIS_IRQ) {
/* TODO Dummy-read to clear the IRQ status */
readl(ioaddr + GMAC_PHYIF_CONTROL_STATUS);
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_pcs.h b/drivers/net/ethernet/stmicro/stmmac/stmmac_pcs.h
index 083128e0013c..48b635139fa5 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_pcs.h
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_pcs.h
@@ -61,18 +61,17 @@
/**
* dwmac_pcs_isr - TBI, RTBI, or SGMII PHY ISR
- * @ioaddr: IO registers pointer
- * @reg: Base address of the AN Control Register.
+ * @spcs: pointer to &struct stmmac_pcs
* @intr_status: GMAC core interrupt status
* @x: pointer to log these events as stats
* Description: it is the ISR for PCS events: Auto-Negotiation Completed and
* Link status.
*/
-static inline void dwmac_pcs_isr(void __iomem *ioaddr, u32 reg,
+static inline void dwmac_pcs_isr(struct stmmac_pcs *spcs,
unsigned int intr_status,
struct stmmac_extra_stats *x)
{
- u32 val = readl(ioaddr + GMAC_AN_STATUS(reg));
+ u32 val = readl(spcs->pcs_base + GMAC_AN_STATUS(0));
if (intr_status & PCS_ANE_IRQ) {
x->irq_pcs_ane_n++;
--
2.30.2
next prev parent reply other threads:[~2024-08-05 10:30 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-05 10:24 [PATCH RFC net-next v4 00/14] net: stmmac: convert stmmac "pcs" to phylink Russell King (Oracle)
2024-08-05 10:24 ` [PATCH RFC net-next v4 01/14] net: stmmac: qcom-ethqos: add ethqos_pcs_set_inband() Russell King (Oracle)
2024-08-05 10:24 ` [PATCH RFC net-next v4 02/14] net: stmmac: replace ioaddr with stmmac_priv for pcs_set_ane() method Russell King (Oracle)
2024-08-05 10:24 ` [PATCH RFC net-next v4 03/14] net: stmmac: remove pcs_get_adv_lp() support Russell King (Oracle)
2024-08-05 10:24 ` [PATCH RFC net-next v4 04/14] net: stmmac: add infrastructure for hwifs to provide PCS Russell King (Oracle)
2024-08-05 10:25 ` [PATCH RFC net-next v4 05/14] net: stmmac: provide core phylink PCS infrastructure Russell King (Oracle)
2024-08-05 10:25 ` [PATCH RFC net-next v4 06/14] net: stmmac: dwmac1000: convert sgmii/rgmii "pcs" to phylink Russell King (Oracle)
2024-08-05 10:25 ` [PATCH RFC net-next v4 07/14] net: stmmac: dwmac1000: move PCS interrupt control Russell King (Oracle)
2024-08-05 10:25 ` [PATCH RFC net-next v4 08/14] net: stmmac: dwmac4: convert sgmii/rgmii "pcs" to phylink Russell King (Oracle)
2024-08-05 10:25 ` [PATCH RFC net-next v4 09/14] net: stmmac: dwmac4: move PCS interrupt control Russell King (Oracle)
2024-08-05 10:25 ` [PATCH RFC net-next v4 10/14] net: stmmac: move dwmac_ctrl_ane() into stmmac_pcs.c Russell King (Oracle)
2024-08-05 10:25 ` Russell King (Oracle) [this message]
2024-08-05 10:25 ` [PATCH RFC net-next v4 12/14] net: stmmac: rename PCS registers Russell King (Oracle)
2024-08-05 10:25 ` [PATCH RFC net-next v4 13/14] net: stmmac: remove obsolete pcs methods and associated code Russell King (Oracle)
2024-08-05 10:25 ` [PATCH RFC net-next v4 14/14] net: stmmac: Activate Inband/PCS flag based on the selected iface Russell King
2024-08-06 18:56 ` [PATCH RFC net-next v4 00/14] net: stmmac: convert stmmac "pcs" to phylink Serge Semin
2024-08-07 9:21 ` Russell King (Oracle)
2024-08-08 20:42 ` Serge Semin
2024-09-04 21:26 ` Andrew Halaney
2024-09-05 21:00 ` Andrew Lunn
2024-09-05 21:16 ` Andrew Halaney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1sauuC-000tvg-R6@rmk-PC.armlinux.org.uk \
--to=rmk+kernel@armlinux.org.uk \
--cc=ahalaney@redhat.com \
--cc=alexandre.torgue@foss.st.com \
--cc=ast@kernel.org \
--cc=bartosz.golaszewski@linaro.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=fancer.lancer@gmail.com \
--cc=hawk@kernel.org \
--cc=joabreu@synopsys.com \
--cc=john.fastabend@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=quic_snehshah@quicinc.com \
--cc=vkoul@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).