Skip to content

Commit

Permalink
wifi: VIM4: fix aml_wifi module reload errors
Browse files Browse the repository at this point in the history
unload & reload aml_wifi module, below errors occur:

[   19.053599@0]  load module: aml_wifi
[   19.053853@0]  of_get_named_gpiod_flags: parsed 'interrupt-gpios' property of node '/aml_wifi[0]' - status (0)
[   19.053863@0]  of_get_named_gpiod_flags: parsed 'power_on-gpios' property of node '/aml_wifi[0]' - status (0)
[   19.053866@0]  wifi: power_on_pin_OD = 0;
[   19.053872@0]  aml_wifi aml_wifi: [wifi_dev_probe] no power_on_pin2
[   19.053876@0]  aml_wifi aml_wifi: [wifi_dev_probe] no chip_en_pin
[   19.053879@0]  aml_wifi aml_wifi: [wifi_dev_probe] use double channel
[   19.054003@0]  aml_wifi aml_wifi: [pwm_double_channel_conf_dt] wifi pwm dt ok
[   19.054009@0]  aml_wifi aml_wifi: [pwm_double_channel_conf] wifi pwm conf ok
[   19.054013@0]  aml_wifi aml_wifi: [wifi_dev_probe] dhd_static_buf all setup
[   19.054016@0]  Wifi: bcmdhd_init_wlan_mem: [dhd] STATIC-MSG) bcmdhd_init_wlan_mem : 101.10.361.10 (wlan=r892223-20210623-1)
[   19.056601@0]  Wifi: bcmdhd_init_wlan_mem: [dhd] STATIC-MSG) bcmdhd_init_wlan_mem : prealloc ok: 8162304(7971K)
[   19.056610@0]  aml_wifi aml_wifi: [wifi_dev_probe] interrupt_pin=382
[   19.056614@0]  aml_wifi aml_wifi: [wifi_dev_probe] irq_num=0, irq_trigger_type=1
[   19.056617@0]  aml_wifi aml_wifi: [wifi_dev_probe] power_on_pin=381
[   19.056620@0]  aml_wifi aml_wifi: [wifi_dev_probe] clock_32k_pin=0
[   19.056649@0]  sysfs: cannot create duplicate filename '/class/wifi_power'
[   19.056655@0]  CPU: 0 PID: 1802 Comm: insmod Not tainted 5.4.125 #16
[   19.056657@0]  Hardware name: Khadas VIM4 (DT)
[   19.056659@0]  Call trace:
[   19.056671@0]  [ffffffc0202b36c0+ 112][<ffffffc0100953c8>] dump_backtrace+0x0/0x158
[   19.056675@0]  [ffffffc0202b3730+  32][<ffffffc010095544>] show_stack+0x24/0x30
[   19.056681@0]  [ffffffc0202b3750+  64][<ffffffc010f18320>] dump_stack+0xb8/0xe0
[   19.056687@0]  [ffffffc0202b3790+  48][<ffffffc010388968>] sysfs_warn_dup+0x68/0x80
[   19.056691@0]  [ffffffc0202b37c0+  64][<ffffffc010388af0>] sysfs_create_dir_ns+0xf0/0x108
[   19.056696@0]  [ffffffc0202b3800+  64][<ffffffc010ed072c>] kobject_add_internal+0xb4/0x308
[   19.056700@0]  [ffffffc0202b3840+  32][<ffffffc010ed0b4c>] kset_register+0x54/0x80
[   19.056705@0]  [ffffffc0202b3860+  48][<ffffffc010645294>] __class_register+0xc4/0x170
[   19.056719@0]  [ffffffc0202b3890+ 112][<ffffffc008ff0400>] wifi_dev_probe+0x348/0x888 [aml_wifi]
[   19.056723@0]  [ffffffc0202b3900+  48][<ffffffc010646488>] platform_drv_probe+0x58/0xa8
[   19.056728@0]  [ffffffc0202b3930+  80][<ffffffc010643898>] really_probe+0xf0/0x3a8
[   19.056733@0]  [ffffffc0202b3980+  48][<ffffffc010643d3c>] driver_probe_device+0x5c/0xf0
[   19.056737@0]  [ffffffc0202b39b0+  48][<ffffffc010644004>] device_driver_attach+0x74/0x80
[   19.056742@0]  [ffffffc0202b39e0+  48][<ffffffc010644074>] __driver_attach+0x64/0xe0
[   19.056747@0]  [ffffffc0202b3a10+  96][<ffffffc010641408>] bus_for_each_dev+0x80/0xd0
[   19.056751@0]  [ffffffc0202b3a70+  32][<ffffffc010643160>] driver_attach+0x30/0x40
[   19.056755@0]  [ffffffc0202b3a90+  64][<ffffffc010642a14>] bus_add_driver+0x14c/0x1f0
[   19.056760@0]  [ffffffc0202b3ad0+  32][<ffffffc010644dac>] driver_register+0x64/0x110
[   19.056763@0]  [ffffffc0202b3af0+  32][<ffffffc0106463d4>] __platform_driver_register+0x54/0x60
[   19.056772@0]  [ffffffc0202b3b10+  16][<ffffffc008ff9028>] wifi_dt_init+0x28/0x1000 [aml_wifi]
[   19.056777@0]  [ffffffc0202b3b20+ 144][<ffffffc010085748>] do_one_initcall+0x50/0x2a8
[   19.056782@0]  [ffffffc0202b3bb0+  48][<ffffffc01017b2dc>] do_init_module+0x5c/0x1f0
[   19.056786@0]  [ffffffc0202b3be0+ 368][<ffffffc01017d730>] load_module+0x2168/0x2770
[   19.056790@0]  [ffffffc0202b3d50+ 256][<ffffffc01017e000>] __do_sys_init_module+0x2c8/0x3a8
[   19.056793@0]  [ffffffc0202b3e50+  32][<ffffffc01017e104>] __arm64_sys_init_module+0x24/0x30
[   19.056799@0]  [ffffffc0202b3e70+  48][<ffffffc01009dddc>] el0_svc_common.constprop.0+0x74/0x168
[   19.056804@0]  [ffffffc0202b3ea0+ 336][<ffffffc01009df04>] el0_svc_handler+0x34/0xa0
[   19.056808@0]  [ffffffc0202b3ff0+   0][<ffffffc010084f08>] el0_svc+0x8/0xc
[   19.056811@0]  kobject_add_internal failed for wifi_power with -EEXIST, don't try to register things with the same name in the same directory.
[   19.056918@0]  aml_wifi: probe of aml_wifi failed with error -17

Signed-off-by: Nick Xie <[email protected]>
Change-Id: I2b8a52a9f2f8707f9c3e450de69856235ca81bdc
  • Loading branch information
numbqq committed May 26, 2022
1 parent ee3c8e1 commit 469c251
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/amlogic/wifi/wifi_dt.c
Original file line number Diff line number Diff line change
Expand Up @@ -930,6 +930,14 @@ static int wifi_dev_remove(struct platform_device *pdev)
{
WIFI_INFO("%s\n", __func__);
wifi_teardown_dt();

class_remove_file(wifi_dt_class, &class_attr_power);
class_destroy(wifi_dt_class);
device_destroy(&wifi_power_class, wifi_power_devno);
class_destroy(&wifi_power_class);
cdev_del(wifi_power_cdev);
unregister_chrdev_region(wifi_power_devno, 1);

return 0;
}

Expand Down

0 comments on commit 469c251

Please sign in to comment.