Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1197932pxy; Thu, 29 Apr 2021 01:38:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzPQIz0j2W1dKStQh7qD/gLvGr/9iPrL1gXGN+L/iq6qSBnkfm+iWZrJG2SmwUVeDQPniEV X-Received: by 2002:a17:906:fb0e:: with SMTP id lz14mr21046444ejb.424.1619685492121; Thu, 29 Apr 2021 01:38:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619685492; cv=none; d=google.com; s=arc-20160816; b=zu6yTLa8mLEQXXXZ3cZH+k9nrxcWWzt21veYBUxi9zWcvegt5zdBuOZcQZ2UTScLfK KNz5i9+4CTAo2AyMOXbItC8uQQfbyMBdSLVOCczfVB5uuUuiz6piZG104KDdz2/a9Czb afur3zZ2fc/ogy0bj1niAAL+4amusWsN4O2WS5dPvGckSZMlRv3GHGh/Y3s/BgnBURvr rPtb3CrIFAXCwdbO7ftMvNA+DPUliJRRoWwyCllm9EU7xy86zq3BhI6k8wU5oalyvpz6 YJ2dLiDjv898BQw2rmBDxzxuhiSsNG9nmg873/vyha4LNgDJE27wZlMnhek1G39qlj87 IIkg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=pd9ug0/iBbRhIbfZpZwiccfCmUnYf+oX0lPztqVLGZ4=; b=NcOZ4fIW0PzXNCpVRig9DHVvUN/JKu9TWvDxoDIi8oOjGd/sWUhB551wnHr3jKR5gN Ev2gDFYi5ZHc+Ux6c3nGy8NRCi0A8yw5gVy7pFxBy5b18y4QVallBA4CvdPNxTB7bITE rV3rcRK6NXBwwEI/xNWWut4+ZSoBOIIAlgKpTxu0jBLj1ui5gy6sNvENsPRfbgxjkRsZ A/j3IlDiThBk2ZhJLO53xpf+HYoH5mBuWw66VQV2b1u9hspc2wXzomaPCeRic4ylSfmE 5hfpe9ZJ8jir0QfpJlcehta6z6p203dfwPvAYhijACPPQo6LfMMqzvFWnpWW2Qv6HOWW g90g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IW7NtWq1; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 20si2349257ejy.225.2021.04.29.01.37.46; Thu, 29 Apr 2021 01:38:12 -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=@kernel.org header.s=k20201202 header.b=IW7NtWq1; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239903AbhD2Ihh (ORCPT + 99 others); Thu, 29 Apr 2021 04:37:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:47822 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229963AbhD2Ihg (ORCPT ); Thu, 29 Apr 2021 04:37:36 -0400 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=20Roh=C3=A1r?= To: Gregory CLEMENT , Andrew Lunn Cc: =?UTF-8?q?Marek=20Beh=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 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 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; -- 2.20.1