From patchwork Fri May 29 03:49:34 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: 11577647 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 F3C1160D for ; Fri, 29 May 2020 03:49:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D813F207D3 for ; Fri, 29 May 2020 03:49:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=cypress.com header.i=@cypress.com header.b="Xba3LBhO" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388242AbgE2Dtx (ORCPT ); Thu, 28 May 2020 23:49:53 -0400 Received: from mail-dm6nam10on2119.outbound.protection.outlook.com ([40.107.93.119]:15968 "EHLO NAM10-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388127AbgE2Dtw (ORCPT ); Thu, 28 May 2020 23:49:52 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lHXE9JjcwnLO3dwPhFXmgu4v8WGiSjtcx06GNQp7pWEIicS/JC9sMdpzpRcc4EA8ypOQPZ9W6BMUR/D9tNmTiJRxUuQAjoG6LRsm9bmnlMOPcwE8zebJ9EHzZsMbwzoyPR7//QI5yKTHB8H0KI6hc/YCnMdZNTWlo565I5VlDKhArcsFoQWIkNKTuBjSERkr8GEm8uRwnyBiyP383ta6GulKnzoS+NOMmrvoDKG6dor3lWXW/DanySt0oCQ/DDA+uYWc+I2TDoTSm+7V8CJCkFzgVSw2tKCTjzXatfEKLJpyqjO5R/3hPKjhO0lWXCo/rS+zsIyTo34B6JF/knlLWw== 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=oT34NRo2N50gmbYudBerLBgw9vPCOSzmhxtvhmqQwPw=; b=AgOor8VDr2Sk8VZZZjEhEunwf1YxF3jK0iIG496GfKZ1PXKJvXEcOkB4UKopg43VZKT4WJF9+9Xh0FeZDPdCTaxTsOG6U1qLW1DokEnuRiI89fLcI9NgICQdmbP0+2iDvt9h2qK4h+G9Mx1w7VA/wRwjfmICUG4M0R4LFdTRU1aIkuJ9wX7r/5LarTJ1oWlITcQspClhXFflJ2SC0SLZrBCcq3BF4XNIOK98wfy2o5N8XJKiVVmMMxO9z5xQ50pkPhliciZDsSD1cd+y94DjbgalFdjl/cF/t+w/IuhTDUjZt1skDQMis5wTXzhDZ2QCxtlh+pizgLKpHj3xSsEgtQ== 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=oT34NRo2N50gmbYudBerLBgw9vPCOSzmhxtvhmqQwPw=; b=Xba3LBhOO2x1sKm27JLlQdh8QNxtMvhfoWh0MEqCcWKVzdpoGp2QF0gxgFBSgxl7iOfTViS5eM0S8lxQlpDijgcNFm/RKKm98NmQ/nuccwugVSusiRHUwloPQoBAg3lKJWTcOOHB5DC90SKDNJKpDkgkuFmNdzz5FQxwK3dzSos= 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 BYAPR06MB4839.namprd06.prod.outlook.com (2603:10b6:a03:77::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.25; Fri, 29 May 2020 03:49:47 +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.3045.018; Fri, 29 May 2020 03:49:47 +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 , Chi-hsien Lin Subject: [PATCH V2 1/5] brcmfmac: set F2 blocksize for 4373 Date: Thu, 28 May 2020 22:49:34 -0500 Message-Id: <20200529034938.124533-2-chi-hsien.lin@cypress.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200529034938.124533-1-chi-hsien.lin@cypress.com> References: <20200529034938.124533-1-chi-hsien.lin@cypress.com> X-ClientProxiedBy: BYAPR06CA0072.namprd06.prod.outlook.com (2603:10b6:a03:14b::49) 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 BYAPR06CA0072.namprd06.prod.outlook.com (2603:10b6:a03:14b::49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.18 via Frontend Transport; Fri, 29 May 2020 03:49:46 +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: 3fe1ba95-3388-40fc-ff94-08d8038354ac X-MS-TrafficTypeDiagnostic: BYAPR06MB4839: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5236; X-Forefront-PRVS: 04180B6720 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SYs5Z+VXBlJU6xgdqB1NDdb+ypwNGMDHPbPerzKDSbfy8F/0zBsONvHcCXm/00/hk9VLvzRznO/0V+dFuExsxO3nutB9eUeEBHNvcmSSSLB+O0zeARX3P3fsyaw3s2FbMoJU6cwuyMOawnj6m9d0yvnjES/bDaCrJELIMgXTMW4Wa+8oWG9Kv2QmnoHY4yn8e+PdWaQ6Luyzl5zRZJDzblEzlB23o/7X4jLF2oi4VKsIXFrsPsMiGI3eBniWtu12uN8DKSyN7Bp+aO/oW/1SsjDEj9LfLDJ35GjStw33w2q1ak+wOs0UvgAziNXPOlDn 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)(136003)(366004)(376002)(396003)(39860400002)(66476007)(2906002)(66946007)(52116002)(16526019)(7696005)(26005)(186003)(36756003)(83380400001)(5660300002)(478600001)(6916009)(2616005)(956004)(66556008)(8676002)(6486002)(4326008)(107886003)(86362001)(54906003)(316002)(1076003)(8936002)(6666004);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: OxBWMcxZTdGkp8Dhec6VecMGK7wkkocBK+GpE3EGA0o+Beo7ikjKezUmccDofvmUIQnpyLTtsKiiGWpJRCY8HHfP3hdzTG7cf8Kcq95Fsn2SFLObceuOa6sDkAj2b4/eH46dJFGYn4zA7UlnumcTGCXI6u2fUZUMCPP1yjhn384JVrewDeYd4wZmL6Fd38Ds1ZIgFhwpt9DVex2ISraUQturD/zcgVHVR8c5ENRVi7c42vAUsJc6zA43//8cwALPab8Z/bnttG3csljTilF48sGEa0YvgJRoH2SdnaEHzw34rxoHIvVCI51IGM1GuJVhk9CtiRaGw2bWTkrLw5UHvTrtszIbrmvR59JNrp0GMN3hKCjSLU2mg0OWVLw1c0WOz8NdCNJZ2mOYl/4QjcoO44oEjNvlT9LwwKzqZzA05Z5loRZHstXNNJ4WqROjfhA+FMvxbpVd+nvrny5G5v7oKQpsDkFwHCvIXaBoKMWIGThV0Ewuy7fQ/0i8AsXTL22g X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3fe1ba95-3388-40fc-ff94-08d8038354ac X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 May 2020 03:49:47.3425 (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: nUiHEGC8KdwNhrXIto9WdhMWnKBy99CbMrGr8RDnH66+Jq2mdT7xWSXh2p7hu5iEltlRSHBGZaEaBWMTIsCA6g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR06MB4839 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Wright Feng Set F2 blocksize to 256 bytes for 4373. It fixes DMA error while having UDP bi-directional traffic. Also use a defined F1 MesBusyCtrl value. Signed-off-by: Wright Feng Signed-off-by: Chi-hsien Lin --- .../wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 14 +++++++++++++- .../wireless/broadcom/brcm80211/brcmfmac/sdio.c | 4 ++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c index 22a17ae09e94..bb3196cba683 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c @@ -43,6 +43,7 @@ #define SDIO_FUNC1_BLOCKSIZE 64 #define SDIO_FUNC2_BLOCKSIZE 512 +#define SDIO_4373_FUNC2_BLOCKSIZE 256 #define SDIO_4359_FUNC2_BLOCKSIZE 256 /* Maximum milliseconds to wait for F2 to come up */ #define SDIO_WAIT_F2RDY 3000 @@ -910,13 +911,24 @@ static int brcmf_sdiod_probe(struct brcmf_sdio_dev *sdiodev) sdio_release_host(sdiodev->func1); goto out; } - if (sdiodev->func2->device == SDIO_DEVICE_ID_BROADCOM_4359) + switch (sdiodev->func2->device) { + case SDIO_DEVICE_ID_CYPRESS_4373: + f2_blksz = SDIO_4373_FUNC2_BLOCKSIZE; + break; + case SDIO_DEVICE_ID_BROADCOM_4359: f2_blksz = SDIO_4359_FUNC2_BLOCKSIZE; + break; + default: + break; + } + ret = sdio_set_block_size(sdiodev->func2, f2_blksz); if (ret) { brcmf_err("Failed to set F2 blocksize\n"); sdio_release_host(sdiodev->func1); goto out; + } else { + brcmf_dbg(SDIO, "set F2 blocksize to %d\n", f2_blksz); } /* increase F2 timeout */ diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c index ce6f15284277..dce22cd2279d 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c @@ -41,6 +41,7 @@ /* watermark expressed in number of words */ #define DEFAULT_F2_WATERMARK 0x8 #define CY_4373_F2_WATERMARK 0x40 +#define CY_4373_F1_MESBUSYCTRL (CY_4373_F2_WATERMARK | SBSDIO_MESBUSYCTRL_ENAB) #define CY_43012_F2_WATERMARK 0x60 #define CY_4359_F2_WATERMARK 0x40 #define CY_4359_F1_MESBUSYCTRL (CY_4359_F2_WATERMARK | SBSDIO_MESBUSYCTRL_ENAB) @@ -4195,8 +4196,7 @@ static void brcmf_sdio_firmware_callback(struct device *dev, int err, brcmf_sdiod_writeb(sdiod, SBSDIO_DEVICE_CTL, devctl, &err); brcmf_sdiod_writeb(sdiod, SBSDIO_FUNC1_MESBUSYCTRL, - CY_4373_F2_WATERMARK | - SBSDIO_MESBUSYCTRL_ENAB, &err); + CY_4373_F1_MESBUSYCTRL, &err); break; case SDIO_DEVICE_ID_CYPRESS_43012: brcmf_dbg(INFO, "set F2 watermark to 0x%x*4 bytes\n", From patchwork Fri May 29 03:49:35 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: 11577649 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 22A1160D for ; Fri, 29 May 2020 03:49:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 04AC2207D3 for ; Fri, 29 May 2020 03:49:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=cypress.com header.i=@cypress.com header.b="p06NRDS4" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388320AbgE2Dt5 (ORCPT ); Thu, 28 May 2020 23:49:57 -0400 Received: from mail-dm6nam10on2119.outbound.protection.outlook.com ([40.107.93.119]:15968 "EHLO NAM10-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388037AbgE2Dty (ORCPT ); Thu, 28 May 2020 23:49:54 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BZgcBLOu777B5ZpaoAZ+8fITxY5Y/TMlMYbTRYNAWlA212uemzSjWN+TGLWPRCkEhydXNHvHKqsEbF/77Hn86E+TrepxPd1XuKQ/aN7d+vhZId7os0SgoZ5J+xL/0AmzT/dA/IBpoW0OuyLhl81kyTUqc/IRy5pdy+hZe83KoMvYI6KB+vc1ouOh4gFLDRO/PrLu5isvnybi7kq77J5Y8sPpVh4QJpZ3FXeOtlvHy9G9WC7zYqJIW/gE14YXJYaC8bMJVwbP2VqQz6PzMUj5Yq/VsmdxiYTdbImmsB/3OajpcV6MSh7g5fOKqVMOu9+k9gYE2nzm6RGtyyawy1MWQA== 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=hM/2HTVcpY6qXHj38f6p/B2+3120kRfxmM2StYpFC/U=; b=TvxiaQ6M2Ya9waXk84CnAjrPD88rd5ip0rByB++d2Fs3+rSKnywo+GqGcLAbdxIXKuqg7mo3mDcMjU3cCNV/gRZ+NtN0IKPAshfRq991KuingVVpuUvRK9gB3wKFBt5QmRpwgRo/rdASotjzkznnd9qAdgSqkbmdqyGiKmR5iZ8aaHdd2DFwNf+QZi+zgZnaf9CjQI3QLi/VQ4KVHgDxo2ItYIkWbFaj51UvjNArO7mB2N7PJeNKs1/wQ1KZ5+HyPYepJHTKHnxuJ6gHyVWzk2Bd9lDBzFbfqJDye06WME7RKvaivRaaQXykDWPIXGrZ2yQEaI7RBFS7Bk0NNKpOOQ== 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=hM/2HTVcpY6qXHj38f6p/B2+3120kRfxmM2StYpFC/U=; b=p06NRDS4RmnkitY0P+3PfKcl8HHkvQMuCVgARvwx43mkjTsqwob6T/G33HgX+kD+WN9tSnThZ/QjbQMdM4wU3LVX9J7Pv43p+FxBiiL1H9sHQCPLA9d6BUyit/7I6EtV7fEZ4FK5SG9XLfG2xdCodwrf1TKxdrmbzOm7ZOU9R8U= 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 BYAPR06MB4839.namprd06.prod.outlook.com (2603:10b6:a03:77::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.25; Fri, 29 May 2020 03:49:48 +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.3045.018; Fri, 29 May 2020 03:49:48 +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 2/5] brcmfmac: fix 4339 CRC error under SDIO 3.0 SDR104 mode Date: Thu, 28 May 2020 22:49:35 -0500 Message-Id: <20200529034938.124533-3-chi-hsien.lin@cypress.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200529034938.124533-1-chi-hsien.lin@cypress.com> References: <20200529034938.124533-1-chi-hsien.lin@cypress.com> X-ClientProxiedBy: BYAPR06CA0072.namprd06.prod.outlook.com (2603:10b6:a03:14b::49) 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 BYAPR06CA0072.namprd06.prod.outlook.com (2603:10b6:a03:14b::49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.18 via Frontend Transport; Fri, 29 May 2020 03:49:47 +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: e44e6d86-832b-4012-7593-08d80383555b X-MS-TrafficTypeDiagnostic: BYAPR06MB4839: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-Forefront-PRVS: 04180B6720 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rvWlnQ7uBCNLY7p3OWq7KdOwDm+rIM4I95TuqnDC7yRHfBm1eCJc4xY5Y6fUtbWcOW9fgtnlrqtvMrAMMn3cmcoEN5rEzi2whys/q+sH46tt5rBRE29tO36g/zHuV1oGDTKN5zwKHp/x/fTCJsm8WVLIUXseFdihjuVMUn4uHFwwsxhYQqVEIae+Ngv7dQOL76X2FcfYsBCfxJF5eNwbv2TYyffqFv/KD1m2i70UqAE1hyyf8jVKcDPLTq2Ui0nmElWcQIa+juUbaKmQPeHGzBBsoR2eQKu3NO9xy1lKtl28oPvlSh2fwWbRBX5zI4S1ZYyLAgpu5r8PPbwvVI9sCg== 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)(136003)(366004)(376002)(396003)(39860400002)(66476007)(2906002)(66946007)(52116002)(16526019)(7696005)(26005)(186003)(36756003)(83380400001)(5660300002)(478600001)(6916009)(2616005)(956004)(66556008)(8676002)(6486002)(4326008)(107886003)(86362001)(54906003)(316002)(1076003)(8936002)(6666004);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: nfUm5Gl1GtC7kPLdoQqPpDz8+v7WAy54wR50rUduqnl5uiZQiCfc2AssoDjizxMb1h5fYrtTNrkDNa2irwNv2BRbLMkzYw2uHcImdv7bptVtHH3VwpDUBkVN7IZgmU/c2YtTONIEmrCFKeoANcNKs7Ga2alH7k7HlDajWY0/lGosdu/aVyIkH0rxBIJ47xSLp0NANi+SWGIx1Op/8j6DHOeegcg2pxdPk3+gxrHkE4qOYCubEPtfjMpMa1WECAHD8+UBFyYXxt+L4oA9EZe5fedkXDV2LoHylH2V+Elh4yFgGS25y9rCdJskf2W0pliJmDCaZyadj4T7sriUmzipKCP5eqw0bo9wrxnhzQAgE6yh9OoSll7OCYT6XqyLaRw9N7VbiYW09vGoqjlmkN8bbBpw1FqVRRVR3nbWZnnOeKDA+E6ba9ReAjZu+0smfNmX8jonUB1k5fwADCmU54msN28LDNCJv4/KX/vEUS19FfHpc4D2/wQ7i2vYZB/Vjrrx X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-Network-Message-Id: e44e6d86-832b-4012-7593-08d80383555b X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 May 2020 03:49:48.4989 (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: +o+5PGX4j3ZwGKGIcAt+6nz0OZtPP6vY+q5O304m2GV/PJuhIWmxR+8abVA06h/1PSKlHfFD4tX4hlwcYDUK4g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR06MB4839 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Double Lo This patch fixes 4339 CRC error while running Tput test with suspend/resume test script. The continuous failure messages before system crash: brcmfmac: brcmf_sdiod_sglist_rw: CMD53 sg block read failed -84 brcmfmac: brcmf_sdio_rxglom: glom read of 25600 bytes failed: -5 brcmfmac: brcmf_sdio_rxfail: abort command, terminate frame brcmfmac: brcmf_sdiod_sglist_rw: CMD53 sg block read failed -84 brcmfmac: brcmf_sdio_rxglom: glom read of 24576 bytes failed: -5 brcmfmac: brcmf_sdio_rxfail: abort command, terminate frame Signed-off-by: Double Lo Signed-off-by: Chi-hsien Lin --- .../wireless/broadcom/brcm80211/brcmfmac/sdio.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c index dce22cd2279d..491b635e72b1 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c @@ -43,6 +43,10 @@ #define CY_4373_F2_WATERMARK 0x40 #define CY_4373_F1_MESBUSYCTRL (CY_4373_F2_WATERMARK | SBSDIO_MESBUSYCTRL_ENAB) #define CY_43012_F2_WATERMARK 0x60 +#define CY_4339_F2_WATERMARK 48 +#define CY_4339_MES_WATERMARK 80 +#define CY_4339_MESBUSYCTRL (CY_4339_MES_WATERMARK | \ + SBSDIO_MESBUSYCTRL_ENAB) #define CY_4359_F2_WATERMARK 0x40 #define CY_4359_F1_MESBUSYCTRL (CY_4359_F2_WATERMARK | SBSDIO_MESBUSYCTRL_ENAB) @@ -4209,6 +4213,19 @@ static void brcmf_sdio_firmware_callback(struct device *dev, int err, brcmf_sdiod_writeb(sdiod, SBSDIO_DEVICE_CTL, devctl, &err); break; + case SDIO_DEVICE_ID_BROADCOM_4339: + brcmf_dbg(INFO, "set F2 watermark to 0x%x*4 bytes for 4339\n", + CY_4339_F2_WATERMARK); + brcmf_sdiod_writeb(sdiod, SBSDIO_WATERMARK, + CY_4339_F2_WATERMARK, &err); + devctl = brcmf_sdiod_readb(sdiod, SBSDIO_DEVICE_CTL, + &err); + devctl |= SBSDIO_DEVCTL_F2WM_ENAB; + brcmf_sdiod_writeb(sdiod, SBSDIO_DEVICE_CTL, devctl, + &err); + brcmf_sdiod_writeb(sdiod, SBSDIO_FUNC1_MESBUSYCTRL, + CY_4339_MESBUSYCTRL, &err); + break; case SDIO_DEVICE_ID_BROADCOM_4359: brcmf_dbg(INFO, "set F2 watermark to 0x%x*4 bytes\n", CY_4359_F2_WATERMARK); From patchwork Fri May 29 03:49:36 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: 11577651 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 E0A0E60D for ; Fri, 29 May 2020 03:49:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C3AEA207D3 for ; Fri, 29 May 2020 03:49:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=cypress.com header.i=@cypress.com header.b="N/lf4CH3" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388404AbgE2Dt6 (ORCPT ); Thu, 28 May 2020 23:49:58 -0400 Received: from mail-dm6nam10on2119.outbound.protection.outlook.com ([40.107.93.119]:15968 "EHLO NAM10-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388127AbgE2Dt4 (ORCPT ); Thu, 28 May 2020 23:49:56 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CMkJxReHZORecoyHGtS/mohj3/Gy/QiIV0gk38FXxuGkKUPBUhtUJOGPsRl/ddNPKZrud+JZ6NpPr79D4cAISA687gvAsN9fPFAp/mO/2CM/hxipBw256diptquAGTo4qH+0ALKpQPNOpFACQw/brDwHraFqLVGPtaa1K5WCuDMiX1dBBmzu8ly6Bx2q5itAz/Sq0EQF1DUALx/9TuxsWv/wM3N0NWp9X9+SApBHwmdOzU9ibMQ4brVw3a7rJIWoVGk/qIYkK/wKS1JeRlciYtgtMZNAKAxK7XBGxIWheBsbmcbM77t6uFLrPB/EIJK+JwfcKnTO2n8njT8R4AwNzQ== 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=J0Dr/aBVqPha4YOTea4HTXrrfH9IfDVbbjn9gs0s1xQ=; b=KqTdwCK6XeSlRj15S+I04eujved1qa2MB+sqMRG0uUw7I2HkQNz/FqIVIvZWhtPUXvr8yAefut3rlUNGpyY0TGTZceMO3e56FIA04+3sjHWoAo6u97gac2xiRxr31YnXOIH4spY648vIvu30HC2tlzwuE5ogIn4FWPNenVfe4ZrdK+VCRqHiDnbTqyQxRWTKfUpkI/1D9SMKIV8Wy/q4zK4vN1f0FHa3PlBjtE/wtYTXSObOAATANp/39UiX3otto5Q6CyTPMBf1GHCkBwdIMxGwaO5GK/a7Ep3V+Ke8GJmLko0i6Qy8zTrt43AjUAIvsj9wguT3iBRzmlsa9WawXg== 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=J0Dr/aBVqPha4YOTea4HTXrrfH9IfDVbbjn9gs0s1xQ=; b=N/lf4CH3df6wuYS1TYxXlXnTgmksO+vDJWNyeu+fjqWU7XJpZdIFKKn2b80bXJRaqHh6kcREijS48f6w+Nu3vT60H02juAAZmKO4oFCTqbqLI2VoaiyjUJvcngFUDLNmMfcqL3XQZMgQxtNNkiFuP1vmIVnbDlBHc0HtCk10c0M= 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 BYAPR06MB4839.namprd06.prod.outlook.com (2603:10b6:a03:77::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.25; Fri, 29 May 2020 03:49:49 +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.3045.018; Fri, 29 May 2020 03:49:49 +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 , Frank Kao , Chi-Hsien Lin Subject: [PATCH V2 3/5] brcmfmac: set F2 blocksize and watermark for 4354/4356 SDIO Date: Thu, 28 May 2020 22:49:36 -0500 Message-Id: <20200529034938.124533-4-chi-hsien.lin@cypress.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200529034938.124533-1-chi-hsien.lin@cypress.com> References: <20200529034938.124533-1-chi-hsien.lin@cypress.com> X-ClientProxiedBy: BYAPR06CA0072.namprd06.prod.outlook.com (2603:10b6:a03:14b::49) 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 BYAPR06CA0072.namprd06.prod.outlook.com (2603:10b6:a03:14b::49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.18 via Frontend Transport; Fri, 29 May 2020 03:49:48 +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: 0aa4ba31-e10f-46ad-0eca-08d803835603 X-MS-TrafficTypeDiagnostic: BYAPR06MB4839: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-Forefront-PRVS: 04180B6720 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Mbyj+h7aOZubM94tjx2E9+yqe/q3UUefAkBA79ZN73nU/RfNhH7cduQCN7MW50f1f1qgU8b/4H2kF38ouGeOo0KAOMkUHHKN8ObtzBsU9W/BQxEXNMvyN/PI5+MuJC1/DNHaHiYGAUAQYIJhghSS9Ty37vv+gxX5prPUfUlz38CLoOiAeYE3Y/Pg8aM40jlc8mE7HJYRKZ94O1memFyMOOLrjFqIzcsdxQUGpXbjQSYr+eHyYNTR6fffZkHHel/RPMtUa9VwovoV45JtOcK6/Vrz2LlrkB27MNMLnVs4bC1mLTgOByPuY07fgSJyiHsxsX8yZEFXnAKSmyvrfno/uw== 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)(136003)(366004)(376002)(396003)(39860400002)(66476007)(2906002)(66946007)(52116002)(16526019)(7696005)(26005)(186003)(36756003)(83380400001)(5660300002)(478600001)(6916009)(2616005)(956004)(66556008)(8676002)(6486002)(4326008)(107886003)(86362001)(54906003)(316002)(1076003)(8936002)(6666004);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: li8n84mPIvai7GGgZPkoKZ9L+dkso4A+B7E/eS+ITjP7IaZ2QfU/LRMbtxTMunzTn3JVkk9DOSFCkLiacRMCSqC5oFsEpUixqquBj8q7g9pL8w7ESsEmpg60C5FFc0w+SZN5enKqjpnZv7VHAtbb111IsOlEz/QdHBh805TRg/pV+RQWClpzK2nQv9rA98NXiO7tjJcEdI/u1PmatMA+zxUHELE9IlljMMAHZnZ6MlbPtAig62TtHhoABu9dRvchtHydZQAp8djQO6o54xgKomGZC+ita8xotQC7y647uAqrjTWm0VMvFmSiT+FID0slLoWCgyMBNoHOa2cPhqv7EHAxqeCe94R2RZXaGXmXwtW8rJCjth3H28VqZJjVd9WA/HVsxZ1atO9yY97mbU7rCLApltfAVw7SWRAqxSyigR+HHOA7713TMe43CTgXq5eznF9jIkzTr8Sba/p7gBtUhji9yX083/c8ygZopLhCGgdWbU0Wa7CgVNvH/v3QBM0Y X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0aa4ba31-e10f-46ad-0eca-08d803835603 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 May 2020 03:49:49.5992 (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: 72NmDHiuiqC7Bmo1X8Dfo5jMq+OeBhRR8zlO4KpPlF09+nGfa4ceT3baAR5JVv8yI0oCaGTl6jYvSzOqq4GmWQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR06MB4839 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Frank Kao Set F2 blocksize to 256 bytes and watermark to 0x40 for 4354/4356 SDIO. Also enable and configure F1 MesBusyCtrl. It would resolve random driver crash issue. Signed-off-by: Frank Kao Signed-off-by: Chi-Hsien Lin --- .../broadcom/brcm80211/brcmfmac/bcmsdh.c | 8 ++++++-- .../wireless/broadcom/brcm80211/brcmfmac/sdio.c | 16 ++++++++++------ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c index bb3196cba683..b1a66320ba54 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c @@ -44,7 +44,7 @@ #define SDIO_FUNC1_BLOCKSIZE 64 #define SDIO_FUNC2_BLOCKSIZE 512 #define SDIO_4373_FUNC2_BLOCKSIZE 256 -#define SDIO_4359_FUNC2_BLOCKSIZE 256 +#define SDIO_435X_FUNC2_BLOCKSIZE 256 /* Maximum milliseconds to wait for F2 to come up */ #define SDIO_WAIT_F2RDY 3000 @@ -916,7 +916,11 @@ static int brcmf_sdiod_probe(struct brcmf_sdio_dev *sdiodev) f2_blksz = SDIO_4373_FUNC2_BLOCKSIZE; break; case SDIO_DEVICE_ID_BROADCOM_4359: - f2_blksz = SDIO_4359_FUNC2_BLOCKSIZE; + /* fallthrough */ + case SDIO_DEVICE_ID_BROADCOM_4354: + /* fallthrough */ + case SDIO_DEVICE_ID_BROADCOM_4356: + f2_blksz = SDIO_435X_FUNC2_BLOCKSIZE; break; default: break; diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c index 491b635e72b1..037a4efef924 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c @@ -47,9 +47,9 @@ #define CY_4339_MES_WATERMARK 80 #define CY_4339_MESBUSYCTRL (CY_4339_MES_WATERMARK | \ SBSDIO_MESBUSYCTRL_ENAB) -#define CY_4359_F2_WATERMARK 0x40 -#define CY_4359_F1_MESBUSYCTRL (CY_4359_F2_WATERMARK | SBSDIO_MESBUSYCTRL_ENAB) - +#define CY_435X_F2_WATERMARK 0x40 +#define CY_435X_F1_MESBUSYCTRL (CY_435X_F2_WATERMARK | \ + SBSDIO_MESBUSYCTRL_ENAB) #ifdef DEBUG #define BRCMF_TRAP_INFO_SIZE 80 @@ -4227,17 +4227,21 @@ static void brcmf_sdio_firmware_callback(struct device *dev, int err, CY_4339_MESBUSYCTRL, &err); break; case SDIO_DEVICE_ID_BROADCOM_4359: + /* fallthrough */ + case SDIO_DEVICE_ID_BROADCOM_4354: + /* fallthrough */ + case SDIO_DEVICE_ID_BROADCOM_4356: brcmf_dbg(INFO, "set F2 watermark to 0x%x*4 bytes\n", - CY_4359_F2_WATERMARK); + CY_435X_F2_WATERMARK); brcmf_sdiod_writeb(sdiod, SBSDIO_WATERMARK, - CY_4359_F2_WATERMARK, &err); + CY_435X_F2_WATERMARK, &err); devctl = brcmf_sdiod_readb(sdiod, SBSDIO_DEVICE_CTL, &err); devctl |= SBSDIO_DEVCTL_F2WM_ENAB; brcmf_sdiod_writeb(sdiod, SBSDIO_DEVICE_CTL, devctl, &err); brcmf_sdiod_writeb(sdiod, SBSDIO_FUNC1_MESBUSYCTRL, - CY_4359_F1_MESBUSYCTRL, &err); + CY_435X_F1_MESBUSYCTRL, &err); break; default: brcmf_sdiod_writeb(sdiod, SBSDIO_WATERMARK, From patchwork Fri May 29 03:49:37 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: 11577653 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 8F3DF1392 for ; Fri, 29 May 2020 03:50:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 72A10207D3 for ; Fri, 29 May 2020 03:50:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=cypress.com header.i=@cypress.com header.b="ZI9P+G+Y" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388430AbgE2DuA (ORCPT ); Thu, 28 May 2020 23:50:00 -0400 Received: from mail-dm6nam10on2119.outbound.protection.outlook.com ([40.107.93.119]:15968 "EHLO NAM10-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388337AbgE2Dt7 (ORCPT ); Thu, 28 May 2020 23:49:59 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ds4hDDwtMKsttj7300WyNXgrdqDbt2zFyaAxL04gZrLenFA48K/Mt87z8VGdfARgM/E7YlqEpn+1VmPg4SN49lUNLcq8UNUygba4W6ro1h6v9dENtgdxGSpIz+YgN+8Uifm+a97PaRUqJ0qaqycU04HLHSjesiNTZnf/MUlDuB50lNr0hJBMt1pQ9o6mmN0R9hAWEW4HtcNq/2gblsDKryvJNq3S5W2wHn4XIy7HPdJvx5QpEscEutz7RkbwfsReg2PzolMWUC3UM+hO6GjTqWnRKRiUG6iYwaEqC4pLNeT0qJK0Km9dLeuwGmokfK0xkeaUkw8MEuDV7EihrBjJlw== 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=hjXysJpyqauXrvqsetGXjctQpRVyWajdSX322wBmyrw=; b=j/Xza+I754wOPGCl9+TFJ+KZ2+koix8Uz8/YeFMp8NZZR7alJoeofOj5ITFXm2ZBf4AdFwwhVLQ4s7jJiu+b7r3SbsNBr7rsXbnjOpoPDvRcH7QHk0ysaoen52kni7QbX/vJ128xjbtE+/F5pmJkOHhM0eLCJuolu5258qHKA7TIrXlCFvkfGXUctDmkrw83HG4ki0i+ZQGKma9p0MydXDeSo154vbAVf+r9Ap5SMZgAqSLyspo5IaxuzpPE9e3A2PNwDdXSFQWcpVeG+nypAceypNxgeVtAMdNI7msl4QkLbKSqXUngOkGbQ/l2UFacIZs5lH+jVmJSVj1QKLg9Bg== 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=hjXysJpyqauXrvqsetGXjctQpRVyWajdSX322wBmyrw=; b=ZI9P+G+YUuyjuBZ9uSUBL11elkgeCpndbyolXm0MQcximvUbpXODYf+P1kGG8vDMiKUDnHc+H/1oDivD1YfztovMnOR/RxWRru+PdX2i4xUo1n3cZ15I4vkC0P0jbJV+d1K8GDIQXsdemec0RqVgzrO/Wm2jxHTUa9/ErHICoCU= 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 BYAPR06MB4839.namprd06.prod.outlook.com (2603:10b6:a03:77::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.25; Fri, 29 May 2020 03:49:50 +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.3045.018; Fri, 29 May 2020 03:49:50 +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 , Chi-hsien Lin Subject: [PATCH V2 4/5] brcmfmac: fix 43455 CRC error under SDIO 3.0 SDR104 mode Date: Thu, 28 May 2020 22:49:37 -0500 Message-Id: <20200529034938.124533-5-chi-hsien.lin@cypress.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200529034938.124533-1-chi-hsien.lin@cypress.com> References: <20200529034938.124533-1-chi-hsien.lin@cypress.com> X-ClientProxiedBy: BYAPR06CA0072.namprd06.prod.outlook.com (2603:10b6:a03:14b::49) 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 BYAPR06CA0072.namprd06.prod.outlook.com (2603:10b6:a03:14b::49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.18 via Frontend Transport; Fri, 29 May 2020 03:49:49 +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: 244e8657-d7f7-48d4-d424-08d80383569f X-MS-TrafficTypeDiagnostic: BYAPR06MB4839: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-Forefront-PRVS: 04180B6720 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hfOOIn+ky57cf4ZS2Sy+cUls85OjzqGRyWCeIjW5CpcrtIn5KRbkN6FEHL19J1h++bdp2JgnXPTbvRJ1pwLwnjRqKinNsIp90qZCmf+KyPeumhAX+cizqwu5kZnGB7NoH+LJ3dm0Pes5KpM0U5QVr8picc2EKuicP8qVDQurcoJUHEYuCaowMJ7WIFQjPmVJOAWOT84ZNkfHoqaZel64/dNAirC/z/Rs2HiGMbWDEW1SldkVIbMqMlMs4DoGeRj0zZoObX3ruL1eYoYE7dZMoVQMNJIIamVmKP/UxwY3W4BaLVqb1BhRVhuv6/yZU8WvPBE4vY2d+gkv42JwhkIMBA== 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)(136003)(366004)(376002)(396003)(39860400002)(66476007)(2906002)(66946007)(52116002)(16526019)(7696005)(26005)(186003)(36756003)(83380400001)(5660300002)(478600001)(6916009)(2616005)(956004)(66556008)(8676002)(6486002)(4326008)(107886003)(86362001)(54906003)(316002)(1076003)(8936002)(6666004);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: ZAjwYocAPOojm+HbA5h771MjMju7A9Y2h5s8Mc6MiEuENguhuNk0qcjcNLAjSQuul/tOmYntWjyuBiFbMLdvxuubXGUpN7zd8DRwsh8c2uzgnb2pwzBvcdOga4/eCUf9nVuV2/Hz/ukJGRCBdvecRlKw8xu31akRFGS4Dgjom1tsQBLIpImtzPZ1Gb6svN3DHQDIl/t+K4m6gCQtXGUf+/3h6rFJ+0PEFa4tUnF6re1NcKgXSHgkQ6rNzWc9UccIF8ivT+ZNy4Lx+Onm0imleDJ1vTT5ZSlUC7W6X/oJGjwZptrYOUsUSTFuS5kuu6mRXgGEzrPUquWdCp+ln7mN70haL40mP3LewMU5+nokJUJf2HcryZqohJvvoz1v6nVKgFtYxlDy4yGSRSDfHYGqmyMEH6CWDWhhwm0lPuV3Oyx9Ax5OiGWWKFjIVBdC8FBmhpbT9q88jEg0qQEPJSbcn3yW/QEhshXqJBnBJjtM+KOZJELDvC5woaRuY2pSkLrC X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-Network-Message-Id: 244e8657-d7f7-48d4-d424-08d80383569f X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 May 2020 03:49:50.6136 (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: P0p3ow1u9ut2KvEbWwuf0g76dPIgKA9eATlW6gXLBPpJXOATaYzI5RJtkG9mxh1F1ZcRjBGR1GzHb5cvIPl7GQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR06MB4839 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Wright Feng This patch fixes 43455 CRC error while running throughput test with suspend/resume stress test. The continuous failure messages before system crash: brcmfmac: brcmf_sdiod_sglist_rw: CMD53 sg block read failed -84 brcmfmac: brcmf_sdio_rxglom: glom read of 25600 bytes failed: -5 brcmfmac: brcmf_sdio_rxfail: abort command, terminate frame brcmfmac: brcmf_sdiod_sglist_rw: CMD53 sg block read failed -84 brcmfmac: brcmf_sdio_rxglom: glom read of 24576 bytes failed: -5 brcmfmac: brcmf_sdio_rxfail: abort command, terminate frame Signed-off-by: Wright Feng Signed-off-by: Chi-hsien Lin --- .../broadcom/brcm80211/brcmfmac/sdio.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c index 037a4efef924..58d9f0b90ad3 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c @@ -47,9 +47,14 @@ #define CY_4339_MES_WATERMARK 80 #define CY_4339_MESBUSYCTRL (CY_4339_MES_WATERMARK | \ SBSDIO_MESBUSYCTRL_ENAB) +#define CY_43455_F2_WATERMARK 0x60 +#define CY_43455_MES_WATERMARK 0x50 +#define CY_43455_MESBUSYCTRL (CY_43455_MES_WATERMARK | \ + SBSDIO_MESBUSYCTRL_ENAB) #define CY_435X_F2_WATERMARK 0x40 #define CY_435X_F1_MESBUSYCTRL (CY_435X_F2_WATERMARK | \ SBSDIO_MESBUSYCTRL_ENAB) + #ifdef DEBUG #define BRCMF_TRAP_INFO_SIZE 80 @@ -4226,6 +4231,19 @@ static void brcmf_sdio_firmware_callback(struct device *dev, int err, brcmf_sdiod_writeb(sdiod, SBSDIO_FUNC1_MESBUSYCTRL, CY_4339_MESBUSYCTRL, &err); break; + case SDIO_DEVICE_ID_BROADCOM_43455: + brcmf_dbg(INFO, "set F2 watermark to 0x%x*4 bytes for 43455\n", + CY_43455_F2_WATERMARK); + brcmf_sdiod_writeb(sdiod, SBSDIO_WATERMARK, + CY_43455_F2_WATERMARK, &err); + devctl = brcmf_sdiod_readb(sdiod, SBSDIO_DEVICE_CTL, + &err); + devctl |= SBSDIO_DEVCTL_F2WM_ENAB; + brcmf_sdiod_writeb(sdiod, SBSDIO_DEVICE_CTL, devctl, + &err); + brcmf_sdiod_writeb(sdiod, SBSDIO_FUNC1_MESBUSYCTRL, + CY_43455_MESBUSYCTRL, &err); + break; case SDIO_DEVICE_ID_BROADCOM_4359: /* fallthrough */ case SDIO_DEVICE_ID_BROADCOM_4354: From patchwork Fri May 29 03:49:38 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: 11577655 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 ACCBD139A for ; Fri, 29 May 2020 03:50:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9475E207D3 for ; Fri, 29 May 2020 03:50:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=cypress.com header.i=@cypress.com header.b="DUY7PgWW" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388012AbgE2DuE (ORCPT ); Thu, 28 May 2020 23:50:04 -0400 Received: from mail-dm6nam10on2119.outbound.protection.outlook.com ([40.107.93.119]:15968 "EHLO NAM10-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388127AbgE2DuA (ORCPT ); Thu, 28 May 2020 23:50:00 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Rf4LHcAgn94VzfzLPx3H8rZzipG3FAY7oXOQr7c7TlAyYafcjpRHL9YCVqZ5ejSG+0aPMZXTOWLK6fPU+VD/lOP0qEWnBGO5d+SiI8gZp4mYZFkiG5uqioKw8PK1kEmk8fHPWACxFsqM0AnIRroix0KbogvpQo821L/8Y4BJVOWPP8al7HwE6WSTHfBS1HTIREMA/+DO88t8T0a7E7N2fSwoWQT53dv0D2RwkXghW97mW/ihOtLZpOyixCXVvXcZwG4XtQUCMmNKETJQ/GTShC+1nVgjsJtmBkucaOXOV12x2sZEwGkf3MlFJT80sAYmt24f5YlhswWfRxIDxLcJHQ== 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=NHOIx0TG6hJ1+4q9r+fXISUcVyO1lvCMzO2bdSqqzqU=; b=eVpdf04FyqwjRfIXbaiz77jOQl4EgRZN5xTBZagKbK4C/0HQZSkLZpoj9bYK/XxZ0Y8ImQ8L7DVcLEW8Lnx/DuTEk3ti3BjRdtXG865qJjFw8ErGrNSLXGtY9mcbpB8UwQesQa800LZZQMunz07sg49r4coMssOr+2ylIU1ifNL3/GcKne1LUbErY9EzQ/ceMNvIUqzUoYLcZ2vdKShcULLYrTk4dj4OIU5lMgvdzBJSKqUZLxGiSOWx6cm3+pA5XC5pYVfRBih28LeOCe+g/0hHP23JQ0GewuDVa0fjeWF9YhYwH4njtJctuElS2MTZpR7wEuk8B0iLTSRjF8GZ2g== 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=NHOIx0TG6hJ1+4q9r+fXISUcVyO1lvCMzO2bdSqqzqU=; b=DUY7PgWWQBjSrjGtGQC8zJn/yTUMXX6K2QDlLzWg/CnzW9swHXNwp0uWtd9h0u0QJSGa0nUigIHRKAnIdwZnj4zvzanhZXfG7HCp9kLYNCaUGfPvHcCrLXqubn7J1LT9BswV4s4Zl9luU7feOsSFXjkgzDns/Bce7u0KvJJiPzI= 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 BYAPR06MB4839.namprd06.prod.outlook.com (2603:10b6:a03:77::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.25; Fri, 29 May 2020 03:49:51 +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.3045.018; Fri, 29 May 2020 03:49:51 +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/5] brcmfmac: 43012 Update MES Watermark Date: Thu, 28 May 2020 22:49:38 -0500 Message-Id: <20200529034938.124533-6-chi-hsien.lin@cypress.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200529034938.124533-1-chi-hsien.lin@cypress.com> References: <20200529034938.124533-1-chi-hsien.lin@cypress.com> X-ClientProxiedBy: BYAPR06CA0072.namprd06.prod.outlook.com (2603:10b6:a03:14b::49) 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 BYAPR06CA0072.namprd06.prod.outlook.com (2603:10b6:a03:14b::49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.18 via Frontend Transport; Fri, 29 May 2020 03:49:50 +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: 031ee933-bbff-4402-a130-08d80383574a X-MS-TrafficTypeDiagnostic: BYAPR06MB4839: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-Forefront-PRVS: 04180B6720 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: S3oudXht3XK4j3MUbzbI2PpO8RlP7i3QucyWtCgwdQbzE7iXlMk5xEpn6w8xPTwEuW1fRmPrxaPrNjvhgigRNjon3n9KtzwFERJtG/fKJ6od7XFaRK+wLgwc52YlxPnAez9pYqnnMy+vBq08Pbpa7f9TVgZDhbMJVa+CK02SF8WH70uRjCY9u6NIIZ9SiFNkcxDFQyg30CCMZpNnNHbJHKF/N8v51FjPAgmupujtzXSP6QoIxdVaW72wIW+UcvV7/Lk04OLTDJEDPHJ2S/X8HN3v5z7envwGV4hzzJWXUhkc8cmoAlf9Up/MFuFFvjgR9JYBhSwfBuvnrwx7m5EEIA== 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)(136003)(366004)(376002)(396003)(39860400002)(66476007)(2906002)(66946007)(52116002)(16526019)(7696005)(26005)(186003)(36756003)(5660300002)(478600001)(6916009)(2616005)(956004)(66556008)(8676002)(6486002)(4326008)(107886003)(86362001)(54906003)(316002)(1076003)(8936002)(6666004);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: GAvtu0hxsAntyOJCQ42oJolBcJ4FY94ALarhMlgLvlL93ub2EgJ5lFvLRd2KkUrLc6b72YA0h1nJwDGPDXMs1u+a3yjrHKU1o24AH1KcspvQyEuumbJc+s1DDs3HYeaYnAPNf0aRTLU2yectGrhGXADU+rmF4k5io6ka7syj9M8VfZRiy7DT7IVak9T+lmJLvkEKv0PyceFB7UpRl3wFsrumCpOcqvnWSAz/s/RK5c4oNIjyTAXy9jLKccwY7ekOuIZ+VXEUFBRBJdwKQtZ2lsZhznCPL9lhiUmONiHF4xC0AYX5Ydj23Ptrs/gQyP1o8w9kTfFUoeFsUtfyMXtfBFL7FiZ4ggkUCRe4wcTyKHZreFSp6cPaoeEvxl5NUysgZRv7C1Wbz+m0lylX1SV8reoAJWjXwluk/cGoswZCniy9xDByeG0/OEuzuvJR3izrjFQfM7wDiG2yP23CGQmkVUZu1l4gBANcHGNK7a60uIMtG/PV0Cb3UEvV4iCWBXuS X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-Network-Message-Id: 031ee933-bbff-4402-a130-08d80383574a X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 May 2020 03:49:51.6551 (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: 8TjjBO5vYpqa5uJ/EbGtdAOwcTGkm9mi1BQWnE/FIXi71Hx74wozS6+kamA1H+jer3mnvtpx/qD4u7JenY+3VQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR06MB4839 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Double Lo Set MES watermark size to 0x50 for 43012. It fixes SDIO bus hang issue when running at high throughput. Signed-off-by: Double Lo Signed-off-by: Chi-hsien Lin --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c index 58d9f0b90ad3..760b7737e745 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c @@ -43,6 +43,9 @@ #define CY_4373_F2_WATERMARK 0x40 #define CY_4373_F1_MESBUSYCTRL (CY_4373_F2_WATERMARK | SBSDIO_MESBUSYCTRL_ENAB) #define CY_43012_F2_WATERMARK 0x60 +#define CY_43012_MES_WATERMARK 0x50 +#define CY_43012_MESBUSYCTRL (CY_43012_MES_WATERMARK | \ + SBSDIO_MESBUSYCTRL_ENAB) #define CY_4339_F2_WATERMARK 48 #define CY_4339_MES_WATERMARK 80 #define CY_4339_MESBUSYCTRL (CY_4339_MES_WATERMARK | \ @@ -4217,6 +4220,8 @@ static void brcmf_sdio_firmware_callback(struct device *dev, int err, devctl |= SBSDIO_DEVCTL_F2WM_ENAB; brcmf_sdiod_writeb(sdiod, SBSDIO_DEVICE_CTL, devctl, &err); + brcmf_sdiod_writeb(sdiod, SBSDIO_FUNC1_MESBUSYCTRL, + CY_43012_MESBUSYCTRL, &err); break; case SDIO_DEVICE_ID_BROADCOM_4339: brcmf_dbg(INFO, "set F2 watermark to 0x%x*4 bytes for 4339\n",