Bug#1069082: linux-image-6.1.0-20-amd64: USB ethernet AX88179 device name eth0

2024-05-10 Thread Salvatore Bonaccorso
Hi Roland,

On Fri, May 10, 2024 at 11:18:17AM +0200, Roland Rosenfeld wrote:
> Control: fixed -1 6.1.90+1
> 
> In the meantime I upgraded to linux-image-6.1.0-21-amd64 (6.1.90+1).
> With this version the issue is solved for me.

Thanks for confirming. I in fact missed to add the bug closer for this
in the changelog once the upstream patch got indeed backported as well
to the 6.1.y series.

Regards,
Salvatore



Bug#1069082: linux-image-6.1.0-20-amd64: USB ethernet AX88179 device name eth0

2024-05-10 Thread Roland Rosenfeld
Control: fixed -1 6.1.90+1

In the meantime I upgraded to linux-image-6.1.0-21-amd64 (6.1.90+1).
With this version the issue is solved for me.

Greetings
Roland



Bug#1069082: linux-image-6.1.0-20-amd64: USB ethernet AX88179 device name eth0

2024-04-16 Thread Salvatore Bonaccorso
Control: forwarded -1 
https://lore.kernel.org/regressions/zh7flxvnddfat...@eldamar.lan/T/#u

Hi both,

On Tue, Apr 16, 2024 at 08:31:23PM +0200, Roland Rosenfeld wrote:
> Hi Salvatore and Diederik!
> 
> On Di, 16 Apr 2024, Salvatore Bonaccorso wrote:
> 
> > If you revert that commit, does that fix your issue? Note that it
> > opens up again as well the referenced issue, but it would be helpfull
> > for reporting as regression if we know that's the case.
> 
> Thanks to the support by Diederik, I was able to build a new kernel
> with the two patches reverted and this kernel solves the issue and
> uses the correct MAC and renames the interface to enx as before
> instead of using a random MAC and using eth0 as the inerface name.
> 
> On Di, 16 Apr 2024, Diederik de Haas wrote:
> 
> > https://kernel-team.pages.debian.net/kernel-handbook/ch-common-tasks.html#id-1.6.6.4
> > describes a procedure with which you can apply (the attached) patches
> 
> Thanks for this hint and pointing to the perfect chapter, which made
> building a test kernel really easy.
> 
> I used the two patches, that you suggested, they are exactly the
> reverse of the two problem patches, that lead us to this issue.

Many thanks for testing!

I have forward your found regression to the regressions list:

https://lore.kernel.org/regressions/zh7flxvnddfat...@eldamar.lan/T/#u

Regards,
Salvatore



Bug#1069082: linux-image-6.1.0-20-amd64: USB ethernet AX88179 device name eth0

2024-04-16 Thread Roland Rosenfeld
Hi Salvatore and Diederik!

On Di, 16 Apr 2024, Salvatore Bonaccorso wrote:

> If you revert that commit, does that fix your issue? Note that it
> opens up again as well the referenced issue, but it would be helpfull
> for reporting as regression if we know that's the case.

Thanks to the support by Diederik, I was able to build a new kernel
with the two patches reverted and this kernel solves the issue and
uses the correct MAC and renames the interface to enx as before
instead of using a random MAC and using eth0 as the inerface name.

On Di, 16 Apr 2024, Diederik de Haas wrote:

> https://kernel-team.pages.debian.net/kernel-handbook/ch-common-tasks.html#id-1.6.6.4
> describes a procedure with which you can apply (the attached) patches

Thanks for this hint and pointing to the perfect chapter, which made
building a test kernel really easy.

I used the two patches, that you suggested, they are exactly the
reverse of the two problem patches, that lead us to this issue.

Greetings
Roland



Bug#1069082: linux-image-6.1.0-20-amd64: USB ethernet AX88179 device name eth0

2024-04-16 Thread Diederik de Haas
On Tuesday, 16 April 2024 16:41:46 CEST Roland Rosenfeld wrote:
> A.B says on stackexchange, that both patches have to be reverted to
> make this working again.
> 
> I did not yet try this out myself, because I use precompiled kernels
> for ages and have to re-learn again how to patch and build a kernel.

https://kernel-team.pages.debian.net/kernel-handbook/ch-common-tasks.html#id-1.6.6.4
describes a procedure with which you can apply (the attached) patches

HTH>From 21f7e476d0afe832f6656b917b976c6efe6b24f3 Mon Sep 17 00:00:00 2001
From: Diederik de Haas 
Date: Tue, 16 Apr 2024 16:53:16 +0200
Subject: [PATCH 1/2] Revert "net: usb: ax88179_178a: avoid the interface
 always configured as random address"

This reverts commit fc77240f6316d17fc58a8881927c3732b1d75d51.
---
 drivers/net/usb/ax88179_178a.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/usb/ax88179_178a.c b/drivers/net/usb/ax88179_178a.c
index e0e9b4c53cb0..d837c1887416 100644
--- a/drivers/net/usb/ax88179_178a.c
+++ b/drivers/net/usb/ax88179_178a.c
@@ -1273,8 +1273,6 @@ static void ax88179_get_mac_addr(struct usbnet *dev)
 
 	if (is_valid_ether_addr(mac)) {
 		eth_hw_addr_set(dev->net, mac);
-		if (!is_local_ether_addr(mac))
-			dev->net->addr_assign_type = NET_ADDR_PERM;
 	} else {
 		netdev_info(dev->net, "invalid MAC address, using random\n");
 		eth_hw_addr_random(dev->net);
-- 
2.43.0

>From 75b1a1f4d80ca93591e7833c0683a651d54edc38 Mon Sep 17 00:00:00 2001
From: Diederik de Haas 
Date: Tue, 16 Apr 2024 16:53:36 +0200
Subject: [PATCH 2/2] Revert "net: usb: ax88179_178a: avoid two consecutive
 device resets"

This reverts commit 5c4cbec5106d2f3c055ad138165e60a73f5b355c.
---
 drivers/net/usb/ax88179_178a.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/usb/ax88179_178a.c b/drivers/net/usb/ax88179_178a.c
index d837c1887416..5a1bf42ce156 100644
--- a/drivers/net/usb/ax88179_178a.c
+++ b/drivers/net/usb/ax88179_178a.c
@@ -1315,6 +1315,8 @@ static int ax88179_bind(struct usbnet *dev, struct usb_interface *intf)
 
 	netif_set_tso_max_size(dev->net, 16384);
 
+	ax88179_reset(dev);
+
 	return 0;
 }
 
-- 
2.43.0



signature.asc
Description: This is a digitally signed message part.


Bug#1069082: linux-image-6.1.0-20-amd64: USB ethernet AX88179 device name eth0

2024-04-16 Thread Roland Rosenfeld
Hi Salvatore!

On Di, 16 Apr 2024, Salvatore Bonaccorso wrote:

