stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: Giuseppe CAVALLARO <peppe.cavallaro@st.com>
Cc: Corentin Labbe <clabbe.montjoie@gmail.com>,
	Alexandre Torgue <alexandre.torgue@st.com>,
	<netdev@vger.kernel.org>, <stable@vger.kernel.org>
Subject: Re: [PATCH] net: ethernet: stmmac: properly set PS bit in MII configurations during reset
Date: Mon, 8 May 2017 21:12:30 +0200	[thread overview]
Message-ID: <20170508211230.58aeead9@free-electrons.com> (raw)
In-Reply-To: <49297ed2-84dc-3e9b-8f40-af915476a091@st.com>

Hello,

On Mon, 8 May 2017 16:28:21 +0200, Giuseppe CAVALLARO wrote:

> > I just see that GMAC_CONTROL and MAC_CTRL_REG are the same, so why not create a custom adjust_link for each dwmac type ?
> > This will permit to call it instead of set_ps() and remove lots of if (has_gmac) and co in stmmac_adjust_link()
> > Basicly replace all between "ctrl = readl()... and writel(ctrl)" by a sot of priv->hw->mac->adjust_link()
> >
> > It will also help a lot for my dwmac-sun8i inclusion (since I add some if has_sun8i:))  
> 
> Corentin, I think this is a good idea and maybe necessary now that the 
> driver is supporting a lot of chips.
> In the past it was sufficient to have a adjust link function and a 
> stmmac_hw_fix_mac_speed
> to invoke dedicated hook shared between MAC10/100 and GMAC inside STM 
> platforms.
> 
> Thomas, I wonder if you could take a look at the 
> priv->plat->fix_mac_speed. This can be used
> for setting internal registers too.

Once again, this is not called at the right time to fix the issue I'm
seeing with a MII PHY. I need to adjust the PS bit between asserting the
reset and polling for the reset bit to clear.

->fix_mac_speed() is called in the adjust_link() call-back, which is
called way too late.

Please, read again my patch and the description of the problem that I
have sent. But basically, any solution that does not allow to set the
PS bit between asserting the DMA reset bit and polling for it to clear
will not work for MII PHYs.

Best regards,

Thomas Petazzoni
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

  reply	other threads:[~2017-05-08 19:12 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-27  9:45 [PATCH] net: ethernet: stmmac: properly set PS bit in MII configurations during reset Thomas Petazzoni
2017-05-02 19:00 ` David Miller
2017-05-03  8:13 ` Giuseppe CAVALLARO
2017-05-03 14:30   ` Corentin Labbe
2017-05-08 14:28     ` Giuseppe CAVALLARO
2017-05-08 19:12       ` Thomas Petazzoni [this message]
2017-05-10  7:03         ` Giuseppe CAVALLARO
2017-05-10  7:18           ` Thomas Petazzoni
2017-05-15 14:27             ` Thomas Petazzoni
2017-06-25 12:32               ` Thomas Petazzoni
2017-06-28 14:40                 ` Giuseppe CAVALLARO
2017-07-29 19:54                   ` Thomas Petazzoni
2017-08-02 12:33                     ` Giuseppe CAVALLARO
2017-05-03 15:11   ` Thomas Petazzoni

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=20170508211230.58aeead9@free-electrons.com \
    --to=thomas.petazzoni@free-electrons.com \
    --cc=alexandre.torgue@st.com \
    --cc=clabbe.montjoie@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=peppe.cavallaro@st.com \
    --cc=stable@vger.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).