From patchwork Tue Jun 9 10:59:08 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: 11595253 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 02B02618 for ; Tue, 9 Jun 2020 10:59:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D726D207C3 for ; Tue, 9 Jun 2020 10:59:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=cypress.com header.i=@cypress.com header.b="SfdOo/ej" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728553AbgFIK7d (ORCPT ); Tue, 9 Jun 2020 06:59:33 -0400 Received: from mail-dm6nam10on2129.outbound.protection.outlook.com ([40.107.93.129]:26720 "EHLO NAM10-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728446AbgFIK7b (ORCPT ); Tue, 9 Jun 2020 06:59:31 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Id35zqMf2V3Vxyv0bt20ipsPeew1WhcSibJbC9pbm59T5LnneevUrIq0L9KjxtlpvvmGL24SGN8Q825wQkXWUrPplr6Y9RvvDb3B0nhryNe5b1kM5Gp/HADNSHxUriU7lLnlxY9VyRTJIfN0ZhkqzC4jrDIj3M1tqXxPmM0j97t0ccnU5CSPySQ9BkFDKJvYlq5V0Dg+Ts5Yi/GStrb9y1Y1Dw2MG7fuHGKy5ttSqtgqOOe/RpScNV0njsWRQvUf0KbWM++F30WTSBBwTbuf6QcF4YuCg48z8IaKBXNqbp8lD6CTCQJ1pG72PEEHxKnOU26cvZ5fJHLPTNQ/ghs90Q== 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=BPIgjrureciik3rRlIVRBmesC5dVU64zDvqneTVE5FbpeH4f8D1q30HnWJ7iikJZE6T4nwKSfnaYm9+dfKJCfWbmdsExACugKcXy1Fzt5jAT8FsI9MFyFJqG6lEelqDxSo/FkgWyl78jKkmsRQvyjA3lSr2kDhf645blv8PfGo9XSFj0dLVmR3sa7DfqJgkzm+//dhnMqlo6IMTa/ZKOmt6mce6SN6r9+mVlU+g0wifP861c3+wHtkH0acfzsfpY+qZaRnIoO7z+XtYFVaqytzM0b/y3rRYb5tH7psulJYWr+7Y9JJTGUztYj52DcNDZyRDZiGukQEe08/8W2e9LNA== 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=SfdOo/ejbW0mFhDAE/40fg+T9jnvAympTivIES5C7PVhN6WI6tjVDvhh7Oo0sJc6JdgWgOreVLUew4BVpeGmocn6B+3LHBo6HkXlx7ZglkYlSjU0WqsFrCS234pcJSpGDH/UEKJaR4TLsCNfFCIMz+RqLkm+MvOUx5fRsFKqhxM= 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 BYAPR06MB5064.namprd06.prod.outlook.com (2603:10b6:a03:19::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.18; Tue, 9 Jun 2020 10:59:25 +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; Tue, 9 Jun 2020 10:59:25 +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 1/6] brcmfmac: allow credit borrowing for all access categories Date: Tue, 9 Jun 2020 05:59:08 -0500 Message-Id: <20200609105913.163239-2-chi-hsien.lin@cypress.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200609105913.163239-1-chi-hsien.lin@cypress.com> References: <20200609105913.163239-1-chi-hsien.lin@cypress.com> X-ClientProxiedBy: MN2PR19CA0068.namprd19.prod.outlook.com (2603:10b6:208:19b::45) 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 MN2PR19CA0068.namprd19.prod.outlook.com (2603:10b6:208:19b::45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.18 via Frontend Transport; Tue, 9 Jun 2020 10:59:23 +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: 5ffebc05-edca-43c9-7dd1-08d80c642c4e X-MS-TrafficTypeDiagnostic: BYAPR06MB5064: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-Forefront-PRVS: 042957ACD7 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wO43NuKFsZ3uAEzTcjUEUYe9iTot04l5bxSjDw2lx0jA/QqVBGMA2B0Q81pUM5kB7KTJdXIwtSeW3r82la5gXFJN37Umc+KLHRWR93EqYsgiMKnniV51UYgfcPksK+qS3usVngS8ha980ATIYAVP8YK0J9k0yiuJJUCU4yVfYbaI8/mzLo/KPA0M9mfovCnHjB4PcKZNOCLJzBrK63ATv/nREvxoBTKvsygCJMNV+guSrz5yF8k5wlGy6HN0JEjs4kUsQoV+KEw/0A+qq58tGxdFJfuzktwHSD28d0aJqsZ5C8ftjPxeSL2W+4pfdnp6/svrabDQsHLcrZmfSNXgpQ== 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:(136003)(376002)(346002)(396003)(39860400002)(366004)(36756003)(316002)(2616005)(52116002)(66946007)(8936002)(956004)(83380400001)(16526019)(4326008)(2906002)(186003)(5660300002)(6916009)(7696005)(8676002)(66556008)(107886003)(478600001)(1076003)(26005)(86362001)(6486002)(54906003)(6666004)(66476007);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: RDF9Paa384Pl6W10rUsmGL5ZHgIHvcl9F/R/1mi+ITkaqSOgWFI+81YdB7FJfocx7ISGxB3HL/1jIlM3qn7kvDq4Hd2luMCLriY4gVLUDtY/3W+NaMcW7HE1+MLBdd/BSZAqirOU4JZD7DN+74JpVEtHqS52Dk44N+V1yCvl8HwUvPpIh/tNzQ6V8rdFBG3/J1n4UHhkGWVe3d0vywOJBCYmAOVPmEBMx7XgwV4o8liFW18ng4gIUJE1Nb/T8RuhIyFEcsi2hDN4K7MjbL3QSs8XLS1WqOWlafKb5RfUvZRT+KF7qCgxfxwMpw8BY7AzkfqH9J9E+GPNQtrCgrJv80H9SiSaEKm6gKYhfkb1g5ND3u2qxIZ6UdN6yvL9HUqV241b3I1zMUzW2mI2hApe5pOk0M4KMP2cel8NbDCCoFVh7bFZLG2610DmoLuY+dM0YWmcVwokGZ3t3XSB3+8xdtUO3+QYYq06oyc8SkUgX0/tEnbnAHa6jZ+RYMtvSVNr X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5ffebc05-edca-43c9-7dd1-08d80c642c4e X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2020 10:59:25.6077 (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: +10Wz+DUwweIIuoRVVUGuuLzyw9B0DMvd9CnkHcEOyzA6tuXbU8XsRsLMnCau7MBzR/HcduSOTbbTo+Ngeb6XA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR06MB5064 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 Tue Jun 9 10:59:09 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: 11595255 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 292831391 for ; Tue, 9 Jun 2020 10:59:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0C1252078D for ; Tue, 9 Jun 2020 10:59:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=cypress.com header.i=@cypress.com header.b="LYKGmHm7" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728639AbgFIK7f (ORCPT ); Tue, 9 Jun 2020 06:59:35 -0400 Received: from mail-dm6nam10on2129.outbound.protection.outlook.com ([40.107.93.129]:26720 "EHLO NAM10-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726463AbgFIK7e (ORCPT ); Tue, 9 Jun 2020 06:59:34 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DywDNjU67naqKAnlLQvDFFzphm8pG1dtMVobvT4Wzc45HFN6n8GanJhMPaOCvVwQjavvkdbGlLBY7M+lWWmcffW1sz4tnfyRW2qBc9jXaSWsRixvCMuGBu3u+1wPZJbtLcmV2Z+DBS6BhmvxzfMctL0V3gGouA99t1qPf3AtM6cTQvOXaA7bk5uLmb12o2yJ507BCx++C39SM3RWWwK3wYuhVYGWiMY+98O08R6O2VMZyzOE4Xz7wG79L9Lc3G/pTfTvO5L6axgD+GwoZcHxasw4mT+j0NcYUiPOfrBLCjY+f6z4eHW46y2E+TeUuApGaqJjL9Eilm5heM+V6rMPmQ== 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=M502k5uFDQ3fRYrjLRKpCj9X4+FIL98VBYaAm9Rr4vy91sFIOXXCyqjbXididq6V1eAp/dbXBi4UtlHL4+KXaDU+KZHs6yVYam+ZSBb3U99dRvS/YSoeSX9M5WHFLnL/ozBtD1f7afb/zs6rW8qmBTisI2zEm3Ilae/ZBmTtd4QVVN90SXpKUis0OcdfQgVMAaUiOz/7UsNGMAPTSJQtwGl3T7oeXPU5Y3HANsf0PJPbnU3nNI4WRvuSEJSZICtDD94ETuHO349t5pcT28yZststB7E7fGL7hoeG/xXLodyxnAaO9cRvsJtsQx5bxZKgS8yzVLo87CPFpSJZkLO+cg== 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=LYKGmHm7+kvnXfLOjJ0ViyVwbL9wX71j4AaAoEetlJTh6xUN4D9HQUYVdt5sis1VXsb3O5ju5xeandskCbBqFUUjbxv7dvw5Es91XtE1U6xkQI6/lz3u0SorR89H69dtZgv6e+x9mpcVqvixLgkvAlSeBb1hESJPoJ8FQsD4nP0= 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 BYAPR06MB5064.namprd06.prod.outlook.com (2603:10b6:a03:19::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.18; Tue, 9 Jun 2020 10:59:27 +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; Tue, 9 Jun 2020 10:59:27 +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 2/6] brcmfmac: increase message buffer size for control packets Date: Tue, 9 Jun 2020 05:59:09 -0500 Message-Id: <20200609105913.163239-3-chi-hsien.lin@cypress.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200609105913.163239-1-chi-hsien.lin@cypress.com> References: <20200609105913.163239-1-chi-hsien.lin@cypress.com> X-ClientProxiedBy: MN2PR19CA0068.namprd19.prod.outlook.com (2603:10b6:208:19b::45) 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 MN2PR19CA0068.namprd19.prod.outlook.com (2603:10b6:208:19b::45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.18 via Frontend Transport; Tue, 9 Jun 2020 10:59: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: f0afcf06-8575-41e6-df69-08d80c642d77 X-MS-TrafficTypeDiagnostic: BYAPR06MB5064: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-Forefront-PRVS: 042957ACD7 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ndH/7FDrgHn+bPGHh9KMte66qmeS4sIglvLhRN+h20pEdJ7HYpFJW08/nEjCFENoxP9P2Si3eV8bN9Q0Ng8j4TbR3g3KoMZ7CxoyQFlztRCgQBIM3xSkpSSuUY7858E4L9Y6HloBNctMMwsLdIGEoq1kl5ddek0kU5azXBgP3M8F+pPrsffodLYm33K2jElu4KqCdQVh9iktkWk6leUaEwxKH7gBEAPneOUExcixFjk4C7GIKBjqJih/JKl8EgHfuiongAZ3O9rt2fNZRvdz4J41jLP5Ghqsz3lm2kjNgyg23BiOqbBIupS4WKn2BR/9 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:(136003)(376002)(346002)(396003)(39860400002)(366004)(36756003)(316002)(2616005)(52116002)(66946007)(8936002)(956004)(83380400001)(16526019)(4326008)(2906002)(186003)(5660300002)(6916009)(7696005)(8676002)(66556008)(107886003)(15650500001)(478600001)(1076003)(26005)(86362001)(6486002)(54906003)(6666004)(66476007);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: TAtBAwCxryo8SQnwUIdriIhCNMgsjxKWdjj3cATxaa+Z82fXJMC3P3LtQPA/i6YGMY36z22ODP/HN7RpOO17RRYdskv//rjxzjNTPrMNQLwlMn33sbzetdci9gZGYHMDb+qsbtEnXguFtGQmAlDMeyEsU85tCWwsIw6G2DB7gXdq6UnWpEiE/5IzPqrrsX8ttqksiPFmswdzprmDN2oF/QpPWCwGUGQhULuxQgQTyvOOmTFF2FM9OLjzCSg9VKzXiRo9Tg32vEnX9o04jxCAeItZ4UK1zgMi/vnUvinFlZ+jElUZdZxGYNbf+cCOVE8gdQsezPB3tRWEG1Zo+5PSkWB6Sxfgrtnx3jH0FoVW45SuF2ljECCa9Jw4NbFwD4NObiDMYShRg8hAmCDff60cnKsNLkISx3QEdSOIlTUT9HiMl86R64guOEjh7r05SyaJgkzws0oLCZ9DngOim/C8UbozqpajdWa/n2pi2QHpZ/8WYyTXq1rfhKlsLX1tmGDi X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-Network-Message-Id: f0afcf06-8575-41e6-df69-08d80c642d77 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2020 10:59:27.5756 (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: 5XI7/0S2HRAt7yUpH+oM2ljK+to1JvrL0Q1fkUA+Lt9GKMg5UZSlrFYJ6C1ejJKt6mIG5ssaWeLWHUBaTV+6dg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR06MB5064 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 Tue Jun 9 10:59:10 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: 11595257 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 4649A618 for ; Tue, 9 Jun 2020 10:59:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 26EDA207C3 for ; Tue, 9 Jun 2020 10:59:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=cypress.com header.i=@cypress.com header.b="hQCBMI/4" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728753AbgFIK7i (ORCPT ); Tue, 9 Jun 2020 06:59:38 -0400 Received: from mail-dm6nam10on2129.outbound.protection.outlook.com ([40.107.93.129]:26720 "EHLO NAM10-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728135AbgFIK7h (ORCPT ); Tue, 9 Jun 2020 06:59:37 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Z3++X2PSkjZEmXakfX2lnTFgxKX1dphOXaC6XzpmA8wy3ghmWHTLv95Zj45kb2fwn73NztfXdQVRtytbUQtNhIqId2BJuvgd8M0c7wegY/O4mcv9th0ERuUd/Atvzq9SQuuBqX9KrynGZL3+wS19D3GGp0DfhNdOLXO5dSqsIHy7K7y5I0iunnxrOUfDUAfNnHiEG1o8QE+rz0wgk5ABDwNV3Ra6Y8EsQAxVrx1nhVMOldYHybPmGrf6Q0yWlmGu6z8d5AwjypHGhQdlIt5ZJdOsRxIEz/c2qq+wVW9Vebpca0bEoY7tMyHwaFWQIdgCpXFBlG6QvApMupXzNeMjMw== 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=P8lxT92krDgpNqty38l6O5QguIUYJoY405Qj7PQ/Wh8=; b=S30pOrHtHAIirkjNqjTqtl+YhlVkp5F3qPMc1EBFdq7w4EhGxHow49+Le0U7VsYgQ2aL5wYCaAXscwc4Br27sOd9KcpI5ezT0g4hYbt9fuJg17Z28/1Wur9wrmj3xq+dDi/RoiSLw7+ot3bCpj6FZWJPbK421/0uYrPNQmCCYwkR6BRYtfwIwfVqUi/e1khjWSWRFSe6H8qOmFOn0qu8O+Rg6j89XfC3+CI7RqvSG6U9cOyq8gbLWdJ7PzudzwAlrutcjFtTXhg/5Sd6Jxv1ISNCKVsKjzLW9lFlTqTClS2lDeAOxK+U7KkmTL7IB7Mx6SBZbBrRo4yzeQfl7y0Mjw== 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=P8lxT92krDgpNqty38l6O5QguIUYJoY405Qj7PQ/Wh8=; b=hQCBMI/4Tk9oe49/N15QvWVNwG1BGNg15BX68hXyW4RjZUTngHda5MamjlyWLFmz/mpYFyYaaDDqI4o51Xa1K2I2Jug23LEJ3mc9qgKTYa8vr0rrQoX0zvcrU7U58FtmAMv2YHxy6fzLmxn/Zj3huL1D5nIdi8/4qDaxTRdPVIA= 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 BYAPR06MB5064.namprd06.prod.outlook.com (2603:10b6:a03:19::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.18; Tue, 9 Jun 2020 10:59:30 +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; Tue, 9 Jun 2020 10:59:30 +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 3/6] brcmfmac: reserve 2 credits for host tx control path Date: Tue, 9 Jun 2020 05:59:10 -0500 Message-Id: <20200609105913.163239-4-chi-hsien.lin@cypress.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200609105913.163239-1-chi-hsien.lin@cypress.com> References: <20200609105913.163239-1-chi-hsien.lin@cypress.com> X-ClientProxiedBy: MN2PR19CA0068.namprd19.prod.outlook.com (2603:10b6:208:19b::45) 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 MN2PR19CA0068.namprd19.prod.outlook.com (2603:10b6:208:19b::45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.18 via Frontend Transport; Tue, 9 Jun 2020 10:59: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: aba03b57-f4f2-4c6f-0c78-08d80c642ea7 X-MS-TrafficTypeDiagnostic: BYAPR06MB5064: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-Forefront-PRVS: 042957ACD7 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vFCTAmliTyEF6IMPDfOo1wS/QmZfQ4u5IAoAqPGnYqMzjaHluA23XOJHwSebIqeifxI69SWsHN7vh/6zl628ut9nhiR4kYCzpxsz8md7hPxl76vfHXPAPioru9QBmKR6k9Qe9cEptUKv02gmEsMBizqbuDWsrLO+j2aMClyWVPno72ejVGC2wh29Zj4nO6ehKo4XEI9qnaixUohVMRhESlCGNW6OaO+DP1k0fLMnPIyTQh+ybMhbrLNo5z+gZQoder21joCusEutbQfDa/7uJrC9VD1QowwCIWQECzM1In6uKsa6Qux+ASQCJaK+47Uh 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:(136003)(376002)(346002)(396003)(39860400002)(366004)(36756003)(316002)(2616005)(52116002)(66946007)(8936002)(956004)(83380400001)(16526019)(4326008)(2906002)(186003)(5660300002)(6916009)(7696005)(8676002)(66556008)(107886003)(478600001)(1076003)(26005)(86362001)(6486002)(54906003)(6666004)(66476007);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: j7LmCslkGZv8yKdXiYOZNBv+IiyfIUPfBUiJv+OyDG2FZKEnEcYBU+rX16S81ad3VNxQyMIRtQtvQA+y4zHdJpyezl3JSAz9SIzpm7+n6tRtYbCJbbFhDARG9ENgtX4Daa6/Lze1ctevJ062uN9TiF+kh/Z3zySuHw/gfIj+y8O/sVDGXAKTRuBvhOLqP0geKKEm6rrn7y3gHUJXLC4PDU39srvq7tOHaVSuWhvgf/aeppmbZWQA0mMOZobd1UNxIv3ObXPaSK08kwLBYZSKMTCGPPv8HZiKOYyvDbLC/LG2dK/FOspZlp1cJL7KhfyQDQY5BFBAjplnOlm7IhCV6lbz8VK4GJOD7/0fOR3N3FLuzAYjWdmgC3u8Fj0QYcXaNgZwUvqVj9s7+1tnkRAuQRANjUZGKe/6Dazcxpl4YAF9nmAzKanng9rMckIh+5neEyDJ3dCDn4KPICR+FZv7Z4J39Oa+dKH9TL7RS4u+nCaLi4vLgQVpI5RIGmbQ2/Ay X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-Network-Message-Id: aba03b57-f4f2-4c6f-0c78-08d80c642ea7 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2020 10:59:30.1592 (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: q5cymjAyeFcUteflDIP3ZxiSJKtFsJXzOxRaVVgzJt1dUXlPv4FfCOWoTk+o2RIRLK1h9QgQ2CTrCPHQIALBBg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR06MB5064 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 --- .../wireless/broadcom/brcm80211/brcmfmac/sdio.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c index ce6f15284277..163bb7f41e44 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; @@ -647,6 +649,14 @@ 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) +{ + /* Reserve TXCTL_CREDITS credits for txctl */ + return (u8)(bus->tx_max - bus->tx_seq) > TXCTL_CREDITS && + ((u8)(bus->tx_max - bus->tx_seq) & 0x80) == 0; +} + +/* To check if there's window offered */ +static bool txctl_ok(struct brcmf_sdio *bus) { return (u8)(bus->tx_max - bus->tx_seq) != 0 && ((u8)(bus->tx_max - bus->tx_seq) & 0x80) == 0; @@ -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 Tue Jun 9 10:59:11 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: 11595259 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 2175A618 for ; Tue, 9 Jun 2020 10:59:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 04648207C3 for ; Tue, 9 Jun 2020 10:59:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=cypress.com header.i=@cypress.com header.b="iRsovIsy" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728774AbgFIK7l (ORCPT ); Tue, 9 Jun 2020 06:59:41 -0400 Received: from mail-dm6nam10on2129.outbound.protection.outlook.com ([40.107.93.129]:26720 "EHLO NAM10-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726463AbgFIK7j (ORCPT ); Tue, 9 Jun 2020 06:59:39 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=O9KZXagqo8VPAMNGvivATSAyPtBZqPydd99iAmYzsbEgPbrq2h+VzCeZyLUmKTvwzVq2+rwt7CHWj6ez5aLYVuv1YEGG+q1KzXFTq6lpnUIkMwWQ+t5FNX2hrjvCgZxGdSBVbBdKZt8ouX4mAlTb+BG9+fA/cAJcHyagzSY8HJjItK4jYkYdWTjIsaSUqqJF9kGfDq50I78PRnjsQ6V77JOX6qMSubT0VCmV/FLmntMjuD8MRAkunvrTVDEHI/wyRhJEP5JIXeyd0R/fI1TiWFRaY/c1Su3T7s5640+hp5xyAO/1RYCbal7lIr6spnM9ejZx0HI1dQzgwvktlePq8Q== 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=TfKxnKxJ4qbtGpFyGDC1e7rY9uRPkK2v0aZst7AJSF/MH3UMlFMGzXeZLd2nXbiU0QIRxywXwlaWd6B2MSYzBl+Io4efoK+ow0qB7snydrvTili0oKfEvbzymXYKUs6lcEPqSmMxCV+QqxSc9Qb6nj1no5UHe13aoOUkUaucQFvt7VCUJxJE+GHUXmv76QGVcOZo22Kk3vIamvSx4I93f1kZ/zrmuHkSSA2bypEmrZ3brR4yFMtZmd+hdLV8ocwhHmZBU9JjVWPxBjD58JQVU8kq/clrwb3Fa3UwczRREvhShjiZt7UWyTZWWHlWWDF1sSIQyaA9Q7OAkWJelHHgIA== 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=iRsovIsyJ14s9XUIDxTSEZMcNKqMCASQEuHlDx6v/v3xpEmk6dp+untn2OBZgIrNoL1JtKij1p6KAcV3ekT1U9HgC8ZbSAZxCj3ad8+hqe/SMgaMXCxcdE6Npl+YyEfGu9dhsqLoqMEfLirjl3pAt+YhmAwdIvguOQMWxQ0xWmA= 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 BYAPR06MB5064.namprd06.prod.outlook.com (2603:10b6:a03:19::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.18; Tue, 9 Jun 2020 10:59:32 +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; Tue, 9 Jun 2020 10:59:32 +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 4/6] brcmfmac: update tx status flags to sync with firmware Date: Tue, 9 Jun 2020 05:59:11 -0500 Message-Id: <20200609105913.163239-5-chi-hsien.lin@cypress.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200609105913.163239-1-chi-hsien.lin@cypress.com> References: <20200609105913.163239-1-chi-hsien.lin@cypress.com> X-ClientProxiedBy: MN2PR19CA0068.namprd19.prod.outlook.com (2603:10b6:208:19b::45) 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 MN2PR19CA0068.namprd19.prod.outlook.com (2603:10b6:208:19b::45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.18 via Frontend Transport; Tue, 9 Jun 2020 10:59:30 +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: 7532d243-0238-49e8-81bb-08d80c643030 X-MS-TrafficTypeDiagnostic: BYAPR06MB5064: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-Forefront-PRVS: 042957ACD7 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: W4nWINNKWJ8jUvhtONUrSXMP030miRcWElj27ZVLTno1aeyusESIxkPn5/FLGqO9xsqn5D+UFUlCA8rY5imBf2E4LZMEhS+9dtJnwIuW1poMnOP2sKARuSvLk5pRroMzkLFyCvc3PIQ53KO4Bms8Jx4wHF+dpGkXqwciTgSfkM1/xxQ7tSRvq1NthMP041ycjO6hlShJTbzfNU1InakXXK1ZF/aL4rk0+oqC3iuPH85ozpJYBOD0djm9HqApL7sKQlilicNkAjtHQ6+haqJFKtQxA8DR4+KFSu3W+vk6jf6/bSOX7eczp9KBHbS1itXU1PbakHq+W5iqrIJdOGwcEA== 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:(136003)(376002)(346002)(396003)(39860400002)(366004)(36756003)(316002)(2616005)(52116002)(66946007)(8936002)(956004)(83380400001)(16526019)(4326008)(2906002)(186003)(5660300002)(6916009)(7696005)(8676002)(66556008)(107886003)(15650500001)(478600001)(1076003)(26005)(86362001)(6486002)(54906003)(6666004)(66476007);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: IgmoSwgC8fEpFGyt3WDg8xkG0Em3Ocxt1txFRr3uooP2+RWFC5aDTGfYULFveWz1UsjxpJSgqmHRfm2svzUe686BUEJpreLNH9aV3t9FpDCIONYZb/BsT3HG5J0ULClI7e4/gFOnOYEba5ixNLV6d5y8MzdGgsa3YRPdYhT4CEQA3YVVZl3tEDNvCuGx6UvBltk41rPlB4h0wLKaLCcbGAoc6Hme0WA4d1zCxYM24WhU9TWyVw2k5Vatjify1qdzZIQKiZx3GTrW9qetwfTkH5dSalCW+SfcLeuReOcU5W+wwGzpI+9me+CXjwgux3qL+vEjFrEn8Ky00qFIgTGD6QjMXD12P0hTjfUWVwyB4Sdu9DfN7DDpBv5DSEBjaX+p7BYaR0moOadRHm23LxL67RacfcG7cXHTnucQA71jvRh+xCi+GQClcNUBf1x+ndYIdZQkYVK2dPrq+rz/ERESf4pp4ci0GaupIru9Ot8HKHbiPiW2sqiaW4MRjdMFsCkD X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7532d243-0238-49e8-81bb-08d80c643030 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2020 10:59:32.7108 (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: tokVNd5EjcP5nXiL5bjRvGX/WLszFd3f1L46J9ihBuCgAZNHwv49Ll21kkrsNaqtRXlGyAFK6VpIG6xVvip9zg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR06MB5064 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 Tue Jun 9 10:59:12 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: 11595261 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 071DF1391 for ; Tue, 9 Jun 2020 10:59:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DD711207C3 for ; Tue, 9 Jun 2020 10:59:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=cypress.com header.i=@cypress.com header.b="Hr7RK8QF" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728388AbgFIK7p (ORCPT ); Tue, 9 Jun 2020 06:59:45 -0400 Received: from mail-dm6nam10on2129.outbound.protection.outlook.com ([40.107.93.129]:26720 "EHLO NAM10-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728135AbgFIK7m (ORCPT ); Tue, 9 Jun 2020 06:59:42 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B5b0/JS+mJM/HnHQP06YAoVus+3EfJFB8/41d40swZBIy7XpEpfmA3oocDt/qF7AuOFr7gbh6+FxICsc91wjjz0OuIY+DiSvShv20GOAPCnLwhiyppCb9ll2/Zv+72vI2Yd29VxLdECpwdvIvNNae7ECUhifvKFY5E2MkBsmdXhYAraQPCDw6dzys7A7D17Eq2ICJcGFAlzElslsl+Ugp88GAUnIAA3lMWl7cV28qQD9rasoYWbq/GOnQudsxrysVhvpv6L1e07IF40x+wGCbhCwiJZHjkJ5hGtwQmPQ+AUCuzxB/WHCtaWuOkxflzhuGHmuxO9tYBDo1b+LVSQxFA== 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=HkbDCxCNHifCbGYSNI0oP/LKRgfqIJHOBgZH/FDuEgciYGLT3sgsUVR0WZnb8CM9zKoiJptvjPvoxcRghZB4yWEKwHh0TVY9Vz1jn7hp+Hz4AVZlxWVoRKwhGiH+W4Sq9YbrATYmdxzszjHjsoqfrHVV+d7yzQJqYuoL0/int+5z34Ic69ETywE4Jcn3xH6c+kTPzFwQWI50H4GZDNLOOTfYJT82+DsrK2PIq2TGY/jguX8Byu4ZRX8Fn2coNHdPNxlcK1aG7SrVeeVIdN7PFfcFEu9i4DqwYnoRze0EQq5lPfDgVUEb1S2QRPvmfPZQB7GxLhdDBmvS436vplOlAQ== 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=Hr7RK8QFPHnOodYr/V7Bn/Ta3T74HOX0qMAU1DaQcYQAiIjYzS54azOfvIrXxIJ23t9CfRgIyk0aRyGjI/uOBOpR9D9UhE8EuEaUh+TamY599h7SdeOhoFyF7GquslY7TeNAjslTVjlBoH0hOgAw/y/zoqkr6C/P0RmIO/SiFD8= 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 BYAPR06MB5064.namprd06.prod.outlook.com (2603:10b6:a03:19::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.18; Tue, 9 Jun 2020 10:59:35 +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; Tue, 9 Jun 2020 10:59:35 +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 5/6] brcmfmac: fix throughput zero stalls on PM 1 mode due to credit map Date: Tue, 9 Jun 2020 05:59:12 -0500 Message-Id: <20200609105913.163239-6-chi-hsien.lin@cypress.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200609105913.163239-1-chi-hsien.lin@cypress.com> References: <20200609105913.163239-1-chi-hsien.lin@cypress.com> X-ClientProxiedBy: MN2PR19CA0068.namprd19.prod.outlook.com (2603:10b6:208:19b::45) 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 MN2PR19CA0068.namprd19.prod.outlook.com (2603:10b6:208:19b::45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.18 via Frontend Transport; Tue, 9 Jun 2020 10:59:32 +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: 05d736d2-2818-49d5-7aaf-08d80c6431a2 X-MS-TrafficTypeDiagnostic: BYAPR06MB5064: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-Forefront-PRVS: 042957ACD7 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ytKX4RWqSqL5GExdi63G4e3z+guKXVjsWYT8fya0Ier+LepVoL9zYJmxk5L2qyT6yx+4lkWfPpx99f8NPrWXyYy2zgvhTLxCLITwTKXhew0lbApim70xxeobPGAcsoH5EDSYXp2jomWpxJxRql3K65JE34QB/Dcm1Co4+ICRy/7gB9bhMbH41nfIH5frPkGWImGQCajigB/6SUEcNgSSUXslYJJfz3/kkWwb1PW6v5UIlecKuySprJnqqNWJZzb9xf1DQtu79a2RuIIgsN0KAQTSZPAsIsjM+beUk9TsE0l9ADiFKP8wkIOlhj/5FlxbBQOoqhBZ4GvMdXdUYStpgw== 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:(136003)(376002)(346002)(396003)(39860400002)(366004)(36756003)(316002)(2616005)(52116002)(66946007)(8936002)(956004)(83380400001)(16526019)(4326008)(2906002)(186003)(5660300002)(6916009)(7696005)(8676002)(66556008)(107886003)(478600001)(1076003)(26005)(86362001)(6486002)(54906003)(6666004)(66476007);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: gIlOTzOkrg8hXwl6CwLW7pQ6lZEugxut9M2Y2sFo91oqg8kKq7siXIFtcCXKh71Z3OIiPJaqUNxNReR4nhX6tBUgqUorT1WEGFKATN/35oMDs87zFw4veIi6qOlO2mMirRe1KVoRa0DepvBdFTDRlLQSu8X+2tzXuLXlqbGSI8B23QD31uf1ytMS6KkvzanPnf+pAO6u0Ef2UDnJojNE08Lx0cFgAASlOj0wtys1gQhmqC917c72BxlUyfxftrnOXnx2EugDeDh41UFIsovI8RAJr5R3AJoJ47Dtb5iQUorW1w6LqNBi+Zjxf/8gSwIneos+A3LKs//E8+JeazpIWcV9geh9QagqaIdi13CqMfb2x0sQ9jRdqsFDZkPwq4cSEpJVAddb1jgP+LWL0epFrhjUC334bUo2FdPQPCOL6TW/rqJFGeI7OWM3de9ygk9zcL6ddh2IXtbRxUGn+frgC05VWPp5PrUlQstYuUyCyae7qc3JRcoBjMpYm5W8eB/0 X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-Network-Message-Id: 05d736d2-2818-49d5-7aaf-08d80c6431a2 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2020 10:59:35.0115 (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: QhNQAStl5tyL0HRZ5cLmczE8svna0N5/rOOZQn/G8oT3MhsVMkfBhq/Y6/qdFVRpzffWWxqIEXH1DSJcf/5BUg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR06MB5064 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 Tue Jun 9 10:59:13 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: 11595263 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 D1E021391 for ; Tue, 9 Jun 2020 10:59:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AAF7B207C3 for ; Tue, 9 Jun 2020 10:59:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=cypress.com header.i=@cypress.com header.b="P3u5jTNJ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728739AbgFIK7s (ORCPT ); Tue, 9 Jun 2020 06:59:48 -0400 Received: from mail-dm6nam10on2129.outbound.protection.outlook.com ([40.107.93.129]:26720 "EHLO NAM10-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726463AbgFIK7r (ORCPT ); Tue, 9 Jun 2020 06:59:47 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y8UfpPll2iQaeEyXRJluGQsYb0E9vvNUOMQE92djcDLk6WByusZXtyeJ9xcRcFrLfDcPW33pPcOpr+ozl9OWmqf3bD1g7DRQyTn5HwV7y53W+6fzYH7H47g7+K6FVWM+SCDkOblUxqj4Oe0khOT9ad/J4dGN7K8EnpkZxlEK9x9xkVaLhIYdsisR7wjVvb6btp3OHhqYvNelKbD/exvvUuxPOhCJDxU37vmrZ32c8qafZdHKA59b0oZj5UX3epppY2k/d1xm21j3INmR+HD4Cw2wcvPczdmUwjgmgVomJeY7DPRi3ksVCZGoECyA/P3w/6g7G75sOFn/EPPw6U8EYw== 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=h97ds22DjvqfM4FgHLDFR6NAtY/fCHzrVpidpAJ27LjdSM9ECmxsAH8QCN93wexZBvbY7kdrtQo60hifFJC7u0GJpU5CV5L+vqXIqVqn9t+OgUWSO1H3vPIMGDgKbB4aZ1dGtI3kLRM/HlWQFV7zLg8iYcDxqhl27iT+XomXejcFBYKffNpk2tweQ7qkRMvDSBhz7C/pcM+ERZMH9MNrCjZXBjKabLnzTZcQ2LsMkbBiyQUVPfDjis4T2pobX49G0rcICg3oDTdFLyTW+epzcw9CndrM11hbYmVjsqvmAaoENXX6ZHcdDlVG0KdGFa/Ch0fVcXQbycEZZqHZoosQEA== 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=P3u5jTNJ92SClilowQrDqW6+ugo10El2baKstMktMJZUxFAVw/SzxYgqbPaaN3zhGuSvJA6d4wL/QRRWJwUyfoS0/1aPpEys2VAqPRb0fct+uDjFgEbB+KMlVWDmCppTX9bo+qP0XzFow1mBBuDM3iDzxss0wW0jkYNosY3YxQI= 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 BYAPR06MB5064.namprd06.prod.outlook.com (2603:10b6:a03:19::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.18; Tue, 9 Jun 2020 10:59:37 +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; Tue, 9 Jun 2020 10:59:37 +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 6/6] brcmfmac: initialize the requested dwell time Date: Tue, 9 Jun 2020 05:59:13 -0500 Message-Id: <20200609105913.163239-7-chi-hsien.lin@cypress.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200609105913.163239-1-chi-hsien.lin@cypress.com> References: <20200609105913.163239-1-chi-hsien.lin@cypress.com> X-ClientProxiedBy: MN2PR19CA0068.namprd19.prod.outlook.com (2603:10b6:208:19b::45) 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 MN2PR19CA0068.namprd19.prod.outlook.com (2603:10b6:208:19b::45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.18 via Frontend Transport; Tue, 9 Jun 2020 10:59:35 +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: 9b778b7b-7d3d-478b-050e-08d80c643334 X-MS-TrafficTypeDiagnostic: BYAPR06MB5064: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:862; X-Forefront-PRVS: 042957ACD7 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fzv+4IKNUc/You4LQdepRiz1dakjzjmMzWRRVrT1CeTOEmK56KMW62c1erOoOArb+WQxfL6x8phnerLfaWquRU1mQL+A9DNa+qTvAMg4H1ks1lZdi9lx/mR2WX3h9NCFJgZBR7y1SDlDYzKYpreD+Xq9VecZjalY/lyrMYsEKb3XoiV2fCHWj/C2sAiE1n0oSNg94AcpmE8sJY6+kT3zRszCX7Vp0rDutci/9MbwIRLz6WG2mpwy6G23Ph8WwyiRTLzoT5zTXPYv54w+aDo02j/6xUUQ5WAbhnnXmlvg0cWvYdKRnXE3GDm/rmNUw75RIa7ElegDJCYv0gyDmZLP+g== 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:(136003)(376002)(346002)(396003)(39860400002)(366004)(36756003)(316002)(2616005)(52116002)(66946007)(8936002)(956004)(83380400001)(16526019)(4326008)(2906002)(186003)(5660300002)(6916009)(7696005)(8676002)(66556008)(107886003)(478600001)(1076003)(26005)(86362001)(6486002)(54906003)(6666004)(66476007);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: /9qkeiWsMZPTeyRzgFmb/yoY4GCnagartyKu5uHtCGU4pkAENRguKXMGfefdJDE1pJXDOzTu8YmTQuLYtMqw0j5HM87w4I2NK3Z38KvLmqIQFCcc1YwLEHkol8DQG/8gBzOasIJfHgIcAutY7LnMXYu6yyaZwS1frjDcRmPYxAadcTe0HvLxSRaYOXtBsqyxPT02ONy+kea7hw3K/9P/qMwG80FsANFBRimroNj/j8JrB+rLCd2NyvsCQvawSbutj1VzagcQmcskC7v1Xg7Zf87vcRJ10QaDAn19C7MrI2sXzUnFV7aXUXUcdE8Y2bdelBFBh9Qlu/MmAM2CmgmnlDis/P2cD5kCO5yCQFq9XFC+EkmHpjYP3qjGzBpoH23UTtgu5OWbVdMXensgI+WO+6caX5zTkwDMgIeiJPddY4k6bF8qVCH+htxQSnC/vqpd1I4yerR4R1oMad+YDi4KhugSCUGwZdxt0oOO56Pj2ixv2jbwLMeaz8Z4v77r61id X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9b778b7b-7d3d-478b-050e-08d80c643334 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2020 10:59:37.2372 (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: A8IP7dg04Whp+RVdBlLBoc7AuUZUN89r/TZL6pT0DIKib3mUHIqm6/Wna5+8p2X9bNk69sMZmjVhn5LAnWJzwA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR06MB5064 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 --- 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);