From patchwork Fri Apr 26 03:41:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wright Feng X-Patchwork-Id: 10918007 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 1A18092A for ; Fri, 26 Apr 2019 03:41:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 07DA328D07 for ; Fri, 26 Apr 2019 03:41:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EDB2A28D85; Fri, 26 Apr 2019 03:41:50 +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 75B0028D07 for ; Fri, 26 Apr 2019 03:41:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726628AbfDZDlt (ORCPT ); Thu, 25 Apr 2019 23:41:49 -0400 Received: from mail-eopbgr740109.outbound.protection.outlook.com ([40.107.74.109]:6166 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726390AbfDZDlt (ORCPT ); Thu, 25 Apr 2019 23:41:49 -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=S3YYfimd75a8tzj6wjK0SQgPz5FklluwjWse0pghZLE=; b=OfJRUctEk5B7c+xtoz73vwDhwhqUSdEkh1WZrol/eMGfmAZXh54l18zREJYG4uYJwzN7jm/dReSKiHO45hms57EtRGffPWCPf1KlH6mQ/S6oO7tPrDVuHuEDfzllSbmmfKqYrZGsdIA7X7E11afCRWhz+I+4Llwmpga8S/zf8YU= Received: from MN2PR06MB5806.namprd06.prod.outlook.com (20.179.145.207) by MN2PR06MB5934.namprd06.prod.outlook.com (20.179.146.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1835.13; Fri, 26 Apr 2019 03:41:47 +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; Fri, 26 Apr 2019 03:41:47 +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 v2] brcmfmac: set txflow request id from 1 to pktids array size Thread-Topic: [PATCH v2] brcmfmac: set txflow request id from 1 to pktids array size Thread-Index: AQHU++H5OHsVuoN/lEy+93JWyOB45A== Date: Fri, 26 Apr 2019 03:41:46 +0000 Message-ID: <1556250092-3834-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: BYAPR05CA0020.namprd05.prod.outlook.com (2603:10b6:a03:c0::33) 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: db19aa3d-f50d-4584-4ae5-08d6c9f91b8e 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:MN2PR06MB5934; x-ms-traffictypediagnostic: MN2PR06MB5934: x-microsoft-antispam-prvs: x-forefront-prvs: 001968DD50 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(136003)(396003)(39860400002)(376002)(366004)(346002)(189003)(199004)(26005)(68736007)(64756008)(8936002)(316002)(25786009)(6636002)(71190400001)(71200400001)(50226002)(5660300002)(81156014)(66066001)(52116002)(6116002)(99286004)(81166006)(3846002)(110136005)(2201001)(54906003)(86362001)(4326008)(476003)(386003)(73956011)(6512007)(6506007)(2616005)(8676002)(14454004)(44832011)(102836004)(256004)(66446008)(186003)(14444005)(486006)(6486002)(2906002)(478600001)(305945005)(6436002)(72206003)(97736004)(53936002)(66476007)(7736002)(2501003)(36756003)(66946007)(66556008);DIR:OUT;SFP:1102;SCL:1;SRVR:MN2PR06MB5934;H:MN2PR06MB5806.namprd06.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A: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: gnBTejQ6rRK0Z59FPZMfwN9pJioL36MH7QoPbkQomi9WnYjrhlpEB+yxiF16AJJxKsDBoP3HBzHEZXDKKkYiBEMCgkX9RARm5D7UxSzpfy2A4qXil4zXmpnkgtQKFIh5XKDlxg4EcXoaVMZneLRvC2Dn49yWmtTXnmXTN3UCiWUghYLLAyBwMKjkfUAElM/eMlHPLR6P20+TCrWTR6LM+gNq6kq5pa9Q8VP48xvkTjR/brbFcTYOQ+T7ZKHVw29ekqW/gxTGmxAUMYgGPnJzImabLRSz9G6+wQHBDxbjiZo26K1JVguFqmV36APc6neUGGQCeyO/33BiW55kZ3JCsHaOArk7eThyHei6oIhH82NbgNC2nSykwCOTvZGHHW4O3JYH3z0VtZJEO829g6ggTKzpCwfMoZ/boTneaig/N4g= MIME-Version: 1.0 X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-Network-Message-Id: db19aa3d-f50d-4584-4ae5-08d6c9f91b8e X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Apr 2019 03:41:46.9666 (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: MN2PR06MB5934 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 never 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 every time. To be compatible with all firmwares, host should set txflow request id from 1 instead of from 0. Signed-off-by: Wright Feng --- v2: change for not wasting the first entry --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c index d3780ea..9d1f9ff 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c @@ -375,7 +375,7 @@ brcmf_msgbuf_get_pktid(struct device *dev, struct brcmf_msgbuf_pktids *pktids, struct brcmf_msgbuf_pktid *pktid; struct sk_buff *skb; - if (idx >= pktids->array_size) { + if (idx < 0 || idx >= pktids->array_size) { brcmf_err("Invalid packet id %d (max %d)\n", idx, pktids->array_size); return NULL; @@ -747,7 +747,7 @@ static void brcmf_msgbuf_txflow(struct brcmf_msgbuf *msgbuf, u16 flowid) tx_msghdr = (struct msgbuf_tx_msghdr *)ret_ptr; tx_msghdr->msg.msgtype = MSGBUF_TYPE_TX_POST; - tx_msghdr->msg.request_id = cpu_to_le32(pktid); + tx_msghdr->msg.request_id = cpu_to_le32(pktid + 1); tx_msghdr->msg.ifidx = brcmf_flowring_ifidx_get(flow, flowid); tx_msghdr->flags = BRCMF_MSGBUF_PKT_FLAGS_FRAME_802_3; tx_msghdr->flags |= (skb->priority & 0x07) << @@ -884,7 +884,7 @@ brcmf_msgbuf_process_txstatus(struct brcmf_msgbuf *msgbuf, void *buf) u16 flowid; tx_status = (struct msgbuf_tx_status *)buf; - idx = le32_to_cpu(tx_status->msg.request_id); + idx = le32_to_cpu(tx_status->msg.request_id) - 1; flowid = le16_to_cpu(tx_status->compl_hdr.flow_ring_id); flowid -= BRCMF_H2D_MSGRING_FLOWRING_IDSTART; skb = brcmf_msgbuf_get_pktid(msgbuf->drvr->bus_if->dev,