From patchwork Tue Dec 17 16:15:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 11298115 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 99B3C14B7 for ; Tue, 17 Dec 2019 16:17:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6E04D21582 for ; Tue, 17 Dec 2019 16:17:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="D4NOo8/M" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728872AbfLQQRB (ORCPT ); Tue, 17 Dec 2019 11:17:01 -0500 Received: from mail-bn7nam10on2078.outbound.protection.outlook.com ([40.107.92.78]:31534 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728522AbfLQQQG (ORCPT ); Tue, 17 Dec 2019 11:16:06 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Wr2yMnuf/26/ucrpMj2/xWg2CCm5d/iToXlXBmVcmyL+hIunThAcVsbvqRnA19q7s4DkVB/BQYXTTTqsBvRTmrCOj6X63Oym9nHcnoACTBP2rOZzLco16B0ISnD54K4VY0qs0QxHRmyZTl32Ijj7S6VVn3QzFh3V6sOhIpGh50Iz8Vnc5Ec9G3qgnpHX8a+joYtJjwQM+q3aelfTF1+DjEahTf0HxRtUxF6yMMxr32g6WD9KL3O7MYvZJjyrmWG2h38BdUoGQsBrgT7RsXKqHSO7fYu+VtURwJox/Z0wmTXnRiTSov8IE7cDqGHDIeLQvBmHopai0OSGJMvhRZ/oPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Mu0mjoAQJzGjXwx+jJTT1bjBwlNSB4kdrjnvQDQ3lVc=; b=hnn9n98R8UjOTFstDPSGcWvjTJ+GlGcLSxnexj0TR8M3XxGidfsIQjDPtBo3YIEb/lw+lFoMfKsxar5YoFfY3C8WILDpjVWA0TOHkS2fZwxdqHVC2N6ip531KTi7ldKHTYF8V8wGRuae9EWTcu/YWAlhe9HeAR9jaAOWVcxuon5ry9xAf7bnq2e8Neer2qA/F7OqXU6y6ZD+Ole5lT6Qg5Omp/xbc5FvgVpeyPq1pvXT6j5QFROOqymLAMnPQc2X7gBVGejSsSTshq6ci6yh+9mb0Coz/0RYAL9Sl3qOjvG+2Twyyy4ViEgmOMC4UHh/7LORuz56l5l+SsTa2hUD7w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Mu0mjoAQJzGjXwx+jJTT1bjBwlNSB4kdrjnvQDQ3lVc=; b=D4NOo8/MH/G3oqsD5wP3542nQeA4PUqoE/z2b4SVpyJVVQ4GBTJhtw4YWqlqcvqJiNJISPJQr48Z1oLfPAnyWhaJMAT/g7JkQBKtof7gnfXaY3ieNF7Aoos56A82WpVxMszES+eMm/jX6Z71Swt/foAENYaZ67sIDJpmLls7wTE= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4208.namprd11.prod.outlook.com (52.135.36.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.20; Tue, 17 Dec 2019 16:16:03 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2538.019; Tue, 17 Dec 2019 16:16:03 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH v2 53/55] staging: wfx: delayed_link_loss cannot happen Thread-Topic: [PATCH v2 53/55] staging: wfx: delayed_link_loss cannot happen Thread-Index: AQHVtPU5XBjY6+iTL0u1q/qrv4sC6Q== Date: Tue, 17 Dec 2019 16:15:39 +0000 Message-ID: <20191217161318.31402-54-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d55df1c4-5ce5-49a4-dfc6-08d7830c5baa x-ms-traffictypediagnostic: MN2PR11MB4208: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4941; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(39850400004)(396003)(366004)(136003)(376002)(346002)(199004)(189003)(5660300002)(316002)(6506007)(85182001)(478600001)(71200400001)(2906002)(36756003)(186003)(26005)(81166006)(54906003)(1076003)(110136005)(66574012)(4326008)(8676002)(86362001)(6486002)(6666004)(52116002)(6512007)(64756008)(85202003)(66946007)(66476007)(66446008)(66556008)(8936002)(107886003)(2616005)(81156014);DIR:OUT;SFP:1101;SCL:1;SRVR:MN2PR11MB4208;H:MN2PR11MB4063.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: /ARgdrUUOqN22siMyq4IENtfTivLj+Oj3tKD8RWKC+DiKgq8fAaYULiV3TmeEG7RUeBnxZhxc+C0k9qL7gTTaa/RCNtGfgXHw/0PrpBdsVUyb54W6hUHXy+X3ZAH2TGEjJPISMR21Z1waO//qPnfa7hCqBRcM4XGBq3l9TI5Esw3+H7fFFnqlVUPY117dd01I9xsNbMjhuQGrljRmK+SRfPU0P/uQ8B/VOc9MuxT45bG17A22H3kIFppCAlQJUW5v0RjrNrrV68b9cS9L3r84hRQnLcebflXNG6b3UMi1sBB6qJ4kIxa7mZhADBz5WYnnQYFwP3YKOthjNBV+V/eY77ypFAFRcZtYg0+eGRn6LdOFphfPalGps8XgqBPUOKn+YK0yJ3ZAG/F3P6eCUiQHVHSk+TuPjqTWr0C6OpnO8Pb/Le/jDaufk+ZeHutjtFa Content-ID: <4014511410AD2A4DAB4D17017AEDD18B@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: d55df1c4-5ce5-49a4-dfc6-08d7830c5baa X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:15:39.8464 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: SblUKLvPCvREFLNgCRvXH5ksnfs9CL809G+bQ4jLeodnePkYj/PDaXZiPCLz4QiGGsOVZjO9LSbz1u+mbFruWg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4208 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller Original code allows to detect an BSS loss during a scan and delaying the handling of BSS loss. However, there it is no real problem to just make these two events mutually exclusive (there is just a performance penalty). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/scan.c | 4 ---- drivers/staging/wfx/sta.c | 18 +++--------------- drivers/staging/wfx/wfx.h | 1 - 3 files changed, 3 insertions(+), 20 deletions(-) diff --git a/drivers/staging/wfx/scan.c b/drivers/staging/wfx/scan.c index bdbce6926e91..dde2f8868147 100644 --- a/drivers/staging/wfx/scan.c +++ b/drivers/staging/wfx/scan.c @@ -95,10 +95,6 @@ void wfx_hw_scan_work(struct work_struct *work) mutex_unlock(&wvif->wdev->conf_mutex); mutex_unlock(&wvif->scan_lock); __ieee80211_scan_completed_compat(wvif->wdev->hw, ret < 0); - if (wvif->delayed_link_loss) { - wvif->delayed_link_loss = false; - wfx_cqm_bssloss_sm(wvif, 1, 0, 0); - } } int wfx_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif, diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 7ae763e96455..3296bc3521d5 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -63,7 +63,6 @@ void wfx_cqm_bssloss_sm(struct wfx_vif *wvif, int init, int good, int bad) int tx = 0; mutex_lock(&wvif->bss_loss_lock); - wvif->delayed_link_loss = 0; cancel_work_sync(&wvif->bss_params_work); if (init) { @@ -429,18 +428,9 @@ static void wfx_event_handler_work(struct work_struct *work) switch (event->evt.event_id) { case HIF_EVENT_IND_BSSLOST: cancel_work_sync(&wvif->unjoin_work); - if (mutex_trylock(&wvif->scan_lock)) { - wfx_cqm_bssloss_sm(wvif, 1, 0, 0); - mutex_unlock(&wvif->scan_lock); - } else { - /* Scan is in progress. Delay reporting. - * Scan complete will trigger bss_loss_work - */ - wvif->delayed_link_loss = 1; - /* Also start a watchdog. */ - schedule_delayed_work(&wvif->bss_loss_work, - 5 * HZ); - } + mutex_lock(&wvif->scan_lock); + wfx_cqm_bssloss_sm(wvif, 1, 0, 0); + mutex_unlock(&wvif->scan_lock); break; case HIF_EVENT_IND_BSSREGAINED: wfx_cqm_bssloss_sm(wvif, 0, 0, 0); @@ -497,8 +487,6 @@ static void wfx_do_unjoin(struct wfx_vif *wvif) { mutex_lock(&wvif->wdev->conf_mutex); - wvif->delayed_link_loss = false; - if (!wvif->state) goto done; diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index 5e7c911db024..db433bee87af 100644 --- a/drivers/staging/wfx/wfx.h +++ b/drivers/staging/wfx/wfx.h @@ -70,7 +70,6 @@ struct wfx_vif { int id; enum wfx_state state; - int delayed_link_loss; int bss_loss_state; u32 bss_loss_confirm_id; struct mutex bss_loss_lock;