Return-path: Received: from smtp.codeaurora.org ([198.145.29.96]:34687 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753571AbcHSKFl (ORCPT ); Fri, 19 Aug 2016 06:05:41 -0400 From: Kalle Valo To: Adi Ratiu Cc: Benjamin Berg , , , , , Felix Fietkau Subject: Re: ath9k: Fix beacon configuration assertion failure References: Date: Fri, 19 Aug 2016 13:03:22 +0300 In-Reply-To: (Kalle Valo's message of "Fri, 19 Aug 2016 11:13:47 +0200") Message-ID: <87fuq1yt1x.fsf@kamboji.qca.qualcomm.com> (sfid-20160819_120603_310931_707F2EF6) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-wireless-owner@vger.kernel.org List-ID: Kalle Valo writes: > Adi Ratiu wrote: >> commit cfda2d8e2314 ("ath9k: Fix beacon configuration for >> addition/removal of interfaces") reworked beacon configs to happen at >> IF changes and missed cases when NL80211_IFTYPE_STATION has no beacons >> with the corresponding values iter_data.primary_beacon_vif == 0 and >> iter_data.nbcnvifs == 0 in ath9k_calculate_summary_state(), thus >> calling ath9k_beacon_config() with null and giving the below warning. >> >> Fix this by calling beacon config only when a beacon actually exists, >> i.e. by checking iter_data.beacons which should be set only inside >> ath9k_vif_iter_set_beacon() (the line "iter_data.beacons = true;" in >> ath9k_calculate_summary_state() is a bug in above rework commit). >> >> [ 16.910537] ------------[ cut here ]------------ >> [ 16.910549] WARNING: CPU: 2 PID: 6 at drivers/net/wireless/ath/ath9k/beacon.c:642 ath9k_beacon_config+0x12c/0x130 [ath9k] >> [ 16.910551] Modules linked in: intel_rapl x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel kvm irqbypass crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel hid_generic aesni_intel usbhid hid aes_x86_64 joydev mousedev arc4 lrw ath9k dell_laptop ath9k_common ath9k_hw ath mac80211 gf128mul glue_helper ablk_helper dell_smbios input_leds cryptd led_class snd_hda_codec_hdmi psmouse cfg80211 serio_raw atkbd snd_hda_codec_realtek libps2 rfkill r8169 sr_mod snd_hda_codec_generic dcdbas cdrom mii snd_hda_intel snd_hda_codec snd_hwdep snd_hda_core i8042 snd_pcm snd_timer serio ac xhci_pci xhci_hcd battery i2c_i801 tpm_tis pcspkr tpm_tis_core evdev shpchp lpc_ich i2c_smbus tpm sch_fq_codel ip_tables x_tables >> [ 16.910620] CPU: 2 PID: 6 Comm: kworker/u16:0 Not tainted 4.8.0-rc1-next-20160815-g118253a #1 >> [ 16.910621] Hardware name: Dell Inc. Inspiron 3521/018DYG, BIOS A14 07/31/2015 >> [ 16.910648] Workqueue: phy0 ieee80211_iface_work [mac80211] >> [ 16.910652] 0000000000000000 ffff880159f13630 ffffffff813140f0 0000000000000000 >> [ 16.910657] 0000000000000000 ffff880159f13670 ffffffff8106b22b 0000028200000202 >> [ 16.910661] ffff880156bc1500 0000000000000000 ffff880153cc8018 ffff880153cc8018 >> [ 16.910666] Call Trace: >> [ 16.910674] [] dump_stack+0x63/0x83 >> [ 16.910678] [] __warn+0xcb/0xf0 >> [ 16.910682] [] warn_slowpath_null+0x1d/0x20 >> [ 16.910690] [] ath9k_beacon_config+0x12c/0x130 [ath9k] >> [ 16.910696] [] ath9k_calculate_summary_state+0xf6/0x350 [ath9k] >> [ 16.910703] [] ath9k_bss_info_changed+0x186/0x1a0 [ath9k] >> [ 16.910720] [] ieee80211_bss_info_change_notify+0xb1/0x200 [mac80211] >> [ 16.910737] [] ieee80211_assoc_success+0x677/0xdeb [mac80211] >> [ 16.910746] [] ? up+0x32/0x50 >> [ 16.910751] [] ? wake_up_klogd+0x3b/0x50 >> [ 16.910755] [] ? console_unlock+0x539/0x5f0 >> [ 16.910760] [] ? vprintk_emit+0x254/0x490 >> [ 16.910765] [] ? vprintk_default+0x1f/0x30 >> [ 16.910769] [] ? printk+0x48/0x50 >> [ 16.910788] [] ieee80211_rx_mgmt_assoc_resp+0x152/0x4c0 [mac80211] >> [ 16.910807] [] ieee80211_sta_rx_queued_mgmt+0x18f/0x840 [mac80211] >> [ 16.910813] [] ? lock_timer_base.isra.2+0x80/0xa0 >> [ 16.910817] [] ? cpuacct_charge+0x86/0xa0 >> [ 16.910822] [] ? update_curr+0xb7/0x160 >> [ 16.910827] [] ? dequeue_entity+0x24c/0xa20 >> [ 16.910831] [] ? dequeue_task_fair+0x5c3/0x960 >> [ 16.910848] [] ? ieee80211_iface_work+0xd4/0x410 [mac80211] >> [ 16.910865] [] ieee80211_iface_work+0x295/0x410 [mac80211] >> [ 16.910870] [] ? finish_task_switch+0x77/0x1e0 >> [ 16.910875] [] process_one_work+0x1e5/0x470 >> [ 16.910880] [] worker_thread+0x48/0x4e0 >> [ 16.910885] [] ? process_one_work+0x470/0x470 >> [ 16.910888] [] kthread+0xc9/0xe0 >> [ 16.910894] [] ? __switch_to+0x2c3/0x610 >> [ 16.910899] [] ret_from_fork+0x1f/0x40 >> [ 16.910902] [] ? kthread_create_on_node+0x40/0x40 >> [ 16.910904] ---[ end trace aa169ad4461f2f18 ]--- >> >> Signed-off-by: Ioan-Adrian Ratiu > > Benjamin, does this look reasonable to you? I'm planning to queue this for 4.8. Actually, I see two patches which might be related but not identical: ath9k: fix client mode beacon configuration https://patchwork.kernel.org/patch/9247699/ ath9k: Fix beacon configuration assertion failure https://patchwork.kernel.org/patch/9281191/ Felix (CCed) & Benjamin: please take a look and advice which one I should take. -- Kalle Valo