Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3865974pxv; Mon, 19 Jul 2021 10:37:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyRDOm1Jst3mXwjijV5jjeHbhDjz7ZysNLLE+f8ymH3CinP0vgKy/7xamjaET11xhtgqNlm X-Received: by 2002:a05:6402:502:: with SMTP id m2mr36194033edv.57.1626716227820; Mon, 19 Jul 2021 10:37:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626716227; cv=none; d=google.com; s=arc-20160816; b=dlobMJyLBrLLJyWflfBcvEY7p04OsNA+ireJhXtsPOiNuv54SeMHUaBVomtgn4WZVi E06y6X5DZamfS7b4riLH75GZ0gTkNC+w62nEwvDdBL3WsaXaGHtPFwN/D3SBgEr5i2nU rIz6l++mJlvsb4gXKVcKaCRsBDxGP+aaZAW6/nhjWhv6XsA1V6e01X7uRgMPng1PCvQD 10iNOE3LvLLVZ7/1gRkOl3gWLRO5m1HpV9eUO6q3n+vfm/cV1agvY5MVQLlRIKwsZ0Q5 R7n+mkiMiTCSigC4yF7bHBM80fig5/Zf5CQYFYWGX5J6XcSnhCO+fxs001iKoX12xpKx 9dug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=aHkPilvxbcEmz1fUGHlSRtVbP0wLfplB2tOLiOvBRnw=; b=KapJCfxzDpeGt/nU/Or7wWAKEhJmSnzPaY4zMiTzmSKU4KvEhiBN+AdsuX12PBQyDX QVJ9goWkT8+y9SjGV2RAxuuQgVjbCW20I/phhvyF4GpPSVwkv7Qo+/uljSQAEzqDgXC7 RoDcwQeh5U37O/C1sV0ZNoWetvh61UC2b8MRiFDuPlX1LVtMYnEiwB+AEvCftXuAiEMh 6xkt4Uw/EZK/VF16yfH3ZKC6iJG5wfeDpTiZQAIq9bcW1sKWSwt4s4FDxF0gOCsGc5kN YGFtz/F29iUBrExYIeJxlEfsyuwL4ySXNy3b7tYJ6/+YyVZTs6cr43r9SrkHb1fydN6c w/JQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GlwPWgIY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c20si20533839edw.229.2021.07.19.10.36.45; Mon, 19 Jul 2021 10:37:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GlwPWgIY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353356AbhGSQu0 (ORCPT + 99 others); Mon, 19 Jul 2021 12:50:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:41026 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348068AbhGSPYd (ORCPT ); Mon, 19 Jul 2021 11:24:33 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1342D61402; Mon, 19 Jul 2021 16:01:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626710468; bh=Atg+ShOxgkOQ6B8kdEjyZwFGVRtIPYzDOkgc04DgZ0g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GlwPWgIY/w6XDd2Is4W72JAdJHOGkHyD5JxkSqNq4cJh+YFqCJwGcHBOI91jaW7fg AmRunKigc/wavUBUbgEikll2JfMP8vdggGgACxrww4uMwdC1nhJdmA+OdkUpKocJCo Q8jtG5eweyR865EREYLg8FpDeAwHEsXPEAy5RX+w= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Marek=20Beh=C3=BAn?= , =?UTF-8?q?Pali=20Roh=C3=A1r?= , Andrew Lunn , Gregory CLEMENT , Sasha Levin Subject: [PATCH 5.10 230/243] firmware: turris-mox-rwtm: report failures better Date: Mon, 19 Jul 2021 16:54:19 +0200 Message-Id: <20210719144948.341909759@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210719144940.904087935@linuxfoundation.org> References: <20210719144940.904087935@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Marek Behún [ Upstream commit 72f99888944c44de1c899bbe44db1e53bdc9d994 ] Report a notice level message if a command is not supported by the rWTM firmware. This should not be an error, merely a notice, because the firmware can be used on boards that do not have manufacturing information burned. Fixes: 389711b37493 ("firmware: Add Turris Mox rWTM firmware driver") Signed-off-by: Marek Behún Reviewed-by: Pali Rohár Reviewed-by: Andrew Lunn Signed-off-by: Gregory CLEMENT Signed-off-by: Sasha Levin --- drivers/firmware/turris-mox-rwtm.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/firmware/turris-mox-rwtm.c b/drivers/firmware/turris-mox-rwtm.c index 54b98642ee1b..0f9e40a28fb0 100644 --- a/drivers/firmware/turris-mox-rwtm.c +++ b/drivers/firmware/turris-mox-rwtm.c @@ -204,11 +204,14 @@ static int mox_get_board_info(struct mox_rwtm *rwtm) return ret; ret = mox_get_status(MBOX_CMD_BOARD_INFO, reply->retval); - if (ret < 0 && ret != -ENODATA) { - return ret; - } else if (ret == -ENODATA) { + if (ret == -ENODATA) { dev_warn(rwtm->dev, "Board does not have manufacturing information burned!\n"); + } else if (ret == -ENOSYS) { + dev_notice(rwtm->dev, + "Firmware does not support the BOARD_INFO command\n"); + } else if (ret < 0) { + return ret; } else { rwtm->serial_number = reply->status[1]; rwtm->serial_number <<= 32; @@ -237,10 +240,13 @@ static int mox_get_board_info(struct mox_rwtm *rwtm) return ret; ret = mox_get_status(MBOX_CMD_ECDSA_PUB_KEY, reply->retval); - if (ret < 0 && ret != -ENODATA) { - return ret; - } else if (ret == -ENODATA) { + if (ret == -ENODATA) { dev_warn(rwtm->dev, "Board has no public key burned!\n"); + } else if (ret == -ENOSYS) { + dev_notice(rwtm->dev, + "Firmware does not support the ECDSA_PUB_KEY command\n"); + } else if (ret < 0) { + return ret; } else { u32 *s = reply->status; -- 2.30.2