From patchwork Mon Dec 16 17:03:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 1210628 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="ZULMbHuY"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47c72C07Q6z9sRX for ; Tue, 17 Dec 2019 04:05:38 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727532AbfLPRFh (ORCPT ); Mon, 16 Dec 2019 12:05:37 -0500 Received: from mail-eopbgr700045.outbound.protection.outlook.com ([40.107.70.45]:49121 "EHLO NAM04-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726931AbfLPRDv (ORCPT ); Mon, 16 Dec 2019 12:03:51 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JdtwqTRVAGqS1WlKfIodAykAmA8iRsDQxBRIL/AqERb09oGAtu+uqho0nTKUqCnMONHu4GirtKQoy22i65jJoGvZ6nqlvqKlCpWrgatRIcT0LCcAgTJTrpXvK/9RTg0FDZHE9ftXEzcEIek3Cbr1CssPdxAd6u2v2J5+34AtEZ0EHEIo/19BnkS1M+CX5BF/SkS63Ii+dLyftXRsWpneAkbv1tVc8GNDxfP0WHWoqK+I3+o/SQ9vwVAemgujjlZ76GgeN+bWYq6cI7k24++egLDvzbRVNgs+/V0z6cqNNaLmcrhumjGVNMR1ZMPdMRh1RUIY/fMtAehq1sy5Ci1UIA== 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=vZm021/OuiiRkuw5MI4dTjoQN3+jOzXvYS77AFtcuFc=; b=Bk2QwlFMQ46MlQdB5N3vvkOf/GJp+s86+ROg7YSIquxZlsa6xTDcBNC8gnv7O27L9tqhv5OV6PBMVLCwF/f/5dnK0H9u+tEbg8WKWzRCDxBG2ffUSI0bppB5g9Kjz3Cg97gwO7j6c7AS0ZWXyXjR7jt6gqGr1wfbC3+gFHKCjEYb5Pz/r2HEbh5rEo54tJfQBkYDf3T46r5BBu5go49WYEJwBCCK9JmORgzTM6OCCtj+Sjo2Vp7sXayWVHdoPlCxoHcnfm/NQ1a3J3j2L560hG89UNDSCv0GwIHTyDof3IlzMua9h4x+kEYHobrv1ye42TozeBKtn6XcAwLLN6I0uQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vZm021/OuiiRkuw5MI4dTjoQN3+jOzXvYS77AFtcuFc=; b=ZULMbHuYNtVHCAd2McSmtz7VL3WAKAL5GI0y64E//DRvUe8cZbbzdbwmuJvCvcfvojAJSfO58GJwuAhjid3CIyDtD2CMJGXwOY5T5i4oLbkwnjwyu+Dd64F/hzKr4l6FsE/vTniVCwZN1mJhFE1USHh7Ft+5Qx5mmnO954l8Gmc= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4351.namprd11.prod.outlook.com (52.135.39.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.19; Mon, 16 Dec 2019 17:03:47 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2538.019; Mon, 16 Dec 2019 17:03:47 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91?= =?utf-8?q?iller?= Subject: [PATCH 12/55] staging: wfx: don't print useless error messages Thread-Topic: [PATCH 12/55] staging: wfx: don't print useless error messages Thread-Index: AQHVtDLDWbe5jwhX3Euocgmb2a3bIg== Date: Mon, 16 Dec 2019 17:03:40 +0000 Message-ID: <20191216170302.29543-13-Jerome.Pouiller@silabs.com> References: <20191216170302.29543-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191216170302.29543-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 259754d3-3195-4395-4081-08d78249eabd x-ms-traffictypediagnostic: MN2PR11MB4351: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3968; x-forefront-prvs: 02530BD3AA x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(366004)(376002)(346002)(396003)(39860400002)(199004)(189003)(66556008)(66446008)(64756008)(66476007)(76116006)(85202003)(91956017)(66946007)(54906003)(107886003)(4326008)(478600001)(110136005)(71200400001)(6512007)(81156014)(8676002)(81166006)(186003)(36756003)(2906002)(85182001)(6666004)(66574012)(15650500001)(1076003)(316002)(6506007)(5660300002)(86362001)(26005)(2616005)(6486002)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4351; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 3rPcC2kLStzUws27as1SwYD9VMS0e7+h8bjkIv86fbR8xFQoVVKGJSNHmVzM0Cf7eN6s4sW7UKuAGmDcfAjH6KswqMx6qbQQ3vwaV9g0CULpNdGGIqZZWZNUC8Vuk5M2dcbHzB4FOR09ZyNx5LLD+wB9FpCfIvCXva7sSOB5J6MI/HBnRqpfKVXqpBvYNYn6eJ8JcLfprRW+ZVRoTLl8+M5fy+RhN4j0FOOtStX7v/ZVlX8cmBm6Ng96PFLrc2JxCfNFyl+s5cIAWYQcbXftFXMfC/pjnbkShvHcGHTdWZCbTumhihvxuqNkw9RSPdIwoMsLNxA0ii1eIQddE+5carlH6da2u6i6uV6hTo8O2vSmoWwTPjN5/3W1kAqMLArAz2JH8wt+JK7oqt/kyyEGU1EhUwCHI7MjtfLgDatcJhDBcPVJOxmNZ4fFMAjf3uUf Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 259754d3-3195-4395-4081-08d78249eabd X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Dec 2019 17:03:40.0204 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: SQWAY13n7PDhTOovxizbOaJ4SGHq1aXoHHzIIjAOryuLQNpTRW4dHnfB40jyHPC+xHC2XwVQXE5mH0lWy3Gf4Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4351 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller During chip probing, if error does not come from secure boot (for exemple when firmware has been found), others errors probably appears. It is not necessary to say to user that the error does not come from secure boot. So, drop the message saying "no error reported by secure boot". BTW, we take the opportunity to simplify print_boot_status(). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/fwio.c | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/drivers/staging/wfx/fwio.c b/drivers/staging/wfx/fwio.c index dbf8bda71ff7..47e627bf0f8e 100644 --- a/drivers/staging/wfx/fwio.c +++ b/drivers/staging/wfx/fwio.c @@ -61,7 +61,7 @@ #define DCA_TIMEOUT 50 // milliseconds #define WAKEUP_TIMEOUT 200 // milliseconds -static const char * const fwio_error_strings[] = { +static const char * const fwio_errors[] = { [ERR_INVALID_SEC_TYPE] = "Invalid section type or wrong encryption", [ERR_SIG_VERIF_FAILED] = "Signature verification failed", [ERR_AES_CTRL_KEY] = "AES control key not initialized", @@ -220,22 +220,16 @@ static int upload_firmware(struct wfx_dev *wdev, const u8 *data, size_t len) static void print_boot_status(struct wfx_dev *wdev) { - u32 val32; + u32 reg; - sram_reg_read(wdev, WFX_STATUS_INFO, &val32); - if (val32 == 0x12345678) { - dev_info(wdev->dev, "no error reported by secure boot\n"); - } else { - sram_reg_read(wdev, WFX_ERR_INFO, &val32); - if (val32 < ARRAY_SIZE(fwio_error_strings) && - fwio_error_strings[val32]) - dev_info(wdev->dev, "secure boot error: %s\n", - fwio_error_strings[val32]); - else - dev_info(wdev->dev, - "secure boot error: Unknown (0x%02x)\n", - val32); - } + sram_reg_read(wdev, WFX_STATUS_INFO, ®); + if (reg == 0x12345678) + return; + sram_reg_read(wdev, WFX_ERR_INFO, ®); + if (reg < ARRAY_SIZE(fwio_errors) && fwio_errors[reg]) + dev_info(wdev->dev, "secure boot: %s\n", fwio_errors[reg]); + else + dev_info(wdev->dev, "secure boot: Error %#02x\n", reg); } static int load_firmware_secure(struct wfx_dev *wdev)