From patchwork Wed Jul 13 15:49:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 12916936 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 10D52C433EF for ; Wed, 13 Jul 2022 15:51:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; 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=5JEIzKrNKpzTSKWA7z0oQQQ1GCdP1eYaGSWB6ivszsc=; b=EcAXbk4xZtEytu QHqs84EctF79NK9ubrve7AS7PDCOa95xMcDH4VHVInFljWzG/XU2lFdpF3OilO4mmf5DxgxgSYr4E Uiew7+r20RUqFQNGl4wyCdgecyHQGwvf7joBPHPrjNCNuDXrR2WGlu9tbxyJLWjimFHgit1/nrOyL a7CGOdV8n/f+e77OAb7VV7hZ4BYJrZfXyJ24wQjTG8e3Ef69SOT+oyQ7vibuXcywcgaKPK5SC0vVN iOQisV7d+k5yRWXxIhDjig/w3iAQHGlOWreedpQZLl1n233klKGqPh3Le8Qnoar/0q9MdusDVB1eW zbV3v1JnijyY8i9g9ktw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oBedI-005HTM-In; Wed, 13 Jul 2022 15:50:36 +0000 Received: from mout.kundenserver.de ([212.227.126.133]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oBed6-005HIQ-12 for linux-arm-kernel@lists.infradead.org; Wed, 13 Jul 2022 15:50:25 +0000 Received: from localhost.localdomain ([37.4.249.155]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MmUcL-1nlMDX3e4X-00iSaV; Wed, 13 Jul 2022 17:50:14 +0200 From: Stefan Wahren To: Florian Fainelli , Michael Turquette , Stephen Boyd Cc: bcm-kernel-feedback-list@broadcom.com, Maxime Ripard , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Stefan Wahren , Phil Elwell Subject: [PATCH 1/3] clk: bcm: rpi: Prevent out-of-bounds access Date: Wed, 13 Jul 2022 17:49:51 +0200 Message-Id: <20220713154953.3336-2-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220713154953.3336-1-stefan.wahren@i2se.com> References: <20220713154953.3336-1-stefan.wahren@i2se.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:jGsizjmPYWgMoUirvQPLUgxsbQQ2ElofdI3BKUEign/NkaXhQnb 7QjSp9tRRJjSoRwYo2JCI9mm5WE4aTOFLAXAb7B4AU8+U27vsejDtad6uMOwUTiCs7HYia9 4slz0QSgGGiFI55mLVpss+WK/KvQYCtBOwQSn1E/LesqOJhf2BivXmj1vBeUTVPQZUTxS2a W3IWa+gsVuN0RW+ci6LxQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:JZF35l+UcLk=:3rrKjxywLhZnx3saFAZ03f RMfNv9To5MMrJae+wasiax14VAta/qz7qlHqYscW9QG+W9uSeXq/Q/sPT2z1U6iEHwEyJ/Fc6 l6iWARRu/GyhECQ3JgEWVxp3X9z1N1z9ba59O+O4wUc6TaYuICWxURN2yp9xTP2hVhcSIJmZs B/EIupn4iudl0TpKqHqXI3DKeIObvsmGPXd7mZsDynZHA/ZTW8F2h2Waf0JDQ1YrZUr9cMavD OIueboobopg4KlWlidkOcDW2AaFVWYis7t0HvcysUU2La0M8aeXP7G5Ayoi+pIlOAC8CPAgNR LZU+aX7CjgXHIlLDS0vGb2ZJTgSkc4u+s6Q+IA8KS72QiyLD2NbYeJ7Bo885+NeVCmFn/k9ip GpRvbFaQ3+szbQ9VKDuqtcjJ3ugpzSar85MPtaA/EzdOLHTwRzxUoQdfqo1/Yuv8xP4Cw4K1o bNvvuaB4IcOldicNvi6F0nL6dRvgGuNt96qJO/yhKOusHJYFfA0Ip4DLZj9tnKmIzw2b396dF 4QTw0brk8XiTRIL8lgKkCTXP2hjZvToJ7ZkfbBGfZLCPgjKyBS77uDcO8vSiyvcF/Ar5XgdPi DMTREaU4xn5O9599xbDHf9eMW+EYLyXyhNcF8IenY+AvCxKYjTBAfUfdBWg4pTx9D9OfkerDu sT8g3yYbA/e/Nvt8yrrZcSmH2ZoiEbsJmdPjtMMWDbrLIB2BQetGGCVeCeTPKT++h1c++0PuF BHNrLVqmNEUcsVN+8AU7CCO3BwnhyMLGi3OEPiZ8JTXZS5I/puT+etUuIDI= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220713_085024_385744_E0B54674 X-CRM114-Status: GOOD ( 13.03 ) 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 The while loop in raspberrypi_discover_clocks() relies on the assumption that the id of the last clock element is zero. Because this data comes from the Videocore firmware and it doesn't guarantuee such a behavior this could lead to out-of-bounds access. So fix this by providing a sentinel element. Fixes: 93d2725affd6 ("clk: bcm: rpi: Discover the firmware clocks") Link: https://github.com/raspberrypi/firmware/issues/1688 Suggested-by: Phil Elwell Signed-off-by: Stefan Wahren Acked-by: Florian Fainelli --- drivers/clk/bcm/clk-raspberrypi.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/clk/bcm/clk-raspberrypi.c b/drivers/clk/bcm/clk-raspberrypi.c index 73518009a0f2..79cbf0c0b401 100644 --- a/drivers/clk/bcm/clk-raspberrypi.c +++ b/drivers/clk/bcm/clk-raspberrypi.c @@ -344,8 +344,13 @@ static int raspberrypi_discover_clocks(struct raspberrypi_clk *rpi, struct rpi_firmware_get_clocks_response *clks; int ret; + /* + * The firmware doesn't guarantee that the last element of + * RPI_FIRMWARE_GET_CLOCKS is zeroed. So allocate an additional + * zero element as sentinel. + */ clks = devm_kcalloc(rpi->dev, - RPI_FIRMWARE_NUM_CLK_ID, sizeof(*clks), + RPI_FIRMWARE_NUM_CLK_ID + 1, sizeof(*clks), GFP_KERNEL); if (!clks) return -ENOMEM; From patchwork Wed Jul 13 15:49:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 12916938 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 92CD9C43334 for ; Wed, 13 Jul 2022 15:51:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; 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=7BWQ9I0pHrBtIzo33OqXSyAdGOpXaJNgLwJuAIQzynE=; b=UdarF/u+nQzO4G R3cmCypovm/cgpLT6bwkrEYGQeuJ4DJ7RZGxCPRVUtcEM/VoRtTN96YuZZ8hJ59/rb/GEoAEOCZZw HN6mwosGm+QL6QqlFFIEi3+bb1DGDsyG0w8Ffffpep02U+yHsBOa4NvQH7uGsqfeyCFq424HKfTLb ndMSEXMM8m/wFDA3NCLlDAyoNFSNLKQCoJbUTtyObsGs3ISiQs9GRmdIEwiBTPgThE3TyzSaI1WuZ VqKliUFYMfzY+0NxhpXT8FsaOm7BqXXAEkyGhi/y0UkZgOTRy1dNSjGPXP1m/wN4cK5GfFd2R5Z7Y +N6aaPy1V2/WjXLkBELw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oBeda-005Hg5-Rf; Wed, 13 Jul 2022 15:50:54 +0000 Received: from mout.kundenserver.de ([212.227.126.134]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oBed8-005HIN-TB for linux-arm-kernel@lists.infradead.org; Wed, 13 Jul 2022 15:50:28 +0000 Received: from localhost.localdomain ([37.4.249.155]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MVe1U-1o1ekN0t6K-00RbxS; Wed, 13 Jul 2022 17:50:15 +0200 From: Stefan Wahren To: Florian Fainelli , Michael Turquette , Stephen Boyd Cc: bcm-kernel-feedback-list@broadcom.com, Maxime Ripard , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Stefan Wahren Subject: [PATCH 2/3] clk: bcm: rpi: Add missing newline Date: Wed, 13 Jul 2022 17:49:52 +0200 Message-Id: <20220713154953.3336-3-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220713154953.3336-1-stefan.wahren@i2se.com> References: <20220713154953.3336-1-stefan.wahren@i2se.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:sGcyrdiutb7GIoCLipnUr6iIVEMZ+gsBWeTC2KmS5tqLdxpzkyB Wk50z1h/Ma6Xmm+0SdXcZ/Iqy79E/fhfv67qOruy3qvyOC8hmQstbNOC5rQEzFLSYVDI2wR ne//FkZ85AwORjyJLCnHEx2Qg/gyFip5RVqYrQJYQsjh/FXJCEeJFBnA49JsB2egqqgdiV+ OXgHcxBB7DTrzt4sAiTlw== X-UI-Out-Filterresults: notjunk:1;V03:K0:BdWXRuZEhGY=:HySxyUUrMsch78s564Xixj spPtAVQkZQRDJOHen31aR66pqhayupEtzY55Reih+bAv4aHtWLGcVTg136zAqGN2oZQQQVgiM KgsaICaOtbQpX665ShyVbY9uaXizcIncqpm8CeAZIqVrOWeqKoQinEaMceQzl7ePh19+UkuS8 b1rzCUxaWRuX0rbMblFSdJ0UXj4DuaqJHc4K8xnVFsDPbCmhjuizX9rMCYwMWGY7ITq8ATB3E RTJnuBY9ceRP8fUN6e8M1Bi4FtjMvCtnuLTt1o3oseidva8UqnnsDelFeiI/Er0X7Hp1hrNkE ZwzE76mnbT3JB5csjjKqcfvT/H+8RGEI/twYtnEM/rQsB3TwBlSrWFA8/D/7BWTwd53fAPQNI qycFpUPFmNIUDo+rQcid6XgB/Uv98vIQUdEpYeOOObl0xJSzCdJnloxnC3M8HzOcha5wnlK6o an+16M8CcBMjfJSVyEx+UWOFd1jT+eRQQy0oakEYOEvWEhNBzgmSWB/yBQ1dRD7OY2zFzC7f1 on5JEHISRBg+OjL+XVHor9PYZA4AZtxfSozzzGbLFiDrDHrrMFGMmlABBy7NGIh22xvC+dAHC x45quEtcbEyNE6/FaZUiTCZ5s3CYAI166FiyB1Rj4JAUkL166aqYy1G7cOSYkWCtk9XgggomE P/YY5v2u2ZUEdsGUaLoNum4QsLKV/wr4T1z+Sov5XXVBnuo/9uImqkm5ce+wQHTYxvZ7ifLJ9 XrjeL2CBdJuvn3IVghjEzo66KFunMZiQnCnBuHiwrUTAYnrQX4aHz9OmqYQ= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220713_085027_260804_F3FDD887 X-CRM114-Status: GOOD ( 11.51 ) 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 Some log messages lacks the final newline. So add them. Fixes: 93d2725affd6 ("clk: bcm: rpi: Discover the firmware clocks") Signed-off-by: Stefan Wahren Acked-by: Florian Fainelli --- drivers/clk/bcm/clk-raspberrypi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/clk/bcm/clk-raspberrypi.c b/drivers/clk/bcm/clk-raspberrypi.c index 79cbf0c0b401..b3b629516182 100644 --- a/drivers/clk/bcm/clk-raspberrypi.c +++ b/drivers/clk/bcm/clk-raspberrypi.c @@ -220,7 +220,7 @@ static int raspberrypi_fw_set_rate(struct clk_hw *hw, unsigned long rate, ret = raspberrypi_clock_property(rpi->firmware, data, RPI_FIRMWARE_SET_CLOCK_RATE, &_rate); if (ret) - dev_err_ratelimited(rpi->dev, "Failed to change %s frequency: %d", + dev_err_ratelimited(rpi->dev, "Failed to change %s frequency: %d\n", clk_hw_get_name(hw), ret); return ret; @@ -288,7 +288,7 @@ static struct clk_hw *raspberrypi_clk_register(struct raspberrypi_clk *rpi, RPI_FIRMWARE_GET_MIN_CLOCK_RATE, &min_rate); if (ret) { - dev_err(rpi->dev, "Failed to get clock %d min freq: %d", + dev_err(rpi->dev, "Failed to get clock %d min freq: %d\n", id, ret); return ERR_PTR(ret); } @@ -365,7 +365,7 @@ static int raspberrypi_discover_clocks(struct raspberrypi_clk *rpi, struct raspberrypi_clk_variant *variant; if (clks->id > RPI_FIRMWARE_NUM_CLK_ID) { - dev_err(rpi->dev, "Unknown clock id: %u", clks->id); + dev_err(rpi->dev, "Unknown clock id: %u\n", clks->id); return -EINVAL; } From patchwork Wed Jul 13 15:49:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 12916937 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 99CCBC43334 for ; Wed, 13 Jul 2022 15:51:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; 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=llrL8/pYIxMTKW/VTLfSTStgjWCs6alUtEywHk4MARw=; b=l6vg+icNRXUKIj GcSXbtgh3xGCbwELCMC3Dp4/f4f8aJdpdy7gpHkZH8lKcaVssXsb0VwKYOHTehn40+i9Po4GHf3im dhO5g6pjGwpf68Q0W8a3hF4KIbbEw4prPTLa74kK2fchcbZLiqJnYR694sOHMWyzuyI+w2eCheKRS kh1w/NfrwI5aN3O0Rx5iSOGA7jPIWUF7HHOzoVKppCt16B8MP0FV5tcceL1KE4MqtwQWjTJPRs9RO 8LeeV4hXoDAD0BAEoedYskybOaezMyYskOkbBf0VOqAWT185CklPNeFj0H87dvp5qF82Ewlia+MP9 yZrj+orKfnuTGbdFzGMg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oBedR-005HZh-QD; Wed, 13 Jul 2022 15:50:45 +0000 Received: from mout.kundenserver.de ([212.227.126.134]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oBed8-005HIh-TA for linux-arm-kernel@lists.infradead.org; Wed, 13 Jul 2022 15:50:28 +0000 Received: from localhost.localdomain ([37.4.249.155]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis) id 1Mw99Y-1nJYVH2GyC-00s74U; Wed, 13 Jul 2022 17:50:15 +0200 From: Stefan Wahren To: Florian Fainelli , Michael Turquette , Stephen Boyd Cc: bcm-kernel-feedback-list@broadcom.com, Maxime Ripard , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Stefan Wahren Subject: [PATCH 3/3] clk: bcm: rpi: Show clock id limit in error case Date: Wed, 13 Jul 2022 17:49:53 +0200 Message-Id: <20220713154953.3336-4-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220713154953.3336-1-stefan.wahren@i2se.com> References: <20220713154953.3336-1-stefan.wahren@i2se.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:8mnJLUyPm2j8Dg6SBPoCNRDkohg99QfXZh8VkkEFevhN5A6P6sP nBIu5b5oVOrVqz3RSRFIq/uvpy8hRPJ76z3/Gq8xekVgq9nMbwd+DKEpOsafopJTe3ZoNbG rg5Nf2ARTxJpVuqZ/sVPOG3PCFWDRbwpP96G9qAh7D6ZqiRcSYeg7WVA+H1/fmHiZucdO4v EoZpfSGSrYOSQd0Rzhbow== X-UI-Out-Filterresults: notjunk:1;V03:K0:Xh7qk7C8uOs=:qEDdAYmcQ/dTXZQ1jLyBfq zkdBlORYvpKG8v663Z5MWcbMXp/+tH3PPt/IuLuSRAo/l2mhH/pkwu5bkqXPxDB7X14qPGJxG GW8/PIKtVkXTnCH/uyTEGbptdwjzV6s8FIV3Y7oj8WUFX1ukITic9N0+BgjzpRnn+pK7MoI7T PqmR3ow9dHX6X/9nrjaCEmsEGpI+R2eMCW6tOv8kCoQXxM+Q5FgYM58wW72vbD/S9Xxv+NIsT 0pMEYL3EkHbfIqs9Dor2KA7NmJIzzDBvGoyUBRon1Bu00cAkcWZZ8rLkcz/W0aRTRgBpkWKVn HE9A9Zxri71tFjALCWelIGJJX9Pcm//cjuspEclemlYfLbIUacpEIRpigPnI4qR+KAFL83tCV XjcPrOzPXzY0pce1xjTcywqqU1quRtF/j+3SG87gsrQjOhlwBl5CfPXNIzAtF9pJ7SKQBZT6t borKQtg4eBXem6TBwqadm91XxwzY/bEfwKB6BYbzLLh7nUtd5KpQGzFLCLOxmPXN/ozrFBPzu cw4KZZZ1Bvtq8qFiNopEwXO0zg1FL1WPO8sNBHw0zcdr7xODpEGs3E1YdMsS8ZPk0QEHQQgXN Yf9/zYSZqItmIfGVIhqp+LPue1j+z1rK4CHzqgU4tXmFK4noCFz6BNT8zbHemLbk3BRpN5Kh8 P+xzDl9qszO4rH00teRQ76adlSrzG4zdCWypPaOIzCAWJwtz6DvHeGLd0LHCb8eUMUHRUIyXg K74mW/gBeft29x6gkJzdlykFaDmH0mwYaWczEcxVGvfUnw6eLsXhfySBfbU= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220713_085027_264489_9ACFB65B X-CRM114-Status: GOOD ( 11.59 ) 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 The clock id limit will be extended in the future, so it would be helpful to see the actual clock id limit in case the firmware response has been rejected. Signed-off-by: Stefan Wahren Acked-by: Florian Fainelli --- drivers/clk/bcm/clk-raspberrypi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/clk/bcm/clk-raspberrypi.c b/drivers/clk/bcm/clk-raspberrypi.c index b3b629516182..676e5379ebce 100644 --- a/drivers/clk/bcm/clk-raspberrypi.c +++ b/drivers/clk/bcm/clk-raspberrypi.c @@ -365,7 +365,8 @@ static int raspberrypi_discover_clocks(struct raspberrypi_clk *rpi, struct raspberrypi_clk_variant *variant; if (clks->id > RPI_FIRMWARE_NUM_CLK_ID) { - dev_err(rpi->dev, "Unknown clock id: %u\n", clks->id); + dev_err(rpi->dev, "Unknown clock id: %u (max: %u)\n", + clks->id, RPI_FIRMWARE_NUM_CLK_ID); return -EINVAL; }