From patchwork Thu May 6 09:07:58 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: 12241887 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.7 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,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 659C7C433B4 for ; Thu, 6 May 2021 09:11:57 +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 C79326100A for ; Thu, 6 May 2021 09:11:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C79326100A 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=SYRCH0xoqTw9VbYvHcBaa0CZe 2VGBy/pB2AHigGUgHBcgVMM4yEDgsGShNmX+FYGRe62mr7Zoals5+08SQ3i/Wut4VYnbXD3LIVSLz bu2xfrrpgkhGekQxkNNrWSBTv0yheoFgkZ+I/RtphP8XbEi+880F8DbcZ7htK2y8spyht2iMoBxEX oFJ9aPML6gY/rVnvxsLMzQSS9wwwbnztBYFa5KRDLbEAjSNR9pAo4kzmIgf1zMyEfLN7mxYZxDgGe sCJ301NmANgnlKTMbtw001nwmUjmgDetu6FE/8Pkx9fm0yssVlh4i1izdytmVTSOUf3p3XP9o4e3X q83YYAZuA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lea0C-003krj-VZ; Thu, 06 May 2021 09:09:01 +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 1leZzi-003koV-RJ for linux-arm-kernel@desiato.infradead.org; Thu, 06 May 2021 09:08:37 +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=YF74W7+jqRC85Pzd+cjUhjfaGH ycXrTEua0PazzHG8x0KAlgTdGcvt9pSNAaW1ljkdkChuPabBKxEIpHUTdgWD6DAwKd2Ve+f64qGGk ierZeHd7oNC6mcSwysS2IpefWWxBlVJ+j5DOVGO/9QVFRdAFvWXRPjM0CvXGP5UCryIb6FvvLBhXe fL5ZjpDieygP0LYWxNOcamZRltrzniCO41let98uIxOxPRst9BlOq/JFbrBqpaFDJa5fvzUG+ALUv VJ11gIws249L3bTSM4eJQyV7udTdmJb6U2615ih6FpsESqCbdLoLI0HYvmD81c8Yv8RQSSAZaS7Qa X2t0XgAA==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1leZzg-005tQc-Bj for linux-arm-kernel@lists.infradead.org; Thu, 06 May 2021 09:08:29 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id DBD5F611EE; Thu, 6 May 2021 09:08:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620292108; bh=MeLEsLw6D27yIvjQ/kVD7YJHUqg3HKZl6KtwqpCreNs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ppFfWfUXBpLxfS3Ih6t60uqrk/ob2Ir4lUbuZFoJzDt9EtUW5oXm5z0PFXMfmRq8k Z+PrrJ5sHZAHtqS+JpZ4hvZbQhhN2Rc7qpkxw+/PYPw1GdaTEVUyrkf+dRRIr+9Yag RQAhz4ZON8p/Djxx1/tQDsSVgNbEDXqHl+rj7aGJ9o7fAhhbeqVSzlnpYdiAXl9Vxb fCKoHMnTsPkm1Jnsf0gqfDj8kSJWoQ5JNL4rxz2X19Pd+Mu2vLmVXofKeKYIq1AqQz xFE2dzXJaEoyp1L7UjOVJIGGnThIFcu/VrTIsiTi7Kx5SayJBpW7T/mrjQjubGb4DT aehTpB1ItdVvg== Received: by pali.im (Postfix) id EFC977DF; Thu, 6 May 2021 11:08:25 +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 v3 mvebu + mvebu/dt64 2/6] firmware: turris-mox-rwtm: report failures better Date: Thu, 6 May 2021 11:07:58 +0200 Message-Id: <20210506090802.14268-2-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210506090802.14268-1-pali@kernel.org> References: <20210308153703.23097-1-kabel@kernel.org> <20210506090802.14268-1-pali@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210506_020828_452126_96309804 X-CRM114-Status: GOOD ( 13.68 ) 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;