netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Eichenberger <eichest@gmail.com>
To: Rob Herring <robh@kernel.org>
Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, krzk+dt@kernel.org,
	conor+dt@kernel.org, hkallweit1@gmail.com, linux@armlinux.org.uk,
	geert+renesas@glider.be, ben.dooks@codethink.co.uk,
	netdev@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, francesco.dolcini@toradex.com,
	rafael.beims@toradex.com,
	Stefan Eichenberger <stefan.eichenberger@toradex.com>
Subject: Re: [PATCH net-next v1 2/3] dt-bindings: net: micrel: Add keep-preamble-before-sfd
Date: Wed, 17 Dec 2025 15:30:31 +0100	[thread overview]
Message-ID: <aUK-h6jDsng0Awjm@eichest-laptop> (raw)
In-Reply-To: <20251217135519.GA767145-robh@kernel.org>

On Wed, Dec 17, 2025 at 07:55:19AM -0600, Rob Herring wrote:
> On Wed, Dec 17, 2025 at 01:21:19PM +0100, Stefan Eichenberger wrote:
> > On Wed, Dec 17, 2025 at 10:58:54AM +0100, Stefan Eichenberger wrote:
> > > On Mon, Dec 15, 2025 at 08:03:30AM -0600, Rob Herring wrote:
> > > > On Fri, Dec 12, 2025 at 09:46:17AM +0100, Stefan Eichenberger wrote:
> > > > > From: Stefan Eichenberger <stefan.eichenberger@toradex.com>
> > > > > 
> > > > > Add a property to activate a Micrel PHY feature that keeps the preamble
> > > > > enabled before the SFD (Start Frame Delimiter) is transmitted.
> > > > > 
> > > > > This allows to workaround broken Ethernet controllers as found on the
> > > > > NXP i.MX8MP. Specifically, errata ERR050694 that states:
> > > > > ENET_QOS: MAC incorrectly discards the received packets when Preamble
> > > > > Byte does not precede SFD or SMD.
> > > > 
> > > > It doesn't really work right if you have to change the DT to work-around 
> > > > a quirk in the kernel. You should have all the information needed 
> > > > already in the DT. The compatible string for the i.MX8MP ethernet 
> > > > controller is not sufficient? 
> > > 
> > > Is doing something like this acceptable in a phy driver?
> > > if (of_machine_is_compatible("fsl,imx8mp")) {
> > > ...
> > > }
> > > 
> > > That would be a different option, rather than having to add a new DT
> > > property. Unfortunately, the workaround affects the PHY rather than the
> > > MAC driver. This is why we considered adding a DT property.
> > 
> > Francesco made a good point about this. The i.MX8MP has two MACs, but
> > only one of them is affected. Therefore, checking the machine's
> > compatible string would not be correct. As far as I know, checking the
> > MAC's compatible string from within the PHY driver is also not good
> > practice, is it?
> 
> It's not great, but probably what you need to do. The 2 MACs are the 
> same (compatible) or different? As that only works if they are 
> different. I suppose you need to only check the MAC the PHY is connected 
> to.
> 
> I think the ideal implementation would be the MAC driver calling some 
> phy API to apply the quirk, and then that gets passed on to the phy 
> driver. Surely this isn't the first case of a MAC-PHY combination 
> needing to go fiddle with some special setting.

I was also hoping to find something like that, but I couldn't really
find it. However, I will try looking in that direction. At least we can
identify the broken MAC via the compatible string of the MAC driver, as
they use two different compatibles: 'fsl,imx8mp-fec' (fine) and
'nxp,imx8mp-dwmac-eqos' (affected by the errata).

Regards,
Stefan

  reply	other threads:[~2025-12-17 14:30 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-12  8:46 [PATCH net-next v1 0/3] Convert Micrel bindings to YAML, add keep-preamble-before-sfd Stefan Eichenberger
2025-12-12  8:46 ` [PATCH net-next v1 1/3] dt-bindings: net: micrel: Convert to YAML schema Stefan Eichenberger
2025-12-12 10:29   ` Rob Herring (Arm)
2025-12-12 14:51     ` Stefan Eichenberger
2025-12-12 14:16   ` Simon Horman
2025-12-12 14:52     ` Stefan Eichenberger
2025-12-15 14:37   ` Rob Herring
2025-12-17  9:41     ` Stefan Eichenberger
2025-12-12  8:46 ` [PATCH net-next v1 2/3] dt-bindings: net: micrel: Add keep-preamble-before-sfd Stefan Eichenberger
2025-12-12 10:29   ` Rob Herring (Arm)
2025-12-15 14:03   ` Rob Herring
2025-12-17  9:58     ` Stefan Eichenberger
2025-12-17 12:21       ` Stefan Eichenberger
2025-12-17 13:55         ` Rob Herring
2025-12-17 14:30           ` Stefan Eichenberger [this message]
2025-12-17 17:04             ` Andrew Lunn
2025-12-18  8:59               ` Stefan Eichenberger
2025-12-12  8:46 ` [PATCH net-next v1 3/3] net: phy: micrel: Add keep-preamble-before-sfd property Stefan Eichenberger

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=aUK-h6jDsng0Awjm@eichest-laptop \
    --to=eichest@gmail.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=ben.dooks@codethink.co.uk \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=francesco.dolcini@toradex.com \
    --cc=geert+renesas@glider.be \
    --cc=hkallweit1@gmail.com \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rafael.beims@toradex.com \
    --cc=robh@kernel.org \
    --cc=stefan.eichenberger@toradex.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;
as well as URLs for NNTP newsgroup(s).