Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp6065214rwi; Tue, 18 Oct 2022 07:43:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM610DaWwa1F8dHTEXsa5vZz++XQgNBUTDsVx/wHZrYjZ4Vi/TFnhYas5R87Y/dx9BLIlSh/ X-Received: by 2002:a63:b4d:0:b0:454:d8b4:285 with SMTP id a13-20020a630b4d000000b00454d8b40285mr2972382pgl.410.1666104206075; Tue, 18 Oct 2022 07:43:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666104206; cv=none; d=google.com; s=arc-20160816; b=W3QYhZ1GZqeylrbc1mNdMJVytbm+oiXS/vJcIk9+SU9A8yf9shHvJvCa0vCR2MNn3x h9kVoxkkxh1L2p7uT7AxZNtD6tqZDQWy9wiP6FIOvkw6h0cGX2TY7GnD5S4r1SPgy2+x 3VXwJO5fZErNHK/+rxvE5VZOY98ucADc434NsfNJIvEqs3q2Y45/n7mFd+MPpgyruuYo Mh/iHK0d+2e5+Ca5EbhunFJ4ynyxuHI62/pl2GZa2fmuPZ8Mi75ysghfNWG/mOS8aH0k bC+ID8sXKo8tQUwf9OmE2l5XPx+1hYptPEr1YaQIw7y0rol4Ngo1VDopE7gX1HiP5L6t 1aJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :feedback-id:dkim-signature:dkim-signature; bh=gtRPidfBht3s3mfnhidv0jmAjwR4x/ZpX6vTRpwG0a4=; b=1KnYtZFPqgGxU/1x8HYG7S2dhf7CwZiFUHjbYcn5lmCIDqmx8l2bA0gEViAQNrI2hH wvUxVDY9DMOy9yJa9Z9idS7yEeMcpagLXqxGqxRCwxqPIVRIRerfvpSY4JrX+2HGtR0l pCfZ7N8SAtaekIqpaSO11ShQeGqysVPzXtOuM2ZvQBzmxaguuo3Yte+QFVulDR53mImA HajfvjcJ12onVtKxs7PQJHMXgjQRzvbNC/SvD6WhH9Yk0uj5W+xjmb/VSgxUPVIQxgLS iFEo9y1hpKQcSoP0Cgc4TNdJYBPiceNadYl8lV+cTSWwrYQT5E0xoU0zO2HqVltqrQop 9DWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm3 header.b=Ixbn3kSr; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=lgbGJKF9; 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=cerno.tech Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z12-20020a1709028f8c00b00178a33faa42si13505341plo.66.2022.10.18.07.43.12; Tue, 18 Oct 2022 07:43:26 -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=@cerno.tech header.s=fm3 header.b=Ixbn3kSr; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=lgbGJKF9; 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=cerno.tech Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231267AbiJRNxV (ORCPT + 99 others); Tue, 18 Oct 2022 09:53:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231239AbiJRNxG (ORCPT ); Tue, 18 Oct 2022 09:53:06 -0400 Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89691CF1A0; Tue, 18 Oct 2022 06:53:04 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 4C01D3200564; Tue, 18 Oct 2022 09:53:02 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Tue, 18 Oct 2022 09:53:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1666101181; x= 1666187581; bh=gtRPidfBht3s3mfnhidv0jmAjwR4x/ZpX6vTRpwG0a4=; b=I xbn3kSr195n1Ku828GGqT9LNGbZYN9khyCSnY4wBk2NpoD+ADDKH3qhEt74snp1G RkEToqTq3c5poMxn53/x9SHOi52Unf0jEkIhGXczJPFHbdR6xIYramB39TqmXGzj 9S61cbdqFEfVn7E72pn7JNi+U3sDTcanQpulGCWURIGPujZlcJhhtr7zqiLGd3Ht 5HnqP2zpq9gqVdas81sGMJnY2sC84gknwP72baruxA9pfi4kHS9/SxTCLGHWisYG /LKaMmzckbVDHFXBGCDfAexwLKJClaGMHiE7J/zr+oXh1IUZ61I/L9KCPR5BFpkx Df9oLN+RIZOO4nz3fNTIg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1666101181; x= 1666187581; bh=gtRPidfBht3s3mfnhidv0jmAjwR4x/ZpX6vTRpwG0a4=; b=l gbGJKF9TJJX4ozkCOqMcnIH8mEjozHYZ+NCoIuZmSiqkUueqPlGGWVYc70mEyBR7 Lt6A5QNi4p1CrVZSikL9uH0hJwF30AsjnZjJlsnFqYj3QpYHiZVwxKs1m2PAtyAD 5FEMtOA+D+MUkNh3XLJVP9CiyKtB3CRSX0XkwJGXRbhaP32WDY5PC2UjTVkpvfYC q2eO5mWRZeKTeQFB/crV5Baqnwp7LtZacSRJf2RrnhNKd8NPab+ypkFbPGggMXiX yYKJZdu0Ed1nAmXQ/08ZjD2X0s9IrkWCo4Bdqe8tOyk1TX7XR9qweMHGesjQZrA9 sj5ZGV9eW3bbe5H6M8e5g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeelvddggedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephfffufggtgfgkfhfjgfvvefosehtkeertdertdejnecuhfhrohhmpeforgig ihhmvgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrf grthhtvghrnhepudduudfhveejteefgedvffdvvedvjedugedukeejhedtlefhffevtefh jeeltdevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epmhgrgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Feedback-ID: i8771445c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 18 Oct 2022 09:53:01 -0400 (EDT) From: Maxime Ripard Date: Tue, 18 Oct 2022 15:52:56 +0200 Subject: [PATCH 1/4] clk: Remove WARN_ON NULL parent in clk_core_init_rate_req() MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20221018-clk-range-checks-fixes-v1-1-f3ef80518140@cerno.tech> References: <20221018-clk-range-checks-fixes-v1-0-f3ef80518140@cerno.tech> In-Reply-To: <20221018-clk-range-checks-fixes-v1-0-f3ef80518140@cerno.tech> To: Stephen Boyd , Michael Turquette Cc: linux-kernel@vger.kernel.org, AngeloGioacchino Del Regno , Maxime Ripard , linux-clk@vger.kernel.org X-Mailer: b4 0.11.0-dev-7da52 X-Developer-Signature: v=1; a=openpgp-sha256; l=1452; i=maxime@cerno.tech; h=from:subject:message-id; bh=zafRG0QXl+PXtxAm4Bsu+gNoZDPQ5i9BnzeNzVpJFUE=; b=owGbwMvMwCX2+D1vfrpE4FHG02pJDMl+63fq613QnCGifVvqiPD2noefCzazdHF/+TPhz8sfsZFO Res+dpSyMIhxMciKKbLECJsviTs163UnG988mDmsTCBDGLg4BWAiPcIM/2Pv8Wd5/pdo477bt0JXNm bVO+U1bRMX3tW+MltY4mr8WhZGhrasfcuLNZfc7rsz//mT6oKOO48e7jukfercAt3HPEq2J7kA X-Developer-Key: i=maxime@cerno.tech; a=openpgp; fpr=BE5675C37E818C8B5764241C254BCFC56BF6CE8D X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, 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 If a clock has CLK_SET_RATE_PARENT, but core->parent is NULL (most likely because it's orphan), callers of clk_core_init_rate_req() will blindly call this function leading to a very verbose warning. Since it's a fairly common situation, let's just remove the WARN_ON but keep the check that prevents us from dereferencing the pointer. Interestingly, it fixes a regression on the Mediatek MT8195 where the GPU would stall during a clk_set_rate for its main clock. We couldn't come up with a proper explanation since the condition is essentially the same. It was then assumed that it could be timing related since printing the warning stacktrace takes a while, but we couldn't replicate the failure by using fairly large (10ms) mdelays. Fixes: 262ca38f4b6e ("clk: Stop forwarding clk_rate_requests to the parent") Reported-by: AngeloGioacchino Del Regno Signed-off-by: Maxime Ripard --- drivers/clk/clk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index c3c3f8c07258..37d623c7b73b 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -1459,7 +1459,7 @@ static void clk_core_init_rate_req(struct clk_core * const core, { struct clk_core *parent; - if (WARN_ON(!core || !req)) + if (!core || WARN_ON(!req)) return; memset(req, 0, sizeof(*req)); -- b4 0.11.0-dev-7da52