Return-path: Received: from mail-wi0-f174.google.com ([209.85.212.174]:65023 "EHLO mail-wi0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753260AbbAZINv convert rfc822-to-8bit (ORCPT ); Mon, 26 Jan 2015 03:13:51 -0500 Received: by mail-wi0-f174.google.com with SMTP id n3so8104178wiv.1 for ; Mon, 26 Jan 2015 00:13:50 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <87y4osgn8n.fsf@kamboji.qca.qualcomm.com> References: <1421412811-6387-1-git-send-email-michal.kazior@tieto.com> <1421412811-6387-2-git-send-email-michal.kazior@tieto.com> <87y4osgn8n.fsf@kamboji.qca.qualcomm.com> Date: Mon, 26 Jan 2015 09:13:50 +0100 Message-ID: (sfid-20150126_091356_496984_EE5FD974) Subject: Re: [PATCH 2/2] ath10k: fix beacon deadlock From: Michal Kazior To: Kalle Valo Cc: "ath10k@lists.infradead.org" , linux-wireless Content-Type: text/plain; charset=UTF-8 Sender: linux-wireless-owner@vger.kernel.org List-ID: On 24 January 2015 at 17:24, Kalle Valo wrote: > Michal Kazior writes: > >> This should fix a very rare occurrence of the following deadlock: >> >> [] ath10k_wmi_tx_beacons_nowait+0x1e/0x50 [ath10k_core] >> [] ath10k_wmi_op_ep_tx_credits+0x16/0x40 [ath10k_core] >> [] ath10k_htc_send+0x285/0x3d0 [ath10k_core] >> [] ath10k_wmi_cmd_send_nowait+0x81/0x110 [ath10k_core] >> [] ath10k_wmi_tx_beacon_nowait.part.33+0x51/0x90 [ath10k_core] >> [] ath10k_wmi_tx_beacons_iter+0x30/0x40 [ath10k_core] >> [] __iterate_active_interfaces+0xa6/0x100 >> [] ? ath10k_wmi_tx_beacon_nowait.part.33+0x90/0x90 [ath10k_core] >> [] ieee80211_iterate_active_interfaces_atomic+0xe/0x10 >> [] ath10k_wmi_tx_beacons_nowait+0x36/0x50 [ath10k_core] >> [] ath10k_wmi_op_ep_tx_credits+0x16/0x40 [ath10k_core] >> [] ath10k_htc_rx+0x280/0x410 [ath10k_core] >> [] ? ath10k_ce_completed_recv_next+0x60/0x80 [ath10k_pci] >> [] ath10k_pci_ce_recv_data+0x11b/0x1d0 [ath10k_pci] >> [] ath10k_ce_per_engine_service+0x64/0xc0 [ath10k_pci] >> [] ath10k_ce_per_engine_service_any+0x22/0x50 [ath10k_pci] >> [] ath10k_pci_tasklet+0x30/0x90 [ath10k_pci] >> [] tasklet_action+0xc5/0x100 >> >> To prevent this make sure to release ar->data_lock >> while calling to ath10k_wmi_beacon_send_ref_nowait(). >> >> Signed-off-by: Michal Kazior > > This introduces a new warning from kbuild: > > tree: git://github.com/kvalo/ath ath-next-test > head: 59030a70b61c41268383d1406bb49fc559e0da4e > commit: 60845cf1bc104bbec7509eb4b6c9f09a1559bfdc [104/113] ath10k: fix beacon deadlock > > New smatch warnings: > drivers/net/wireless/ath/ath10k/wmi.c:969 ath10k_wmi_tx_beacon_nowait() warn: variable dereferenced before check 'bcn' (see line 967) >From a practical standpoint there is no dereference because control buffer is inlined in sk_buff and it ends up just as an offset to the sk_buff. I guess smatch couldn't figure this out due to macros. When I run smatch (tip) locally it doesn't complain about this. Maybe I'm missing some parameters? I'll post a v2 later. MichaƂ