> > Maybe it has to do with the following commit from
> > https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.1.85
> > 
> > commit fc77240f6316d17fc58a8881927c3732b1d75d51
> > Author: Jose Ignacio Tornos Martinez 
> > Date:   Wed Apr 3 15:21:58 2024 +0200
> > 
> > net: usb: ax88179_178a: avoid the interface always configured as random 
> > address
> > 
> > commit 2e91bb99b9d4f756e92e83c4453f894dda220f09 upstream.
> > 
> > After the commit d2689b6a86b9 ("net: usb: ax88179_178a: avoid two
> > consecutive device resets"), reset is not executed from bind operation 
> > and
> > mac address is not read from the device registers or the devicetree at 
> > that
> > moment. Since the check to configure if the assigned mac address is 
> > random
> > or not for the interface, happens after the bind operation from
> > usbnet_probe, the interface keeps configured as random address, 
> > although the
> > address is correctly read and set during open operation (the only reset
> > now).
> > 
> > In order to keep only one reset for the device and to avoid the 
> > interface
> > always configured as random address, after reset, configure correctly 
> > the
> > suitable field from the driver, if the mac address is read successfully 
> > from
> > the device registers or the devicetree. Take into account if a locally
> > administered address (random) was previously stored.
> > 
> > cc: sta...@vger.kernel.org # 6.6+
> > Fixes: d2689b6a86b9 ("net: usb: ax88179_178a: avoid two consecutive 
> > device resets")
> > Reported-by: Dave Stevenson  
> > Signed-off-by: Jose Ignacio Tornos Martinez 
> > Reviewed-by: Simon Horman 
> > Link: 
> > https://lore.kernel.org/r/20240403132158.344838-1-jtorn...@redhat.com
> > Signed-off-by: Jakub Kicinski 
> > Signed-off-by: Greg Kroah-Hartman 
> > 
> > Seems, that I'm not alone with this issue, there are also reports in
> > https://www.reddit.com/r/debian/comments/1c304xn/linuximageamd64_61851_usb_link_interface_names/
> > and https://infosec.space/@topher/112276500329020316
> > 
> > 
> > All other (pci based) network interfaces still use there static names
> > (enp0s25, enp2s0, enp3s0), only the usb ethernet name is broken with
> > the new kernel.

> If you revert that commit, does that fix your issue? Note that it
> opens up again as well the referenced issue, but it would be helpfull
> for reporting as regression if we know that's the case.

I didn't try this out myself, but according to
https://unix.stackexchange.com/questions/774594/debian-12-all-of-sudden-my-usb3-lan-adapter-get-assigned-random-mac-address-ea
the root cause comes from the following patch:

https://mirrors.edge.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.1.77
commit 5c4cbec5106d2f3c055ad138165e60a73f5b355c
Author: Jose Ignacio Tornos Martinez 
Date:   Mon Nov 20 13:11:41 2023 +0100

net: usb: ax88179_178a: avoid two consecutive device resets

[ Upstream commit d2689b6a86b9d23574bd4b654bf770b6034e2c7e ]

The device is always reset two consecutive times (ax88179_reset is called
twice), one from usbnet_probe during the device binding and the other from
usbnet_open.

Remove the non-necessary reset during the device binding and let the reset
operation from open to keep the normal behavior (tested with generic ASIX
Electronics Corp. AX88179 Gigabit Ethernet device).

Reported-by: Herb Wei 
Tested-by: Herb Wei 
Signed-off-by: Jose Ignacio Tornos Martinez 
Link: https://lore.kernel.org/r/20231120121239.54504-1-jtorn...@redhat.com
Signed-off-by: Jakub Kicinski 
Signed-off-by: Sasha Levin 


A.B says on stackexchange, that both patches have to be reverted to
make this working again.

I did not yet try this out myself, because I use precompiled kernels
for ages and have to re-learn again how to patch and build a kernel.

Greetings
Roland



Bug#1069082: linux-image-6.1.0-20-amd64: USB ethernet AX88179 device name eth0

2024-04-16 Thread Salvatore Bonaccorso
Control: tags -1 + moreinfo

Hi Roland,

On Tue, Apr 16, 2024 at 09:29:28AM +0200, Roland Rosenfeld wrote:
> Package: src:linux
> Version: 6.1.85-1
> Severity: important
> 
> Dear Maintainer,
> 
> when upgrading from 6.1.76-1 to 6.1.85-1 my USB ethernet device
>  ID 0b95:1790 ASIX Electronics Corp. AX88179 Gigabit Ethernet
> is no longer named enx00249bXX but eth0.
> 
> I see the following in dmsg:
> 
> [1.484345] usb 4-5: Manufacturer: ASIX Elec. Corp.
> [1.484661] usb 4-5: SerialNumber: 249BXX
> [1.496312] ax88179_178a 4-5:1.0 eth0: register 'ax88179_178a' at 
> usb-:00:14.0-5, ASIX AX88179 USB 3.0 Gigabit Ethernet, d2:60:4c:YY:YY:YY
> [1.497746] usbcore: registered new interface driver ax88179_178a
> 
> Unplugging and plugging again does not solve the issue, but the
> interface still is named eth0.
> 
> Maybe it has to do with the following commit from
> https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.1.85
> 
> commit fc77240f6316d17fc58a8881927c3732b1d75d51
> Author: Jose Ignacio Tornos Martinez 
> Date:   Wed Apr 3 15:21:58 2024 +0200
> 
> net: usb: ax88179_178a: avoid the interface always configured as random 
> address
> 
> commit 2e91bb99b9d4f756e92e83c4453f894dda220f09 upstream.
> 
> After the commit d2689b6a86b9 ("net: usb: ax88179_178a: avoid two
> consecutive device resets"), reset is not executed from bind operation and
> mac address is not read from the device registers or the devicetree at 
> that
> moment. Since the check to configure if the assigned mac address is random
> or not for the interface, happens after the bind operation from
> usbnet_probe, the interface keeps configured as random address, although 
> the
> address is correctly read and set during open operation (the only reset
> now).
> 
> In order to keep only one reset for the device and to avoid the interface
> always configured as random address, after reset, configure correctly the
> suitable field from the driver, if the mac address is read successfully 
> from
> the device registers or the devicetree. Take into account if a locally
> administered address (random) was previously stored.
> 
> cc: sta...@vger.kernel.org # 6.6+
> Fixes: d2689b6a86b9 ("net: usb: ax88179_178a: avoid two consecutive 
> device resets")
> Reported-by: Dave Stevenson  
> Signed-off-by: Jose Ignacio Tornos Martinez 
> Reviewed-by: Simon Horman 
> Link: 
> https://lore.kernel.org/r/20240403132158.344838-1-jtorn...@redhat.com
> Signed-off-by: Jakub Kicinski 
> Signed-off-by: Greg Kroah-Hartman 
> 
> Seems, that I'm not alone with this issue, there are also reports in
> https://www.reddit.com/r/debian/comments/1c304xn/linuximageamd64_61851_usb_link_interface_names/
> and https://infosec.space/@topher/112276500329020316
> 
> 
> All other (pci based) network interfaces still use there static names
> (enp0s25, enp2s0, enp3s0), only the usb ethernet name is broken with
> the new kernel.

If you revert that commit, does that fix your issue? Note that it
opens up again as well the referenced issue, but it would be helpfull
for reporting as regression if we know that's the case.

Regards,
Salvatore



Bug#1069082: linux-image-6.1.0-20-amd64: USB ethernet AX88179 device name eth0

2024-04-16 Thread Roland Rosenfeld
Package: src:linux
Version: 6.1.85-1
Severity: important

Dear Maintainer,

when upgrading from 6.1.76-1 to 6.1.85-1 my USB ethernet device
 ID 0b95:1790 ASIX Electronics Corp. AX88179 Gigabit Ethernet
is no longer named enx00249bXX but eth0.

I see the following in dmsg:

[1.484345] usb 4-5: Manufacturer: ASIX Elec. Corp.
[1.484661] usb 4-5: SerialNumber: 249BXX
[1.496312] ax88179_178a 4-5:1.0 eth0: register 'ax88179_178a' at 
usb-:00:14.0-5, ASIX AX88179 USB 3.0 Gigabit Ethernet, d2:60:4c:YY:YY:YY
[1.497746] usbcore: registered new interface driver ax88179_178a

Unplugging and plugging again does not solve the issue, but the
interface still is named eth0.

Maybe it has to do with the following commit from
https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.1.85

commit fc77240f6316d17fc58a8881927c3732b1d75d51
Author: Jose Ignacio Tornos Martinez 
Date:   Wed Apr 3 15:21:58 2024 +0200

net: usb: ax88179_178a: avoid the interface always configured as random 
address

commit 2e91bb99b9d4f756e92e83c4453f894dda220f09 upstream.

After the commit d2689b6a86b9 ("net: usb: ax88179_178a: avoid two
consecutive device resets"), reset is not executed from bind operation and
mac address is not read from the device registers or the devicetree at that
moment. Since the check to configure if the assigned mac address is random
or not for the interface, happens after the bind operation from
usbnet_probe, the interface keeps configured as random address, although the
address is correctly read and set during open operation (the only reset
now).

In order to keep only one reset for the device and to avoid the interface
always configured as random address, after reset, configure correctly the
suitable field from the driver, if the mac address is read successfully from
the device registers or the devicetree. Take into account if a locally
administered address (random) was previously stored.

cc: sta...@vger.kernel.org # 6.6+
Fixes: d2689b6a86b9 ("net: usb: ax88179_178a: avoid two consecutive device 
resets")
Reported-by: Dave Stevenson  
Signed-off-by: Jose Ignacio Tornos Martinez 
Reviewed-by: Simon Horman 
Link: https://lore.kernel.org/r/20240403132158.344838-1-jtorn...@redhat.com
Signed-off-by: Jakub Kicinski 
Signed-off-by: Greg Kroah-Hartman 

Seems, that I'm not alone with this issue, there are also reports in
https://www.reddit.com/r/debian/comments/1c304xn/linuximageamd64_61851_usb_link_interface_names/
and https://infosec.space/@topher/112276500329020316


All other (pci based) network interfaces still use there static names
(enp0s25, enp2s0, enp3s0), only the usb ethernet name is broken with
the new kernel.

Greetings
Roland


-- Package-specific info:
** Version:
Linux version 6.1.0-20-amd64 (debian-ker...@lists.debian.org) (gcc-12 (Debian 
12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP 
PREEMPT_DYNAMIC Debian 6.1.85-1 (2024-04-11)

** Command line:
BOOT_IMAGE=/vmlinuz-6.1.0-20-amd64 root=/dev/mapper/ssd-root ro

** Not tainted

** Loaded modules:
[...]
ax88179_178a   36864  0
usbnet 57344  1 ax88179_178a
mii16384  2 usbnet,ax88179_178a
[...]

** Network status:
*** IP interfaces and addresses:
[...]
11: eth0:  mtu 1500 qdisc fq_codel state UP 
group default qlen 1000
link/ether 00:24:9b:XX:XX:XX brd ff:ff:ff:ff:ff:ff
inet6 fe80::224:9bff:feXX:/64 scope link 
   valid_lft forever preferred_lft forever
[...]

** USB devices:
[...]
Bus 004 Device 003: ID 0b95:1790 ASIX Electronics Corp. AX88179 Gigabit Ethernet
[...]

-- System Information:
Debian Release: 12.5
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 6.1.0-20-amd64 (SMP w/2 CPU threads; PREEMPT)
Locale: LANG=de_DE.utf-8, LC_CTYPE=de_DE.utf-8 (charmap=UTF-8), 
LANGUAGE=en_US:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages linux-image-6.1.0-20-amd64 depends on:
ii  initramfs-tools [linux-initramfs-tool]  0.142
ii  kmod30+20221128-1
ii  linux-base  4.9

Versions of packages linux-image-6.1.0-20-amd64 recommends:
ii  apparmor 3.0.8-3
ii  firmware-linux-free  20200122-1

Versions of packages linux-image-6.1.0-20-amd64 suggests:
pn  debian-kernel-handbook  
ii  grub-efi-amd64  2.06-13+deb12u1
pn  linux-doc-6.1   

Versions of packages linux-image-6.1.0-20-amd64 is related to:
pn  firmware-amd-graphics 
pn  firmware-atheros  
pn  firmware-bnx2 
pn  firmware-bnx2x
pn  firmware-brcm80211
pn  firmware-cavium   
pn  firmware-intel-sound  
pn  firmware-intelwimax   
pn  firmware-ipw2x00  
pn  firmware-ivtv