From patchwork Thu May 20 11:35:18 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: 12269745 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.4 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 0E8EEC433B4 for ; Thu, 20 May 2021 11:37:36 +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 8FCE360FEE for ; Thu, 20 May 2021 11:37:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8FCE360FEE 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=/O5CZQaFnb/+h3zRKCSowpb1x3zahR6XOMizAgW2JfA=; b=EQVKK9nQ+6bjqE1/sKRjiKWLTD qzNF+s2gbd+9A8/Ph75w9+ufkm6rDkahq9KpLhdV2mXrEgJ/aswz+dB4dnt3bgn5Ub2EQvx3UuMwk lAYgChna9GqHO0VgMat4iGQtXG/gDTh/38OTvzNwfL0ctHndOl8DZZjiJc3QahunHmD8W29Mc2hMe WHTN0avQQZMhFS+Sd3oj9fv3N0lbgFfYmF7Ur4eeQpcSisX64mKoPrGM9gLafDxhwdAAzsXtDpWbH wvW/WWMCvaOjozr/+TjZgOY6jee+/p7O/ezVo8XkcJnpBqsgCs9v5EZqu8y9D90Dn6kVuso1v1woX QzSyrpHg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ljgxs-000VoA-KV; Thu, 20 May 2021 11:35:44 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ljgxk-000Vko-P0 for linux-arm-kernel@desiato.infradead.org; Thu, 20 May 2021 11:35:38 +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=x1q0Yij+PokrqPfZdGZIcHAmnwAyy0jlg9i0w0xoTJw=; b=O9bNJzv/7rLIx1SiHVEBzAVN23 WiQJ5wwUXdMOK0thqnV1u08j5CrthSWvuxyG7ug0B3iG7eTKjcHg6nd6hfTfu7OxGAa4h/A10IXj6 ccwViXhuJLxnPow58Mrh8jd1e0pPIEINc4cO1Ic+X7OhXVDMSVknwnHoZQmdSFTizNW2fm7W5IBxN ahy27Et3Afeki1XS98B/yPXs4IWJUYVe6x/FY6ISW81G1v2MML53upaiwlo8Z9DJKiticOKFQ6egg MCVm5v00p2AxRal5Oeuw2rd9jZFcBaYmSkbZUrNy/e3woFWCPQSMiPvWtirbz0JoF1PkXbxnhXnym 35vFLZRw==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1ljgxh-00GFvS-U2 for linux-arm-kernel@lists.infradead.org; Thu, 20 May 2021 11:35:35 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7D29E6135A; Thu, 20 May 2021 11:35:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1621510533; bh=24Nsl8oN56bAduw/YicAP/q9D+8TJgKDdu5gQxqytLk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q4NN7oJFQNSbTFjFIJZRH0n2Umj69/HQJnIO4rJKrFojYNwYJq06LEzjUrr6CWmSd 2V+y+bUPJs293YpQCY/FNVPfECTrhSe0eF7V+VOJJgRSxtoxzQEsZsLhdMnIz0e6pE c60Tb6Hj3zGmYVcVYRnEJKxPKDC4rdmHYF7Shsn7IbvGVHRrzyL2WVAxFpvCaKZH6k j/Y6SS2mkmqygfkx0L5Nn1T7Y+PVTTXU+W4n/Greas/IzrjeX/fWK0MpsM+QfwYVH/ adW3BGzZtZtm6+uZaZoWWLbVUeXVAuQE0PLa7kPnHXfSf9MaV7WL9mtY7wb20rWaKA P/228fWS34oYg== Received: by pali.im (Postfix) id 8C52F9E7; Thu, 20 May 2021 13:35:31 +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 v4 mvebu 2/4] firmware: turris-mox-rwtm: report failures better Date: Thu, 20 May 2021 13:35:18 +0200 Message-Id: <20210520113520.32240-3-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210520113520.32240-1-pali@kernel.org> References: <20210308153703.23097-1-kabel@kernel.org> <20210520113520.32240-1-pali@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210520_043534_008270_66C993F3 X-CRM114-Status: GOOD ( 14.19 ) 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 boards that do not have manufacturing information burned. Signed-off-by: Marek Behún Reviewed-by: Pali Rohár Fixes: 389711b37493 ("firmware: Add Turris Mox rWTM firmware driver") Reviewed-by: Andrew Lunn --- 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;