From patchwork Thu Apr 25 08:04:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wright Feng X-Patchwork-Id: 10916229 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1C16F1515 for ; Thu, 25 Apr 2019 08:05:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 073B728742 for ; Thu, 25 Apr 2019 08:05:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 04E01289D1; Thu, 25 Apr 2019 08:05:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A04E22857D for ; Thu, 25 Apr 2019 08:05:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387417AbfDYIE7 (ORCPT ); Thu, 25 Apr 2019 04:04:59 -0400 Received: from mail-eopbgr820091.outbound.protection.outlook.com ([40.107.82.91]:8683 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726184AbfDYIE7 (ORCPT ); Thu, 25 Apr 2019 04:04:59 -0400 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=r6ANJAAhGGm9GsoHzZJbB5gF9waVsTI6VPt6VpTJih4=; b=P4risVl/3jYHleB0m8Z2MckL7Ku8P7rlaYsqHNk4LVDrwoA6d4K+SbwBcIp/v0MtQ2c/hCwikJq/vPHO//IYHXoSB9vrbN5DMSxhPrTo4Ye8ACyhnkK1vkezwB5TQy44hgsWx+wonNoKoXsfxD54fYsfz8XyFFt4G9qtmlsLbIA= Received: from MN2PR06MB5806.namprd06.prod.outlook.com (20.179.145.207) by MN2PR06MB6016.namprd06.prod.outlook.com (20.179.145.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1813.16; Thu, 25 Apr 2019 08:04:56 +0000 Received: from MN2PR06MB5806.namprd06.prod.outlook.com ([fe80::1ca6:d3b:6b7a:65cb]) by MN2PR06MB5806.namprd06.prod.outlook.com ([fe80::1ca6:d3b:6b7a:65cb%5]) with mapi id 15.20.1813.017; Thu, 25 Apr 2019 08:04:56 +0000 From: Wright Feng To: "arend.vanspriel@broadcom.com" , "franky.lin@broadcom.com" , "hante.meuleman@broadcom.com" , "kvalo@codeaurora.org" , Chi-Hsien Lin CC: Wright Feng , "linux-wireless@vger.kernel.org" , "brcm80211-dev-list.pdl@broadcom.com" Subject: [PATCH] brcmfmac: allocate msgbuf pktid from 1 to pktids array size Thread-Topic: [PATCH] brcmfmac: allocate msgbuf pktid from 1 to pktids array size Thread-Index: AQHU+z2RzToH3FeQwUSmmepORWhyJQ== Date: Thu, 25 Apr 2019 08:04:56 +0000 Message-ID: <1556179487-147593-1-git-send-email-wright.feng@cypress.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: SN4PR0501CA0148.namprd05.prod.outlook.com (2603:10b6:803:2c::26) To MN2PR06MB5806.namprd06.prod.outlook.com (2603:10b6:208:127::15) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Wright.Feng@cypress.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.1.0 x-originating-ip: [12.110.209.245] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 7221a00d-15f0-47f1-2825-08d6c954b434 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020);SRVR:MN2PR06MB6016; x-ms-traffictypediagnostic: MN2PR06MB6016: x-microsoft-antispam-prvs: x-forefront-prvs: 0018A2705B x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(136003)(346002)(396003)(376002)(39860400002)(366004)(199004)(189003)(14454004)(486006)(6512007)(2906002)(2501003)(476003)(6486002)(44832011)(4326008)(14444005)(478600001)(66946007)(6116002)(256004)(71190400001)(71200400001)(72206003)(6506007)(6636002)(2616005)(3846002)(66556008)(386003)(66446008)(64756008)(66476007)(66066001)(68736007)(54906003)(52116002)(2201001)(110136005)(36756003)(86362001)(99286004)(7736002)(305945005)(5660300002)(97736004)(50226002)(102836004)(81156014)(53936002)(8676002)(25786009)(26005)(6436002)(8936002)(186003)(73956011)(316002)(81166006);DIR:OUT;SFP:1102;SCL:1;SRVR:MN2PR06MB6016;H:MN2PR06MB5806.namprd06.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: cypress.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 3iGMcjIp/Fl9Vw6z4Cp8k3FEYJa9Prhs+mm5TXxeEK6qNWngxBMiVgZxBnxCy3BvcOGwYLFrabprI0uwb2ctkzaN+u1O4QTLaVhVX8nORXHia9fJvblMjSoy0hT3cElGnqrxlPgM1Xj1huHh3mgvRQA4eXgOPFWe/0xiHEAP9C1L2LcG1vPTtCWDh8xurjxNHGk/GLzEqs8xi2GZuW3CGyYUstIyXUSAWqmX8D6Vp0b5lkvUYGnRdM5azqIGjOF58LS0oQOBEOSGWQBjpCnHJVzdM099xb2Y8BS2JDAbsx2bAGlZ8JCBf8Cxd2R+BfnyPFkCROJIP3NHaE17PVNlSY15mP4yCY1JK3FaJqSEEo9A6L22+LOKwfwJ1zPcM4wktDGu2vox2DNTrMSB0pADE/+6wmgvqDPaJ/rhnlNti04= MIME-Version: 1.0 X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7221a00d-15f0-47f1-2825-08d6c954b434 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Apr 2019 08:04:56.1209 (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-Transport-CrossTenantHeadersStamped: MN2PR06MB6016 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Some PCIE firmwares drop txstatus if pktid is 0 and make packet held in host side and not be released. If that packet type is 802.1x, the pend_8021x_cnt value will be always greater than 0 and show "Timed out waiting for no pending 802.1x packets" error message when sending key to dongle. To be compatible with all firmwares, host should allocate msgbuf pktid from 1 instead of from 0. Signed-off-by: Wright Feng --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c index d3780ea..b2fab3c 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c @@ -348,7 +348,7 @@ brcmf_msgbuf_alloc_pktid(struct device *dev, do { (*idx)++; if (*idx == pktids->array_size) - *idx = 0; + *idx = 1; if (array[*idx].allocated.counter == 0) if (atomic_cmpxchg(&array[*idx].allocated, 0, 1) == 0) break;