From patchwork Mon Oct 22 20:27:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Greear X-Patchwork-Id: 10652465 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4FF8A13A4 for ; Mon, 22 Oct 2018 20:27:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 41212291BA for ; Mon, 22 Oct 2018 20:27:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 331FE291C3; Mon, 22 Oct 2018 20:27:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D1AD9291BA for ; Mon, 22 Oct 2018 20:27:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726824AbeJWEr5 (ORCPT ); Tue, 23 Oct 2018 00:47:57 -0400 Received: from mail2.candelatech.com ([208.74.158.173]:38962 "EHLO mail2.candelatech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726082AbeJWEr4 (ORCPT ); Tue, 23 Oct 2018 00:47:56 -0400 Received: from [192.168.100.149] (firewall.candelatech.com [50.251.239.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail2.candelatech.com (Postfix) with ESMTPSA id 42BC440A30A for ; Mon, 22 Oct 2018 13:27:54 -0700 (PDT) To: "linux-wireless@vger.kernel.org" From: Ben Greear Subject: Should we check netif_running in cfg80211_calculate_bi_data? Organization: Candela Technologies Message-ID: <8c876445-a065-ddb2-4dcf-e922f22a1b7d@candelatech.com> Date: Mon, 22 Oct 2018 13:27:53 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP I was testing on my 4.16 kernel with a bunch of VAPs and I had two configured for 100 beacon interval, and more at 240. This failed for reasons I figured out (gcd logic), but even once I tried to configure the vaps for 240 interval they could not come up. I am thinking maybe it was because I could only re-configure admin-up interfaces, and they couldn't come up due the gcd thing? Anyway, while poking, I thought maybe the patch below would be helpful since we shouldn't care about admin-down interfaces in this case? Thanks, Ben diff --git a/net/wireless/util.c b/net/wireless/util.c index fbc880e..56d7583 100644 --- a/net/wireless/util.c +++ b/net/wireless/util.c @@ -1541,6 +1541,9 @@ static void cfg80211_calculate_bi_data(struct wiphy *wiphy, u32 new_beacon_int, if (wdev->beacon_interval == *beacon_int_gcd) continue; + if (!netif_running(wdev->netdev)) + continue; + *beacon_int_different = true; *beacon_int_gcd = gcd(*beacon_int_gcd, wdev->beacon_interval); }