From patchwork Tue Dec 12 09:39:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wright Feng X-Patchwork-Id: 10106571 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.web.codeaurora.org (Postfix) with ESMTP id 8A85B602C2 for ; Tue, 12 Dec 2017 09:40:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7988E29B04 for ; Tue, 12 Dec 2017 09:40:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6ACCB29B69; Tue, 12 Dec 2017 09:40:12 +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=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 9E06E29B04 for ; Tue, 12 Dec 2017 09:40:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751434AbdLLJkJ (ORCPT ); Tue, 12 Dec 2017 04:40:09 -0500 Received: from mail-co1nam03on0115.outbound.protection.outlook.com ([104.47.40.115]:15632 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750853AbdLLJkG (ORCPT ); Tue, 12 Dec 2017 04:40:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cycorp.onmicrosoft.com; s=selector1-cypress-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=NMYv3IQX9qKL21hnL7x+BC8oXSg7VFRs4H+N5Lb4WKU=; b=SBRMSw3ZEfJwpZK+dJuNFtFCL0TYhy+UepnZGMWF8GlO07mLJdbsQHw0KSwx4WclXK3avQLoWSp6wwJAvnfU0C6lQDmLHNllHNVaDQevGK7ctvyQhJWSSjkYkkiG3DMkuK6YzDI6w4C1dlAc18XXOWJeh2Jg0o7eMuwKn3QAh6k= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Wright.Feng@cypress.com; Received: from localhost (61.222.14.99) by DM5PR0601MB3590.namprd06.prod.outlook.com (2603:10b6:4:7c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Tue, 12 Dec 2017 09:40:04 +0000 From: Wright Feng To: arend.vanspriel@broadcom.com, franky.lin@broadcom.com, hante.meuleman@broadcom.com, kvalo@codeaurora.org, chi-hsien.lin@cypress.com Cc: linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, Wright Feng Subject: [PATCH] brcmfmac: fix CLM load error for legacy chips when user helper is enabled Date: Tue, 12 Dec 2017 17:39:56 +0800 Message-Id: <1513071596-17506-1-git-send-email-wright.feng@cypress.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [61.222.14.99] X-ClientProxiedBy: OS2PR01CA0107.jpnprd01.prod.outlook.com (2603:1096:602:1::25) To DM5PR0601MB3590.namprd06.prod.outlook.com (2603:10b6:4:7c::12) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cc064964-f7a7-4347-93f3-08d5414452dd X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(48565401081)(2017052603307); SRVR:DM5PR0601MB3590; X-Microsoft-Exchange-Diagnostics: 1; DM5PR0601MB3590; 3:PrgkAD5H4Cgc8tk7v9VXnB4Zw9uA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f4+Gfnx2LLyTtFnOZHX5DpUCJodzs7hG7vjmFgjgH6EyE4682XSKpa2CEXRrylBjrSy+rTIx2cz1YgW8KU1+fwbWHq0E+WaDF7k67Ha/5NqQDG/aQwCkn7jNM4X88YG1KsloCCrNPmBsVpiOHeKMx8so6IRq2BR2vW8rZXYwXuYgS90h72RLz9WKMnZfyOv3tfc7mDIP4fBcHHQR0XbS/IgxVonTk26tle2OGe1mosrBLeO8AjnnxpzAw/XnYuNr7FwrSYjWSQcDw+1i0vbWvhf1kI+TdwkWj+MY1CE4HhiHHSjP9+b+TY2z2hLxXfk/TfVxU; 4:VY5mOZCH7w7fgMyBmjpsMD1kILenZ+OkhoTakOV7np/PgzJUKJFN6kl3LUKwnFfj8N2VbIY81lw8MChaCbI4bK02ERhYeyzarTiwb14gk6vTcOZJlg7htasOLOqnL+SqCmGVlFYrObYEOJByfZka8SVhFa2Ngvu+QVbOid4DvmQE0GME+cygkgD/ev6p+V9/1Mf0xwiybJ3SpAKft3R7NdBl8nkkLHqlNZxpYxAf0wYDXf8md/ICvZC/cvuy20ZNcZ7Acx4wHHBkGHrIKpE9nPuXepvmqzqSN9i2BiElYw/Kq6AhfVGeUKRHb9iLVzJx X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(258095267146985); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(5005006)(8121501046)(3002001)(3231023)(93006095)(93001095)(10201501046)(6055026)(6041248)(20161123555025)(20161123564025)(20161123562025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(6072148)(201708071742011); SRVR:DM5PR0601MB3590; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:DM5PR0601MB3590; X-Forefront-PRVS: 051900244E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6069001)(39860400002)(346002)(376002)(366004)(189003)(199004)(6496006)(6116002)(6486002)(3846002)(4326008)(68736007)(6636002)(6666003)(8936002)(16526018)(107886003)(59450400001)(36756003)(25786009)(50466002)(48376002)(50226002)(97736004)(5660300001)(16586007)(72206003)(53936002)(105586002)(86362001)(106356001)(478600001)(81156014)(81166006)(2906002)(8676002)(316002)(76506005)(305945005)(7736002)(47776003)(52116002)(51416003)(66066001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR0601MB3590; H:localhost; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: cypress.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR0601MB3590; 23:UE/0DYc3tBVCN7Xo1z6VhW4uP+L+bWP3z5Y+E9t?= =?us-ascii?Q?3E8OUd6TxmBqeeYOJyMmwOU5iYoyEPqov4rtGJBj5iuVdcf/63aSkF3rCD/X?= =?us-ascii?Q?Zf8FL06V6MVrGnEsZFSLrLRit8L/ufjNZDf7ygfDEOe38+gmpWhjfttPFLKx?= =?us-ascii?Q?6/W9/P0QfbwXCiXEX5UwLzzFnPCasAGN+1HUuLocrAOFLZ21GtPpJBTNLHWO?= =?us-ascii?Q?+c6FoOdBAlt/dOFjdEfnvU03NoVwHov7tSn5uGDe+mJpOr3iXCCyKA9cH3oR?= =?us-ascii?Q?50sCq06hxmfLyKJLiq4yXhsnh1dHxP4KjxRc9yTT+x8UBkJJHDRHVVMYI7gT?= =?us-ascii?Q?VdAobzXTNODUzDcv4lhv+G57pnPwu/BGRf7c9vCHwQade04vaFrkMetHulb1?= =?us-ascii?Q?H7qGO+eHzb8lch8Ek7B/5GzNsw24fEiOzsafWUWkgFfzUlgKLyOljH+rhP3Y?= =?us-ascii?Q?HcFI4OorSqHRQfSHGuVD1aiKA3KTeCLOR3/r4w+VMNpjPiH+DmuMpdeeXQdS?= =?us-ascii?Q?EQQQhVMPF1ZccxHGndyZCcQbVybpxHPH3fLluZ2aMvPb50YMdPSbECCR6VU5?= =?us-ascii?Q?pRu2zmTZA1a7LYXjgw1yks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cl4Yy8wevkJGqQAUizsuGsuIND5V+UsGLawtt4g5zpCzXPjgVLNfof6OgADc5iXd5h7PH6kq40Ujd0QI=; 24:Ak+uD8ylkeiOVOf+LG1IOzapT5ITcinS7O+c4VuHnCrcNs5uBDS3P2iGbrOiUlLWONKjwODCab6XTn0oFYvYZnoNtCbo6GSBY/bVzM6UNaM=; 7:oPCyhYKwyfcNfF63Tg+DC0Im1zg5wo3deGmNxITB3+qQfAi1Z5nHZ3qTH9BijJv7EBAMSKoJvc/FcrssGIs1Svr78B/V7xy7Va0GQq5p/bXBWE3GgUWd/RQcyld5tCJ0AzTQ7hVmz+NG61RbGheYWaASWKO9kTH9RHXQGbHLinZa4FoFDvliBmBmsGmusExLfc55+LuGIOJyM0E5hNgENhhBGXRhXscgBM6G1RbB8dra9TI4pyNNmD/v2+iHujlK SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2017 09:40:04.1627 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cc064964-f7a7-4347-93f3-08d5414452dd X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 011addfc-2c09-450d-8938-e0bbc2dd2376 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR0601MB3590 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 For legacy chips w/o CLM blob files, kernel with user helper function enables returns -EAGAIN when we request_firmware() for blob file: "request_firmware() -> _request_firmware() -> fw_load_from_user_helper() -> _request_firmware_load() -> retval=-EAGAIN" We should do one more retry and continue brcmf_c_process_clm_blob if getting -EAGAIN from request_firmware function. Signed-off-by: Wright Feng --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c index 6a59d06..56e2654 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c @@ -45,6 +45,8 @@ #define BRCMF_DEFAULT_TXGLOM_SIZE 32 /* max tx frames in glom chain */ +#define CLM_LOAD_RETRIES 1 /* # of retries to load clm_blob file */ + static int brcmf_sdiod_txglomsz = BRCMF_DEFAULT_TXGLOM_SIZE; module_param_named(txglomsz, brcmf_sdiod_txglomsz, int, 0); MODULE_PARM_DESC(txglomsz, "Maximum tx packet chain size [SDIO]"); @@ -170,6 +172,7 @@ static int brcmf_c_process_clm_blob(struct brcmf_if *ifp) u16 dl_flag = DL_BEGIN; u32 status; s32 err; + uint retries = 0; brcmf_dbg(TRACE, "Enter\n"); @@ -180,11 +183,18 @@ static int brcmf_c_process_clm_blob(struct brcmf_if *ifp) return err; } - err = request_firmware(&clm, clm_name, dev); + do { + err = request_firmware(&clm, clm_name, dev); + } while (err == -EAGAIN && retries++ < CLM_LOAD_RETRIES); if (err) { if (err == -ENOENT) { brcmf_dbg(INFO, "continue with CLM data currently present in firmware\n"); return 0; + } else if (err == -EAGAIN) { + brcmf_dbg(INFO, "reached maximum retries(%d)\n", + CLM_LOAD_RETRIES); + brcmf_dbg(INFO, "continue with CLM data in firmware\n"); + return 0; } brcmf_err("request CLM blob file failed (%d)\n", err); return err;