[PATCH v2 0/3] staging: rtl8192u: fix rmmod warn when wlan0 is renamed

Tong Zhang posted 3 patches 3 years, 9 months ago
Only 0 patches received!
drivers/staging/rtl8192u/Makefile         |   1 +
drivers/staging/rtl8192u/r8192U.h         |   6 +
drivers/staging/rtl8192u/r8192U_core.c    | 223 ++++------------------
drivers/staging/rtl8192u/r8192U_debugfs.c | 188 ++++++++++++++++++
4 files changed, 235 insertions(+), 183 deletions(-)
create mode 100644 drivers/staging/rtl8192u/r8192U_debugfs.c
[PATCH v2 0/3] staging: rtl8192u: fix rmmod warn when wlan0 is renamed
Posted by Tong Zhang 3 years, 9 months ago
There are 4 debug files created under /proc/net/[Devname]. Devname could
be wlan0 initially, however it could be renamed later to e.g. enx00e04c000002.
This will cause problem during debug file teardown since it uses
netdev->name which is no longer wlan0. To solve this problem, add a
notifier to handle device renaming.

Also, due to this is purely for debuging as files are created read only,
move this to debugfs like other NIC drivers do instead of using procfs.

Reported-by: Zheyu Ma <zheyuma97@gmail.com>
Tested-by: Zheyu Ma <zheyuma97@gmail.com>
Signed-off-by: Tong Zhang <ztong0001@gmail.com>

v2: break down patch and fix pointer check

Tong Zhang (3):
  staging: rtl8192u: move debug stuff to its own file
  staging: rtl8192u: move debug files to debugfs
  staging: rtl8192u: fix rmmod warn when wlan0 is renamed

 drivers/staging/rtl8192u/Makefile         |   1 +
 drivers/staging/rtl8192u/r8192U.h         |   6 +
 drivers/staging/rtl8192u/r8192U_core.c    | 223 ++++------------------
 drivers/staging/rtl8192u/r8192U_debugfs.c | 188 ++++++++++++++++++
 4 files changed, 235 insertions(+), 183 deletions(-)
 create mode 100644 drivers/staging/rtl8192u/r8192U_debugfs.c

-- 
2.25.1
Re: [PATCH v2 0/3] staging: rtl8192u: fix rmmod warn when wlan0 is renamed
Posted by Dan Carpenter 3 years, 9 months ago
On Mon, Jul 18, 2022 at 10:50:35PM -0700, Tong Zhang wrote:
> There are 4 debug files created under /proc/net/[Devname]. Devname could
> be wlan0 initially, however it could be renamed later to e.g. enx00e04c000002.
> This will cause problem during debug file teardown since it uses
> netdev->name which is no longer wlan0. To solve this problem, add a
> notifier to handle device renaming.
> 
> Also, due to this is purely for debuging as files are created read only,
> move this to debugfs like other NIC drivers do instead of using procfs.
> 
> Reported-by: Zheyu Ma <zheyuma97@gmail.com>
> Tested-by: Zheyu Ma <zheyuma97@gmail.com>
> Signed-off-by: Tong Zhang <ztong0001@gmail.com>
> 
> v2: break down patch and fix pointer check
> 
> Tong Zhang (3):
>   staging: rtl8192u: move debug stuff to its own file
>   staging: rtl8192u: move debug files to debugfs
>   staging: rtl8192u: fix rmmod warn when wlan0 is renamed

Thanks!  This is much better.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>

regards,
dan carpenter