From: Andrey Konovalov <andrey.konovalov@linaro.org>
To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, robh+dt@kernel.org,
krzysztof.kozlowski+dt@linaro.org, alexandre.torgue@foss.st.com,
peppe.cavallaro@st.com, joabreu@synopsys.com,
mcoquelin.stm32@gmail.com
Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
netdev@vger.kernel.org,
Andrey Konovalov <andrey.konovalov@linaro.org>
Subject: [PATCH 0/2] net: stmmac: add DT parameter to keep RX_CLK running in LPI state
Date: Mon, 23 Jan 2023 16:37:45 +0300 [thread overview]
Message-ID: <20230123133747.18896-1-andrey.konovalov@linaro.org> (raw)
On my qcs404 based board the ethernet MAC has issues with handling
Rx LPI exit / Rx LPI entry interrupts.
When in LPI mode the "refresh transmission" is received, the driver may
see both "Rx LPI exit", and "Rx LPI entry" bits set in the single read from
GMAC4_LPI_CTRL_STATUS register (vs "Rx LPI exit" first, and "Rx LPI entry"
then). In this case an interrupt storm happens: the LPI interrupt is
triggered every few microseconds - with all the status bits in the
GMAC4_LPI_CTRL_STATUS register being read as zeros. This interrupt storm
continues until a normal non-zero status is read from GMAC4_LPI_CTRL_STATUS
register (single "Rx LPI exit", or "Tx LPI exit").
The reason seems to be in the hardware not being able to properly clear
the "Rx LPI exit" interrupt if GMAC4_LPI_CTRL_STATUS register is read
after Rx LPI mode is entered again.
The current driver unconditionally sets the "Clock-stop enable" bit
(bit 10 in PHY's PCS Control 1 register) when calling phy_init_eee().
Not setting this bit - so that the PHY continues to provide RX_CLK
to the ethernet controller during Rx LPI state - prevents the LPI
interrupt storm.
This patch set adds a new parameter to the stmmac DT:
snps,rx-clk-runs-in-lpi.
If this parameter is present in the device tree, the driver configures
the PHY not to stop RX_CLK after entering Rx LPI state.
Andrey Konovalov (2):
dt-bindings: net: snps,dwmac: add snps,rx-clk-runs-in-lpi parameter
net: stmmac: consider snps,rx-clk-runs-in-lpi DT parameter
Documentation/devicetree/bindings/net/snps,dwmac.yaml | 5 +++++
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 ++-
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 3 +++
include/linux/stmmac.h | 1 +
4 files changed, 11 insertions(+), 1 deletion(-)
--
2.34.1
next reply other threads:[~2023-01-23 13:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-23 13:37 Andrey Konovalov [this message]
2023-01-23 13:37 ` [PATCH 1/2] dt-bindings: net: snps,dwmac: add snps,rx-clk-runs-in-lpi parameter Andrey Konovalov
2023-01-23 13:37 ` [PATCH 2/2] net: stmmac: consider snps,rx-clk-runs-in-lpi DT parameter Andrey Konovalov
2023-01-24 1:04 ` [PATCH 0/2] net: stmmac: add DT parameter to keep RX_CLK running in LPI state Andrew Lunn
2023-01-24 8:49 ` Andrey Konovalov
2023-01-24 14:09 ` Andrew Lunn
2023-01-25 19:14 ` Rob Herring
2023-01-26 21:51 ` Andrey Konovalov
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=20230123133747.18896-1-andrey.konovalov@linaro.org \
--to=andrey.konovalov@linaro.org \
--cc=alexandre.torgue@foss.st.com \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=joabreu@synopsys.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mcoquelin.stm32@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=peppe.cavallaro@st.com \
--cc=robh+dt@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).