From patchwork Mon Dec 16 17:03:48 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: 11294731 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 876931580 for ; Mon, 16 Dec 2019 17:06:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5B374206D7 for ; Mon, 16 Dec 2019 17:06:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="hb7KJixG" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727627AbfLPRGQ (ORCPT ); Mon, 16 Dec 2019 12:06:16 -0500 Received: from mail-dm6nam11on2086.outbound.protection.outlook.com ([40.107.223.86]:11937 "EHLO NAM11-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727587AbfLPRGM (ORCPT ); Mon, 16 Dec 2019 12:06:12 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TbHSYiQLlVPmOQPrfY9xqFE3uJOTdgNwIV/GhY/7DeVfrLLNKeS5g8LePvpsJ4ZWIO/1s0VRiNX/DM8cJyWi8XG68AUKuZPNq+/QI4FTj17l4ZinjQUMdRNxQesRiMMQ9Vw4P1iB+gxpM+mghL1LqVUwA8EUy2jH/eMnex6+xc4+iVXeZ1Go9JIR26bMRA/jtklCllIzSqeDmdutwbMHSYSim4U64my/qib66IuaJhhvGfut6mijc5w28YES8S98G84Mlc087aPLXk62AdUba9bC0XDxwJRk6ckqIvVwR7E+bR/5fCCrtNTIXRSKqY8d7Ky8PxU3JUboikrP9cIZ8g== 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=sbl/bXZ+bLDvSHnhVzHYxr0r64r3gC8dl25ybMJqtZk=; b=GjX4Q68j49QUlXy4K5eRNjuFAnbHTxm9LLCvv2lAtA/JsZYA814xS+HAk/F5rYRIZYhY2JVYLf90PDXbeDBsS3CdY3ZdWmRYW+fxagQLAieeQW6KurTQjEZU3uMG1AlnofPi6qkzEHZxiZdL/D/zVCE3e09iU3+CMtYrErv0QWOGrXieWG8OY28jktEblqaduT1+4tKST4lPall1G2AXEoJMG7s2u9yZBN2RYRzZbE+i+cRqSpI9Z4u6DaEwJCUU/ez2eurAyv487SO7datQUKhl3/MWxlVXaLkNog1mHdRJCZMECGWS8rD8COOPG1zHQgjdA/szXHpNFRTm06Py8g== 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=sbl/bXZ+bLDvSHnhVzHYxr0r64r3gC8dl25ybMJqtZk=; b=hb7KJixGFBSz1Az73vsIvguO0s4gsHAWEjZLoMdmMtfQs2e479HYB35/Rila76em5n8IS7hb4huD6r+/cJ3oO0wgvkmR+pPxltiXZruNA6ymjXVaMMTYlvlrT38iwu1Y9Hp0rDx7VaTBH5Edy3bfo1DoAGB/zpqBVAdytljWAEA= 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: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; Mon, 16 Dec 2019 17:06: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 29/55] staging: wfx: simplify handling of tx_lock in wfx_do_join() Thread-Topic: [PATCH 29/55] staging: wfx: simplify handling of tx_lock in wfx_do_join() Thread-Index: AQHVtDLIl4aezkfCgkuXznKYSbYPhw== Date: Mon, 16 Dec 2019 17:03:48 +0000 Message-ID: <20191216170302.29543-30-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: a62a2beb-a3bf-4a0b-391d-08d7824a3b62 x-ms-traffictypediagnostic: MN2PR11MB4445: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7219; x-forefront-prvs: 02530BD3AA x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(376002)(346002)(39860400002)(366004)(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)(6666004)(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: vPfpSvPS0/FAOmoln+J0/kzv56U22khqbhEZfmQlPbXksg+Tjj/pDZIlYzwXyZkNklnAddE0gSx5BE8IhQ501FT5BUDM8YgXRb3kNNMIxHIxHATvAXxsou8gKL3RrqJoujh1r6z9Vs9XJ7u6Xdy5sPi6yRhqcmj7GI3UzU7lAgHcAFEQ457VS8EE37SFe+7VSGhY7fpKy6w6lz9vN9c3jQtxm1j2NVGuRnOVyW85fTwr/YDGbmeW66Jk0FygAFoIByZcbbspR5f0mq9BNhRAHDc2nt5STdWHF7nL9uRD4ss+LHy1/aziOnVbGEkoKw8IpF7qjC2Udp9i0NaEbboSmSJMQjl+oIAiP8TRfEkwiRTkOTVaKr70Ux8huEW9x1ax6wml04dPvgMOYrpcz/IdBuiOaoPYM+8Mi07QZkV0cDe2MQhGxHdx2+Uxhdi7GEUH Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: a62a2beb-a3bf-4a0b-391d-08d7824a3b62 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Dec 2019 17:03:48.7894 (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: vqhydZ3X/j+BbOvuEOKsSVB9o61oyjncXMWaAgBkBikQ4fE+fN7q/l0C8Vih/zMi9d0sfUdfjo10Z+nvLwQw4w== 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 In the old days, wfx_do_join() could be called from different contexts. Now that wfx_do_join() is called only from one place, it is cleaner to keep lock and unlock of data inside the function. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 939c64f108ed..62e65493a4fe 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -644,7 +644,6 @@ static void wfx_set_mfp(struct wfx_vif *wvif, hif_set_mfp(wvif, mfpc, mfpr); } -/* MUST be called with tx_lock held! It will be unlocked for us. */ static void wfx_do_join(struct wfx_vif *wvif) { const u8 *bssid; @@ -659,6 +658,8 @@ static void wfx_do_join(struct wfx_vif *wvif) conf->basic_rates), }; + wfx_tx_lock_flush(wvif->wdev); + if (wvif->channel->flags & IEEE80211_CHAN_NO_IR) join.probe_for_join = 0; @@ -1180,10 +1181,8 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, } mutex_unlock(&wdev->conf_mutex); - if (do_join) { - wfx_tx_lock_flush(wdev); - wfx_do_join(wvif); /* Will unlock it for us */ - } + if (do_join) + wfx_do_join(wvif); } static void wfx_ps_notify(struct wfx_vif *wvif, enum sta_notify_cmd notify_cmd,