mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Csókás Bence" <csokas.bence@prolan.hu>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Frank Li <Frank.Li@freescale.com>,
	"David S. Miller" <davem@davemloft.net>, <imx@lists.linux.dev>,
	<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	Richard Cochran <richardcochran@gmail.com>,
	Wei Fang <wei.fang@nxp.com>, Shenwei Wang <shenwei.wang@nxp.com>,
	Clark Wang <xiaoning.wang@nxp.com>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>
Subject: Re: [PATCH resubmit 2] net: fec: Fix FEC_ECR_EN1588 being cleared on link-down
Date: Fri, 14 Jun 2024 09:59:16 +0200	[thread overview]
Message-ID: <0f315501-e8cb-4904-8c43-d9721fdef846@prolan.hu> (raw)
In-Reply-To: <20240613081233.6ff570cd@kernel.org>

On 6/13/24 17:12, Jakub Kicinski wrote:
> On Tue, 11 Jun 2024 10:04:05 +0200 Csókás, Bence wrote:
>> +	if (fep->bufdesc_ex) {
>> +		val = readl(fep->hwp + FEC_ECNTRL);
>> +		val |= FEC_ECR_EN1588;
>> +		writel(val, fep->hwp + FEC_ECNTRL);
> 
> FEC_ECNTRL gets written multiple times in this function,
> including with 0, and then you RMW it to add this flag.
> 
> Is this intentional? It really seems like you should be
> adding this flag more consistently or making sure its
> not cleared, rather than appending "add it back" at the
> end of the function...

It only writes 0 if WOL is disabled AND the device has the MULTI_QUEUES 
quirk. Otherwise, we either write FEC_ECR_RESET, which resets the device 
(and the HW changes ECNTRL to its reset value), OR we RMW set the WOL 
sleep bits. And then, if some more quirks are set, we set ETHEREN.

So I think RMW is the safest route here, instead of trying to keep track 
of all these different branches, re-read ECNTRL after reset etc.

Bence


  reply	other threads:[~2024-06-14  7:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-11  8:04 Csókás, Bence
2024-06-12 19:16 ` Andrew Lunn
2024-06-13 15:12 ` Jakub Kicinski
2024-06-14  7:59   ` Csókás Bence [this message]
2024-06-15  1:27     ` Jakub Kicinski

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=0f315501-e8cb-4904-8c43-d9721fdef846@prolan.hu \
    --to=csokas.bence@prolan.hu \
    --cc=Frank.Li@freescale.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=imx@lists.linux.dev \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.com \
    --cc=shenwei.wang@nxp.com \
    --cc=wei.fang@nxp.com \
    --cc=xiaoning.wang@nxp.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®