From patchwork Mon Mar 8 15:37:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 12122777 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 CE9B0C433DB for ; Mon, 8 Mar 2021 15:39:27 +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 56D1365208 for ; Mon, 8 Mar 2021 15:39:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 56D1365208 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=P9SUpkTlDgVU0GpmQdEYtx/m2u9Qnyy789gCbqae288=; b=cifaNFMqdapnMmvIe0jq4YCqf Y7juR5EcWqc+808tpyFWszSvTG7bhmyK7nsx6U1AJmwOiZjExaoyxp979+VsfLBUrPq3qe6bGfyr2 HYEbo0CNP+lP6jemRJMbcbc7f+gJem97TvEsyX6THm/tpNk9oM50wuAlFs5pvdzkmUQxQDri4Vy7I e4sZeSqAo+0y2PDrmtnjmEIqg7DAYamumudvj2cpqZWjCqUaKMyBMGlhq0jzcH8HG5cm6mJf9ulLS Keb05Vh7ZwWSTyzLmmnLNG9/SwG3eiBvYgfFwqHtRmaHU4dckcUp8PwNdKJEJkrkeNLnqDk2XHruN MyyRXUEpw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lJHxB-000eyw-Le; Mon, 08 Mar 2021 15:37:53 +0000 Received: from mail.kernel.org ([198.145.29.99]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lJHwt-000eoR-6V for linux-arm-kernel@lists.infradead.org; Mon, 08 Mar 2021 15:37:37 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 35D6365226; Mon, 8 Mar 2021 15:37:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1615217852; bh=DWXhdU4fbTmQ8ZdSnOtkGfJ+kEZcEYeSsHL/SKnku70=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OiAKEHl7Dw1yPnv0c1FshwfQubOmKCjzW7+BwVd6ue7UcG5L8U5x5/pRsupJYSTt9 BC3tNdgnaRmfEiRGkxMyVlRBTcxqbAFuE9A9Vt9KVrjBDB4MLMHosgBeV5wE0PSmmv Od5puCgYCGy1XKhrVCtCYCVefj54v20F948XiAPye3uX25ZSPwquY3ptNch6Uf0eo/ ya3IeQ9m/Ia7SD6doV8sm1tkSNKUTxFg9wsygIEy5iMyVebbOTWrOtIIhxdV1ebPMs UDEUNn/uLdk79yNa6lskfTGhQlKKVD+EWjUSnBGhZ/75yeZet3UFxe53fLrY+TjXp2 +s2n68411JNyw== From: =?utf-8?q?Marek_Beh=C3=BAn?= To: Gregory CLEMENT Cc: linux-arm-kernel@lists.infradead.org, pali@kernel.org, =?utf-8?q?Marek_B?= =?utf-8?q?eh=C3=BAn?= Subject: [PATCH mvebu + mvebu/dt64 2/4] firmware: turris-mox-rwtm: report failures better Date: Mon, 8 Mar 2021 16:37:01 +0100 Message-Id: <20210308153703.23097-2-kabel@kernel.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210308153703.23097-1-kabel@kernel.org> References: <20210308153703.23097-1-kabel@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210308_153735_440600_E677A7F1 X-CRM114-Status: GOOD ( 13.44 ) 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 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 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;