From patchwork Thu Apr 29 08:36:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 12230785 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=-17.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, 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 7CC51C433B4 for ; Thu, 29 Apr 2021 08:38:37 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E1D0A6141E for ; Thu, 29 Apr 2021 08:38:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E1D0A6141E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=X692JUFgjtG6gdFC3apVjirsrsABb5UuTS0RL+oIxA0=; b=OvLEaNEaPh6RYLR1g0dWhiqwC Ld3N+QqP5ZV2T/sAZG8t4eMxfW9WitKeyVS7yM2Wtr1LiSbjQV1I3+m82iljM1RU2PSnGFZtf3x1D wdnTpGw79juox2sfRV6hplDNlqhQ3kfOX+QFK8l2Nw3lD/dp5EaI94Mxn0cq2s4TIWh8jMLuTa85z Wxh+k4acNMwnd5VfhPk6NO5CXwHwIk8ljwXT1WCfkhnhF9j5oVA7uSrzkXV3On4vXV6d3ePsatSNM ZqlbI+tHA/XlHaD7RLetTrelGaGdbD5F12XOPY7XOH4V1sFMSapWtflI3Us4qo6l0R5PRGZOVOPNN maCXxm5oQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lc2AQ-005KC5-MH; Thu, 29 Apr 2021 08:37:02 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lc2AG-005KBG-VR for linux-arm-kernel@desiato.infradead.org; Thu, 29 Apr 2021 08:36:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Sender:Reply-To:Content-ID:Content-Description; bh=pd9ug0/iBbRhIbfZpZwiccfCmUnYf+oX0lPztqVLGZ4=; b=t29E2XMaShK+XGHEu67DnSfNpP keI5G4lvWO++20Q5XjNMwyexo1l6RJ1KWeUiiS8paVXAJmCSQpTqHYwxgIssEQ45zcS0Dd0PSiKWH IeSy+/QsDG+dCJgu/8n4Ocu9Zje25e1CILRNJ10ZGGwaUM5HC1nWbETV4v/FiIUIj5974iuFcGciM MqDvJ4tHNz4szcuUw3iuAszzi/5rPVYUUE7WA+Ow2AsJW6mIV3Vq5lv4QGu8btA93jfjMrAY/Vo5g rif6S9NQDCNQFbsyjUrDUUGogWysdIo9G1iFyi18GtYRKl1xxrIe7xd0F0ZmySRs8zx+GQK1s0lpT lK2PEJiQ==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lc2AE-000UZF-Hk for linux-arm-kernel@lists.infradead.org; Thu, 29 Apr 2021 08:36:51 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 02CBE61289; Thu, 29 Apr 2021 08:36:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1619685410; bh=MeLEsLw6D27yIvjQ/kVD7YJHUqg3HKZl6KtwqpCreNs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IW7NtWq1kOKSpdZ0t3EbHV1G9raGE+iIzxS46CQTSI3s4y9uQ/263WJfMZ3aMSAcD 3wQE3PYuMC3RSGsU6ad9jTzoX+vAfnWiRULC+CcPDb5MDRCDGVQNWzz4gld6H3DODW m4KEUBiD4QNqIISPOb+lbOomUGyOG/P4UCUyzdoM+QKHkaY2MHAHrb6Qbv1JU+zgsh qm7Y7EPApU9qh4OtJRVwtRcMxm+dhHJkDFd3vAP91wKtbuPhdFw5BA5gxfgR22wOyo IdUI0XrOljA3ugdMH1nzmIlD5LwdzvJPoV9Zy6NDIRBE28NKqlbHZH7pLrvVWZLoTp TSe0oV5GwQtOg== Received: by pali.im (Postfix) id 295097DF; Thu, 29 Apr 2021 10:36:48 +0200 (CEST) From: =?utf-8?q?Pali_Roh=C3=A1r?= To: Gregory CLEMENT , Andrew Lunn Cc: =?utf-8?q?Marek_Beh=C3=BAn?= , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 mvebu + mvebu/dt64 2/6] firmware: turris-mox-rwtm: report failures better Date: Thu, 29 Apr 2021 10:36:32 +0200 Message-Id: <20210429083636.22560-2-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210429083636.22560-1-pali@kernel.org> References: <20210308153703.23097-1-kabel@kernel.org> <20210429083636.22560-1-pali@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210429_013650_644827_4D2AAF23 X-CRM114-Status: GOOD ( 13.55 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Marek BehĂșn 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 non-CZ.NIC boards that do not have manufacturing information burned. Signed-off-by: Marek BehĂșn Fixes: 389711b37493 ("firmware: Add Turris Mox rWTM firmware driver") --- 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 f85acdb3130c..d7e3489e4bf2 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;