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: 215453 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08CCBC433DF for ; Fri, 29 May 2020 03:49:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D679E2072D 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: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: 215452 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2068C433DF 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 C32992072D 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: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: 215451 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB0B4C433DF 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 93B962072D 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",