[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6dae31dc-8c4f-4b8d-80e4-120619119326@lunn.ch>
Date: Sun, 24 Mar 2024 16:25:28 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Elad Nachman <enachman@...vell.com>
Cc: Taras Chornyi <taras.chornyi@...ision.eu>,
"davem@...emloft.net" <davem@...emloft.net>,
"edumazet@...gle.com" <edumazet@...gle.com>,
"kuba@...nel.org" <kuba@...nel.org>,
"pabeni@...hat.com" <pabeni@...hat.com>,
"kory.maincent@...tlin.com" <kory.maincent@...tlin.com>,
"thomas.petazzoni@...tlin.com" <thomas.petazzoni@...tlin.com>,
"miquel.raynal@...tlin.com" <miquel.raynal@...tlin.com>,
"przemyslaw.kitszel@...el.com" <przemyslaw.kitszel@...el.com>,
"dkirjanov@...e.de" <dkirjanov@...e.de>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [EXTERNAL] Re: [PATCH v2 0/5] Fix prestera driver fail to probe
twice
> > > Originally, the pain point for Kory was the rmmod + insmod re-probing
> > > failure, Which is only fixed by the first two commits, so I see little
> > > point in submitting 3-5 alone, Without fixing Kory's problem.
> >
> > I thought Kory's problem was actually EPROBE_DEFER? The resources needed
> > for the PoE are not available, so probing the switch needs to happen again
> > later, when PoE can get the resources it needs.
>
> No, the PoE is the general high level application where he noted the problem.
> There is no PoE code nor special PoE resources in the Prestera driver.
So here is Köry email:
https://lore.kernel.org/netdev/20240208101005.29e8c7f3@kmaincent-XPS-13-7390/T/#mb898bb2a4bf07776d79f1a19b6a8420716ecb4a3
I don't see why the prestera needs to be involved in PoE itself. It is
just a MAC. PoE happens much lower down in the network stack. Same as
Prestera uses phylink, it does not need to know about the PHYs or the
SFP modules, phylink manages them, not prestera.
> The problem was caused because the module exit was lacking the so called
> "switch HW reset" API call which would cause the firmware to exit to the firmware
> loader on the firmware CPU, and move to the state in the state machine when
> it can receive new firmware from the host CPU (running the Prestera switchDev
> driver).
>
> >
> > But if that is going to take 30 seconds, i'm not sure we can call EPROBE_DEFER
> > solved.
> >
> > The later patches are pretty simple, don't need discussion, so could be
> > merged. However, i think we need to explore different possible solutions for
> > firmware {re}loading.
> >
> > > The problem is not with the hardware, but with the existing firmware
> > > code on the Firmware cpu, most probably secure-boot protected, which
> > > lacks the ABIs to report to The kernel what is loaded, what version, what
> > state, etc.
> >
> > Can you at least tell if it is running firmware?
>
> There is no existing API/ABI for that.
Do you at least have the ability to determine if an API call exists or
not? It sounds like your firmware needs extending to support returning
the version. If the API is missing, you know it is 4.1 or older. If it
does exist, it will return 4.2 or higher.
> > Can you explain the boot in a bit more detail. Are you saying it could be
> > running an old firmware when the driver first loads? So you need to hit it with
>
> Exactly.
>
> > a reset in order to load the firmware for /lib/firmware, which might be newer
> > than what it is already running?
>
> Right. And there is also the configuration. There is no telling what kind of
> Configuration the existing firmware is running. Just using the existing firmware
> Will lead to the situation where Linux kernel side will report certain configuration
> (via ip link / ip addr / tc , etc.) but the firmware configuration is completely different.
Well, during probe and -EPRODE_DEFER, linux has no configuration,
since the driver failed to probe. However, for a rmmod/modprobe, the
firmware could have stale configuration. However pretty much every
device i've come across has the concept of a software reset which
clears out the configuration. Seems to be something else your firmware
is missing.
Andrew
Powered by blists - more mailing lists