[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7d35d8ca-f711-41b2-b058-08a19a207160@kernel.org>
Date: Tue, 30 Sep 2025 14:44:55 +0900
From: Vincent Mailhol <mailhol@...nel.org>
To: Celeste Liu <uwu@...lacanthus.name>
Cc: Maximilian Schneider <max@...neidersoft.net>,
Henrik Brix Andersen <henrik@...xandersen.dk>,
Wolfgang Grandegger <wg@...ndegger.com>, Kees Cook <kees@...nel.org>,
"Gustavo A. R. Silva" <gustavoars@...nel.org>, linux-can@...r.kernel.org,
linux-kernel@...r.kernel.org, Runcheng Lu <runcheng.lu@...icro.com>,
stable@...r.kernel.org, Marc Kleine-Budde <mkl@...gutronix.de>
Subject: Re: [PATCH v3] net/can/gs_usb: increase max interface to U8_MAX
On 9/30/25 12:06 PM, Celeste Liu wrote:
> This issue was found by Runcheng Lu when develop HSCanT USB to CAN FD
> converter[1]. The original developers may have only 3 intefaces device to
^^^^^^^^^
interfaces (missing "r")
> test so they write 3 here and wait for future change.
>
> During the HSCanT development, we actually used 4 interfaces, so the
> limitation of 3 is not enough now. But just increase one is not
> future-proofed. Since the channel type in gs_host_frame is u8, just
> increase interface number limit to max size of u8 safely.
>
> [1]: https://github.com/cherry-embedded/HSCanT-hardware
>
> Fixes: d08e973a77d1 ("can: gs_usb: Added support for the GS_USB CAN devices")
> Reported-by: Runcheng Lu <runcheng.lu@...icro.com>
> Cc: stable@...r.kernel.org
> Signed-off-by: Celeste Liu <uwu@...lacanthus.name>
Reviewed-by: Vincent Mailhol <mailhol@...nel.org>
The patch is good as-is. However, speaking of the interface numbers, there is
another issue in this gs_usb driver: net_device->dev_port is not populated, and
according to the documentation, this is a bug.
See the description here:
https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-class-net
What: /sys/class/net/<iface>/dev_port
Date: February 2014
KernelVersion: 3.15
Contact: netdev@...r.kernel.org
Description:
Indicates the port number of this network device, formatted
as a decimal value. Some NICs have multiple independent ports
on the same PCI bus, device and function. This attribute allows
userspace to distinguish the respective interfaces.
Note: some device drivers started to use 'dev_id' for this
purpose since long before 3.15 and have not adopted the new
attribute ever since. To query the port number, some tools look
exclusively at 'dev_port', while others only consult 'dev_id'.
If a network device has multiple client adapter ports as
described in the previous paragraph and does not set this
attribute to its port number, it's a kernel bug.
Would you mind sending a separate patch (with a Fixes: tag) to resolve this?
Yours sincerely,
Vincent Mailhol
Powered by blists - more mailing lists