From a7e71a03cf1fe23ce97bf07fb6143431f4abb8fa Mon Sep 17 00:00:00 2001 From: Alex Zhao Date: Tue, 19 Sep 2017 19:59:26 +0800 Subject: [PATCH] net: wireless: rockchip_wlan: ap6255: fix irq abnormal. the dmesg log is like: [11244.133855] Call trace: [11244.133871] Exception stack(0xffffffc075cdf820 to 0xffffffc075cdf950) [11244.133885] f820: ffffffc07b7d6040 0000008000000000 000000000169f000 ffffff80089174c4 [11244.133899] f840: 00000000804001c5 ffffff800940b1e0 0000000000000000 ffffff80091ec000 [11244.133913] f860: 0000000000000040 ffffff8008bf7000 0000000000000140 ffffff80091ec000 [11244.133924] f880: ffffff800938a830 cb88537fdc8ba653 ffffffc075cdf8e0 ffffff80080f28ec [11244.133935] f8a0: ffffffc075cdf8b0 ffffff80080eabf0 ffffffc075cdf8e0 ffffff80080f29f8 [11244.133949] f8c0: ffffffc075cdf8e0 ffffff80080f2a28 ffffff800938a830 cb88537fdc8ba653 [11244.133963] f8e0: ffffffc07b41e400 0000000000000000 0000000000000000 0000000086098608 [11244.133975] f900: 0000000000000000 0000000000000000 00000000fffffffa ffffffc07b050580 [11244.133988] f920: ffffff80082fb318 7f7f7f7f7f7f7f7f 722d6367636c6261 7f7f7f7f7f7f7f7f [11244.133998] f940: 0101010101010101 0000000000000010 [11244.134024] [] clk_core_disable+0x18/0x18c [11244.134039] [] clk_disable+0x2c/0x40 [11244.134064] [] rockchip_irq_gc_mask_set_bit+0x20/0x2c [11244.134086] [] irq_shutdown+0x4c/0x68 [11244.134098] [] __free_irq+0x100/0x20c [11244.134109] [] free_irq+0x48/0x58 [11244.134129] [] bcmsdh_oob_intr_unregister+0x8c/0xa0 [11244.134143] [] dhd_bus_devreset+0x84/0x2c4 [11244.134166] [] dhd_net_bus_devreset+0xc4/0x104 [11244.134190] [] wl_android_wifi_off+0xb8/0x10c [11244.134205] [] dhd_stop+0x6c/0x1d0 [11244.134227] [] __dev_close_many+0x9c/0xc0 [11244.134237] [] __dev_close+0x38/0x68 [11244.134253] [] __dev_change_flags+0xa8/0x140 [11244.134264] [] dev_change_flags+0x20/0x5c [11244.134290] [] devinet_ioctl+0x29c/0x60c [11244.134304] [] inet_ioctl+0xc0/0xec [11244.134327] [] sock_do_ioctl+0x30/0x5c [11244.134341] [] sock_ioctl+0x2d8/0x314 [11244.134365] [] do_vfs_ioctl+0x5e4/0x720 [11244.134377] [] SyS_ioctl+0x60/0x88 [11244.134400] [] el0_svc_naked+0x24/0x28 Change-Id: I93cffbf170e96ccb71da53123f61c78f0ffdc98a Signed-off-by: Alex Zhao --- .../wireless/rockchip_wlan/rkwifi/bcmdhd/bcmsdh_linux.c | 7 +++++++ drivers/net/wireless/rockchip_wlan/rkwifi/rk_wifi_config.c | 4 ++++ .../net/wireless/rockchip_wlan/wifi_sys/rkwifi_sys_iface.c | 7 ++++++- include/linux/rfkill-wlan.h | 1 + net/rfkill/rfkill-wlan.c | 4 +++- 5 files changed, 21 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/bcmsdh_linux.c b/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/bcmsdh_linux.c index 9c93279dcbf2..a0e5f2400c1e 100755 --- a/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/bcmsdh_linux.c +++ b/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/bcmsdh_linux.c @@ -51,6 +51,9 @@ extern void dhdsdio_isr(void * args); #include #endif /* defined(CONFIG_ARCH_ODIN) */ #include +#include + +extern int get_wifi_chip_type(void); /* driver info, initialized when bcmsdh_register is called */ static bcmsdh_driver_t drvinfo = {NULL, NULL, NULL, NULL}; @@ -333,6 +336,7 @@ int bcmsdh_oob_intr_register(bcmsdh_info_t *bcmsdh, bcmsdh_cb_fn_t oob_irq_handl void* oob_irq_handler_context) { int err = 0; + int type; bcmsdh_os_info_t *bcmsdh_osinfo = bcmsdh->os_cxt; SDLX_MSG(("%s: Enter\n", __FUNCTION__)); @@ -365,6 +369,9 @@ int bcmsdh_oob_intr_register(bcmsdh_info_t *bcmsdh, bcmsdh_cb_fn_t oob_irq_handl return err; } + type = get_wifi_chip_type(); + if (type == WIFI_AP6255) + bcmsdh_oob_intr_set(bcmsdh, FALSE); #if defined(DISABLE_WOWLAN) SDLX_MSG(("%s: disable_irq_wake\n", __FUNCTION__)); bcmsdh_osinfo->oob_irq_wake_enabled = FALSE; diff --git a/drivers/net/wireless/rockchip_wlan/rkwifi/rk_wifi_config.c b/drivers/net/wireless/rockchip_wlan/rkwifi/rk_wifi_config.c index 230c33776967..566f4672b867 100755 --- a/drivers/net/wireless/rockchip_wlan/rkwifi/rk_wifi_config.c +++ b/drivers/net/wireless/rockchip_wlan/rkwifi/rk_wifi_config.c @@ -73,6 +73,10 @@ if (chip == WIFI_AP6234) { sprintf(nvram, "%s%s", ANDROID_FW_PATH, "nvram_AP6234.txt"); } +if (chip == WIFI_AP6255) { + sprintf(fw, "%s%s", ANDROID_FW_PATH, "fw_bcm43455c0_ag.bin"); + sprintf(nvram, "%s%s", ANDROID_FW_PATH, "nvram_ap6255.txt"); +} if (chip == WIFI_AP6441) { sprintf(fw, "%s%s", ANDROID_FW_PATH, "fw_bcm43341b0_ag.bin"); sprintf(nvram, "%s%s", ANDROID_FW_PATH, "nvram_AP6441.txt"); diff --git a/drivers/net/wireless/rockchip_wlan/wifi_sys/rkwifi_sys_iface.c b/drivers/net/wireless/rockchip_wlan/wifi_sys/rkwifi_sys_iface.c index 7cc12cc9da4b..bdf45f364239 100644 --- a/drivers/net/wireless/rockchip_wlan/wifi_sys/rkwifi_sys_iface.c +++ b/drivers/net/wireless/rockchip_wlan/wifi_sys/rkwifi_sys_iface.c @@ -46,7 +46,12 @@ static ssize_t wifi_chip_read(struct class *cls, struct class_attribute *attr, c count = sprintf(_buf, "%s", "AP6234"); printk("Current WiFi chip is AP6234.\n"); } - + + if (type == WIFI_AP6255) { + count = sprintf(_buf, "%s", "AP6255"); + printk("Current WiFi chip is AP6255.\n"); + } + if(type == WIFI_AP6330) { count = sprintf(_buf, "%s", "AP6330"); printk("Current WiFi chip is AP6330.\n"); diff --git a/include/linux/rfkill-wlan.h b/include/linux/rfkill-wlan.h index 02bf9bb17efa..b78f989f18c7 100755 --- a/include/linux/rfkill-wlan.h +++ b/include/linux/rfkill-wlan.h @@ -49,6 +49,7 @@ enum { WIFI_AP6210, WIFI_AP6212, WIFI_AP6234, + WIFI_AP6255, WIFI_AP6330, WIFI_AP6335, WIFI_AP6354, diff --git a/net/rfkill/rfkill-wlan.c b/net/rfkill/rfkill-wlan.c index 66accd5f84f2..319c44bd5b00 100644 --- a/net/rfkill/rfkill-wlan.c +++ b/net/rfkill/rfkill-wlan.c @@ -115,7 +115,9 @@ int get_wifi_chip_type(void) } else if (strcmp(wifi_chip_type_string, "ap6181") == 0) { type = WIFI_AP6181; } else if (strcmp(wifi_chip_type_string, "ap6234") == 0) { - type = WIFI_AP6234; + type = WIFI_AP6234; + } else if (strcmp(wifi_chip_type_string, "ap6255") == 0) { + type = WIFI_AP6255; } else if (strcmp(wifi_chip_type_string, "ap6330") == 0) { type = WIFI_AP6330; } else if (strcmp(wifi_chip_type_string, "ap6335") == 0) {