]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
Revert "usb: gadget: u_ether: use <linux/hex.h> header file"
authorKuen-Han Tsai <khtsai@google.com>
Mon, 9 Mar 2026 12:04:50 +0000 (20:04 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 11 Mar 2026 15:21:13 +0000 (16:21 +0100)
This reverts commit 7a7930c0f934fb0c46de6e7ca08e14e11df35dd6.

This commit is being reverted as part of a series-wide revert.

By deferring the net_device allocation to the bind() phase, a single
function instance will spawn multiple network devices if it is symlinked
to multiple USB configurations.

This causes regressions for userspace tools (like the postmarketOS DHCP
daemon) that rely on reading the interface name (e.g., "usb0") from
configfs. Currently, configfs returns the template "usb%d", causing the
userspace network setup to fail.

Crucially, because this patch breaks the 1:1 mapping between the
function instance and the network device, this naming issue cannot
simply be patched. Configfs only exposes a single 'ifname' attribute per
instance, making it impossible to accurately report the actual interface
name when multiple underlying network devices can exist for that single
instance.

All configurations tied to the same function instance are meant to share
a single network device. Revert this change to restore the 1:1 mapping
by allocating the network device at the instance level (alloc_inst).

Reported-by: David Heidelberg <david@ixit.cz>
Closes: https://lore.kernel.org/linux-usb/70b558ea-a12e-4170-9b8e-c951131249af@ixit.cz/
Fixes: 56a512a9b410 ("usb: gadget: f_ncm: align net_device lifecycle with bind/unbind")
Cc: stable <stable@kernel.org>
Signed-off-by: Kuen-Han Tsai <khtsai@google.com>
Link: https://patch.msgid.link/20260309-f-ncm-revert-v2-5-ea2afbc7d9b2@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/function/u_ether_configfs.h

index 217990a266b2f6528d7bf8537a77214c538f681a..39d3a261496d9fa0703c4b01c076550ecc02cda1 100644 (file)
@@ -14,7 +14,6 @@
 #define __U_ETHER_CONFIGFS_H
 
 #include <linux/cleanup.h>
-#include <linux/hex.h>
 #include <linux/if_ether.h>
 #include <linux/mutex.h>
 #include <linux/netdevice.h>