Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1371945rwb; Wed, 28 Sep 2022 17:54:03 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5C3rIRSw3SLemibI05RPWImZ+8oBXEc47w9pp1lVSZsNVxWQvKCF1MUnkWzV9lta6gg5cm X-Received: by 2002:a63:82c2:0:b0:43c:e315:dcc3 with SMTP id w185-20020a6382c2000000b0043ce315dcc3mr516158pgd.39.1664412843086; Wed, 28 Sep 2022 17:54:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664412843; cv=none; d=google.com; s=arc-20160816; b=TJ4mkq7lJrRgQ8j9MshMWQ2NZ7lWREFBeLMJnrPQ9w/HKuJs6EPA1Vpg5dhUkukQVS 84Drnzyqa30R9H0HPbyRuguNI7EYZ2yABtANm92awV1TuoGYx5z7TBypmR6u8z3479ga sJ+1N4b3M/nTwQZXEZpREXQiAURz27e1WqZ8WZ+8mzzuQ2tB7oaEzMqMnwWwQNNKamx4 GdsA5paKSxc7WCPLh7oJGFkmL9+LESF2+uDE8/xz+btqDSzo0oUVCeKX+O0bKhHnMs19 21DLXPmY4GLclkYH41K2QpNKBb9wNQ9CTYt2pJyjuaczoxUz7OXaCyGMDIy2Ot2QZE1z 7Gmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:user-agent:date:to:cc:from:subject :references:in-reply-to:content-transfer-encoding:mime-version :dkim-signature; bh=eUy48D9x0nlhjh0pYpVDrtBH/wuQAKXXf/796K5eIlo=; b=m6+UsKAPyDzG4l1mgUV7yZGusV4eNiXMTFmgiN+0vyO0ZogqpytI9jL5/uIw+uvwXH rBDW9istiPOP54rB2VL0av3NKKKjqqd3NSLICfaoWXR/4Kax+9+OxNWmE4HLKPDRvy0t 1s8w02bwvcW2DnE4wLcPNyUY3ilp9PjxY7qc97x3uDLvHNyH5/ODzFId/RPD9kxpEmND 9eHJzKV6g+ZSDDiWC+wDyeOorNlWSoajOCX4rAaKkIaquE4/GN4ts1QI7/IAT1mXE4cz xZkcIx5AIuC1MK48xFnVMcZxKTVcsk2yFEI5Hg6icAQWyvEVUz+iUD0s+Ffm1EJUckgE U4SQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="gV8D/rXo"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n20-20020a17090ade9400b00202a519f846si3650215pjv.173.2022.09.28.17.53.50; Wed, 28 Sep 2022 17:54:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="gV8D/rXo"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S233601AbiI2Aah (ORCPT + 99 others); Wed, 28 Sep 2022 20:30:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231650AbiI2Aae (ORCPT ); Wed, 28 Sep 2022 20:30:34 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02D74264BC; Wed, 28 Sep 2022 17:30:32 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8D11DB80D8E; Thu, 29 Sep 2022 00:30:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A61AC433D6; Thu, 29 Sep 2022 00:30:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664411430; bh=eUy48D9x0nlhjh0pYpVDrtBH/wuQAKXXf/796K5eIlo=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=gV8D/rXoETDpYx4KplcHKwUCcpisrEiEhucasBC0Ud5gY7J/Ur9szwI6bqVnyqOAZ VoOltze3ZHCRcJmGtAwGvG/nudYSBtu0FmXIZ46WQznDSQNzDPQ8doPWTT25LBsShG QTkpoeZDiV+oCB0kVI+DjOve+k/45SlvYQu+qAjPH6uq3LvOMi9o++bX4eYySeeCt+ N7RYj/gUB10IKcpORHKSYuFbTOUY6RjTHeerPLVKNKWST+yhSXsbWvNRhSpWxIbwM0 lTw8RXM+4xl8q+qsSKnHtnlDGXhIsFVNOy4d/pmNO/GwQBgrufOETKy8MW8aLuSDYW UI+9aTHUVAKmg== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <20220909123123.2699583-2-conor.dooley@microchip.com> References: <20220909123123.2699583-1-conor.dooley@microchip.com> <20220909123123.2699583-2-conor.dooley@microchip.com> Subject: Re: [PATCH v5 01/14] clk: microchip: mpfs: fix clk_cfg array bounds violation From: Stephen Boyd Cc: Paul Walmsley , Albert Ou , Claudiu Beznea , linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, Nathan Chancellor To: Conor Dooley , Daire McNamara , Krzysztof Kozlowski , Michael Turquette , Palmer Dabbelt , Rob Herring Date: Wed, 28 Sep 2022 17:30:28 -0700 User-Agent: alot/0.10 Message-Id: <20220929003030.0A61AC433D6@smtp.kernel.org> X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Conor Dooley (2022-09-09 05:31:10) > There is an array bounds violation present during clock registration, > triggered by current code by only specific toolchains. This seems to > fail gracefully in v6.0-rc1, using a toolchain build from the riscv- > gnu-toolchain repo and with clang-15, and life carries on. While > converting the driver to use standard clock structs/ops, kernel panics > were seen during boot when built with clang-15: >=20 [...] >=20 > If parent is RTCREF, so the macro becomes: &mpfs_cfg_clks[33].cfg.hw > which is well beyond the end of the array. Amazingly, builds with GCC > 11.1 see no problem here, booting correctly and hooking the parent up > etc. Builds with clang-15 do not, with the above panic. >=20 > Change the macro to use specific offsets depending on the parent rather > than the dt-binding's clock IDs. >=20 > Fixes: 1c6a7ea32b8c ("clk: microchip: mpfs: add RTCREF clock control") > CC: Nathan Chancellor > Signed-off-by: Conor Dooley > --- I'll merge this patch over to clk-fixes as well.