* Re: [wireless-drivers-next:master 28/45] drivers/net/wireless/rsi/rsi_91x_usb.c:229:27: sparse: restricted __le32 degrades to integer
From: Siva Rebbagondla @ 2019-04-26 11:34 UTC (permalink / raw)
To: Kalle Valo; +Cc: kbuild test robot, kbuild-all, Linux Wireless
In-Reply-To: <875zr1wi3z.fsf@kamboji.qca.qualcomm.com>
Hi Kalle,
On Fri, Apr 26, 2019 at 9:09 AM Kalle Valo <kvalo@codeaurora.org> wrote:
>
> + linux-wireless
>
> Siva Rebbagondla <siva8118@gmail.com> writes:
>
> > Hi Kalle,
> >
> > On Fri, Apr 26, 2019 at 1:06 AM kbuild test robot <lkp@intel.com> wrote:
> >>
> >> tree: https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git master
> >> head: 147b502bda338f4f2dff19faaa5829b691305ea5
> >> commit: 0a60014b76f512f18e48cfb4efc71e07c6791996 [28/45] rsi: miscallaneous changes for 9116 and common
> >> reproduce:
> >> # apt-get install sparse
> >> git checkout 0a60014b76f512f18e48cfb4efc71e07c6791996
> >> make ARCH=x86_64 allmodconfig
> >> make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
> >>
> >> If you fix the issue, kindly add following tag
> >> Reported-by: kbuild test robot <lkp@intel.com>
> >>
> >>
> >> sparse warnings: (new ones prefixed by >>)
> >>
> >> >> drivers/net/wireless/rsi/rsi_91x_usb.c:229:27: sparse: restricted __le32 degrades to integer
> >> drivers/net/wireless/rsi/rsi_91x_usb.c:230:27: sparse: restricted __le32 degrades to integer
> >> drivers/net/wireless/rsi/rsi_91x_usb.c:231:27: sparse: restricted __le32 degrades to integer
> >> drivers/net/wireless/rsi/rsi_91x_usb.c:232:27: sparse: restricted __le32 degrades to integer
> >> drivers/net/wireless/rsi/rsi_91x_usb.c:238:36: sparse: restricted __le32 degrades to integer
> >> drivers/net/wireless/rsi/rsi_91x_usb.c:239:35: sparse: restricted __le32 degrades to integer
> >> drivers/net/wireless/rsi/rsi_91x_usb.c:354:28: sparse: expression using sizeof(void)
> >> drivers/net/wireless/rsi/rsi_91x_usb.c:401:28: sparse: expression using sizeof(void)
> >>
> >> vim +229 drivers/net/wireless/rsi/rsi_91x_usb.c
> >>
> >> 203
> >> 204 /**
> >> 205 * rsi_usb_reg_write() - This function writes the given data into the given
> >> 206 * register address.
> >> 207 * @usbdev: Pointer to the usb_device structure.
> >> 208 * @reg: Address of the register.
> >> 209 * @value: Value to write.
> >> 210 * @len: Length of data to be written.
> >> 211 *
> >> 212 * Return: status: 0 on success, a negative error code on failure.
> >> 213 */
> >> 214 static int rsi_usb_reg_write(struct usb_device *usbdev,
> >> 215 u32 reg,
> >> 216 u32 value,
> >> 217 u16 len)
> >> 218 {
> >> 219 u8 *usb_reg_buf;
> >> 220 int status = -ENOMEM;
> >> 221
> >> 222 if (len > RSI_USB_CTRL_BUF_SIZE)
> >> 223 return -EINVAL;
> >> 224
> >> 225 usb_reg_buf = kmalloc(RSI_USB_CTRL_BUF_SIZE, GFP_KERNEL);
> >> 226 if (!usb_reg_buf)
> >> 227 return status;
> >> 228
> >> > 229 usb_reg_buf[0] = (cpu_to_le32(value) & 0x00ff);
> >> 230 usb_reg_buf[1] = (cpu_to_le32(value) & 0xff00) >> 8;
> >> 231 usb_reg_buf[2] = (cpu_to_le32(value) & 0x00ff0000) >> 16;
> >> 232 usb_reg_buf[3] = (cpu_to_le32(value) & 0xff000000) >> 24;
> >> 233
> >> 234 status = usb_control_msg(usbdev,
> >> 235 usb_sndctrlpipe(usbdev, 0),
> >> 236 USB_VENDOR_REGISTER_WRITE,
> >> 237 RSI_USB_REQ_OUT,
> >> 238 ((cpu_to_le32(reg) & 0xffff0000) >> 16),
> >> 239 (cpu_to_le32(reg) & 0xffff),
> >> 240 (void *)usb_reg_buf,
> >> 241 len,
> >> 242 USB_CTRL_SET_TIMEOUT);
> >> 243 if (status < 0) {
> >> 244 rsi_dbg(ERR_ZONE,
> >> 245 "%s: Reg write failed with error code :%d\n",
> >> 246 __func__, status);
> >> 247 }
> >> 248 kfree(usb_reg_buf);
> >> 249
> >> 250 return status;
> >> 251 }
> >> 252
> >>
> >> ---
> >> 0-DAY kernel test infrastructure Open Source Technology Center
> >> https://lists.01.org/pipermail/kbuild-all Intel Corporation
> >
> > Some where went wrong. I fixed this one. I will resend you the patches
> > with changes.
>
> Your patches are now applied and cannot be changed, so no point of
> resending them anymore. You need to send followup patches which fix the
> issues and apply to wireless-drivers-next.
>
> And remember to use Fixes tag so that we know which commit patch fixes.
Sure. I will send a patch which fixes this.
Best regards,
Siva Rebbagondla
^ permalink raw reply
* Re: [PATCH] net: wireless: fix missing checks for ioremap
From: Kalle Valo @ 2019-04-26 11:48 UTC (permalink / raw)
To: Kangjie Lu
Cc: kjlu, pakki001, David S. Miller, linux-wireless, netdev,
linux-kernel
In-Reply-To: <20190311075440.1513-1-kjlu@umn.edu>
Kangjie Lu <kjlu@umn.edu> wrote:
> ioremap could fail and returns NULL. The fix actively checks
> its return value and handles potential failures.
>
> Signed-off-by: Kangjie Lu <kjlu@umn.edu>
The prefix should be "ray_cs: ":
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches#commit_title_is_wrong
Also I don't see the point of setting the ret variable as it's ignored in the failed label:
failed:
ray_release(link);
return -ENODEV;
Patch set to Changes Requested.
--
https://patchwork.kernel.org/patch/10846851/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply
* Re: [PATCH] net: ath: fix missing checks for bmi reads and writes
From: Kalle Valo @ 2019-04-26 11:51 UTC (permalink / raw)
To: Kangjie Lu
Cc: netdev, linux-wireless, linux-kernel, ath10k, pakki001,
David S. Miller
In-Reply-To: <20190315051903.10664-1-kjlu@umn.edu>
Kangjie Lu <kjlu@umn.edu> writes:
> ath10k_bmi_write32 and ath10k_bmi_read32 can fail. The fix
> checks their statuses to avoid potential undefined behaviors.
>
> Signed-off-by: Kangjie Lu <kjlu@umn.edu>
[...]
> @@ -2500,8 +2515,15 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode,
> if (status)
> goto err;
>
> - if (ar->hif.bus == ATH10K_BUS_SDIO)
> - ath10k_init_sdio(ar);
> + if (ar->hif.bus == ATH10K_BUS_SDIO) {
> + status = ath10k_init_sdio(ar);
> + if (status) {
> + ath10k_err(ar,
> + "could not init HTC (%d)\n",
> + status);
I'll fix the warning message as well, we are not initialisating HTC
here.
--
Kalle Valo
^ permalink raw reply
* Re: [PATCH 1/3] qtnfmac: handle channel switch events for connected stations only
From: Kalle Valo @ 2019-04-26 11:53 UTC (permalink / raw)
To: Sergey Matyukevich
Cc: linux-wireless@vger.kernel.org, Igor Mitsyanko,
Sergey Matyukevich
In-Reply-To: <20190409073500.16402-2-sergey.matyukevich.os@quantenna.com>
Sergey Matyukevich <sergey.matyukevich.os@quantenna.com> wrote:
> Channel switch events from firmware should be processed only when STA
> is already connected to BSS. On connect this notification is not needed
> since full BSS info will be supplied by cfg80211_connect_result.
>
> Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
3 patches applied to wireless-drivers-next.git, thanks.
4f87d486faf1 qtnfmac: handle channel switch events for connected stations only
888f1564a272 qtnfmac: allow to control DFS slave radar detection
0b68fe10b8e8 qtnfmac: modify debugfs to support multiple cards
--
https://patchwork.kernel.org/patch/10890667/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply
* Re: [PATCH] mwl8k: move spin_lock_bh to spin_lock in tasklet
From: Kalle Valo @ 2019-04-26 11:57 UTC (permalink / raw)
To: Jeff Xie; +Cc: buytenh, davem, chongguiguzi, linux-wireless, netdev,
linux-kernel
In-Reply-To: <1553012645-28989-1-git-send-email-chongguiguzi@gmail.com>
Jeff Xie <chongguiguzi@gmail.com> wrote:
> It is unnecessary to call spin_lock_bh in a tasklet.
>
> Signed-off-by: Jeff Xie <chongguiguzi@gmail.com>
Patch applied to wireless-drivers-next.git, thanks.
0b2ff1ff64c8 mwl8k: move spin_lock_bh to spin_lock in tasklet
--
https://patchwork.kernel.org/patch/10859991/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply
* Re: [PATCH] rtlwifi: rtl8192cu: remove set but not used variable 'turbo_scanoff'
From: Kalle Valo @ 2019-04-26 11:59 UTC (permalink / raw)
To: Yue Haibing
Cc: pkshih, Larry.Finger, linux-kernel, netdev, linux-wireless, davem,
YueHaibing
In-Reply-To: <20190423143214.39392-1-yuehaibing@huawei.com>
Yue Haibing <yuehaibing@huawei.com> wrote:
> From: YueHaibing <yuehaibing@huawei.com>
>
> Fixes gcc '-Wunused-but-set-variable' warning:
>
> drivers/net/wireless/realtek/rtlwifi/rtl8192cu/rf.c: In function 'rtl92cu_phy_rf6052_set_cck_txpower':
> drivers/net/wireless/realtek/rtlwifi/rtl8192cu/rf.c:45:7: warning: variable 'turbo_scanoff' set but not used [-Wunused-but-set-variable]
>
> It is not used any more since
> commit e9b0784bb9de ("rtlwifi: rtl8192cu: Fix some code in RF handling")
>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Patch applied to wireless-drivers-next.git, thanks.
a0656c6ec2fd rtlwifi: rtl8192cu: remove set but not used variable 'turbo_scanoff'
--
https://patchwork.kernel.org/patch/10913203/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply
* Re: [PATCH v3] brcmfmac: send mailbox interrupt twice for specific hardware device
From: Kalle Valo @ 2019-04-26 12:01 UTC (permalink / raw)
To: Wright Feng
Cc: arend.vanspriel@broadcom.com, franky.lin@broadcom.com,
hante.meuleman@broadcom.com, Chi-Hsien Lin, Wright Feng,
linux-wireless@vger.kernel.org,
brcm80211-dev-list.pdl@broadcom.com
In-Reply-To: <1556248345-146837-1-git-send-email-wright.feng@cypress.com>
Wright Feng <Wright.Feng@cypress.com> wrote:
> For PCIE wireless device with core revision less than 14, device may miss
> PCIE to System Backplane Interrupt via PCIEtoSBMailbox. So add sending
> mail box interrupt twice as a hardware workaround.
>
> Signed-off-by: Wright Feng <wright.feng@cypress.com>
Patch applied to wireless-drivers-next.git, thanks.
9ef77fbedad9 brcmfmac: send mailbox interrupt twice for specific hardware device
--
https://patchwork.kernel.org/patch/10917993/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply
* Re: [PATCH v9 14/14] staging: rtlwifi: remove staging rtlwifi driver
From: Kalle Valo @ 2019-04-26 12:09 UTC (permalink / raw)
To: yhchuang
Cc: linux-wireless, johannes, pkshih, tehuang, Larry.Finger, sgruszka,
briannorris, gregkh
In-Reply-To: <1555653004-1795-15-git-send-email-yhchuang@realtek.com>
<yhchuang@realtek.com> writes:
> From: Yan-Hsuan Chuang <yhchuang@realtek.com>
>
> The rtlwifi driver is conflicting with Realtek's new 802.11ac chip
> series driver rtw88, remove it to avoid racing with the same ID.
>
> The rtw88 driver can be found at drivers/net/wireless/realtek/rtw88
>
> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
BTW, this patch does not apply to wireless-drivers-next anymore. To
avoid any conflicts, would be it be safer that the driver is removed
directly from Greg's tree? After rtw88 is applied to
wireless-drivers-next, of course.
error: patch failed: drivers/staging/rtlwifi/Kconfig:1
error: drivers/staging/rtlwifi/Kconfig: patch does not apply
error: patch failed: drivers/staging/rtlwifi/efuse.c:1
error: drivers/staging/rtlwifi/efuse.c: patch does not apply
error: patch failed: drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_func_88xx.c:1
error: drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_func_88xx.c: patch does not apply
error: patch failed: drivers/staging/rtlwifi/pci.h:1
error: drivers/staging/rtlwifi/pci.h: patch does not apply
error: patch failed: drivers/staging/rtlwifi/phydm/phydm_rainfo.c:1
error: drivers/staging/rtlwifi/phydm/phydm_rainfo.c: patch does not apply
error: patch failed: drivers/staging/rtlwifi/phydm/rtl_phydm.c:1
error: drivers/staging/rtlwifi/phydm/rtl_phydm.c: patch does not apply
error: patch failed: drivers/staging/rtlwifi/rtl8822be/fw.c:1
error: drivers/staging/rtlwifi/rtl8822be/fw.c: patch does not apply
Patch failed at 0014 staging: rtlwifi: remove staging rtlwifi driver
--
Kalle Valo
^ permalink raw reply
* RE: [PATCH v9 14/14] staging: rtlwifi: remove staging rtlwifi driver
From: Tony Chuang @ 2019-04-26 12:19 UTC (permalink / raw)
To: Kalle Valo
Cc: linux-wireless@vger.kernel.org, johannes@sipsolutions.net, Pkshih,
Andy Huang, Larry.Finger@lwfinger.net, sgruszka@redhat.com,
briannorris@chromium.org, gregkh@linuxfoundation.org
In-Reply-To: <87d0l9ufw5.fsf@kamboji.qca.qualcomm.com>
Hi Greg,
> -----Original Message-----
> From: Kalle Valo [mailto:kvalo@codeaurora.org]
> Sent: Friday, April 26, 2019 8:10 PM
> To: Tony Chuang
> Cc: linux-wireless@vger.kernel.org; johannes@sipsolutions.net; Pkshih; Andy
> Huang; Larry.Finger@lwfinger.net; sgruszka@redhat.com;
> briannorris@chromium.org; gregkh@linuxfoundation.org
> Subject: Re: [PATCH v9 14/14] staging: rtlwifi: remove staging rtlwifi driver
>
> <yhchuang@realtek.com> writes:
>
> > From: Yan-Hsuan Chuang <yhchuang@realtek.com>
> >
> > The rtlwifi driver is conflicting with Realtek's new 802.11ac chip
> > series driver rtw88, remove it to avoid racing with the same ID.
> >
> > The rtw88 driver can be found at drivers/net/wireless/realtek/rtw88
> >
> > Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
>
> BTW, this patch does not apply to wireless-drivers-next anymore. To
> avoid any conflicts, would be it be safer that the driver is removed
> directly from Greg's tree? After rtw88 is applied to
> wireless-drivers-next, of course.
>
> error: patch failed: drivers/staging/rtlwifi/Kconfig:1
> error: drivers/staging/rtlwifi/Kconfig: patch does not apply
> error: patch failed: drivers/staging/rtlwifi/efuse.c:1
> error: drivers/staging/rtlwifi/efuse.c: patch does not apply
> error: patch failed:
> drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_func_88xx.c:1
> error: drivers/staging/rtlwifi/halmac/halmac_88xx/halmac_func_88xx.c: patch
> does not apply
> error: patch failed: drivers/staging/rtlwifi/pci.h:1
> error: drivers/staging/rtlwifi/pci.h: patch does not apply
> error: patch failed: drivers/staging/rtlwifi/phydm/phydm_rainfo.c:1
> error: drivers/staging/rtlwifi/phydm/phydm_rainfo.c: patch does not apply
> error: patch failed: drivers/staging/rtlwifi/phydm/rtl_phydm.c:1
> error: drivers/staging/rtlwifi/phydm/rtl_phydm.c: patch does not apply
> error: patch failed: drivers/staging/rtlwifi/rtl8822be/fw.c:1
> error: drivers/staging/rtlwifi/rtl8822be/fw.c: patch does not apply
> Patch failed at 0014 staging: rtlwifi: remove staging rtlwifi driver
>
Hi Greg,
Can you help us to remove the staging driver rtlwifi in your tree ?
I think Kalle can issue a signal to you when he has done reviewing
the rtw88 driver and merge it into wireless-drivers-next.
Thanks
Yan-Hsuan
^ permalink raw reply
* [PATCH] mt7603: wait for pre_tbtt_tasklet before scanning
From: Lorenzo Bianconi @ 2019-04-26 12:40 UTC (permalink / raw)
To: nbd; +Cc: lorenzo.bianconi, linux-wireless
In-Reply-To: <cover.1556280002.git.lorenzo@kernel.org>
Disable pre_tbtt_tasklet tasklet before performing frequency scanning
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
drivers/net/wireless/mediatek/mt76/mt7603/main.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/main.c b/drivers/net/wireless/mediatek/mt76/mt7603/main.c
index 18a33d921601..184ed4cead0a 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7603/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7603/main.c
@@ -535,6 +535,7 @@ mt7603_sw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
struct mt7603_dev *dev = hw->priv;
set_bit(MT76_SCANNING, &dev->mt76.state);
+ tasklet_disable(&dev->pre_tbtt_tasklet);
mt7603_beacon_set_timer(dev, -1, 0);
}
@@ -545,6 +546,7 @@ mt7603_sw_scan_complete(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
clear_bit(MT76_SCANNING, &dev->mt76.state);
mt7603_beacon_set_timer(dev, -1, dev->beacon_int);
+ tasklet_enable(&dev->pre_tbtt_tasklet);
}
static void
--
2.20.1
^ permalink raw reply related
* [PATCHv2] ath10k: Add wrapper function to ath10k debug
From: Venkateswara Naralasetty @ 2019-04-26 12:58 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, Venkateswara Naralasetty, Kan Yan
ath10k_dbg() is called in ath10k_process_rx() with huge set of arguments
which is causing CPU overhead even when debug_mask is not set.
Good improvement was observed in the receive side performance when call
to ath10k_dbg() is avoided in the RX path.
Since currently all debug messages are sent via tracing infrastructure,
we cannot entirely avoid calling ath10k_dbg. Therefore, call to
ath10k_dbg() is made conditional based on tracing config in the driver.
Trasmit performance remains unchanged with this patch; below are some
experimental results with this patch and tracing disabled.
mesh mode:
w/o this patch with this patch
Traffic TP CPU Usage TP CPU usage
TCP 840Mbps 76.53% 960Mbps 78.14%
UDP 1030Mbps 74.58% 1132Mbps 74.31%
Infra mode:
w/o this patch with this patch
Traffic TP CPU Usage TP CPU usage
TCP Rx 1241Mbps 80.89% 1270Mbps 73.50%
UDP Rx 1433Mbps 81.77% 1472Mbps 72.80%
Tested platform : IPQ8064
hardware used : QCA9984
firmware ver : ver 10.4-3.5.3-00057
Signed-off-by: Kan Yan <kyan@chromium.org>
Signed-off-by: Venkateswara Naralasetty <vnaralas@codeaurora.org>
---
v2:
* changed trace enabled check from IS_ENABLED(CONFIG_ATH10K_TRACING)
* to trace_ath10k_log_dbg_enabled().
drivers/net/wireless/ath/ath10k/core.c | 2 ++
drivers/net/wireless/ath/ath10k/debug.c | 8 ++++----
drivers/net/wireless/ath/ath10k/debug.h | 22 ++++++++++++++++------
drivers/net/wireless/ath/ath10k/trace.c | 1 +
drivers/net/wireless/ath/ath10k/trace.h | 6 +++++-
5 files changed, 28 insertions(+), 11 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index cfd7bb2..ab709bf 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -26,6 +26,8 @@
#include "coredump.h"
unsigned int ath10k_debug_mask;
+EXPORT_SYMBOL(ath10k_debug_mask);
+
static unsigned int ath10k_cryptmode_param;
static bool uart_print;
static bool skip_otp;
diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c
index 32d967a..1b63929 100644
--- a/drivers/net/wireless/ath/ath10k/debug.c
+++ b/drivers/net/wireless/ath/ath10k/debug.c
@@ -2620,8 +2620,8 @@ void ath10k_debug_unregister(struct ath10k *ar)
#endif /* CONFIG_ATH10K_DEBUGFS */
#ifdef CONFIG_ATH10K_DEBUG
-void ath10k_dbg(struct ath10k *ar, enum ath10k_debug_mask mask,
- const char *fmt, ...)
+void __ath10k_dbg(struct ath10k *ar, enum ath10k_debug_mask mask,
+ const char *fmt, ...)
{
struct va_format vaf;
va_list args;
@@ -2638,7 +2638,7 @@ void ath10k_dbg(struct ath10k *ar, enum ath10k_debug_mask mask,
va_end(args);
}
-EXPORT_SYMBOL(ath10k_dbg);
+EXPORT_SYMBOL(__ath10k_dbg);
void ath10k_dbg_dump(struct ath10k *ar,
enum ath10k_debug_mask mask,
@@ -2651,7 +2651,7 @@ void ath10k_dbg_dump(struct ath10k *ar,
if (ath10k_debug_mask & mask) {
if (msg)
- ath10k_dbg(ar, mask, "%s\n", msg);
+ __ath10k_dbg(ar, mask, "%s\n", msg);
for (ptr = buf; (ptr - buf) < len; ptr += 16) {
linebuflen = 0;
diff --git a/drivers/net/wireless/ath/ath10k/debug.h b/drivers/net/wireless/ath/ath10k/debug.h
index db78e85..a5b2039 100644
--- a/drivers/net/wireless/ath/ath10k/debug.h
+++ b/drivers/net/wireless/ath/ath10k/debug.h
@@ -240,18 +240,18 @@ void ath10k_sta_update_rx_tid_stats_ampdu(struct ath10k *ar,
#endif /* CONFIG_MAC80211_DEBUGFS */
#ifdef CONFIG_ATH10K_DEBUG
-__printf(3, 4) void ath10k_dbg(struct ath10k *ar,
- enum ath10k_debug_mask mask,
- const char *fmt, ...);
+__printf(3, 4) void __ath10k_dbg(struct ath10k *ar,
+ enum ath10k_debug_mask mask,
+ const char *fmt, ...);
void ath10k_dbg_dump(struct ath10k *ar,
enum ath10k_debug_mask mask,
const char *msg, const char *prefix,
const void *buf, size_t len);
#else /* CONFIG_ATH10K_DEBUG */
-static inline int ath10k_dbg(struct ath10k *ar,
- enum ath10k_debug_mask dbg_mask,
- const char *fmt, ...)
+static inline int __ath10k_dbg(struct ath10k *ar,
+ enum ath10k_debug_mask dbg_mask,
+ const char *fmt, ...)
{
return 0;
}
@@ -263,4 +263,14 @@ static inline void ath10k_dbg_dump(struct ath10k *ar,
{
}
#endif /* CONFIG_ATH10K_DEBUG */
+
+/* Avoid calling __ath10k_dbg() if debug_mask is not set and tracing
+ * disabled.
+ */
+#define ath10k_dbg(ar, dbg_mask, fmt, ...) \
+do { \
+ if ((ath10k_debug_mask & dbg_mask) || \
+ trace_ath10k_log_dbg_enabled()) \
+ __ath10k_dbg(ar, dbg_mask, fmt, ##__VA_ARGS__); \
+} while (0)
#endif /* _DEBUG_H_ */
diff --git a/drivers/net/wireless/ath/ath10k/trace.c b/drivers/net/wireless/ath/ath10k/trace.c
index 3ecdff1..c7d4c97 100644
--- a/drivers/net/wireless/ath/ath10k/trace.c
+++ b/drivers/net/wireless/ath/ath10k/trace.c
@@ -7,3 +7,4 @@
#define CREATE_TRACE_POINTS
#include "trace.h"
+EXPORT_SYMBOL(__tracepoint_ath10k_log_dbg);
diff --git a/drivers/net/wireless/ath/ath10k/trace.h b/drivers/net/wireless/ath/ath10k/trace.h
index ba977bb..ab91645 100644
--- a/drivers/net/wireless/ath/ath10k/trace.h
+++ b/drivers/net/wireless/ath/ath10k/trace.h
@@ -29,7 +29,11 @@ static inline u32 ath10k_frm_hdr_len(const void *buf, size_t len)
#if !defined(CONFIG_ATH10K_TRACING)
#undef TRACE_EVENT
#define TRACE_EVENT(name, proto, ...) \
-static inline void trace_ ## name(proto) {}
+static inline void trace_ ## name(proto) {} \
+static inline bool trace_##name##_enabled(void) \
+{ \
+ return false; \
+}
#undef DECLARE_EVENT_CLASS
#define DECLARE_EVENT_CLASS(...)
#undef DEFINE_EVENT
--
2.7.4
^ permalink raw reply related
* Re: [PATCHv2] ath10k: Add wrapper function to ath10k debug
From: Ben Greear @ 2019-04-26 13:21 UTC (permalink / raw)
To: Venkateswara Naralasetty, ath10k; +Cc: linux-wireless, Kan Yan
In-Reply-To: <1556283505-29539-1-git-send-email-vnaralas@codeaurora.org>
On 4/26/19 5:58 AM, Venkateswara Naralasetty wrote:
> ath10k_dbg() is called in ath10k_process_rx() with huge set of arguments
> which is causing CPU overhead even when debug_mask is not set.
> Good improvement was observed in the receive side performance when call
> to ath10k_dbg() is avoided in the RX path.
>
> Since currently all debug messages are sent via tracing infrastructure,
> we cannot entirely avoid calling ath10k_dbg. Therefore, call to
> ath10k_dbg() is made conditional based on tracing config in the driver.
>
> Trasmit performance remains unchanged with this patch; below are some
> experimental results with this patch and tracing disabled.
>
> mesh mode:
>
> w/o this patch with this patch
> Traffic TP CPU Usage TP CPU usage
>
> TCP 840Mbps 76.53% 960Mbps 78.14%
> UDP 1030Mbps 74.58% 1132Mbps 74.31%
>
> Infra mode:
>
> w/o this patch with this patch
> Traffic TP CPU Usage TP CPU usage
>
> TCP Rx 1241Mbps 80.89% 1270Mbps 73.50%
> UDP Rx 1433Mbps 81.77% 1472Mbps 72.80%
>
> Tested platform : IPQ8064
> hardware used : QCA9984
> firmware ver : ver 10.4-3.5.3-00057
>
> Signed-off-by: Kan Yan <kyan@chromium.org>
> Signed-off-by: Venkateswara Naralasetty <vnaralas@codeaurora.org>
> ---
> v2:
> * changed trace enabled check from IS_ENABLED(CONFIG_ATH10K_TRACING)
> * to trace_ath10k_log_dbg_enabled().
>
> drivers/net/wireless/ath/ath10k/core.c | 2 ++
> drivers/net/wireless/ath/ath10k/debug.c | 8 ++++----
> drivers/net/wireless/ath/ath10k/debug.h | 22 ++++++++++++++++------
> drivers/net/wireless/ath/ath10k/trace.c | 1 +
> drivers/net/wireless/ath/ath10k/trace.h | 6 +++++-
> 5 files changed, 28 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
> index cfd7bb2..ab709bf 100644
> --- a/drivers/net/wireless/ath/ath10k/core.c
> +++ b/drivers/net/wireless/ath/ath10k/core.c
> @@ -26,6 +26,8 @@
> #include "coredump.h"
>
> unsigned int ath10k_debug_mask;
> +EXPORT_SYMBOL(ath10k_debug_mask);
> +
> static unsigned int ath10k_cryptmode_param;
> static bool uart_print;
> static bool skip_otp;
> diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c
> index 32d967a..1b63929 100644
> --- a/drivers/net/wireless/ath/ath10k/debug.c
> +++ b/drivers/net/wireless/ath/ath10k/debug.c
> @@ -2620,8 +2620,8 @@ void ath10k_debug_unregister(struct ath10k *ar)
> #endif /* CONFIG_ATH10K_DEBUGFS */
>
> #ifdef CONFIG_ATH10K_DEBUG
> -void ath10k_dbg(struct ath10k *ar, enum ath10k_debug_mask mask,
> - const char *fmt, ...)
> +void __ath10k_dbg(struct ath10k *ar, enum ath10k_debug_mask mask,
> + const char *fmt, ...)
> {
> struct va_format vaf;
> va_list args;
Do you still need the check later in this method:
if (ath10k_debug_mask & mask)
since you already checked in the ath10k_dbg() macro?
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply
* RE: [PATCHv2] ath10k: Add wrapper function to ath10k debug
From: Venkateswara Naralasetty @ 2019-04-26 13:38 UTC (permalink / raw)
To: Ben Greear, Venkateswara Naralasetty, ath10k@lists.infradead.org
Cc: Kan Yan, linux-wireless@vger.kernel.org
In-Reply-To: <b9f263a4-e9da-18bb-5932-941a018ee860@candelatech.com>
> -----Original Message-----
> From: ath10k <ath10k-bounces@lists.infradead.org> On Behalf Of Ben
> Greear
> Sent: Friday, April 26, 2019 6:52 PM
> To: Venkateswara Naralasetty <vnaralas@codeaurora.org>;
> ath10k@lists.infradead.org
> Cc: Kan Yan <kyan@chromium.org>; linux-wireless@vger.kernel.org
> Subject: [EXT] Re: [PATCHv2] ath10k: Add wrapper function to ath10k debug
>
> On 4/26/19 5:58 AM, Venkateswara Naralasetty wrote:
> > ath10k_dbg() is called in ath10k_process_rx() with huge set of
> > arguments which is causing CPU overhead even when debug_mask is not
> set.
> > Good improvement was observed in the receive side performance when
> > call to ath10k_dbg() is avoided in the RX path.
> >
> > Since currently all debug messages are sent via tracing
> > infrastructure, we cannot entirely avoid calling ath10k_dbg.
> > Therefore, call to
> > ath10k_dbg() is made conditional based on tracing config in the driver.
> >
> > Trasmit performance remains unchanged with this patch; below are some
> > experimental results with this patch and tracing disabled.
> >
> > mesh mode:
> >
> > w/o this patch with this patch
> > Traffic TP CPU Usage TP CPU usage
> >
> > TCP 840Mbps 76.53% 960Mbps 78.14%
> > UDP 1030Mbps 74.58% 1132Mbps 74.31%
> >
> > Infra mode:
> >
> > w/o this patch with this patch
> > Traffic TP CPU Usage TP CPU usage
> >
> > TCP Rx 1241Mbps 80.89% 1270Mbps 73.50%
> > UDP Rx 1433Mbps 81.77% 1472Mbps 72.80%
> >
> > Tested platform : IPQ8064
> > hardware used : QCA9984
> > firmware ver : ver 10.4-3.5.3-00057
> >
> > Signed-off-by: Kan Yan <kyan@chromium.org>
> > Signed-off-by: Venkateswara Naralasetty <vnaralas@codeaurora.org>
> > ---
> > v2:
> > * changed trace enabled check from
> IS_ENABLED(CONFIG_ATH10K_TRACING)
> > * to trace_ath10k_log_dbg_enabled().
> >
> > drivers/net/wireless/ath/ath10k/core.c | 2 ++
> > drivers/net/wireless/ath/ath10k/debug.c | 8 ++++----
> > drivers/net/wireless/ath/ath10k/debug.h | 22 ++++++++++++++++------
> > drivers/net/wireless/ath/ath10k/trace.c | 1 +
> > drivers/net/wireless/ath/ath10k/trace.h | 6 +++++-
> > 5 files changed, 28 insertions(+), 11 deletions(-)
> >
> > diff --git a/drivers/net/wireless/ath/ath10k/core.c
> > b/drivers/net/wireless/ath/ath10k/core.c
> > index cfd7bb2..ab709bf 100644
> > --- a/drivers/net/wireless/ath/ath10k/core.c
> > +++ b/drivers/net/wireless/ath/ath10k/core.c
> > @@ -26,6 +26,8 @@
> > #include "coredump.h"
> >
> > unsigned int ath10k_debug_mask;
> > +EXPORT_SYMBOL(ath10k_debug_mask);
> > +
> > static unsigned int ath10k_cryptmode_param;
> > static bool uart_print;
> > static bool skip_otp;
> > diff --git a/drivers/net/wireless/ath/ath10k/debug.c
> > b/drivers/net/wireless/ath/ath10k/debug.c
> > index 32d967a..1b63929 100644
> > --- a/drivers/net/wireless/ath/ath10k/debug.c
> > +++ b/drivers/net/wireless/ath/ath10k/debug.c
> > @@ -2620,8 +2620,8 @@ void ath10k_debug_unregister(struct ath10k *ar)
> > #endif /* CONFIG_ATH10K_DEBUGFS */
> >
> > #ifdef CONFIG_ATH10K_DEBUG
> > -void ath10k_dbg(struct ath10k *ar, enum ath10k_debug_mask mask,
> > - const char *fmt, ...)
> > +void __ath10k_dbg(struct ath10k *ar, enum ath10k_debug_mask mask,
> > + const char *fmt, ...)
> > {
> > struct va_format vaf;
> > va_list args;
>
> Do you still need the check later in this method:
>
> if (ath10k_debug_mask & mask)
>
> since you already checked in the ath10k_dbg() macro?
Yes, we need this check.
Otherwise all debug messages will be printed even without any debug mask set in case of tracing enabled.
>
> Thanks,
> Ben
>
>
> --
> Ben Greear <greearb@candelatech.com>
> Candela Technologies Inc http://www.candelatech.com
>
>
> _______________________________________________
> ath10k mailing list
> ath10k@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/ath10k
^ permalink raw reply
* Re: [PATCHv2] ath10k: Add wrapper function to ath10k debug
From: Michał Kazior @ 2019-04-26 13:44 UTC (permalink / raw)
To: Venkateswara Naralasetty; +Cc: ath10k, linux-wireless, Kan Yan
In-Reply-To: <1556283505-29539-1-git-send-email-vnaralas@codeaurora.org>
On Fri, 26 Apr 2019 at 14:58, Venkateswara Naralasetty
<vnaralas@codeaurora.org> wrote:
>
> ath10k_dbg() is called in ath10k_process_rx() with huge set of arguments
> which is causing CPU overhead even when debug_mask is not set.
> Good improvement was observed in the receive side performance when call
> to ath10k_dbg() is avoided in the RX path.
[...]
> +/* Avoid calling __ath10k_dbg() if debug_mask is not set and tracing
> + * disabled.
> + */
> +#define ath10k_dbg(ar, dbg_mask, fmt, ...) \
> +do { \
> + if ((ath10k_debug_mask & dbg_mask) || \
> + trace_ath10k_log_dbg_enabled()) \
> + __ath10k_dbg(ar, dbg_mask, fmt, ##__VA_ARGS__); \
> +} while (0)
Did you consider using jump labels (see include/linux/jump_label.h)?
It's what tracing uses under the hood. I wonder if you could squeeze
out a bit more performance with that? I guess you'd need to add
`struct static_key ath10k_dbg_mask_keys[ATH10K_DBG_MAX]` and re-do
ath10k_debug_mask enum a bit.
Michal
^ permalink raw reply
* Re: [PATCHv2] ath10k: Add wrapper function to ath10k debug
From: Ben Greear @ 2019-04-26 13:56 UTC (permalink / raw)
To: Michał Kazior, Venkateswara Naralasetty
Cc: ath10k, linux-wireless, Kan Yan
In-Reply-To: <CABvG-CVxmnm=JsSsgYQqEzHHYU8RJDxqCZJn4Rzy=zPLtKY1hA@mail.gmail.com>
On 4/26/19 6:44 AM, Michał Kazior wrote:
> On Fri, 26 Apr 2019 at 14:58, Venkateswara Naralasetty
> <vnaralas@codeaurora.org> wrote:
>>
>> ath10k_dbg() is called in ath10k_process_rx() with huge set of arguments
>> which is causing CPU overhead even when debug_mask is not set.
>> Good improvement was observed in the receive side performance when call
>> to ath10k_dbg() is avoided in the RX path.
> [...]
>
>> +/* Avoid calling __ath10k_dbg() if debug_mask is not set and tracing
>> + * disabled.
>> + */
>> +#define ath10k_dbg(ar, dbg_mask, fmt, ...) \
>> +do { \
>> + if ((ath10k_debug_mask & dbg_mask) || \
>> + trace_ath10k_log_dbg_enabled()) \
>> + __ath10k_dbg(ar, dbg_mask, fmt, ##__VA_ARGS__); \
>> +} while (0)
>
> Did you consider using jump labels (see include/linux/jump_label.h)?
> It's what tracing uses under the hood. I wonder if you could squeeze
> out a bit more performance with that? I guess you'd need to add
> `struct static_key ath10k_dbg_mask_keys[ATH10K_DBG_MAX]` and re-do
> ath10k_debug_mask enum a bit.
Maybe first test with debugging just compiled out to see if there is still
any significant overhead with this new patch applied?
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply
* Re: [PATCHv2] ath10k: Add wrapper function to ath10k debug
From: Ben Greear @ 2019-04-26 13:57 UTC (permalink / raw)
To: Venkateswara Naralasetty, Venkateswara Naralasetty,
ath10k@lists.infradead.org
Cc: Kan Yan, linux-wireless@vger.kernel.org
In-Reply-To: <be151755e771423eaa0ad6e6e2e81c2b@APSANEXR01F.ap.qualcomm.com>
On 4/26/19 6:38 AM, Venkateswara Naralasetty wrote:
>>> #ifdef CONFIG_ATH10K_DEBUG
>>> -void ath10k_dbg(struct ath10k *ar, enum ath10k_debug_mask mask,
>>> - const char *fmt, ...)
>>> +void __ath10k_dbg(struct ath10k *ar, enum ath10k_debug_mask mask,
>>> + const char *fmt, ...)
>>> {
>>> struct va_format vaf;
>>> va_list args;
>>
>> Do you still need the check later in this method:
>>
>> if (ath10k_debug_mask & mask)
>>
>> since you already checked in the ath10k_dbg() macro?
> Yes, we need this check.
> Otherwise all debug messages will be printed even without any debug mask set in case of tracing enabled.
Ahh, I see.
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply
* Re: [wireless-drivers-next:master 21/45] drivers/net/wireless/rsi/rsi_91x_usb.c:774:17-26: ERROR: id is NULL but dereferenced. (fwd)
From: Kalle Valo @ 2019-04-26 14:58 UTC (permalink / raw)
To: Julia Lawall; +Cc: Siva Rebbagondla, kbuild-all, linux-wireless
In-Reply-To: <alpine.DEB.2.20.1904261625060.21912@hadrien>
+ linux-wireless
Julia Lawall <julia.lawall@lip6.fr> writes:
> The ifs starting on line 766 can fail because id is NULL.
>
> julia
>
> ---------- Forwarded message ----------
> Date: Fri, 26 Apr 2019 06:39:46 +0800
> From: kbuild test robot <lkp@intel.com>
> To: kbuild@01.org
> Cc: Julia Lawall <julia.lawall@lip6.fr>
> Subject: [wireless-drivers-next:master 21/45]
> drivers/net/wireless/rsi/rsi_91x_usb.c:774:17-26: ERROR: id is NULL but
> dereferenced.
>
> CC: kbuild-all@01.org
> TO: Siva Rebbagondla <siva8118@gmail.com>
> CC: Kalle Valo <kvalo@codeaurora.org>
>
> tree:
> https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git
> master
> head: 147b502bda338f4f2dff19faaa5829b691305ea5
> commit: 54fdb318c1116814711fad4bd166e6c85a477ef0 [21/45] rsi: add new
> device model for 9116
> :::::: branch date: 5 hours ago
> :::::: commit date: 6 hours ago
>
> If you fix the issue, kindly add following tag
> Reported-by: kbuild test robot <lkp@intel.com>
> Reported-by: Julia Lawall <julia.lawall@lip6.fr>
>
>>> drivers/net/wireless/rsi/rsi_91x_usb.c:774:17-26: ERROR: id is NULL
> but dereferenced.
>
> #
> https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git/commit/?id=54fdb318c1116814711fad4bd166e6c85a477ef0
> git remote add wireless-drivers-next
> https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git
> git remote update wireless-drivers-next
> git checkout 54fdb318c1116814711fad4bd166e6c85a477ef0
> vim +774 drivers/net/wireless/rsi/rsi_91x_usb.c
>
> ea0676c47 Karun Eagalapati 2017-07-06 729
> dad0d04fa Fariya Fatima 2014-03-16 730 /**
> dad0d04fa Fariya Fatima 2014-03-16 731 * rsi_probe() - This function
> is called by kernel when the driver provided
> dad0d04fa Fariya Fatima 2014-03-16 732 * Vendor and device IDs are
> matched. All the initialization
> dad0d04fa Fariya Fatima 2014-03-16 733 * work is done here.
> dad0d04fa Fariya Fatima 2014-03-16 734 * @pfunction: Pointer to the
> USB interface structure.
> dad0d04fa Fariya Fatima 2014-03-16 735 * @id: Pointer to the
> usb_device_id structure.
> dad0d04fa Fariya Fatima 2014-03-16 736 *
> 50591c60a Alexey Khoroshilov 2014-06-27 737 * Return: 0 on success, a
> negative error code on failure.
> dad0d04fa Fariya Fatima 2014-03-16 738 */
> dad0d04fa Fariya Fatima 2014-03-16 739 static int rsi_probe(struct
> usb_interface *pfunction,
> dad0d04fa Fariya Fatima 2014-03-16 740 const struct usb_device_id *id)
> dad0d04fa Fariya Fatima 2014-03-16 741 {
> dad0d04fa Fariya Fatima 2014-03-16 742 struct rsi_hw *adapter;
> dad0d04fa Fariya Fatima 2014-03-16 743 struct rsi_91x_usbdev *dev;
> dad0d04fa Fariya Fatima 2014-03-16 744 u16 fw_status;
> 50591c60a Alexey Khoroshilov 2014-06-27 745 int status;
> dad0d04fa Fariya Fatima 2014-03-16 746
> dad0d04fa Fariya Fatima 2014-03-16 747 rsi_dbg(INIT_ZONE, "%s: Init
> function called\n", __func__);
> dad0d04fa Fariya Fatima 2014-03-16 748
> 898b25533 Prameela Rani Garnepudi 2018-02-27 749 adapter =
> rsi_91x_init(dev_oper_mode);
> dad0d04fa Fariya Fatima 2014-03-16 750 if (!adapter) {
> dad0d04fa Fariya Fatima 2014-03-16 751 rsi_dbg(ERR_ZONE, "%s: Failed
> to init os intf ops\n",
> dad0d04fa Fariya Fatima 2014-03-16 752 __func__);
> 50591c60a Alexey Khoroshilov 2014-06-27 753 return -ENOMEM;
> dad0d04fa Fariya Fatima 2014-03-16 754 }
> b78e91bcf Prameela Rani Garnepudi 2017-05-16 755
> adapter->rsi_host_intf = RSI_HOST_INTF_USB;
> dad0d04fa Fariya Fatima 2014-03-16 756
> 50591c60a Alexey Khoroshilov 2014-06-27 757 status =
> rsi_init_usb_interface(adapter, pfunction);
> 50591c60a Alexey Khoroshilov 2014-06-27 758 if (status) {
> dad0d04fa Fariya Fatima 2014-03-16 759 rsi_dbg(ERR_ZONE, "%s: Failed
> to init usb interface\n",
> dad0d04fa Fariya Fatima 2014-03-16 760 __func__);
> dad0d04fa Fariya Fatima 2014-03-16 761 goto err;
> dad0d04fa Fariya Fatima 2014-03-16 762 }
> dad0d04fa Fariya Fatima 2014-03-16 763
> dad0d04fa Fariya Fatima 2014-03-16 764 rsi_dbg(ERR_ZONE, "%s:
> Initialized os intf ops\n", __func__);
> dad0d04fa Fariya Fatima 2014-03-16 765
> 54fdb318c Siva Rebbagondla 2019-04-03 766 if (id && id->idProduct ==
> RSI_USB_PID_9113) {
> 54fdb318c Siva Rebbagondla 2019-04-03 767 rsi_dbg(INIT_ZONE, "%s: 9113
> module detected\n", __func__);
> 54fdb318c Siva Rebbagondla 2019-04-03 768 adapter->device_model =
> RSI_DEV_9113;
> 54fdb318c Siva Rebbagondla 2019-04-03 769 } else if (id &&
> id->idProduct == RSI_USB_PID_9116) {
> 54fdb318c Siva Rebbagondla 2019-04-03 770 rsi_dbg(INIT_ZONE, "%s: 9116
> module detected\n", __func__);
> 54fdb318c Siva Rebbagondla 2019-04-03 771 adapter->device_model =
> RSI_DEV_9116;
> 54fdb318c Siva Rebbagondla 2019-04-03 772 } else {
> 54fdb318c Siva Rebbagondla 2019-04-03 773 rsi_dbg(ERR_ZONE, "%s:
> Unsupported RSI device id 0x%x\n",
> 54fdb318c Siva Rebbagondla 2019-04-03 @774 __func__, id->idProduct);
> 54fdb318c Siva Rebbagondla 2019-04-03 775 goto err1;
> 54fdb318c Siva Rebbagondla 2019-04-03 776 }
> 54fdb318c Siva Rebbagondla 2019-04-03 777
> dad0d04fa Fariya Fatima 2014-03-16 778 dev = (struct rsi_91x_usbdev
> *)adapter->rsi_dev;
> dad0d04fa Fariya Fatima 2014-03-16 779
> 50591c60a Alexey Khoroshilov 2014-06-27 780 status =
> rsi_usb_reg_read(dev->usbdev, FW_STATUS_REG, &fw_status, 2);
> b78e91bcf Prameela Rani Garnepudi 2017-05-16 781 if (status < 0)
> dad0d04fa Fariya Fatima 2014-03-16 782 goto err1;
> dad0d04fa Fariya Fatima 2014-03-16 783 else
> dad0d04fa Fariya Fatima 2014-03-16 784 fw_status &= 1;
> dad0d04fa Fariya Fatima 2014-03-16 785
> dad0d04fa Fariya Fatima 2014-03-16 786 if (!fw_status) {
> b78e91bcf Prameela Rani Garnepudi 2017-05-16 787 rsi_dbg(INIT_ZONE,
> "Loading firmware...\n");
> b78e91bcf Prameela Rani Garnepudi 2017-05-16 788 status =
> rsi_hal_device_init(adapter);
> 50591c60a Alexey Khoroshilov 2014-06-27 789 if (status) {
> dad0d04fa Fariya Fatima 2014-03-16 790 rsi_dbg(ERR_ZONE, "%s: Failed
> in device init\n",
> dad0d04fa Fariya Fatima 2014-03-16 791 __func__);
> dad0d04fa Fariya Fatima 2014-03-16 792 goto err1;
> dad0d04fa Fariya Fatima 2014-03-16 793 }
> b78e91bcf Prameela Rani Garnepudi 2017-05-16 794 rsi_dbg(INIT_ZONE,
> "%s: Device Init Done\n", __func__);
> dad0d04fa Fariya Fatima 2014-03-16 795 }
> dad0d04fa Fariya Fatima 2014-03-16 796
> 1100f81bb Prameela Rani Garnepudi 2018-02-27 797 status =
> rsi_rx_urb_submit(adapter, WLAN_EP);
> 50591c60a Alexey Khoroshilov 2014-06-27 798 if (status)
> dad0d04fa Fariya Fatima 2014-03-16 799 goto err1;
> dad0d04fa Fariya Fatima 2014-03-16 800
> a4302bff2 Siva Rebbagondla 2018-02-27 801 if (adapter->priv->coex_mode
>> 1) {
> a4302bff2 Siva Rebbagondla 2018-02-27 802 status =
> rsi_rx_urb_submit(adapter, BT_EP);
> a4302bff2 Siva Rebbagondla 2018-02-27 803 if (status)
> a4302bff2 Siva Rebbagondla 2018-02-27 804 goto err1;
> a4302bff2 Siva Rebbagondla 2018-02-27 805 }
> a4302bff2 Siva Rebbagondla 2018-02-27 806
> dad0d04fa Fariya Fatima 2014-03-16 807 return 0;
> dad0d04fa Fariya Fatima 2014-03-16 808 err1:
> dad0d04fa Fariya Fatima 2014-03-16 809
> rsi_deinit_usb_interface(adapter);
> dad0d04fa Fariya Fatima 2014-03-16 810 err:
> dad0d04fa Fariya Fatima 2014-03-16 811 rsi_91x_deinit(adapter);
> dad0d04fa Fariya Fatima 2014-03-16 812 rsi_dbg(ERR_ZONE, "%s: Failed
> in probe...Exiting\n", __func__);
> 50591c60a Alexey Khoroshilov 2014-06-27 813 return status;
> dad0d04fa Fariya Fatima 2014-03-16 814 }
> dad0d04fa Fariya Fatima 2014-03-16 815
>
> ---
> 0-DAY kernel test infrastructure Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all Intel Corporation
--
Kalle Valo
^ permalink raw reply
* Re: [wireless-drivers-next:master 21/45] drivers/net/wireless/rsi/rsi_91x_usb.c:774:17-26: ERROR: id is NULL but dereferenced. (fwd)
From: Siva Rebbagondla @ 2019-04-26 15:13 UTC (permalink / raw)
To: Kalle Valo; +Cc: Julia Lawall, kbuild-all, Linux Wireless
In-Reply-To: <871s1ovmo4.fsf@kamboji.qca.qualcomm.com>
Hi,
On Fri, Apr 26, 2019 at 8:28 PM Kalle Valo <kvalo@codeaurora.org> wrote:
>
> + linux-wireless
>
> Julia Lawall <julia.lawall@lip6.fr> writes:
>
> > The ifs starting on line 766 can fail because id is NULL.
I don't think id will be NULL here. id is coming from probe.
Is there any other opinions?.
> >
> > julia
> >
> > ---------- Forwarded message ----------
> > Date: Fri, 26 Apr 2019 06:39:46 +0800
> > From: kbuild test robot <lkp@intel.com>
> > To: kbuild@01.org
> > Cc: Julia Lawall <julia.lawall@lip6.fr>
> > Subject: [wireless-drivers-next:master 21/45]
> > drivers/net/wireless/rsi/rsi_91x_usb.c:774:17-26: ERROR: id is NULL but
> > dereferenced.
> >
> > CC: kbuild-all@01.org
> > TO: Siva Rebbagondla <siva8118@gmail.com>
> > CC: Kalle Valo <kvalo@codeaurora.org>
> >
> > tree:
> > https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git
> > master
> > head: 147b502bda338f4f2dff19faaa5829b691305ea5
> > commit: 54fdb318c1116814711fad4bd166e6c85a477ef0 [21/45] rsi: add new
> > device model for 9116
> > :::::: branch date: 5 hours ago
> > :::::: commit date: 6 hours ago
> >
> > If you fix the issue, kindly add following tag
> > Reported-by: kbuild test robot <lkp@intel.com>
> > Reported-by: Julia Lawall <julia.lawall@lip6.fr>
> >
> >>> drivers/net/wireless/rsi/rsi_91x_usb.c:774:17-26: ERROR: id is NULL
> > but dereferenced.
> >
> > #
> > https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git/commit/?id=54fdb318c1116814711fad4bd166e6c85a477ef0
> > git remote add wireless-drivers-next
> > https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git
> > git remote update wireless-drivers-next
> > git checkout 54fdb318c1116814711fad4bd166e6c85a477ef0
> > vim +774 drivers/net/wireless/rsi/rsi_91x_usb.c
> >
> > ea0676c47 Karun Eagalapati 2017-07-06 729
> > dad0d04fa Fariya Fatima 2014-03-16 730 /**
> > dad0d04fa Fariya Fatima 2014-03-16 731 * rsi_probe() - This function
> > is called by kernel when the driver provided
> > dad0d04fa Fariya Fatima 2014-03-16 732 * Vendor and device IDs are
> > matched. All the initialization
> > dad0d04fa Fariya Fatima 2014-03-16 733 * work is done here.
> > dad0d04fa Fariya Fatima 2014-03-16 734 * @pfunction: Pointer to the
> > USB interface structure.
> > dad0d04fa Fariya Fatima 2014-03-16 735 * @id: Pointer to the
> > usb_device_id structure.
> > dad0d04fa Fariya Fatima 2014-03-16 736 *
> > 50591c60a Alexey Khoroshilov 2014-06-27 737 * Return: 0 on success, a
> > negative error code on failure.
> > dad0d04fa Fariya Fatima 2014-03-16 738 */
> > dad0d04fa Fariya Fatima 2014-03-16 739 static int rsi_probe(struct
> > usb_interface *pfunction,
> > dad0d04fa Fariya Fatima 2014-03-16 740 const struct usb_device_id *id)
> > dad0d04fa Fariya Fatima 2014-03-16 741 {
> > dad0d04fa Fariya Fatima 2014-03-16 742 struct rsi_hw *adapter;
> > dad0d04fa Fariya Fatima 2014-03-16 743 struct rsi_91x_usbdev *dev;
> > dad0d04fa Fariya Fatima 2014-03-16 744 u16 fw_status;
> > 50591c60a Alexey Khoroshilov 2014-06-27 745 int status;
> > dad0d04fa Fariya Fatima 2014-03-16 746
> > dad0d04fa Fariya Fatima 2014-03-16 747 rsi_dbg(INIT_ZONE, "%s: Init
> > function called\n", __func__);
> > dad0d04fa Fariya Fatima 2014-03-16 748
> > 898b25533 Prameela Rani Garnepudi 2018-02-27 749 adapter =
> > rsi_91x_init(dev_oper_mode);
> > dad0d04fa Fariya Fatima 2014-03-16 750 if (!adapter) {
> > dad0d04fa Fariya Fatima 2014-03-16 751 rsi_dbg(ERR_ZONE, "%s: Failed
> > to init os intf ops\n",
> > dad0d04fa Fariya Fatima 2014-03-16 752 __func__);
> > 50591c60a Alexey Khoroshilov 2014-06-27 753 return -ENOMEM;
> > dad0d04fa Fariya Fatima 2014-03-16 754 }
> > b78e91bcf Prameela Rani Garnepudi 2017-05-16 755
> > adapter->rsi_host_intf = RSI_HOST_INTF_USB;
> > dad0d04fa Fariya Fatima 2014-03-16 756
> > 50591c60a Alexey Khoroshilov 2014-06-27 757 status =
> > rsi_init_usb_interface(adapter, pfunction);
> > 50591c60a Alexey Khoroshilov 2014-06-27 758 if (status) {
> > dad0d04fa Fariya Fatima 2014-03-16 759 rsi_dbg(ERR_ZONE, "%s: Failed
> > to init usb interface\n",
> > dad0d04fa Fariya Fatima 2014-03-16 760 __func__);
> > dad0d04fa Fariya Fatima 2014-03-16 761 goto err;
> > dad0d04fa Fariya Fatima 2014-03-16 762 }
> > dad0d04fa Fariya Fatima 2014-03-16 763
> > dad0d04fa Fariya Fatima 2014-03-16 764 rsi_dbg(ERR_ZONE, "%s:
> > Initialized os intf ops\n", __func__);
> > dad0d04fa Fariya Fatima 2014-03-16 765
> > 54fdb318c Siva Rebbagondla 2019-04-03 766 if (id && id->idProduct ==
> > RSI_USB_PID_9113) {
> > 54fdb318c Siva Rebbagondla 2019-04-03 767 rsi_dbg(INIT_ZONE, "%s: 9113
> > module detected\n", __func__);
> > 54fdb318c Siva Rebbagondla 2019-04-03 768 adapter->device_model =
> > RSI_DEV_9113;
> > 54fdb318c Siva Rebbagondla 2019-04-03 769 } else if (id &&
> > id->idProduct == RSI_USB_PID_9116) {
> > 54fdb318c Siva Rebbagondla 2019-04-03 770 rsi_dbg(INIT_ZONE, "%s: 9116
> > module detected\n", __func__);
> > 54fdb318c Siva Rebbagondla 2019-04-03 771 adapter->device_model =
> > RSI_DEV_9116;
> > 54fdb318c Siva Rebbagondla 2019-04-03 772 } else {
> > 54fdb318c Siva Rebbagondla 2019-04-03 773 rsi_dbg(ERR_ZONE, "%s:
> > Unsupported RSI device id 0x%x\n",
> > 54fdb318c Siva Rebbagondla 2019-04-03 @774 __func__, id->idProduct);
> > 54fdb318c Siva Rebbagondla 2019-04-03 775 goto err1;
> > 54fdb318c Siva Rebbagondla 2019-04-03 776 }
> > 54fdb318c Siva Rebbagondla 2019-04-03 777
> > dad0d04fa Fariya Fatima 2014-03-16 778 dev = (struct rsi_91x_usbdev
> > *)adapter->rsi_dev;
> > dad0d04fa Fariya Fatima 2014-03-16 779
> > 50591c60a Alexey Khoroshilov 2014-06-27 780 status =
> > rsi_usb_reg_read(dev->usbdev, FW_STATUS_REG, &fw_status, 2);
> > b78e91bcf Prameela Rani Garnepudi 2017-05-16 781 if (status < 0)
> > dad0d04fa Fariya Fatima 2014-03-16 782 goto err1;
> > dad0d04fa Fariya Fatima 2014-03-16 783 else
> > dad0d04fa Fariya Fatima 2014-03-16 784 fw_status &= 1;
> > dad0d04fa Fariya Fatima 2014-03-16 785
> > dad0d04fa Fariya Fatima 2014-03-16 786 if (!fw_status) {
> > b78e91bcf Prameela Rani Garnepudi 2017-05-16 787 rsi_dbg(INIT_ZONE,
> > "Loading firmware...\n");
> > b78e91bcf Prameela Rani Garnepudi 2017-05-16 788 status =
> > rsi_hal_device_init(adapter);
> > 50591c60a Alexey Khoroshilov 2014-06-27 789 if (status) {
> > dad0d04fa Fariya Fatima 2014-03-16 790 rsi_dbg(ERR_ZONE, "%s: Failed
> > in device init\n",
> > dad0d04fa Fariya Fatima 2014-03-16 791 __func__);
> > dad0d04fa Fariya Fatima 2014-03-16 792 goto err1;
> > dad0d04fa Fariya Fatima 2014-03-16 793 }
> > b78e91bcf Prameela Rani Garnepudi 2017-05-16 794 rsi_dbg(INIT_ZONE,
> > "%s: Device Init Done\n", __func__);
> > dad0d04fa Fariya Fatima 2014-03-16 795 }
> > dad0d04fa Fariya Fatima 2014-03-16 796
> > 1100f81bb Prameela Rani Garnepudi 2018-02-27 797 status =
> > rsi_rx_urb_submit(adapter, WLAN_EP);
> > 50591c60a Alexey Khoroshilov 2014-06-27 798 if (status)
> > dad0d04fa Fariya Fatima 2014-03-16 799 goto err1;
> > dad0d04fa Fariya Fatima 2014-03-16 800
> > a4302bff2 Siva Rebbagondla 2018-02-27 801 if (adapter->priv->coex_mode
> >> 1) {
> > a4302bff2 Siva Rebbagondla 2018-02-27 802 status =
> > rsi_rx_urb_submit(adapter, BT_EP);
> > a4302bff2 Siva Rebbagondla 2018-02-27 803 if (status)
> > a4302bff2 Siva Rebbagondla 2018-02-27 804 goto err1;
> > a4302bff2 Siva Rebbagondla 2018-02-27 805 }
> > a4302bff2 Siva Rebbagondla 2018-02-27 806
> > dad0d04fa Fariya Fatima 2014-03-16 807 return 0;
> > dad0d04fa Fariya Fatima 2014-03-16 808 err1:
> > dad0d04fa Fariya Fatima 2014-03-16 809
> > rsi_deinit_usb_interface(adapter);
> > dad0d04fa Fariya Fatima 2014-03-16 810 err:
> > dad0d04fa Fariya Fatima 2014-03-16 811 rsi_91x_deinit(adapter);
> > dad0d04fa Fariya Fatima 2014-03-16 812 rsi_dbg(ERR_ZONE, "%s: Failed
> > in probe...Exiting\n", __func__);
> > 50591c60a Alexey Khoroshilov 2014-06-27 813 return status;
> > dad0d04fa Fariya Fatima 2014-03-16 814 }
> > dad0d04fa Fariya Fatima 2014-03-16 815
> >
> > ---
> > 0-DAY kernel test infrastructure Open Source Technology Center
> > https://lists.01.org/pipermail/kbuild-all Intel Corporation
>
> --
> Kalle Valo
--
Siva Rebbagondla
^ permalink raw reply
* Re: [wireless-drivers-next:master 21/45] drivers/net/wireless/rsi/rsi_91x_usb.c:774:17-26: ERROR: id is NULL but dereferenced. (fwd)
From: Kalle Valo @ 2019-04-26 15:25 UTC (permalink / raw)
To: Siva Rebbagondla; +Cc: Julia Lawall, kbuild-all, Linux Wireless
In-Reply-To: <CANGSkXSYfzn5oxsRvCrAWiS0itY-aVVC+=Qea506kkjq6TfYjg@mail.gmail.com>
Siva Rebbagondla <siva8118@gmail.com> writes:
> On Fri, Apr 26, 2019 at 8:28 PM Kalle Valo <kvalo@codeaurora.org> wrote:
>
>> Julia Lawall <julia.lawall@lip6.fr> writes:
>>
>> > The ifs starting on line 766 can fail because id is NULL.
>
> I don't think id will be NULL here. id is coming from probe.
> Is there any other opinions?.
The code in question:
if (id && id->idProduct == RSI_USB_PID_9113) {
rsi_dbg(INIT_ZONE, "%s: 9113 module detected\n", __func__);
adapter->device_model = RSI_DEV_9113;
} else if (id && id->idProduct == RSI_USB_PID_9116) {
rsi_dbg(INIT_ZONE, "%s: 9116 module detected\n", __func__);
adapter->device_model = RSI_DEV_9116;
} else {
rsi_dbg(ERR_ZONE, "%s: Unsupported RSI device id 0x%x\n",
__func__, id->idProduct);
goto err1;
}
I think the fact that you are checking if id is NULL is confusing the
static checkers. If it's never NULL why check for that anyway? So if
it's guaranteed that id is never NULL (I didn't check that from USB
core) I would recommend to remove the NULL checks from the driver.
--
Kalle Valo
^ permalink raw reply
* [PATCH 8/9] wil6210: check rx_buff_mgmt before accessing it
From: Maya Erez @ 2019-04-26 15:43 UTC (permalink / raw)
To: Kalle Valo; +Cc: Dedy Lansky, linux-wireless, wil6210, Maya Erez
In-Reply-To: <1556293417-27097-1-git-send-email-merez@codeaurora.org>
From: Dedy Lansky <dlansky@codeaurora.org>
Make sure rx_buff_mgmt is initialized before accessing it.
Signed-off-by: Dedy Lansky <dlansky@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
---
drivers/net/wireless/ath/wil6210/txrx_edma.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/wireless/ath/wil6210/txrx_edma.c b/drivers/net/wireless/ath/wil6210/txrx_edma.c
index f37a205..6140db5 100644
--- a/drivers/net/wireless/ath/wil6210/txrx_edma.c
+++ b/drivers/net/wireless/ath/wil6210/txrx_edma.c
@@ -269,6 +269,9 @@ static void wil_move_all_rx_buff_to_free_list(struct wil6210_priv *wil,
struct list_head *active = &wil->rx_buff_mgmt.active;
dma_addr_t pa;
+ if (!wil->rx_buff_mgmt.buff_arr)
+ return;
+
while (!list_empty(active)) {
struct wil_rx_buff *rx_buff =
list_first_entry(active, struct wil_rx_buff, list);
--
1.9.1
^ permalink raw reply related
* [PATCH 7/9] wil6210: fix missed MISC mbox interrupt
From: Maya Erez @ 2019-04-26 15:43 UTC (permalink / raw)
To: Kalle Valo; +Cc: Maya Erez, linux-wireless, wil6210
In-Reply-To: <1556293417-27097-1-git-send-email-merez@codeaurora.org>
When MISC interrupt is triggered due to HALP bit, in parallel
to mbox events handling by the MISC threaded IRQ, new mbox
interrupt can be missed in the following scenario:
1. MISC ICR is read in the IRQ handler
2. Threaded IRQ is completed and all MISC interrupts are unmasked
3. mbox interrupt is set by FW
4. HALP is masked
The mbox interrupt in step 3 can be missed due to constant high level
of ICM.
Masking all MISC IRQs instead of masking only HALP bit in step 4
will guarantee that ICM will drop to 0 and interrupt will be triggered
once MISC interrupts will be unmasked.
Signed-off-by: Maya Erez <merez@codeaurora.org>
---
drivers/net/wireless/ath/wil6210/interrupt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/wil6210/interrupt.c b/drivers/net/wireless/ath/wil6210/interrupt.c
index d161dc9..b00a13d 100644
--- a/drivers/net/wireless/ath/wil6210/interrupt.c
+++ b/drivers/net/wireless/ath/wil6210/interrupt.c
@@ -595,7 +595,7 @@ static irqreturn_t wil6210_irq_misc(int irq, void *cookie)
/* no need to handle HALP ICRs until next vote */
wil->halp.handle_icr = false;
wil_dbg_irq(wil, "irq_misc: HALP IRQ invoked\n");
- wil6210_mask_halp(wil);
+ wil6210_mask_irq_misc(wil, true);
complete(&wil->halp.comp);
}
}
--
1.9.1
^ permalink raw reply related
* [PATCH 0/9] wil6210 patches
From: Maya Erez @ 2019-04-26 15:43 UTC (permalink / raw)
To: Kalle Valo; +Cc: Maya Erez, linux-wireless, wil6210
The following patches include;
- Various wil6210 bug fixes
- Support handling of multiple section in board file
Ahmad Masri (1):
wil6210: fix overwriting max_assoc_sta module param
Alexei Avshalom Lazar (1):
wil6210: fix _desc access in __wil_tx_vring_tso
Dedy Lansky (3):
wil6210: add printout of platform capabilities
wil6210: enhancements for descriptor and status ring debugfs
wil6210: check rx_buff_mgmt before accessing it
Maya Erez (4):
wil6210: fix spurious interrupts in 3-msi
wil6210: add support for multiple sections in brd file
wil6210: fix missed MISC mbox interrupt
wil6210: remove HALP for Talyn devices
drivers/net/wireless/ath/wil6210/cfg80211.c | 4 +-
drivers/net/wireless/ath/wil6210/debugfs.c | 70 ++++++++----
drivers/net/wireless/ath/wil6210/fw.h | 11 +-
drivers/net/wireless/ath/wil6210/fw_inc.c | 148 +++++++++++++++++++-------
drivers/net/wireless/ath/wil6210/interrupt.c | 67 +++++++-----
drivers/net/wireless/ath/wil6210/main.c | 18 +++-
drivers/net/wireless/ath/wil6210/pcie_bus.c | 2 +
drivers/net/wireless/ath/wil6210/rx_reorder.c | 2 +-
drivers/net/wireless/ath/wil6210/txrx.c | 25 +++--
drivers/net/wireless/ath/wil6210/txrx_edma.c | 10 +-
drivers/net/wireless/ath/wil6210/wil6210.h | 33 ++++--
drivers/net/wireless/ath/wil6210/wmi.c | 14 +--
12 files changed, 275 insertions(+), 129 deletions(-)
--
1.9.1
^ permalink raw reply
* [PATCH 5/9] wil6210: enhancements for descriptor and status ring debugfs
From: Maya Erez @ 2019-04-26 15:43 UTC (permalink / raw)
To: Kalle Valo; +Cc: Dedy Lansky, linux-wireless, wil6210, Maya Erez
In-Reply-To: <1556293417-27097-1-git-send-email-merez@codeaurora.org>
From: Dedy Lansky <dlansky@codeaurora.org>
Add printing of hwhead as part of desc ring and status ring debugfs.
Validate wil->rx_buff_mgmt and ring->ctx arrays before accessing them.
Dump Tx descriptor content even when it indicates invalid buff_id.
Signed-off-by: Dedy Lansky <dlansky@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
---
drivers/net/wireless/ath/wil6210/debugfs.c | 52 +++++++++++++++++++++++-------
drivers/net/wireless/ath/wil6210/wil6210.h | 5 +++
2 files changed, 45 insertions(+), 12 deletions(-)
diff --git a/drivers/net/wireless/ath/wil6210/debugfs.c b/drivers/net/wireless/ath/wil6210/debugfs.c
index df2adff..42507f5 100644
--- a/drivers/net/wireless/ath/wil6210/debugfs.c
+++ b/drivers/net/wireless/ath/wil6210/debugfs.c
@@ -63,7 +63,9 @@ static void wil_print_desc_edma(struct seq_file *s, struct wil6210_priv *wil,
&ring->va[idx].rx.enhanced;
u16 buff_id = le16_to_cpu(rx_d->mac.buff_id);
- has_skb = wil->rx_buff_mgmt.buff_arr[buff_id].skb;
+ if (wil->rx_buff_mgmt.buff_arr &&
+ wil_val_in_range(buff_id, 0, wil->rx_buff_mgmt.size))
+ has_skb = wil->rx_buff_mgmt.buff_arr[buff_id].skb;
seq_printf(s, "%c", (has_skb) ? _h : _s);
} else {
struct wil_tx_enhanced_desc *d =
@@ -71,9 +73,9 @@ static void wil_print_desc_edma(struct seq_file *s, struct wil6210_priv *wil,
&ring->va[idx].tx.enhanced;
num_of_descs = (u8)d->mac.d[2];
- has_skb = ring->ctx[idx].skb;
+ has_skb = ring->ctx && ring->ctx[idx].skb;
if (num_of_descs >= 1)
- seq_printf(s, "%c", ring->ctx[idx].skb ? _h : _s);
+ seq_printf(s, "%c", has_skb ? _h : _s);
else
/* num_of_descs == 0, it's a frag in a list of descs */
seq_printf(s, "%c", has_skb ? 'h' : _s);
@@ -84,7 +86,7 @@ static void wil_print_ring(struct seq_file *s, struct wil6210_priv *wil,
const char *name, struct wil_ring *ring,
char _s, char _h)
{
- void __iomem *x = wmi_addr(wil, ring->hwtail);
+ void __iomem *x;
u32 v;
seq_printf(s, "RING %s = {\n", name);
@@ -96,7 +98,21 @@ static void wil_print_ring(struct seq_file *s, struct wil6210_priv *wil,
else
seq_printf(s, " swtail = %d\n", ring->swtail);
seq_printf(s, " swhead = %d\n", ring->swhead);
+ if (wil->use_enhanced_dma_hw) {
+ int ring_id = ring->is_rx ?
+ WIL_RX_DESC_RING_ID : ring - wil->ring_tx;
+ /* SUBQ_CONS is a table of 32 entries, one for each Q pair.
+ * lower 16bits are for even ring_id and upper 16bits are for
+ * odd ring_id
+ */
+ x = wmi_addr(wil, RGF_DMA_SCM_SUBQ_CONS + 4 * (ring_id / 2));
+ v = readl_relaxed(x);
+
+ v = (ring_id % 2 ? (v >> 16) : (v & 0xffff));
+ seq_printf(s, " hwhead = %u\n", v);
+ }
seq_printf(s, " hwtail = [0x%08x] -> ", ring->hwtail);
+ x = wmi_addr(wil, ring->hwtail);
if (x) {
v = readl(x);
seq_printf(s, "0x%08x = %d\n", v, v);
@@ -188,7 +204,7 @@ static int ring_show(struct seq_file *s, void *data)
static void wil_print_sring(struct seq_file *s, struct wil6210_priv *wil,
struct wil_status_ring *sring)
{
- void __iomem *x = wmi_addr(wil, sring->hwtail);
+ void __iomem *x;
int sring_idx = sring - wil->srings;
u32 v;
@@ -199,7 +215,19 @@ static void wil_print_sring(struct seq_file *s, struct wil6210_priv *wil,
seq_printf(s, " size = %d\n", sring->size);
seq_printf(s, " elem_size = %zu\n", sring->elem_size);
seq_printf(s, " swhead = %d\n", sring->swhead);
+ if (wil->use_enhanced_dma_hw) {
+ /* COMPQ_PROD is a table of 32 entries, one for each Q pair.
+ * lower 16bits are for even ring_id and upper 16bits are for
+ * odd ring_id
+ */
+ x = wmi_addr(wil, RGF_DMA_SCM_COMPQ_PROD + 4 * (sring_idx / 2));
+ v = readl_relaxed(x);
+
+ v = (sring_idx % 2 ? (v >> 16) : (v & 0xffff));
+ seq_printf(s, " hwhead = %u\n", v);
+ }
seq_printf(s, " hwtail = [0x%08x] -> ", sring->hwtail);
+ x = wmi_addr(wil, sring->hwtail);
if (x) {
v = readl_relaxed(x);
seq_printf(s, "0x%08x = %d\n", v, v);
@@ -1091,19 +1119,18 @@ static int txdesc_show(struct seq_file *s, void *data)
if (wil->use_enhanced_dma_hw) {
if (tx) {
- skb = ring->ctx[txdesc_idx].skb;
- } else {
+ skb = ring->ctx ? ring->ctx[txdesc_idx].skb : NULL;
+ } else if (wil->rx_buff_mgmt.buff_arr) {
struct wil_rx_enhanced_desc *rx_d =
(struct wil_rx_enhanced_desc *)
&ring->va[txdesc_idx].rx.enhanced;
u16 buff_id = le16_to_cpu(rx_d->mac.buff_id);
if (!wil_val_in_range(buff_id, 0,
- wil->rx_buff_mgmt.size)) {
+ wil->rx_buff_mgmt.size))
seq_printf(s, "invalid buff_id %d\n", buff_id);
- return 0;
- }
- skb = wil->rx_buff_mgmt.buff_arr[buff_id].skb;
+ else
+ skb = wil->rx_buff_mgmt.buff_arr[buff_id].skb;
}
} else {
skb = ring->ctx[txdesc_idx].skb;
@@ -1136,7 +1163,7 @@ static int status_msg_show(struct seq_file *s, void *data)
struct wil6210_priv *wil = s->private;
int sring_idx = dbg_sring_index;
struct wil_status_ring *sring;
- bool tx = sring_idx == wil->tx_sring_idx ? 1 : 0;
+ bool tx;
u32 status_msg_idx = dbg_status_msg_index;
u32 *u;
@@ -1146,6 +1173,7 @@ static int status_msg_show(struct seq_file *s, void *data)
}
sring = &wil->srings[sring_idx];
+ tx = !sring->is_rx;
if (!sring->va) {
seq_printf(s, "No %cX status ring\n", tx ? 'T' : 'R');
diff --git a/drivers/net/wireless/ath/wil6210/wil6210.h b/drivers/net/wireless/ath/wil6210/wil6210.h
index dc40002..1f0175d 100644
--- a/drivers/net/wireless/ath/wil6210/wil6210.h
+++ b/drivers/net/wireless/ath/wil6210/wil6210.h
@@ -335,6 +335,11 @@ struct RGF_ICR {
#define BIT_BOOT_FROM_ROM BIT(31)
/* eDMA */
+#define RGF_SCM_PTRS_SUBQ_RD_PTR (0x8b4000)
+#define RGF_SCM_PTRS_COMPQ_RD_PTR (0x8b4100)
+#define RGF_DMA_SCM_SUBQ_CONS (0x8b60ec)
+#define RGF_DMA_SCM_COMPQ_PROD (0x8b616c)
+
#define RGF_INT_COUNT_ON_SPECIAL_EVT (0x8b62d8)
#define RGF_INT_CTRL_INT_GEN_CFG_0 (0x8bc000)
--
1.9.1
^ permalink raw reply related
* [PATCH 1/9] wil6210: fix spurious interrupts in 3-msi
From: Maya Erez @ 2019-04-26 15:43 UTC (permalink / raw)
To: Kalle Valo; +Cc: Maya Erez, linux-wireless, wil6210
In-Reply-To: <1556293417-27097-1-git-send-email-merez@codeaurora.org>
Interrupt is set in ICM (ICR & ~IMV) rising trigger.
As the driver masks the IRQ after clearing it, there can
be a race where an additional spurious interrupt is triggered
when the driver unmask the IRQ.
This can happen in case HW triggers an interrupt after the clear
and before the mask.
To prevent the second spurious interrupt the driver needs to mask the
IRQ before reading and clearing it.
Signed-off-by: Maya Erez <merez@codeaurora.org>
---
drivers/net/wireless/ath/wil6210/interrupt.c | 65 +++++++++++++++++-----------
1 file changed, 40 insertions(+), 25 deletions(-)
diff --git a/drivers/net/wireless/ath/wil6210/interrupt.c b/drivers/net/wireless/ath/wil6210/interrupt.c
index 3f5bd17..d161dc9 100644
--- a/drivers/net/wireless/ath/wil6210/interrupt.c
+++ b/drivers/net/wireless/ath/wil6210/interrupt.c
@@ -296,21 +296,24 @@ void wil_configure_interrupt_moderation(struct wil6210_priv *wil)
static irqreturn_t wil6210_irq_rx(int irq, void *cookie)
{
struct wil6210_priv *wil = cookie;
- u32 isr = wil_ioread32_and_clear(wil->csr +
- HOSTADDR(RGF_DMA_EP_RX_ICR) +
- offsetof(struct RGF_ICR, ICR));
+ u32 isr;
bool need_unmask = true;
+ wil6210_mask_irq_rx(wil);
+
+ isr = wil_ioread32_and_clear(wil->csr +
+ HOSTADDR(RGF_DMA_EP_RX_ICR) +
+ offsetof(struct RGF_ICR, ICR));
+
trace_wil6210_irq_rx(isr);
wil_dbg_irq(wil, "ISR RX 0x%08x\n", isr);
if (unlikely(!isr)) {
wil_err_ratelimited(wil, "spurious IRQ: RX\n");
+ wil6210_unmask_irq_rx(wil);
return IRQ_NONE;
}
- wil6210_mask_irq_rx(wil);
-
/* RX_DONE and RX_HTRSH interrupts are the same if interrupt
* moderation is not used. Interrupt moderation may cause RX
* buffer overflow while RX_DONE is delayed. The required
@@ -355,21 +358,24 @@ static irqreturn_t wil6210_irq_rx(int irq, void *cookie)
static irqreturn_t wil6210_irq_rx_edma(int irq, void *cookie)
{
struct wil6210_priv *wil = cookie;
- u32 isr = wil_ioread32_and_clear(wil->csr +
- HOSTADDR(RGF_INT_GEN_RX_ICR) +
- offsetof(struct RGF_ICR, ICR));
+ u32 isr;
bool need_unmask = true;
+ wil6210_mask_irq_rx_edma(wil);
+
+ isr = wil_ioread32_and_clear(wil->csr +
+ HOSTADDR(RGF_INT_GEN_RX_ICR) +
+ offsetof(struct RGF_ICR, ICR));
+
trace_wil6210_irq_rx(isr);
wil_dbg_irq(wil, "ISR RX 0x%08x\n", isr);
if (unlikely(!isr)) {
wil_err(wil, "spurious IRQ: RX\n");
+ wil6210_unmask_irq_rx_edma(wil);
return IRQ_NONE;
}
- wil6210_mask_irq_rx_edma(wil);
-
if (likely(isr & BIT_RX_STATUS_IRQ)) {
wil_dbg_irq(wil, "RX status ring\n");
isr &= ~BIT_RX_STATUS_IRQ;
@@ -403,21 +409,24 @@ static irqreturn_t wil6210_irq_rx_edma(int irq, void *cookie)
static irqreturn_t wil6210_irq_tx_edma(int irq, void *cookie)
{
struct wil6210_priv *wil = cookie;
- u32 isr = wil_ioread32_and_clear(wil->csr +
- HOSTADDR(RGF_INT_GEN_TX_ICR) +
- offsetof(struct RGF_ICR, ICR));
+ u32 isr;
bool need_unmask = true;
+ wil6210_mask_irq_tx_edma(wil);
+
+ isr = wil_ioread32_and_clear(wil->csr +
+ HOSTADDR(RGF_INT_GEN_TX_ICR) +
+ offsetof(struct RGF_ICR, ICR));
+
trace_wil6210_irq_tx(isr);
wil_dbg_irq(wil, "ISR TX 0x%08x\n", isr);
if (unlikely(!isr)) {
wil_err(wil, "spurious IRQ: TX\n");
+ wil6210_unmask_irq_tx_edma(wil);
return IRQ_NONE;
}
- wil6210_mask_irq_tx_edma(wil);
-
if (likely(isr & BIT_TX_STATUS_IRQ)) {
wil_dbg_irq(wil, "TX status ring\n");
isr &= ~BIT_TX_STATUS_IRQ;
@@ -446,21 +455,24 @@ static irqreturn_t wil6210_irq_tx_edma(int irq, void *cookie)
static irqreturn_t wil6210_irq_tx(int irq, void *cookie)
{
struct wil6210_priv *wil = cookie;
- u32 isr = wil_ioread32_and_clear(wil->csr +
- HOSTADDR(RGF_DMA_EP_TX_ICR) +
- offsetof(struct RGF_ICR, ICR));
+ u32 isr;
bool need_unmask = true;
+ wil6210_mask_irq_tx(wil);
+
+ isr = wil_ioread32_and_clear(wil->csr +
+ HOSTADDR(RGF_DMA_EP_TX_ICR) +
+ offsetof(struct RGF_ICR, ICR));
+
trace_wil6210_irq_tx(isr);
wil_dbg_irq(wil, "ISR TX 0x%08x\n", isr);
if (unlikely(!isr)) {
wil_err_ratelimited(wil, "spurious IRQ: TX\n");
+ wil6210_unmask_irq_tx(wil);
return IRQ_NONE;
}
- wil6210_mask_irq_tx(wil);
-
if (likely(isr & BIT_DMA_EP_TX_ICR_TX_DONE)) {
wil_dbg_irq(wil, "TX done\n");
isr &= ~BIT_DMA_EP_TX_ICR_TX_DONE;
@@ -532,20 +544,23 @@ static bool wil_validate_mbox_regs(struct wil6210_priv *wil)
static irqreturn_t wil6210_irq_misc(int irq, void *cookie)
{
struct wil6210_priv *wil = cookie;
- u32 isr = wil_ioread32_and_clear(wil->csr +
- HOSTADDR(RGF_DMA_EP_MISC_ICR) +
- offsetof(struct RGF_ICR, ICR));
+ u32 isr;
+
+ wil6210_mask_irq_misc(wil, false);
+
+ isr = wil_ioread32_and_clear(wil->csr +
+ HOSTADDR(RGF_DMA_EP_MISC_ICR) +
+ offsetof(struct RGF_ICR, ICR));
trace_wil6210_irq_misc(isr);
wil_dbg_irq(wil, "ISR MISC 0x%08x\n", isr);
if (!isr) {
wil_err(wil, "spurious IRQ: MISC\n");
+ wil6210_unmask_irq_misc(wil, false);
return IRQ_NONE;
}
- wil6210_mask_irq_misc(wil, false);
-
if (isr & ISR_MISC_FW_ERROR) {
u32 fw_assert_code = wil_r(wil, wil->rgf_fw_assert_code_addr);
u32 ucode_assert_code =
--
1.9.1
^ permalink raw reply related
* [PATCH 9/9] wil6210: remove HALP for Talyn devices
From: Maya Erez @ 2019-04-26 15:43 UTC (permalink / raw)
To: Kalle Valo; +Cc: Maya Erez, linux-wireless, wil6210
In-Reply-To: <1556293417-27097-1-git-send-email-merez@codeaurora.org>
In Talyn the HW is responsible for power management enter / exit
flow, hence the deep sleep exit latency is significantly shorter than
in Sparrow.
In such a case HALP feature, that is meant to prevent long PCIe blocking
accesses, is no longer needed and can be removed for Talyn.
Signed-off-by: Maya Erez <merez@codeaurora.org>
---
drivers/net/wireless/ath/wil6210/main.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/wireless/ath/wil6210/main.c b/drivers/net/wireless/ath/wil6210/main.c
index efdb6e1..3c30076 100644
--- a/drivers/net/wireless/ath/wil6210/main.c
+++ b/drivers/net/wireless/ath/wil6210/main.c
@@ -1940,6 +1940,9 @@ void wil_halp_vote(struct wil6210_priv *wil)
unsigned long rc;
unsigned long to_jiffies = msecs_to_jiffies(WAIT_FOR_HALP_VOTE_MS);
+ if (wil->hw_version >= HW_VER_TALYN_MB)
+ return;
+
mutex_lock(&wil->halp.lock);
wil_dbg_irq(wil, "halp_vote: start, HALP ref_cnt (%d)\n",
@@ -1971,6 +1974,9 @@ void wil_halp_vote(struct wil6210_priv *wil)
void wil_halp_unvote(struct wil6210_priv *wil)
{
+ if (wil->hw_version >= HW_VER_TALYN_MB)
+ return;
+
WARN_ON(wil->halp.ref_cnt == 0);
mutex_lock(&wil->halp.lock);
--
1.9.1
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox