From patchwork Wed Jun 10 15:21:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chi-Hsien Lin X-Patchwork-Id: 11598099 X-Patchwork-Delegate: kvalo@adurom.com 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 42A5290 for ; Wed, 10 Jun 2020 15:21:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 244952078C for ; Wed, 10 Jun 2020 15:21:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=cypress.com header.i=@cypress.com header.b="FtG5wBg9" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728474AbgFJPVW (ORCPT ); Wed, 10 Jun 2020 11:21:22 -0400 Received: from mail-eopbgr750110.outbound.protection.outlook.com ([40.107.75.110]:38746 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727102AbgFJPVV (ORCPT ); Wed, 10 Jun 2020 11:21:21 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h7t1lPhwOnmghy7DhZ19YUvyaWEMe04gK1ZYPM4H8qMtq7+gl+qwHhUqSBJo4i7ofIUsfMax2RFmBfdsxyJfzbnyjWL4pYtCZOk7TKy1EF16aXw1LERkFKh83WTT9dZcGV7NzAyqMh8K5MT/GOgv68Jw6UIrpmfaYY9cVag0sNUKr36w92YiYiAZ7ggxBy8MbU2KHOwMfUl5zikf9HpPQVTVFMxLdx1tjJibzkSHba92lrtfaLD1bOsxR0XNAWpY/uLVpeAi8Rl1WNnoCuZLqTa0+po8LrXfwehj0wql6sSYn3AoCQg2sv2QSRbQXC6fPpLmQ2MYWvPTlK4VhMDq/g== 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=F6hCBd/N3JOcl/l1jLoYrGAz18ECTLlK0LAuxUBiMCQ=; b=C+eTh22xa5xzH6GFIw0V66XIAczqaUFX0ZV6mTCZWsB0KrL4NYbNbqh4oftBibX+jdWN1qcQLKmQ61wWofkkfPwYk22MDkosvAhue7yI2n43sZ/xPhaEchHTHRFfpDhc3DUtsShk9pkr/SOdR/V2u19/7lJXlyu5kkwRMEpo6gMAp2ziVz9A3u+tsVXZBQNcTNGCyCZX+WuUvBMyfeMYP6taqJOMDiahWnBkQDeu0sZYkEGdzACrrUxb/53f/VUp2MOLIrSLBphJ3k51KrcVMhidWNMAI1xlQ89Z9F6pkqU1Ofoh5tdnrsbCmSku2d5QoK/DN5N2dvCyENOedhgUhg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cypress.com; dmarc=pass action=none header.from=cypress.com; dkim=pass header.d=cypress.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cypress.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=F6hCBd/N3JOcl/l1jLoYrGAz18ECTLlK0LAuxUBiMCQ=; b=FtG5wBg927ggKLD+8UfLWcenBsUhst8sPOsKU/UOkC1h3hbTg1vQ6c3dlwS6rJfYydDTcP9EsEGasYNO90/L4la1/zGCC+lETEoLw1v0EDxGylBYxbdpe/2H++lQYYzMyHEy5RdVtW9Y4o7PrY3HdXsNZ70RY+YxgAttyN8XuA4= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=cypress.com; Received: from BYAPR06MB4901.namprd06.prod.outlook.com (2603:10b6:a03:7a::30) by BYAPR06MB5621.namprd06.prod.outlook.com (2603:10b6:a03:ab::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.22; Wed, 10 Jun 2020 15:21:18 +0000 Received: from BYAPR06MB4901.namprd06.prod.outlook.com ([fe80::b972:c25d:c8fc:fc0e]) by BYAPR06MB4901.namprd06.prod.outlook.com ([fe80::b972:c25d:c8fc:fc0e%7]) with mapi id 15.20.3088.018; Wed, 10 Jun 2020 15:21:18 +0000 From: Chi-Hsien Lin To: linux-wireless@vger.kernel.org Cc: brcm80211-dev-list@broadcom.com, brcm80211-dev-list@cypress.com, Arend van Spriel , Franky Lin , Hante Meuleman , Wright Feng , Kalle Valo , Raveendran Somu , Jia-Shyr Chuang , Chung-Hsien Hsu , Chi-hsien Lin Subject: [PATCH V2 1/6] brcmfmac: allow credit borrowing for all access categories Date: Wed, 10 Jun 2020 10:21:01 -0500 Message-Id: <20200610152106.175257-2-chi-hsien.lin@cypress.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200610152106.175257-1-chi-hsien.lin@cypress.com> References: <20200610152106.175257-1-chi-hsien.lin@cypress.com> X-ClientProxiedBy: MN2PR08CA0019.namprd08.prod.outlook.com (2603:10b6:208:239::24) To BYAPR06MB4901.namprd06.prod.outlook.com (2603:10b6:a03:7a::30) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from aremote02.aus.cypress.com (12.110.209.245) by MN2PR08CA0019.namprd08.prod.outlook.com (2603:10b6:208:239::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3088.21 via Frontend Transport; Wed, 10 Jun 2020 15:21:15 +0000 X-Mailer: git-send-email 2.25.0 X-Originating-IP: [12.110.209.245] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: e409f7a0-8d64-4e58-b4bc-08d80d51ebe3 X-MS-TrafficTypeDiagnostic: BYAPR06MB5621: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-Forefront-PRVS: 0430FA5CB7 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cTalAY+PqSA13QJi5E1jCAMWKnmTTEeTL+uH66kiPgkEGHq2L3m2E4N8iyZlfPrYExjfow7eWSSNiFY+m3Vqzx6SyYvxD9kWfK9uG/3+rdO/uKW8ng6bYft1V7QqnPGbEnGPmZJZjQog4SRwrzoA1F/EdwGR/Rbhk/1Ngni2Q6e0gHb0ep6aaoFv2nImebQNq70/hgKGom+C58dAWHiY4oUlMSuZn+/55sh0/fXiuOeHk3QjKPdizRLb2Scgh96FRv4cLCzShMsXHGAZ3eH6axBCX9VgvpXGGKK1Sgsh+c7E4BkZg4KOUZ9EJ1EHjpP3HIyrNhV28gZ2nzkOtFHEqw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR06MB4901.namprd06.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(396003)(366004)(136003)(39860400002)(346002)(376002)(16526019)(107886003)(2616005)(956004)(8936002)(26005)(1076003)(6916009)(316002)(6486002)(186003)(6666004)(2906002)(8676002)(7696005)(86362001)(66556008)(4326008)(36756003)(52116002)(54906003)(66476007)(5660300002)(478600001)(83380400001)(66946007);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: mIPXTI5IMECyn1Z8SV2KgXKWzp4o+JUZcMZtR1qfaoRpMiLb+HHjUaRZpLN8mxxq355JLgTmMGuq4KrXd55pQp7h58oR1wdPqjmg5fkXGFTubLix1pvyhks6ZS1odB4g0lC4ejxA96Mfzhg/BD6Ra40dF882pmByNaQUXE3gEzRSe82+xZ+PlYfy2fffgJNMwNCXt9Teo9DewyVfC98e7zy0/XEE/O1BUamQEv6vK3ZyBQYeNCK05w2YClZwHI6SuYm5lQgBGwo9JPKBCp7+xc/NqP7qjl7TYFXBs65Cg7rL2ATyDpALp3rdYNld+6IUApA0Crr0dw07q/pbOil43fRpEnoXPtPBKm/nzE2np7aldrl4cbDyhBj+pFAYA2/MocxSPzdsiiFLPvljDyPv3cE788czcpj3SiQj4SbMbOxq4Fa9rsSry2XNzXg+DovJju3H2ptT5/dMfcYYU4wTALI1WAJSCI3767CY7kHBks9vOGZ2/fV46SBPvsmxCOti X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-Network-Message-Id: e409f7a0-8d64-4e58-b4bc-08d80d51ebe3 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jun 2020 15:21:17.8983 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 011addfc-2c09-450d-8938-e0bbc2dd2376 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 5DP98hHWOYA4Iawet7blVgVZBZFFq5Y8dbtIfE+XUDnC30WqwbrRc/bcN/22SEWqrnoPqoQwLzxg9iN48RxyoQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR06MB5621 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Raveendran Somu Current credit borrowing allows only the access category BE to borrow the credits. This change is to fix the credit borrowing logic, to make borrowing available for all access categories and also to borrow only from the lower categories. This fixes WFA 802.11n certs 5.2.27 failures. Signed-off-by: Raveendran Somu Signed-off-by: Jia-Shyr Chuang Signed-off-by: Chung-Hsien Hsu Signed-off-by: Chi-hsien Lin --- .../broadcom/brcm80211/brcmfmac/fwsignal.c | 61 +++++++++++-------- 1 file changed, 37 insertions(+), 24 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c index 09701262330d..d7c36af4b566 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c @@ -383,6 +383,7 @@ struct brcmf_fws_mac_descriptor { }; #define BRCMF_FWS_HANGER_MAXITEMS 3072 +#define BRCMF_BORROW_RATIO 3 /** * enum brcmf_fws_hanger_item_state - state of hanger item. @@ -479,7 +480,8 @@ struct brcmf_fws_info { u32 fifo_enqpkt[BRCMF_FWS_FIFO_COUNT]; int fifo_credit[BRCMF_FWS_FIFO_COUNT]; int init_fifo_credit[BRCMF_FWS_FIFO_COUNT]; - int credits_borrowed[BRCMF_FWS_FIFO_AC_VO + 1]; + int credits_borrowed[BRCMF_FWS_FIFO_AC_VO + 1] + [BRCMF_FWS_FIFO_AC_VO + 1]; int deq_node_pos[BRCMF_FWS_FIFO_COUNT]; u32 fifo_credit_map; u32 fifo_delay_map; @@ -1185,13 +1187,11 @@ static void brcmf_fws_return_credits(struct brcmf_fws_info *fws, if (!credits) return; - fws->fifo_credit_map |= 1 << fifo; - - if ((fifo == BRCMF_FWS_FIFO_AC_BE) && - (fws->credits_borrowed[0])) { + if (fifo > BRCMF_FWS_FIFO_AC_BK && + fifo <= BRCMF_FWS_FIFO_AC_VO) { for (lender_ac = BRCMF_FWS_FIFO_AC_VO; lender_ac >= 0; lender_ac--) { - borrowed = &fws->credits_borrowed[lender_ac]; + borrowed = &fws->credits_borrowed[fifo][lender_ac]; if (*borrowed) { fws->fifo_credit_map |= (1 << lender_ac); fifo_credit = &fws->fifo_credit[lender_ac]; @@ -1208,7 +1208,11 @@ static void brcmf_fws_return_credits(struct brcmf_fws_info *fws, } } - fws->fifo_credit[fifo] += credits; + if (credits) { + fws->fifo_credit[fifo] += credits; + fws->fifo_credit_map |= 1 << fifo; + } + if (fws->fifo_credit[fifo] > fws->init_fifo_credit[fifo]) fws->fifo_credit[fifo] = fws->init_fifo_credit[fifo]; @@ -2005,27 +2009,31 @@ static void brcmf_fws_rollback_toq(struct brcmf_fws_info *fws, } } -static int brcmf_fws_borrow_credit(struct brcmf_fws_info *fws) +static int brcmf_fws_borrow_credit(struct brcmf_fws_info *fws, + int highest_lender_ac, int borrower_ac, + bool borrow_all) { - int lender_ac; + int lender_ac, borrow_limit = 0; - if (time_after(fws->borrow_defer_timestamp, jiffies)) { - fws->fifo_credit_map &= ~(1 << BRCMF_FWS_FIFO_AC_BE); - return -ENAVAIL; - } + for (lender_ac = 0; lender_ac <= highest_lender_ac; lender_ac++) { - for (lender_ac = 0; lender_ac <= BRCMF_FWS_FIFO_AC_VO; lender_ac++) { - if (fws->fifo_credit[lender_ac] > 0) { - fws->credits_borrowed[lender_ac]++; + if (!borrow_all) + borrow_limit = + fws->init_fifo_credit[lender_ac] / BRCMF_BORROW_RATIO; + else + borrow_limit = 0; + + if (fws->fifo_credit[lender_ac] > borrow_limit) { + fws->credits_borrowed[borrower_ac][lender_ac]++; fws->fifo_credit[lender_ac]--; if (fws->fifo_credit[lender_ac] == 0) fws->fifo_credit_map &= ~(1 << lender_ac); - fws->fifo_credit_map |= (1 << BRCMF_FWS_FIFO_AC_BE); + fws->fifo_credit_map |= (1 << borrower_ac); brcmf_dbg(DATA, "borrow credit from: %d\n", lender_ac); return 0; } } - fws->fifo_credit_map &= ~(1 << BRCMF_FWS_FIFO_AC_BE); + fws->fifo_credit_map &= ~(1 << borrower_ac); return -ENAVAIL; } @@ -2216,9 +2224,10 @@ static void brcmf_fws_dequeue_worker(struct work_struct *worker) } continue; } - while ((fws->fifo_credit[fifo] > 0) || + + while ((fws->fifo_credit[fifo]) || ((!fws->bcmc_credit_check) && - (fifo == BRCMF_FWS_FIFO_BCMC))) { + (fifo == BRCMF_FWS_FIFO_BCMC))) { skb = brcmf_fws_deq(fws, fifo); if (!skb) break; @@ -2228,10 +2237,14 @@ static void brcmf_fws_dequeue_worker(struct work_struct *worker) if (fws->bus_flow_blocked) break; } - if ((fifo == BRCMF_FWS_FIFO_AC_BE) && - (fws->fifo_credit[fifo] <= 0) && - (!fws->bus_flow_blocked)) { - while (brcmf_fws_borrow_credit(fws) == 0) { + + if (fifo >= BRCMF_FWS_FIFO_AC_BE && + fifo <= BRCMF_FWS_FIFO_AC_VO && + fws->fifo_credit[fifo] == 0 && + !fws->bus_flow_blocked) { + while (brcmf_fws_borrow_credit(fws, + fifo - 1, fifo, + true) == 0) { skb = brcmf_fws_deq(fws, fifo); if (!skb) { brcmf_fws_return_credits(fws, fifo, 1); From patchwork Wed Jun 10 15:21:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chi-Hsien Lin X-Patchwork-Id: 11598101 X-Patchwork-Delegate: kvalo@adurom.com 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 1B34D92A for ; Wed, 10 Jun 2020 15:21:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 01E15207C3 for ; Wed, 10 Jun 2020 15:21:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=cypress.com header.i=@cypress.com header.b="ObiPp96I" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730092AbgFJPV1 (ORCPT ); Wed, 10 Jun 2020 11:21:27 -0400 Received: from mail-eopbgr750110.outbound.protection.outlook.com ([40.107.75.110]:38746 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728446AbgFJPV0 (ORCPT ); Wed, 10 Jun 2020 11:21:26 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CIlz5CHbGK/912+Jpk5+wWF5fHJMVmfO1zPBAY/XP1hG4mrMHiqN8CL1AnDXeuHqBxPACq44x2j0JEA7WxyEsMv/EG18G+vzcuBMIY4Z15y4GviMamgxUKZ7LM51y8q+2FQKVkxMf0ONS1gPkmzqHo9kdMgCU7PMgxUfhyAc6Xg4W1NoQQ78TfQ6Ugr0h9rT2Bc0lzz7jU82LkXA5y/Xcs/jn0pfGoekUJaxPurzScHiY4UV2R/HR1s8wESpy0WTxtH1rJXVCml+Z8IszGdKPdEc4sw9hXx9U68LstYrzV/oxwK4ogMbY8LQ5HXfXT2gMIBW3dQD/3fN1WvyueGjCQ== 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=lgHi90gclLmqwIbuKaHiH64HqaDm0VrmDfo80pCUMsU=; b=DDYy1ZT1majqALsPY+pSB5WurE+vwrO/DuZvFzpr63qs1SXFneAdTFJDuVJqutbh2/UwZdM17E0YzydutWLNC8Qr2oQoSpD5Vpb58CHbHp+WoEJFN2sPlaiKv1rPceaZTRp0rW9EaC0ssLya3fP8HC9afibQ5MQ2QKI6SFim7qYQAIF7lRJXq7RFWgfNqq6KXZxj2tRRwGbas5dXCAGDu2lYd7ehzc9lhiI/EVtGf351V4juzTPQm8k0ewLIacwAGdBco1JkBkL4UdM43iPJSQAP1MGZDNr9uEIjN97p7PRgOasJLeheKqy+lqAoQ6Tbw1spzVNfpH4+ER5hITIbLg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cypress.com; dmarc=pass action=none header.from=cypress.com; dkim=pass header.d=cypress.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cypress.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lgHi90gclLmqwIbuKaHiH64HqaDm0VrmDfo80pCUMsU=; b=ObiPp96ImrZWGNh0cl3zaWvbjEETICGsmR/rQI8CbXhtvmko0HjD/96vfXMdhsoNNFLlwsUZWcYRNlC6ekBjZOnkCOOlT1ozTabOKMhwL3jimhF31LAFbv/nAjNWLWlfDuc88XPqzJkl4/gQOhgfNWOjCcv8AvwfDA98y4ydVXg= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=cypress.com; Received: from BYAPR06MB4901.namprd06.prod.outlook.com (2603:10b6:a03:7a::30) by BYAPR06MB5621.namprd06.prod.outlook.com (2603:10b6:a03:ab::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.22; Wed, 10 Jun 2020 15:21:20 +0000 Received: from BYAPR06MB4901.namprd06.prod.outlook.com ([fe80::b972:c25d:c8fc:fc0e]) by BYAPR06MB4901.namprd06.prod.outlook.com ([fe80::b972:c25d:c8fc:fc0e%7]) with mapi id 15.20.3088.018; Wed, 10 Jun 2020 15:21:20 +0000 From: Chi-Hsien Lin To: linux-wireless@vger.kernel.org Cc: brcm80211-dev-list@broadcom.com, brcm80211-dev-list@cypress.com, Arend van Spriel , Franky Lin , Hante Meuleman , Wright Feng , Kalle Valo , Jia-Shyr Chuang , Soontak Lee , Chi-Hsien Lin Subject: [PATCH V2 2/6] brcmfmac: increase message buffer size for control packets Date: Wed, 10 Jun 2020 10:21:02 -0500 Message-Id: <20200610152106.175257-3-chi-hsien.lin@cypress.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200610152106.175257-1-chi-hsien.lin@cypress.com> References: <20200610152106.175257-1-chi-hsien.lin@cypress.com> X-ClientProxiedBy: MN2PR08CA0019.namprd08.prod.outlook.com (2603:10b6:208:239::24) To BYAPR06MB4901.namprd06.prod.outlook.com (2603:10b6:a03:7a::30) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from aremote02.aus.cypress.com (12.110.209.245) by MN2PR08CA0019.namprd08.prod.outlook.com (2603:10b6:208:239::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3088.21 via Frontend Transport; Wed, 10 Jun 2020 15:21:18 +0000 X-Mailer: git-send-email 2.25.0 X-Originating-IP: [12.110.209.245] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 8c5eb0b6-1c1b-4c97-46ff-08d80d51ed2b X-MS-TrafficTypeDiagnostic: BYAPR06MB5621: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-Forefront-PRVS: 0430FA5CB7 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EF/X4/KrBsjPlInZylv9b3U6M5Uw9cHKv8KAt0WjI/XiTpM6i1VVIoTsZE5jl0u4cT9tdbzGw5RlzXCGoYNt0RYQt4QfTjOZXUBfRFfEjkckWa1fsuiznEjFc+jQh385RETFdJfUzGIUrxZ8/yPp6TxZ1nzIb4dXCkWuak9GLPDQcpNj4snF96uJchJssQW1LMC4h73fOLMMubZ54KzvEY3szS+7O4M4YadN3eFEcBSFsd4/l7QtDQW780ojMAa2vQXfNSclPVmJtVBHdmRpLFLqiGDlsy6DxL/O0CnSwSwa7mOVmwr806ynRViz7FV9 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR06MB4901.namprd06.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(396003)(366004)(136003)(39860400002)(346002)(376002)(16526019)(107886003)(2616005)(956004)(8936002)(26005)(1076003)(6916009)(316002)(6486002)(186003)(6666004)(2906002)(8676002)(7696005)(86362001)(66556008)(4326008)(36756003)(52116002)(54906003)(66476007)(15650500001)(5660300002)(478600001)(83380400001)(66946007);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: vC+NPcD8dM1qM1DwXRfI+VZh/2YEpdxyeuJEJnRFOfaHBYgvHZSAKZLtOJBb4YPO0qZjuexUPobnlUIhhTsb1Q7QOw+igrE/Oohvi7UmuXaqGccxLp/uOj+nrAkmJb1ckCzZsFqhMSboHmbZ2iWmz69xJMGuEQSty1ILmDxSZ+L9AMNkuC7ZAyFcqA1n5ip3Ogn6Gnily4q5THp8snFUm05ysrKtwkBu/TaT5rbUsNVuluuuJDx4m2WEpwh7Bg85B/Fc/VWvLp/arPYWlBIn7criaMYe1AswDF82SQ7NYRbRU2m8AM83eH2BgM7j9+8n0znqrn8/ZlHKjuuIvppvyXoXkPItswr5LSDmOqzl0urYhTAmqf/rJMoPj7xu5lqzTXi/6rARzMInFYIn3C2NviOwPmtNizhU4YGGxBy1R/M+iwG4GPkDqvKy8a2HTbE7APKUZ9EP+uBDmNL/7c0wb+4P964YpwYjZH4mon4BjCytR9jO+/+PkVt23V7BtfmK X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8c5eb0b6-1c1b-4c97-46ff-08d80d51ed2b X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jun 2020 15:21:20.0220 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 011addfc-2c09-450d-8938-e0bbc2dd2376 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: USrH0mJ56hp01ppGZZyynHGT84eBdQs2b/2QKLdetZx11yexNOfm73GBxHOMvi/trvMX1wsMpZOBFzM3bHYC5A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR06MB5621 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jia-Shyr Chuang In wifi firmware, max length of IOCTL/IOVAR buffer size is 8192. Increase the message buffer max size same as wifi firmware for control packets so return buffers can come back. Signed-off-by: Soontak Lee Signed-off-by: Jia-Shyr Chuang Signed-off-by: Chi-Hsien Lin --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c index 8bb4f1fa790e..f1a20db8daab 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c @@ -54,6 +54,7 @@ #define BRCMF_IOCTL_REQ_PKTID 0xFFFE #define BRCMF_MSGBUF_MAX_PKT_SIZE 2048 +#define BRCMF_MSGBUF_MAX_CTL_PKT_SIZE 8192 #define BRCMF_MSGBUF_RXBUFPOST_THRESHOLD 32 #define BRCMF_MSGBUF_MAX_IOCTLRESPBUF_POST 8 #define BRCMF_MSGBUF_MAX_EVENTBUF_POST 8 @@ -1028,7 +1029,7 @@ brcmf_msgbuf_rxbuf_ctrl_post(struct brcmf_msgbuf *msgbuf, bool event_buf, rx_bufpost = (struct msgbuf_rx_ioctl_resp_or_event *)ret_ptr; memset(rx_bufpost, 0, sizeof(*rx_bufpost)); - skb = brcmu_pkt_buf_get_skb(BRCMF_MSGBUF_MAX_PKT_SIZE); + skb = brcmu_pkt_buf_get_skb(BRCMF_MSGBUF_MAX_CTL_PKT_SIZE); if (skb == NULL) { bphy_err(drvr, "Failed to alloc SKB\n"); From patchwork Wed Jun 10 15:21:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chi-Hsien Lin X-Patchwork-Id: 11598103 X-Patchwork-Delegate: kvalo@adurom.com 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 4D8D490 for ; Wed, 10 Jun 2020 15:21:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 244B820734 for ; Wed, 10 Jun 2020 15:21:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=cypress.com header.i=@cypress.com header.b="CH9OBDju" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730114AbgFJPVa (ORCPT ); Wed, 10 Jun 2020 11:21:30 -0400 Received: from mail-eopbgr750110.outbound.protection.outlook.com ([40.107.75.110]:38746 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727102AbgFJPV3 (ORCPT ); Wed, 10 Jun 2020 11:21:29 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lDX7GWlT9fTnraaCodr13+SYXRlEHxI0mdIXMGrKg1ZC1BeKKiE70e/uPxj1ayvJ4h96HiLsvSNF8w3hg6LPaU+tCG9+snsz++qyt9l53MscbSQ38ad+a4JvsRWQqRez1Su/zN4gwEy5Mpuf3fdhce4J8Pkk04Th5O7Df0QX8vlZSgZCqcifFLEzX8ae6fiMwx1lV3HpOTiwif8thiGI7paGZ+b/9C99SAZiqO9+O1Vw4qaEaQKbV1nZSpoQ/zXwQ0gLlCgBRPBA2Pj9R1FDzaFove/YUAF48XUY3/8ftv8W88kocEovD+r+ucK/6KhA11TqOotAStNpPrfJb8TU4Q== 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=VqvVsvBdTd4F2vCiN7cyq4Nhx8dKj4yLYoitzKtPBi0=; b=Pzybi6oZ9Xifq4213hMNGYw18U4mp7VwCN4xLHGW3n7ARrVVJuqZIdSyYDBSWQ+OWdhX8VsCPKrVWBxsHH2hxZLns/pG1lzQm+ocNL3/xEKQnaKgoCPCT2f/WeiL36SAU06QfvyAZVrx3LGs9y6GMwmTpnpjBgYLKhHqI2YzmAb4i020FWuFZncDzhfKr0vJhXQ6pzcCdJfBj1yR5bUthBv3YaTjv2G+fvohJC5s+IEmRvlXSjGStP8K7RHZft48v/KXMkT0cekROkyj2K28acJr6c3xF352gZeUapak8vNysHx8KNixcL3NqCeCH010Ga4lmSy7AkOBSi5krytmOQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cypress.com; dmarc=pass action=none header.from=cypress.com; dkim=pass header.d=cypress.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cypress.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VqvVsvBdTd4F2vCiN7cyq4Nhx8dKj4yLYoitzKtPBi0=; b=CH9OBDju80Jy4C2OkTBEEB/1p686ppm7l+gHs921HKh61hYKYn1rqNobUj9Fy63SFl5uIZvIHlamVdwggeS/ISW4ZSg8lBwGhy2xTjQ3koCh3PR5ELzWtHyS0Xb75HgU0jGYqE7cRROhXqi22FuHJmaO4/p+aB3SLQD+37zZVGg= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=cypress.com; Received: from BYAPR06MB4901.namprd06.prod.outlook.com (2603:10b6:a03:7a::30) by BYAPR06MB5621.namprd06.prod.outlook.com (2603:10b6:a03:ab::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.22; Wed, 10 Jun 2020 15:21:22 +0000 Received: from BYAPR06MB4901.namprd06.prod.outlook.com ([fe80::b972:c25d:c8fc:fc0e]) by BYAPR06MB4901.namprd06.prod.outlook.com ([fe80::b972:c25d:c8fc:fc0e%7]) with mapi id 15.20.3088.018; Wed, 10 Jun 2020 15:21:22 +0000 From: Chi-Hsien Lin To: linux-wireless@vger.kernel.org Cc: brcm80211-dev-list@broadcom.com, brcm80211-dev-list@cypress.com, Arend van Spriel , Franky Lin , Hante Meuleman , Wright Feng , Kalle Valo , Amar Shankar , Jia-Shyr Chuang , Chi-Hsien Lin Subject: [PATCH V2 3/6] brcmfmac: reserve 2 credits for host tx control path Date: Wed, 10 Jun 2020 10:21:03 -0500 Message-Id: <20200610152106.175257-4-chi-hsien.lin@cypress.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200610152106.175257-1-chi-hsien.lin@cypress.com> References: <20200610152106.175257-1-chi-hsien.lin@cypress.com> X-ClientProxiedBy: MN2PR08CA0019.namprd08.prod.outlook.com (2603:10b6:208:239::24) To BYAPR06MB4901.namprd06.prod.outlook.com (2603:10b6:a03:7a::30) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from aremote02.aus.cypress.com (12.110.209.245) by MN2PR08CA0019.namprd08.prod.outlook.com (2603:10b6:208:239::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3088.21 via Frontend Transport; Wed, 10 Jun 2020 15:21:20 +0000 X-Mailer: git-send-email 2.25.0 X-Originating-IP: [12.110.209.245] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: a64db2f3-8d9a-44ae-b6a8-08d80d51ee70 X-MS-TrafficTypeDiagnostic: BYAPR06MB5621: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-Forefront-PRVS: 0430FA5CB7 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: r1rsuWUhYljGNN2Wl0rS7RfY88KCyLbcdXyXaqrsToxkNvAsabcyhGk7bBVIgmOnpGb3o1EgYFuKgio6q0+230mlTtXLPFiSQFmlj2vYuWzjxoeEcMSZGNjU7Bj4c5s4+S2H07R/G7/iChBtiAylG4j1RpsDoFzVbl1nj2oEipC2AaNc4AVI4eerERN/gxztAM/94Cq4+sfuLsOel4oS4IeZTifI88tmIQBXLoVM/MIgyxQh/azocVcaGIFGT40K+YLGCtcdm2dkcZOp9qfIVO4/f5iI+N2cMQDmfRK2c40duzlythC/Xz8IdvVyeZHe X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR06MB4901.namprd06.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(396003)(366004)(136003)(39860400002)(346002)(376002)(16526019)(107886003)(2616005)(956004)(8936002)(26005)(1076003)(6916009)(316002)(6486002)(186003)(6666004)(2906002)(8676002)(7696005)(86362001)(66556008)(4326008)(36756003)(52116002)(54906003)(66476007)(5660300002)(478600001)(83380400001)(66946007);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: 52t2ye4kC9Fdl6Zrk/j5P857HfsXrC4Qln/NC1J4PaIB6zr59AlKlNpfEhO4EGTdFZ8T2dYWwn0y85utLAL2aadfa15rZC9gbD8ef2+jsdUpIS2BpwUsJVNu4PSemvT6fTCyiIVNDQG9ooh8uq9LBjmjxpr08lBUlQoNPHmmZDO2MjGFEXW6EfvM0APe0ecq4UoiJ5Cvi3NZTZJEGfV4L5y+OATzg4UZ8ykHQqzwxDw3KtdJQbT8qV38PISZ6xNKfv2MuM8rXPKd7hGXRTTPDuvUEy+fDODpG+3NZFvtGM7O8hMT9HHOtUGhKPNTnQur09yPUmrOlPUjMF4/4nqA4mbS/3BqZyhGLQMP8jApC8qInd0Npl3gS+cbT8kIuHBWBMaQtF4N3V2Cu3CIsFet+yR0WYUH0TgNaqEqjBUqPkiU3HQAQYzWlohIAwGV48Gb4WyyrLGwaBVgz1/IfilFTeoAZvncVgqGDlGjHw1t+ZPdC8rUiyXwNsn7p9MrbilN X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-Network-Message-Id: a64db2f3-8d9a-44ae-b6a8-08d80d51ee70 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jun 2020 15:21:22.5906 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 011addfc-2c09-450d-8938-e0bbc2dd2376 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 43paNZXugn2bbwaMwCoqYYY/X5wY7MaBMHczPq3k3fJCBiredLR4YbW4DnhB9m+QQDFOIeADlsymszJOZiUxBQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR06MB5621 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Amar Shankar It is observed that sometimes when sdiod is low in tx credits in low rssi scenarios, the data path consumes all sdiod rx all credits and there is no sdiod rx credit available for control path causing host and card to go out of sync resulting in link loss between host and card. So in order to prevent it some credits are reserved for control path. Note that TXCTL_CREDITS can't be larger than the firmware default credit update threshold 2; otherwise there will be a deadlock for both side waiting for each other. Signed-off-by: Amar Shankar Signed-off-by: Jia-Shyr Chuang Signed-off-by: Chi-Hsien Lin Tested-by: Dmitry Osipenko --- .../broadcom/brcm80211/brcmfmac/sdio.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c index ce6f15284277..4da40436b4ab 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c @@ -635,6 +635,8 @@ static const struct brcmf_firmware_mapping brcmf_sdio_fwnames[] = { BRCMF_FW_ENTRY(CY_CC_43012_CHIP_ID, 0xFFFFFFFF, 43012) }; +#define TXCTL_CREDITS 2 + static void pkt_align(struct sk_buff *p, int len, int align) { uint datalign; @@ -648,8 +650,16 @@ static void pkt_align(struct sk_buff *p, int len, int align) /* To check if there's window offered */ static bool data_ok(struct brcmf_sdio *bus) { - return (u8)(bus->tx_max - bus->tx_seq) != 0 && - ((u8)(bus->tx_max - bus->tx_seq) & 0x80) == 0; + /* Reserve TXCTL_CREDITS credits for txctl */ + return (bus->tx_max - bus->tx_seq) > TXCTL_CREDITS && + ((bus->tx_max - bus->tx_seq) & 0x80) == 0; +} + +/* To check if there's window offered */ +static bool txctl_ok(struct brcmf_sdio *bus) +{ + return (bus->tx_max - bus->tx_seq) != 0 && + ((bus->tx_max - bus->tx_seq) & 0x80) == 0; } static int @@ -2655,7 +2665,7 @@ static void brcmf_sdio_dpc(struct brcmf_sdio *bus) brcmf_sdio_clrintr(bus); if (bus->ctrl_frame_stat && (bus->clkstate == CLK_AVAIL) && - data_ok(bus)) { + txctl_ok(bus)) { sdio_claim_host(bus->sdiodev->func1); if (bus->ctrl_frame_stat) { err = brcmf_sdio_tx_ctrlframe(bus, bus->ctrl_frame_buf, @@ -2663,6 +2673,9 @@ static void brcmf_sdio_dpc(struct brcmf_sdio *bus) bus->ctrl_frame_err = err; wmb(); bus->ctrl_frame_stat = false; + if (err) + brcmf_err("sdio ctrlframe tx failed err=%d\n", + err); } sdio_release_host(bus->sdiodev->func1); brcmf_sdio_wait_event_wakeup(bus); From patchwork Wed Jun 10 15:21:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chi-Hsien Lin X-Patchwork-Id: 11598107 X-Patchwork-Delegate: kvalo@adurom.com 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 F09AD90 for ; Wed, 10 Jun 2020 15:21:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CCBC62078C for ; Wed, 10 Jun 2020 15:21:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=cypress.com header.i=@cypress.com header.b="IhAyd+yr" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730122AbgFJPVc (ORCPT ); Wed, 10 Jun 2020 11:21:32 -0400 Received: from mail-eopbgr750110.outbound.protection.outlook.com ([40.107.75.110]:38746 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729987AbgFJPVb (ORCPT ); Wed, 10 Jun 2020 11:21:31 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WPLurr1KbJgmRqxMElL0ne40uChl8ZwCnyHGZT7u48gTPcgray7dgoyyOsSIqRSCM60GBf/LZQrDfbIjgW4sHioqrw0uYRTRReH97hiFbwNwywfelSk63/dbivGU+qbzckHOGGlmijg0+X4Bax3/mku3ZPo3gMFzrYHCS862KDNrrCSJyC0EknXFo31FgXWxC08A0/Cg80VxDB6Bj89rvuaSmsOEA64naTqZwVPlJltFJPirAIJfIeplv1pbyRlF2szfOu35veJzORDatGSRdO5TzcgMVSi3AEzyDL8CRoIlyMnJBMZ/UHtZvf9BwO8EMmQjRh2NshQtMu8e50nydg== 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=9oTcvlhQieqo502sxUGI7vgIZdSYAA2sHcjDKoWqD0A=; b=npsmg4YbcmwhpB4TFUh7YfKM+tbqB/36zvw4snE+KlMh3eFsCE+ckaEnNBzHod7roEhekXHfdr1bMgZyH0e7pRpwT7uLNM6F9LxEoMMVV5FDuNl5fOXFS9N103rHYt8myg9rshBSSnOsHBaZw+g511xZZvJNO5Z8a4pUV6pvy+NT/b56OpWoPBN3YoQD3w7qvzlq6PdewTADaJtJ/8BDU6JQxomHyx2X86Rxnncl9F14T1LU7AUxIC/UbDCdLB6Yq01BapsxmxyVdC09KWX74mf+6olnZiT11G7XpCBWdM/ZxHDnb8MFQnFStZZSBi8wHi9Z6n3JjfujMn4OrmJk+g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cypress.com; dmarc=pass action=none header.from=cypress.com; dkim=pass header.d=cypress.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cypress.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9oTcvlhQieqo502sxUGI7vgIZdSYAA2sHcjDKoWqD0A=; b=IhAyd+yrsUcfMvlTgUEgnynN9hp8ItX66QJpE39YUePpXjSBwf4g/tuAHehGIszcAux5u57oztznr+4LyzSdPqvdqvBOqp1Hf4frxUaFYjr8CCoNrTF4+yzEp7kUePMfPEeUu+2eDxUKTmvwk9HLUSynQZW0tGsSnYeXg8H3sm8= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=cypress.com; Received: from BYAPR06MB4901.namprd06.prod.outlook.com (2603:10b6:a03:7a::30) by BYAPR06MB5621.namprd06.prod.outlook.com (2603:10b6:a03:ab::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.22; Wed, 10 Jun 2020 15:21:24 +0000 Received: from BYAPR06MB4901.namprd06.prod.outlook.com ([fe80::b972:c25d:c8fc:fc0e]) by BYAPR06MB4901.namprd06.prod.outlook.com ([fe80::b972:c25d:c8fc:fc0e%7]) with mapi id 15.20.3088.018; Wed, 10 Jun 2020 15:21:24 +0000 From: Chi-Hsien Lin To: linux-wireless@vger.kernel.org Cc: brcm80211-dev-list@broadcom.com, brcm80211-dev-list@cypress.com, Arend van Spriel , Franky Lin , Hante Meuleman , Wright Feng , Kalle Valo , Chung-Hsien Hsu , Chi-hsien Lin Subject: [PATCH V2 4/6] brcmfmac: update tx status flags to sync with firmware Date: Wed, 10 Jun 2020 10:21:04 -0500 Message-Id: <20200610152106.175257-5-chi-hsien.lin@cypress.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200610152106.175257-1-chi-hsien.lin@cypress.com> References: <20200610152106.175257-1-chi-hsien.lin@cypress.com> X-ClientProxiedBy: MN2PR08CA0019.namprd08.prod.outlook.com (2603:10b6:208:239::24) To BYAPR06MB4901.namprd06.prod.outlook.com (2603:10b6:a03:7a::30) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from aremote02.aus.cypress.com (12.110.209.245) by MN2PR08CA0019.namprd08.prod.outlook.com (2603:10b6:208:239::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3088.21 via Frontend Transport; Wed, 10 Jun 2020 15:21:22 +0000 X-Mailer: git-send-email 2.25.0 X-Originating-IP: [12.110.209.245] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 5e8201d8-02db-4eb9-a47b-08d80d51efef X-MS-TrafficTypeDiagnostic: BYAPR06MB5621: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-Forefront-PRVS: 0430FA5CB7 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ILGOpp6QnLYsB2sdOb8ucpfCrrSFWOJTvaKjcBkY5Lb1KJLNN56Lvl4Hv9bGFdw3bgOsGxrLU/aPa+iWUXEUUNv4qXKRDfXqTXKUcpm2b/cdds0imn8acZ0ERLPu43DIl79FAGMGjU4K3kYSFrKCHX55kmyko96f1D1a8iEdUW5HqVE8mLilLJ7PWZDxNd+ywczcy5tT4TOawIJY0ZgJkv+AcbBDtRPYJ+f5s6m6pdJhTCrPH4ZpSHcAyuhgCYmYxxmhAX7QtlGYvg9LQS5MEkrihmXbT23swsyQgaRVzuLvf40eZ4degYiBOC63ij5D2obmxwOG25QaPwNcODUpaQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR06MB4901.namprd06.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(396003)(366004)(136003)(39860400002)(346002)(376002)(16526019)(107886003)(2616005)(956004)(8936002)(26005)(1076003)(6916009)(316002)(6486002)(186003)(6666004)(2906002)(8676002)(7696005)(86362001)(66556008)(4326008)(36756003)(52116002)(54906003)(66476007)(15650500001)(5660300002)(478600001)(83380400001)(66946007);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: vbSSorH5Qc4TROJncqrhIzqwz+QW5t9J+2bfrMX7xCdDb73pUxv5YL1wP+gruBcRyuR8TVtiM0a4IgJ6R7z4nSsSg12VSs218CwI1y/k06bnVS1pZaX+oavSACRnAXGnqFg485ct5m7ToaGX+z9IYnRT1/SVf11huoxJpE7TEIdwRlPa1oSsiIcncy4DB/gSe4T0YzKOMG03o+kJ/9UHyoE8TIZ7k9X0KRKTdCvBJhaNKotw+A+8vjwuepEyYL188qRBo8JZEvk+MRFP0X6y61wnVLkSpXHrJlfCHfWr5Nb/t5nkbQIAGrA+QueM2fg/bFe40oFT7iY9AWsDGx7VTov/CpTXUKBBv+JeauDL0HaF+oKssw2UWZlOV4FIgE4vOID2m7M9er90wszjGXnVXPiO7ciM2rMn95k9UmMs9cOc8ONGWeSYuPJkKvwIB1mnSu4SNZ6atFymTKq6K2yq5CP6N6PEXjbtvYo+amfKXuDZIIeO4ohRYH7pYaHMgVtY X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5e8201d8-02db-4eb9-a47b-08d80d51efef X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jun 2020 15:21:24.7403 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 011addfc-2c09-450d-8938-e0bbc2dd2376 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: PJdAem5VuW1x4nyA6yQi2Q6DciEGq/MquqFCQGWvSHu8id3U9WsBfZdunxn9WTeS5Hpd/kBmd39GpJaTeniEwA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR06MB5621 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Chung-Hsien Hsu There is a mismatch of tx status flag values between host and firmware. It makes the host mistake the flags and have incorrect behavior of credit returns. So update the flags to sync with the firmware ones. Signed-off-by: Chung-Hsien Hsu Signed-off-by: Chi-hsien Lin --- .../wireless/broadcom/brcm80211/brcmfmac/fwsignal.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c index d7c36af4b566..ce8c6ceafc58 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c @@ -323,6 +323,10 @@ struct brcmf_skbuff_cb { * firmware suppress the packet as device is already in PS mode. * @BRCMF_FWS_TXSTATUS_FW_TOSSED: * firmware tossed the packet. + * @BRCMF_FWS_TXSTATUS_FW_DISCARD_NOACK: + * firmware tossed the packet after retries. + * @BRCMF_FWS_TXSTATUS_FW_SUPPRESS_ACKED: + * firmware wrongly reported suppressed previously, now fixing to acked. * @BRCMF_FWS_TXSTATUS_HOST_TOSSED: * host tossed the packet. */ @@ -331,6 +335,8 @@ enum brcmf_fws_txstatus { BRCMF_FWS_TXSTATUS_CORE_SUPPRESS, BRCMF_FWS_TXSTATUS_FW_PS_SUPPRESS, BRCMF_FWS_TXSTATUS_FW_TOSSED, + BRCMF_FWS_TXSTATUS_FW_DISCARD_NOACK, + BRCMF_FWS_TXSTATUS_FW_SUPPRESS_ACKED, BRCMF_FWS_TXSTATUS_HOST_TOSSED }; @@ -1455,6 +1461,10 @@ brcmf_fws_txs_process(struct brcmf_fws_info *fws, u8 flags, u32 hslot, remove_from_hanger = false; } else if (flags == BRCMF_FWS_TXSTATUS_FW_TOSSED) fws->stats.txs_tossed += compcnt; + else if (flags == BRCMF_FWS_TXSTATUS_FW_DISCARD_NOACK) + fws->stats.txs_discard += compcnt; + else if (flags == BRCMF_FWS_TXSTATUS_FW_SUPPRESS_ACKED) + fws->stats.txs_discard += compcnt; else if (flags == BRCMF_FWS_TXSTATUS_HOST_TOSSED) fws->stats.txs_host_tossed += compcnt; else From patchwork Wed Jun 10 15:21:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chi-Hsien Lin X-Patchwork-Id: 11598105 X-Patchwork-Delegate: kvalo@adurom.com 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 CDB3B92A for ; Wed, 10 Jun 2020 15:21:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B3A532078C for ; Wed, 10 Jun 2020 15:21:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=cypress.com header.i=@cypress.com header.b="PEpiwUtR" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730116AbgFJPVa (ORCPT ); Wed, 10 Jun 2020 11:21:30 -0400 Received: from mail-eopbgr700104.outbound.protection.outlook.com ([40.107.70.104]:36321 "EHLO NAM04-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728446AbgFJPV3 (ORCPT ); Wed, 10 Jun 2020 11:21:29 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KLphncUR1oIiFTnxD7MKDfNNU9Z8PNqYRop/T1tFD9oJuQ5t6KTYYlD6MY49a7DrsKV4PoKrC8JzjqSB1wtnRQyXQA+r2eHAiILI5RSA/frqdLKJYeR4c6u6X1nEkaVEMOJa7RMaVbyaIquMouw7Ro4VfZiuLiNIRZL/WeIvQbqgqkNcVI3R/EYk4WCVG0RmKuCM1i1Q7E9c2ca5K18rW6Obx3UJga7HRZve5FHOOflNOlyFNCS3sfLimZb8eAN+zgVZ07mp2dET/sM48GvRfcYg+Sa7ouDkYuN220UkbNBwQV+SjWfnG+KJ5bzUAAiyMSxJbionG2YnZhr5a3bisA== 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=Q2PRGbJjvoky2oUijMQwOLo+jmU0gf3d4kuO80Uz1uI=; b=el/ER+H8SRQFpR0ns8TJ2K9sh7wzlJmkDv3ilyiv4/iyxB+ZScf3Gmca6BTkaI3y6HOjgKhYIdohJkasIWkluV/L+6kB3rP2AdKe6rATQWo/m6GOx2iaYHH+bHi8VmqBQLrgEYLsVO5PovvsZLp4CyO5wIutvUZkoEr5q6iN8dXBdHq50dIYxUQlcwAYnGHhITi4EAOrkZRkX5XVU6xRZHsNpf41ACePfmir4H8+/ITWfWKzxuW4Y/ggp2Z+4ep39SgYWoCMeCfNWYyyYunNLeeClfk5a7CXQn3IHeHbrWRpWW6lHg+WZbHgLGZE2Qi4ttarku16+dUDZq0Q+s5YpA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cypress.com; dmarc=pass action=none header.from=cypress.com; dkim=pass header.d=cypress.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cypress.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Q2PRGbJjvoky2oUijMQwOLo+jmU0gf3d4kuO80Uz1uI=; b=PEpiwUtRYsbw9xrTgWnFNqcDXUoH7LlKOb7WeZU6Zqa39i9/m8u3W05s/orhmAI2m2JdP6vgjNCuhRvZ6H+ej00nIPLQiGoawd1RNaT6lkKXjFl7ZgqDtem86mHrhdDKkjstzao2DeaVmljbL86eIIgmIzmhnfM7LxHlfta7eZU= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=cypress.com; Received: from BYAPR06MB4901.namprd06.prod.outlook.com (2603:10b6:a03:7a::30) by BYAPR06MB3912.namprd06.prod.outlook.com (2603:10b6:a02:86::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.18; Wed, 10 Jun 2020 15:21:26 +0000 Received: from BYAPR06MB4901.namprd06.prod.outlook.com ([fe80::b972:c25d:c8fc:fc0e]) by BYAPR06MB4901.namprd06.prod.outlook.com ([fe80::b972:c25d:c8fc:fc0e%7]) with mapi id 15.20.3088.018; Wed, 10 Jun 2020 15:21:26 +0000 From: Chi-Hsien Lin To: linux-wireless@vger.kernel.org Cc: brcm80211-dev-list@broadcom.com, brcm80211-dev-list@cypress.com, Arend van Spriel , Franky Lin , Hante Meuleman , Wright Feng , Kalle Valo , Double Lo , Chi-hsien Lin Subject: [PATCH V2 5/6] brcmfmac: fix throughput zero stalls on PM 1 mode due to credit map Date: Wed, 10 Jun 2020 10:21:05 -0500 Message-Id: <20200610152106.175257-6-chi-hsien.lin@cypress.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200610152106.175257-1-chi-hsien.lin@cypress.com> References: <20200610152106.175257-1-chi-hsien.lin@cypress.com> X-ClientProxiedBy: MN2PR08CA0019.namprd08.prod.outlook.com (2603:10b6:208:239::24) To BYAPR06MB4901.namprd06.prod.outlook.com (2603:10b6:a03:7a::30) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from aremote02.aus.cypress.com (12.110.209.245) by MN2PR08CA0019.namprd08.prod.outlook.com (2603:10b6:208:239::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3088.21 via Frontend Transport; Wed, 10 Jun 2020 15:21:25 +0000 X-Mailer: git-send-email 2.25.0 X-Originating-IP: [12.110.209.245] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 4e8925c1-8107-46c8-0faf-08d80d51f137 X-MS-TrafficTypeDiagnostic: BYAPR06MB3912: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-Forefront-PRVS: 0430FA5CB7 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rNTXFVFTjbYV317jHfC8/DU8VUt965gpgHNpSRhrbaM9dNU2mBrLFp/PheMZLzF/7DC5R6dE6hICn06qAbMEXEkH+yuZvgta8073gcMi0mSkkaBD2F9Z/bm9IdbEIlZmQbciE2XY3GGV7DF9lY4S1vJSoDXAslkoookQ9B90TTbs3J+S85Sx9npabXgp5NkbcrhqGDo9guWrmxNqz/czVwiutrkIBBgGDrWwwG2NWMFGVJ3dfWQ8IsJITib1zR/qT7mz3OuT8eaJ1GtjEW19LBgvImpaw7NK0TflRcedsyZHNGZk8dnt9DkuVHspsoft9D4htuRHxYIzkIT9vEyyWg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR06MB4901.namprd06.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(346002)(376002)(366004)(396003)(39860400002)(136003)(6666004)(4326008)(52116002)(316002)(478600001)(1076003)(7696005)(86362001)(83380400001)(54906003)(6916009)(107886003)(186003)(5660300002)(956004)(2906002)(36756003)(26005)(8676002)(66476007)(6486002)(8936002)(66556008)(2616005)(66946007)(16526019);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: x9drNuKzINetoUoPojjb5MkH8+CONyS5ozQUhc/UNwdWj7jHR460x2ETB8RDskcfHCyzQRHvntbag+YVvVfRA8wuCGUhjwnYhenQnoLGyQwVFiKfb54kZdgX74KdbxgGjw4LGpDeYddcv1IcNlFwQK0ijLb08NG+b/YewhADqK/QEJQ7GOPWSoBVpk+kBoZOtGpjqDDiu2VGJo8xirZDlGfTb1NZpUumjCppWyMWu3n8egAhoGgQOEk3eOf174ryktbbYeHT4iLilyDYj0rsCp+8lFPR/M3d6GIF0la8TRf5C/ODeRuecYG6otmJZdbR3OLufBZFPrie6HJf/reBX+XXV+XCdEAKw2Z9fuIZjS7bkjR9KToikXDrLUc2+5drYzPGQxZYaPTplvoGaru20VQo81o6moQ4lnahNl7bkEbXcx2jTC1X8oaV5CsxwcVG6/aAhm2jDVsSf7IPhLkAIuN6Qk7B7Th0oSAK/UZRUWg+I1AfbZaAmxFC68R4KWKB X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4e8925c1-8107-46c8-0faf-08d80d51f137 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jun 2020 15:21:26.7942 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 011addfc-2c09-450d-8938-e0bbc2dd2376 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 9IMVrBpjIwwJDFsfSQK1avg4eXvsJrh4C16G8NPPswokxaY9jd73jKdVMILfjkL6yH9FpIN/Qj3XrmbBVWSL5w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR06MB3912 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Double Lo This patch move the credit map setting to right place to avoid brcmf_fws_return_credits() return without setting the credit map. It fix the thoughput zero stalls issue in softAP mode when STA using PM 1 mode. Signed-off-by: Double Lo Signed-off-by: Chi-hsien Lin --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c index ce8c6ceafc58..ab4526223a93 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c @@ -1193,6 +1193,8 @@ static void brcmf_fws_return_credits(struct brcmf_fws_info *fws, if (!credits) return; + fws->fifo_credit_map |= 1 << fifo; + if (fifo > BRCMF_FWS_FIFO_AC_BK && fifo <= BRCMF_FWS_FIFO_AC_VO) { for (lender_ac = BRCMF_FWS_FIFO_AC_VO; lender_ac >= 0; @@ -1216,7 +1218,6 @@ static void brcmf_fws_return_credits(struct brcmf_fws_info *fws, if (credits) { fws->fifo_credit[fifo] += credits; - fws->fifo_credit_map |= 1 << fifo; } if (fws->fifo_credit[fifo] > fws->init_fifo_credit[fifo]) From patchwork Wed Jun 10 15:21:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chi-Hsien Lin X-Patchwork-Id: 11598109 X-Patchwork-Delegate: kvalo@adurom.com 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 AFE6E90 for ; Wed, 10 Jun 2020 15:21:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8E3652078C for ; Wed, 10 Jun 2020 15:21:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=cypress.com header.i=@cypress.com header.b="FQIRWB6O" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730124AbgFJPVd (ORCPT ); Wed, 10 Jun 2020 11:21:33 -0400 Received: from mail-eopbgr700104.outbound.protection.outlook.com ([40.107.70.104]:36321 "EHLO NAM04-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730106AbgFJPVb (ORCPT ); Wed, 10 Jun 2020 11:21:31 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CvHibWaTyDtC/nmqdZKqcCyr+7aCNmaxm17H3TTNJocRkJsD7fz3QbsZufQl1joXUqiKarvxBv1LIG1r4biY0XUgyho9xSS1rlmg5ayvyj13AnFY6WRO8Mx1+Di6nLlF1dl8T0u/kAD7vjsRF2rqFooyDloSZwSzuQXzn+VSK7ajtJIoP+ZScAdvVateIRsCzdzNhyfNdFIQ6x0Le0FZwLUPJ4oNtqtgXt6xcwdareiNeY0+cU2bQGCRsgzLucAgL5CXERC9VboUiHnKcrLXSiN552bsJoXkXPXTwbX3Wn+H7bS0ZIlGmN/5MXHFpp51bKDAVYtxkpXXH4YGDlGa7w== 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=gnGTJGIUbPjb/3tbGz/NsAiSFlHk0P+ln5+n0bI1Z4o=; b=LpYtMP6zfiVKpnVu/LvlSpsayVezztocf60xLENPf1zjk2UTLKw6zl8UzCsZ8vIykYBrZkouDdvp/UrPnaajA1I0EK3bZ4fiXTtK96KifIaYJMMqnvHNB+TiJr9tF3f2I9xX8c9qjI/YPuFIF943Rq5BFjnWD643NW3HxfWjXV5ys2bAEajVDlB9KRzK6BkBEQcfiEANTQYdzpD5QCdw8jQLBSfzXN80lXsH+SviJ9t+HlTOQeaTm6axwJDdAW0AWdXnI2UurCVQXvFiftCMC0bbvfmhitSil+3lOdhXV1xHNtKU8D88Livv8/2HdsuD6TUqb8VFDK0hzI+NghPsmg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cypress.com; dmarc=pass action=none header.from=cypress.com; dkim=pass header.d=cypress.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cypress.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gnGTJGIUbPjb/3tbGz/NsAiSFlHk0P+ln5+n0bI1Z4o=; b=FQIRWB6OK0MwwR0XVZNZkCZP86iniuB/K6byn7ThkGdhEUtn+UjqU6QQAqj/2n3VPi9h6DE/0lQh2BGh52d6PtRD+AWgKcz7MBbW2dZg6OtLqIRKwafuzX4Nzr0emKgm4mb3rKCPFdkr3JHf4yMqEatGjGkAYBLynvyIRdo7BI0= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=cypress.com; Received: from BYAPR06MB4901.namprd06.prod.outlook.com (2603:10b6:a03:7a::30) by BYAPR06MB3912.namprd06.prod.outlook.com (2603:10b6:a02:86::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.18; Wed, 10 Jun 2020 15:21:29 +0000 Received: from BYAPR06MB4901.namprd06.prod.outlook.com ([fe80::b972:c25d:c8fc:fc0e]) by BYAPR06MB4901.namprd06.prod.outlook.com ([fe80::b972:c25d:c8fc:fc0e%7]) with mapi id 15.20.3088.018; Wed, 10 Jun 2020 15:21:29 +0000 From: Chi-Hsien Lin To: linux-wireless@vger.kernel.org Cc: brcm80211-dev-list@broadcom.com, brcm80211-dev-list@cypress.com, Arend van Spriel , Franky Lin , Hante Meuleman , Wright Feng , Kalle Valo , Joseph Chuang , Chi-Hsien Lin Subject: [PATCH V2 6/6] brcmfmac: initialize the requested dwell time Date: Wed, 10 Jun 2020 10:21:06 -0500 Message-Id: <20200610152106.175257-7-chi-hsien.lin@cypress.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200610152106.175257-1-chi-hsien.lin@cypress.com> References: <20200610152106.175257-1-chi-hsien.lin@cypress.com> X-ClientProxiedBy: MN2PR08CA0019.namprd08.prod.outlook.com (2603:10b6:208:239::24) To BYAPR06MB4901.namprd06.prod.outlook.com (2603:10b6:a03:7a::30) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from aremote02.aus.cypress.com (12.110.209.245) by MN2PR08CA0019.namprd08.prod.outlook.com (2603:10b6:208:239::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3088.21 via Frontend Transport; Wed, 10 Jun 2020 15:21:27 +0000 X-Mailer: git-send-email 2.25.0 X-Originating-IP: [12.110.209.245] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 4eadc90d-3c77-4e10-f1e9-08d80d51f263 X-MS-TrafficTypeDiagnostic: BYAPR06MB3912: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:862; X-Forefront-PRVS: 0430FA5CB7 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: G3bFChFrmjecpL3PlsajNcJBho030E8W2T6GV0lSJNBnso2A1EjPX3sAUBXQvde1/Zv1GOLqOSvmVyWy7FcqWmUx37qv6MpJNdwQqwPoDJwYfrI33KsKKSr9/Qxp19r+bav907l5N4HhthChS39we+28syUrGU4+yq6vWtELcz0tLUbQlngrb06FObJcHRb3wPCtPEk9P7+8GmmLSvxlAgkE1I4WM1gete1o8SHR1KVgzecoMZaBQkDt44QgUQ8hOJd+2lANTp49k5sNRYmpanMhry6cCbUTaH+VwF3CS7ZpaxxgzOIDv9bCJObKtLQO8W1i5U7ed5bDHvPSFiTqQA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR06MB4901.namprd06.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(346002)(376002)(366004)(396003)(39860400002)(136003)(6666004)(4326008)(52116002)(316002)(478600001)(1076003)(7696005)(86362001)(83380400001)(54906003)(6916009)(107886003)(186003)(5660300002)(956004)(2906002)(36756003)(26005)(8676002)(66476007)(6486002)(8936002)(66556008)(2616005)(66946007)(16526019);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: 1OncAySsqHrtrkKfqUFr+58ScBXeAKy/gbmwtjx0wWmXsXOqbFF54H9sxi8lNFbyBC/eoEOpZsNG/g5u3yqsuVIViHdaPNAXbIktwpyEkfKyWlBf/gWivTZMinTczB9x2rSEFxn0u8VKHFxmeSIX9vwGjUz2elHE6E3YGwoSuidQEdTFDxeR5Rzd+PpnhhTYbxGZrckzkSy9ku/oYGfUJqqUBAFNtllD7AVe5VDFnzLLce3oPxGPxoBE80uAGSpORhPY4D5K6PJXMgQiF8cZRcp1HHDILVXbqlVcaI3dh8MljlD9ycsVpL0CZjBkdYiVRe34nCnYW4TusFzzTzk7TYbkyzvO9s27Um7Rzm4AxdHg+oKN8iIZCh0wmp9QYsCTw9XZGu6SoIe80O16WwLm1sY4sMJQ3KtUHAxFmZ6JTTPzotYsbttzPRdOR3z1em/WojQmbGBAr0excCwcvDFg0dq9l6J5WFlWVL6oYHJ+h2wBZQ0kB+yiO43+ReJ6IqhT X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4eadc90d-3c77-4e10-f1e9-08d80d51f263 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jun 2020 15:21:28.9689 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 011addfc-2c09-450d-8938-e0bbc2dd2376 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: fxCENsRbEi7werv5Uys/+aqYVZvlxeG6Zgi/SmgtLWWDFOkCT/IgL5reL5AIfYi0kNNwys8EA+BK5YW9FS4lTA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR06MB3912 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Joseph Chuang Commit 9c29da3f4e7e ("brcmfmac: Fix P2P Group Formation failure via Go-neg method") did not initialize requested_dwell properly, resulting in an always-false dwell time overflow check. Fix it by setting the correct requested_dwell value. Fixes: 4905432b28b7 ("brcmfmac: Fix P2P Group Formation failure via Go-neg method") Signed-off-by: Joseph Chuang Signed-off-by: Chi-Hsien Lin Reported-by: kernel test robot --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 2 +- drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c index a757abd7a599..bddd23240609 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c @@ -5129,7 +5129,7 @@ brcmf_cfg80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, &freq); chan_nr = ieee80211_frequency_to_channel(freq); af_params->channel = cpu_to_le32(chan_nr); - + af_params->dwell_time = cpu_to_le32(params->wait); memcpy(action_frame->data, &buf[DOT11_MGMT_HDR_LEN], le16_to_cpu(action_frame->len)); diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c index d2795dc17c46..debd887e159e 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c @@ -1700,7 +1700,7 @@ static s32 brcmf_p2p_pub_af_tx(struct brcmf_cfg80211_info *cfg, return err; } -static bool brcmf_p2p_check_dwell_overflow(s32 requested_dwell, +static bool brcmf_p2p_check_dwell_overflow(u32 requested_dwell, unsigned long dwell_jiffies) { if ((requested_dwell & CUSTOM_RETRY_MASK) && @@ -1738,8 +1738,7 @@ bool brcmf_p2p_send_action_frame(struct brcmf_cfg80211_info *cfg, unsigned long dwell_jiffies = 0; bool dwell_overflow = false; - s32 requested_dwell = af_params->dwell_time; - + u32 requested_dwell = le32_to_cpu(af_params->dwell_time); action_frame = &af_params->action_frame; action_frame_len = le16_to_cpu(action_frame->len);