From patchwork Mon Dec 16 17:03:59 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: 11294773 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 84747930 for ; Mon, 16 Dec 2019 17:08:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 57ADA206EC for ; Mon, 16 Dec 2019 17:08:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="CQ+uAoQX" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727581AbfLPRId (ORCPT ); Mon, 16 Dec 2019 12:08:33 -0500 Received: from mail-dm6nam11on2044.outbound.protection.outlook.com ([40.107.223.44]:54496 "EHLO NAM11-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727842AbfLPRG6 (ORCPT ); Mon, 16 Dec 2019 12:06:58 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dRCAy9kveX6rn4UKHwIX+CLm/oFd0CoJMDCcgJSdpktzocfucFuVd6vpumpu9PEFK9oyRYiiz+SbfTXiNVR4IXT4ZrkbyjFe2BCApIt1Ggm8oKmAkItMozNijzAxHBhm2PVlbCc6IUVSKV3sNZSHKJtuN79QgRDxgXFq1q/Nc52MqgaayUZonvfQk4aESJiJt/Im6wnAhNAM4AqU7COlxCH9E96qfwDsDp+ZMHli/KbCbQve5PeJmGdR74cB0u2zy7M2fQM0LNELpTFplJJd4qGks+PCTByVkTb7wjV4iI1XC3zMOWxi/XbeIzAcTlIZRdEsO6d8TlKYdxAWt8yJNA== 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=BknZ6/vVeDiyYg38ZyZZ7DJX3Z1VRAYQ2Qogo2oC7Jk=; b=TZ03SbM+1MUF8cVcEXpTMFxN/asE5MsfnbmRWn+QrEmcV/m0mf89eN1eZnx7YOhCKbn585WXD1kRjv05faFhPDDteezf1/4Ic5fhLImBgy7EuIYURipFQ47spwafABwtPvFLL+mpOPScxXgW/WbT9Fn5827amnb+U0VMAisNT75ukika5b8XXwEUUbFtGD5AUVcX/T491QUtyrBKImqnnDlfsn1oaw/RBLe7QjeJYYdKrniJO6Hxa0dweN7gOZlEGkXQTxa8pNKYPKzQvBgmeQVoy+kj2AzrsSow5wEv4Iun7DDsrRBj5MKE9chOiuvj2LFEjX1FDNH2b8YolF/vEA== 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=BknZ6/vVeDiyYg38ZyZZ7DJX3Z1VRAYQ2Qogo2oC7Jk=; b=CQ+uAoQXN0auX+lWFK9rilxuwxVaIQOxy6fESEdhUhDsgD5sEqNgihsnHtVjZzVkSplPErbMgA/PHOY2qMsDbRST2yhSdb5NBIZChMdDj9wBm6wQHKpLDpwkSktHTZFUw3c92bD1RMK4MA6GX2qZJlrTAthebHEPV41gMWQe/Qk= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4445.namprd11.prod.outlook.com (52.135.37.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.18; Mon, 16 Dec 2019 17:06:50 +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; Mon, 16 Dec 2019 17:06:50 +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 52/55] staging: wfx: delayed_unjoin cannot happen Thread-Topic: [PATCH 52/55] staging: wfx: delayed_unjoin cannot happen Thread-Index: AQHVtDLPYDhkmxPTK0mSWKbBk04+CQ== Date: Mon, 16 Dec 2019 17:03:59 +0000 Message-ID: <20191216170302.29543-53-Jerome.Pouiller@silabs.com> References: <20191216170302.29543-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191216170302.29543-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 7427762c-5324-4004-112b-08d7824a5763 x-ms-traffictypediagnostic: MN2PR11MB4445: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4714; x-forefront-prvs: 02530BD3AA x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(376002)(346002)(366004)(39850400004)(396003)(136003)(189003)(199004)(110136005)(6486002)(107886003)(36756003)(186003)(316002)(66946007)(54906003)(5660300002)(66574012)(66446008)(66556008)(85182001)(66476007)(76116006)(91956017)(64756008)(2616005)(6506007)(85202003)(2906002)(26005)(71200400001)(6512007)(4326008)(8936002)(81166006)(1076003)(478600001)(86362001)(81156014)(8676002);DIR:OUT;SFP:1101;SCL:1;SRVR:MN2PR11MB4445;H:MN2PR11MB4063.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A: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: f+orFObs1m1b2vI6ryPeQRhoLuxu3i+/EilepAm8x41AF+jXF8sJJFNjU3UnSO05kQj5BqQq1uB+pIIFPdacMe9lRtKuJmGMNO/WXZ6yOG4dwTRtCkdoquLMUSV905GTLTArcSf0uB4clq7krAVDKdgMnAmKVnirm5pfJff4YIfM3n5dVnrTpGmNRKKpGpCAaEeGFcnYpOCn8nUhrxJLBo2WUjTrdShhj+fUg8J+JIsEuDAv2F94HjnKgAd/YIxIG6EAI/49ZtRdpyso+yjArGYteO2mJmvb4jLQga+ZiwopJnJTii8mnB9Ik8WBUQpTna1cQe/MLr7mZX2EmCHeOyc643GR6ubq2gX1NMJ2dyBLvL1Pw085//VRJU9K25TGyGjLth6IedI9Q5j7WyvVW31nYUp6MrQAJNZGvzJBLXNI1jOsq9Nj7PtMTx1dW1d9 Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7427762c-5324-4004-112b-08d7824a5763 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Dec 2019 17:03:59.8570 (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: BVKMSe9Q1lmAg1G12WXfx7gPCN32b4GSN1fYd2A0GjS7pUXQZrMsj70Bui9GFewp+8DkYnt3DvAwJVscm76s5A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4445 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 unjoin request during a scan and delaying the unjoin request. However, it is far easier to just block the unjoin request until the end of the scan request. In fact, it is already the case since scan and unjoin are protected by conf_mutex. So, currently, the handling of delayed_unjoin is just dead code. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/scan.c | 7 +------ drivers/staging/wfx/sta.c | 14 -------------- drivers/staging/wfx/wfx.h | 1 - 3 files changed, 1 insertion(+), 21 deletions(-) diff --git a/drivers/staging/wfx/scan.c b/drivers/staging/wfx/scan.c index 540009b72240..bdbce6926e91 100644 --- a/drivers/staging/wfx/scan.c +++ b/drivers/staging/wfx/scan.c @@ -95,12 +95,7 @@ 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_unjoin) { - wvif->delayed_unjoin = false; - wfx_tx_lock(wvif->wdev); - if (!schedule_work(&wvif->unjoin_work)) - wfx_tx_unlock(wvif->wdev); - } else if (wvif->delayed_link_loss) { + if (wvif->delayed_link_loss) { wvif->delayed_link_loss = false; wfx_cqm_bssloss_sm(wvif, 1, 0, 0); } diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 4354bb8081c5..7ae763e96455 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -66,10 +66,6 @@ void wfx_cqm_bssloss_sm(struct wfx_vif *wvif, int init, int good, int bad) wvif->delayed_link_loss = 0; cancel_work_sync(&wvif->bss_params_work); - /* If we have a pending unjoin */ - if (wvif->delayed_unjoin) - goto end; - if (init) { schedule_delayed_work(&wvif->bss_loss_work, HZ); wvif->bss_loss_state = 0; @@ -501,16 +497,6 @@ static void wfx_do_unjoin(struct wfx_vif *wvif) { mutex_lock(&wvif->wdev->conf_mutex); - if (!mutex_trylock(&wvif->scan_lock)) { - if (wvif->delayed_unjoin) - dev_dbg(wvif->wdev->dev, - "delayed unjoin is already scheduled\n"); - else - wvif->delayed_unjoin = true; - goto done; - } - mutex_unlock(&wvif->scan_lock); - wvif->delayed_link_loss = false; if (!wvif->state) diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index b5f763c3fac7..5e7c911db024 100644 --- a/drivers/staging/wfx/wfx.h +++ b/drivers/staging/wfx/wfx.h @@ -122,7 +122,6 @@ struct wfx_vif { struct work_struct set_cts_work; int join_complete_status; - bool delayed_unjoin; struct work_struct unjoin_work; /* avoid some operations in parallel with scan */