From: David Miller <davem@davemloft.net>
To: niklas.cassel@axis.com
Cc: peppe.cavallaro@st.com, alexandre.torgue@st.com,
niklass@axis.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v2] net: stmmac: fix LPI transitioning for dwmac4
Date: Tue, 14 Nov 2017 22:05:09 +0900 (KST) [thread overview]
Message-ID: <20171114.220509.510877965546682781.davem@davemloft.net> (raw)
In-Reply-To: <20171114101555.18902-1-niklas.cassel@axis.com>
From: Niklas Cassel <niklas.cassel@axis.com>
Date: Tue, 14 Nov 2017 11:15:54 +0100
> The LPI transitioning logic in stmmac_main uses
> priv->tx_path_in_lpi_mode to enter/exit LPI.
>
> However, priv->tx_path_in_lpi_mode is assigned
> using the return value from host_irq_status().
>
> So for dwmac4, priv->tx_path_in_lpi_mode was always false,
> so stmmac_tx_clean() would always try to put us in eee mode,
> and stmmac_xmit() would never take us out of eee mode.
>
> To fix this, make host_irq_status() read and return the LPI
> irq status also for dwmac4.
>
> This also increments the existing LPI counters, so that
> ethtool --statistics shows LPI transitions also for dwmac4.
>
> For dwmac1000, irqs are enabled/disabled using the register
> named "Interrupt Mask Register", and thus setting a bit disables
> that specific irq.
>
> For dwmac4 the matching register is named "MAC_Interrupt_Enable",
> and thus setting a bit enables that specific irq.
>
> Looking at dwmac1000_core.c, the irqs that are always enabled are:
> LPI and PMT.
>
> Looking at dwmac4_core.c, the irqs that are always enabled are:
> PMT.
>
> To be able to read the LPI irq status, we need to enable the LPI
> irq also for dwmac4.
>
> Signed-off-by: Niklas Cassel <niklas.cassel@axis.com>
Applied.
prev parent reply other threads:[~2017-11-14 13:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-14 10:15 Niklas Cassel
2017-11-14 13:05 ` David Miller [this message]
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=20171114.220509.510877965546682781.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=alexandre.torgue@st.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=niklas.cassel@axis.com \
--cc=niklass@axis.com \
--cc=peppe.cavallaro@st.com \
/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
all inboxes | Powered by JetHome®