* [PATCH] net: fealnx: remove never-true 486 CPU check
@ 2026-09-15 2:46 Ethan Nelson-Moore
2026-09-15 3:36 ` Ethan Nelson-Moore
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Ethan Nelson-Moore @ 2026-09-15 2:46 UTC (permalink / raw)
To: Jakub Kicinski, Uwe Kleine-König (The Capable Hub),
Arend van Spriel, Johannes Berg, Michael Grzeschik, Denis Benato,
netdev
Cc: Ethan Nelson-Moore, Andrew Lunn, David S. Miller, Eric Dumazet,
Paolo Abeni, Jijie Shao, Aleksandr Loktionov
The fealnx driver contains a check for boot_cpu_data.x86 <= 4.
This field encodes the x86 generation (3 = 386, 4 = 486, etc).
Therefore, since 486 support was removed from the kernel in commit
8b793a92d862 ("x86/cpu: Remove M486/M486SX/ELAN support"), the
condition is always true. Remove the check.
Signed-off-by: Ethan Nelson-Moore <enelsonmoore@gmail.com>
---
drivers/net/ethernet/fealnx.c | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ethernet/fealnx.c b/drivers/net/ethernet/fealnx.c
index bdc38aac5850..708b61f21915 100644
--- a/drivers/net/ethernet/fealnx.c
+++ b/drivers/net/ethernet/fealnx.c
@@ -839,8 +839,7 @@ static int netdev_open(struct net_device *dev)
/* Initialize other registers. */
/* Configure the PCI bus bursts and FIFO thresholds.
- 486: Set 8 longword burst.
- 586: no burst limit.
+ No burst limit.
Burst length 5:3
0 0 0 1
0 0 1 4
@@ -858,13 +857,7 @@ static int netdev_open(struct net_device *dev)
#ifdef __BIG_ENDIAN
np->bcrvalue |= 0x04; /* big-endian */
#endif
-
-#if defined(__i386__) && !defined(MODULE) && !defined(CONFIG_UML)
- if (boot_cpu_data.x86 <= 4)
- np->crvalue = 0xa00;
- else
-#endif
- np->crvalue = 0xe00; /* rx 128 burst length */
+ np->crvalue = 0xe00; /* rx 128 burst length */
// 89/12/29 add,
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] net: fealnx: remove never-true 486 CPU check
2026-09-15 2:46 [PATCH] net: fealnx: remove never-true 486 CPU check Ethan Nelson-Moore
@ 2026-09-15 3:36 ` Ethan Nelson-Moore
2026-09-15 22:51 ` Jakub Kicinski
2026-09-15 5:42 ` Loktionov, Aleksandr
2026-09-16 5:48 ` netdev-bot+sashiko
2 siblings, 1 reply; 6+ messages in thread
From: Ethan Nelson-Moore @ 2026-09-15 3:36 UTC (permalink / raw)
To: Jakub Kicinski, Uwe Kleine-König (The Capable Hub),
Arend van Spriel, Johannes Berg, Michael Grzeschik, Denis Benato,
netdev
Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Paolo Abeni,
Jijie Shao, Aleksandr Loktionov
On Mon, Sep 14, 2026 at 7:46 PM Ethan Nelson-Moore
<enelsonmoore@gmail.com> wrote:
> The fealnx driver contains a check for boot_cpu_data.x86 <= 4.
> This field encodes the x86 generation (3 = 386, 4 = 486, etc).
> Therefore, since 486 support was removed from the kernel in commit
> 8b793a92d862 ("x86/cpu: Remove M486/M486SX/ELAN support"), the
> condition is always true. Remove the check.
Oops, never true*. Should I send a v2, or will whoever merges this fix it?
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH] net: fealnx: remove never-true 486 CPU check
2026-09-15 2:46 [PATCH] net: fealnx: remove never-true 486 CPU check Ethan Nelson-Moore
2026-09-15 3:36 ` Ethan Nelson-Moore
@ 2026-09-15 5:42 ` Loktionov, Aleksandr
2026-09-16 5:48 ` netdev-bot+sashiko
2 siblings, 0 replies; 6+ messages in thread
From: Loktionov, Aleksandr @ 2026-09-15 5:42 UTC (permalink / raw)
To: Ethan Nelson-Moore, Jakub Kicinski,
Uwe Kleine-König (The Capable Hub), Arend van Spriel,
Johannes Berg, Michael Grzeschik, Denis Benato,
netdev@vger.kernel.org
Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Paolo Abeni,
Jijie Shao
> -----Original Message-----
> From: Ethan Nelson-Moore <enelsonmoore@gmail.com>
> Sent: Tuesday, September 15, 2026 4:47 AM
> To: Jakub Kicinski <kuba@kernel.org>; Uwe Kleine-König (The Capable
> Hub) <u.kleine-koenig@baylibre.com>; Arend van Spriel
> <arend.vanspriel@broadcom.com>; Johannes Berg
> <johannes@sipsolutions.net>; Michael Grzeschik <mgr@kernel.org>; Denis
> Benato <benato.denis96@gmail.com>; netdev@vger.kernel.org
> Cc: Ethan Nelson-Moore <enelsonmoore@gmail.com>; Andrew Lunn
> <andrew+netdev@lunn.ch>; David S. Miller <davem@davemloft.net>; Eric
> Dumazet <edumazet@google.com>; Paolo Abeni <pabeni@redhat.com>; Jijie
> Shao <shaojijie@huawei.com>; Loktionov, Aleksandr
> <aleksandr.loktionov@intel.com>
> Subject: [PATCH] net: fealnx: remove never-true 486 CPU check
>
> The fealnx driver contains a check for boot_cpu_data.x86 <= 4.
> This field encodes the x86 generation (3 = 386, 4 = 486, etc).
> Therefore, since 486 support was removed from the kernel in commit
> 8b793a92d862 ("x86/cpu: Remove M486/M486SX/ELAN support"), the
> condition is always true. Remove the check.
>
> Signed-off-by: Ethan Nelson-Moore <enelsonmoore@gmail.com>
> ---
> drivers/net/ethernet/fealnx.c | 11 ++---------
> 1 file changed, 2 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/net/ethernet/fealnx.c
> b/drivers/net/ethernet/fealnx.c index bdc38aac5850..708b61f21915
> 100644
> --- a/drivers/net/ethernet/fealnx.c
> +++ b/drivers/net/ethernet/fealnx.c
> @@ -839,8 +839,7 @@ static int netdev_open(struct net_device *dev)
>
> /* Initialize other registers. */
> /* Configure the PCI bus bursts and FIFO thresholds.
> - 486: Set 8 longword burst.
> - 586: no burst limit.
> + No burst limit.
> Burst length 5:3
> 0 0 0 1
> 0 0 1 4
> @@ -858,13 +857,7 @@ static int netdev_open(struct net_device *dev)
> #ifdef __BIG_ENDIAN
> np->bcrvalue |= 0x04; /* big-endian */
> #endif
> -
> -#if defined(__i386__) && !defined(MODULE) && !defined(CONFIG_UML)
> - if (boot_cpu_data.x86 <= 4)
> - np->crvalue = 0xa00;
> - else
> -#endif
> - np->crvalue = 0xe00; /* rx 128 burst length */
> + np->crvalue = 0xe00; /* rx 128 burst length */
>
>
> // 89/12/29 add,
> --
> 2.43.0
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] net: fealnx: remove never-true 486 CPU check
2026-09-15 3:36 ` Ethan Nelson-Moore
@ 2026-09-15 22:51 ` Jakub Kicinski
0 siblings, 0 replies; 6+ messages in thread
From: Jakub Kicinski @ 2026-09-15 22:51 UTC (permalink / raw)
To: Ethan Nelson-Moore
Cc: Uwe Kleine-König (The Capable Hub), Arend van Spriel,
Johannes Berg, Michael Grzeschik, Denis Benato, netdev,
Andrew Lunn, David S. Miller, Eric Dumazet, Paolo Abeni,
Jijie Shao, Aleksandr Loktionov
On Mon, 14 Sep 2026 20:36:45 -0700 Ethan Nelson-Moore wrote:
> On Mon, Sep 14, 2026 at 7:46 PM Ethan Nelson-Moore
> <enelsonmoore@gmail.com> wrote:
> > The fealnx driver contains a check for boot_cpu_data.x86 <= 4.
> > This field encodes the x86 generation (3 = 386, 4 = 486, etc).
> > Therefore, since 486 support was removed from the kernel in commit
> > 8b793a92d862 ("x86/cpu: Remove M486/M486SX/ELAN support"), the
> > condition is always true. Remove the check.
>
> Oops, never true*. Should I send a v2, or will whoever merges this fix it?
Will fix
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] net: fealnx: remove never-true 486 CPU check
2026-09-15 2:46 [PATCH] net: fealnx: remove never-true 486 CPU check Ethan Nelson-Moore
2026-09-15 3:36 ` Ethan Nelson-Moore
2026-09-15 5:42 ` Loktionov, Aleksandr
@ 2026-09-16 5:48 ` netdev-bot+sashiko
2026-09-17 2:22 ` Jakub Kicinski
2 siblings, 1 reply; 6+ messages in thread
From: netdev-bot+sashiko @ 2026-09-16 5:48 UTC (permalink / raw)
To: enelsonmoore
Cc: kuba, u.kleine-koenig, arend.vanspriel, johannes, mgr,
benato.denis96, netdev, andrew+netdev, davem, edumazet, pabeni,
shaojijie, aleksandr.loktionov
Thank you for your contribution! Sashiko AI review found 3 potential
issue(s) to consider:
Critical: 0 · High: 0 · Medium: 1 · Low: 2
- [Medium] Inverted rationale in the commit message of "net: fealnx:
remove never-true 486 CPU check": the log states that after 486…
- [Low] The block comment above the burst/FIFO register setup in
drivers/net/ethernet/fealnx.c:netdev_open() was rewritten from the two…
- [Low] The patch removes the last user of asm/processor.h in
drivers/net/ethernet/fealnx.c (`boot_cpu_data.x86`) but leaves the…
--
net: fealnx: remove never-true 486 CPU check
The patch drops the boot_cpu_data.x86 <= 4 test in netdev_open() and keeps
the value that the else arm used to assign, np->crvalue = 0xe00. The block
comment above the burst setup is reworded at the same time.
A few questions below.
> diff --git a/drivers/net/ethernet/fealnx.c b/drivers/net/ethernet/fealnx.c
> index bdc38aac58509..708b61f219156 100644
> --- a/drivers/net/ethernet/fealnx.c
> +++ b/drivers/net/ethernet/fealnx.c
> The fealnx driver contains a check for boot_cpu_data.x86 <= 4.
> This field encodes the x86 generation (3 = 386, 4 = 486, etc).
> Therefore, since 486 support was removed from the kernel in commit
> 8b793a92d862 ("x86/cpu: Remove M486/M486SX/ELAN support"), the
> condition is always true. Remove the check.
[Severity: Medium]
Should this read "always false" rather than "always true"?
boot_cpu_data.x86 is the CPU family (4 == 486, 5 == Pentium), so once 386/486
support is gone the minimum family is 5 and:
if (boot_cpu_data.x86 <= 4)
can never hold. The subject line already says "never-true", so the body looks
inverted with respect to the subject.
The code change matches the "always false" reading, since it deletes the
np->crvalue = 0xa00 arm and keeps the else value:
np->crvalue = 0xe00; /* rx 128 burst length */
Taken literally, the "always true" wording would call for the opposite edit
(keep 0xa00, rx burst field 0b101 instead of 0b111). Could the changelog be
reworded so that anyone revisiting or reverting this hunk later does not
program the other burst value? It may also be worth mentioning that the hunk
was already compiled out for MODULE, non-i386 and UML builds.
> @@ -839,8 +839,7 @@ static int netdev_open(struct net_device *dev)
>
> /* Initialize other registers. */
> /* Configure the PCI bus bursts and FIFO thresholds.
> - 486: Set 8 longword burst.
> - 586: no burst limit.
> + No burst limit.
^^^^^^^^^^^^^^^
[Severity: Low]
Does this new line agree with the code below it? A few lines further down
netdev_open() still programs a finite 8-longword bus burst into BCR:
np->bcrvalue = 0x10; /* little-endian, 8 burst length */
...
iowrite32(np->bcrvalue, ioaddr + BCR);
Per the encoding table kept in the same comment ("Burst length 5:3", 0 1 0 ->
8), 0x10 sets bits 5:3 = 0b010, i.e. an 8-longword limit.
Since the removal of the CPU check makes this unconditional, would it be
clearer to drop the line along with the conditional, or reword it to describe
what is actually latched (BCR: 8-longword bus burst, TCRRCR rx burst field at
maximum)?
Also, the retained inline comment on np->crvalue = 0xe00 says "rx 128 burst
length" while the table above maps 1 1 1 to 256. That inaccuracy predates the
patch, but it is now the only case the header comment describes.
The comment rework itself is not mentioned in the changelog, which only
mentions removing the CPU check.
> Burst length 5:3
> 0 0 0 1
> 0 0 1 4
[ ... ]
> @@ -858,13 +857,7 @@ static int netdev_open(struct net_device *dev)
> #ifdef __BIG_ENDIAN
> np->bcrvalue |= 0x04; /* big-endian */
> #endif
> -
> -#if defined(__i386__) && !defined(MODULE) && !defined(CONFIG_UML)
> - if (boot_cpu_data.x86 <= 4)
> - np->crvalue = 0xa00;
> - else
> -#endif
> - np->crvalue = 0xe00; /* rx 128 burst length */
> + np->crvalue = 0xe00; /* rx 128 burst length */
[Severity: Low]
This removes the last user of asm/processor.h in the file, but the include and
its justification comment near the top of drivers/net/ethernet/fealnx.c are
left behind:
#include <asm/processor.h> /* Processor type for cache alignment. */
After this patch, git grep boot_cpu_data on the file returns nothing, and a
grep for other plausible users (cpu_relax, cpu_data, cache_line*) also finds
nothing. Should the include be dropped together with its only user?
>
>
> // 89/12/29 add,
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260915024638.198865-1-enelsonmoore%40gmail.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] net: fealnx: remove never-true 486 CPU check
2026-09-16 5:48 ` netdev-bot+sashiko
@ 2026-09-17 2:22 ` Jakub Kicinski
0 siblings, 0 replies; 6+ messages in thread
From: Jakub Kicinski @ 2026-09-17 2:22 UTC (permalink / raw)
To: netdev-bot+sashiko
Cc: enelsonmoore, u.kleine-koenig, arend.vanspriel, johannes, mgr,
benato.denis96, netdev, andrew+netdev, davem, edumazet, pabeni,
shaojijie, aleksandr.loktionov
On Wed, 16 Sep 2026 05:48:28 +0000 netdev-bot+sashiko@kernel.org wrote:
> > -#if defined(__i386__) && !defined(MODULE) && !defined(CONFIG_UML)
> > - if (boot_cpu_data.x86 <= 4)
> > - np->crvalue = 0xa00;
> > - else
> > -#endif
> > - np->crvalue = 0xe00; /* rx 128 burst length */
> > + np->crvalue = 0xe00; /* rx 128 burst length */
>
> [Severity: Low]
> This removes the last user of asm/processor.h in the file, but the include and
> its justification comment near the top of drivers/net/ethernet/fealnx.c are
> left behind:
>
> #include <asm/processor.h> /* Processor type for cache alignment. */
>
> After this patch, git grep boot_cpu_data on the file returns nothing, and a
> grep for other plausible users (cpu_relax, cpu_data, cache_line*) also finds
> nothing. Should the include be dropped together with its only user?
Massaging the comment is more a judgment call (the other Low complaint
from AI) but the header we should probably remove..
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-09-17 2:22 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-15 2:46 [PATCH] net: fealnx: remove never-true 486 CPU check Ethan Nelson-Moore
2026-09-15 3:36 ` Ethan Nelson-Moore
2026-09-15 22:51 ` Jakub Kicinski
2026-09-15 5:42 ` Loktionov, Aleksandr
2026-09-16 5:48 ` netdev-bot+sashiko
2026-09-17 2:22 ` Jakub Kicinski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox