Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3150144rwd; Fri, 16 Jun 2023 13:02:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4iRbQ5epdVjyZu2oRlz21JY7DA6kn4LpT1WgwwFYb6xvnMm52bzReoIu26vvjjBn763gHQ X-Received: by 2002:a05:6871:e09:b0:19e:aa46:34f2 with SMTP id vj9-20020a0568710e0900b0019eaa4634f2mr151403oab.12.1686945767861; Fri, 16 Jun 2023 13:02:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686945767; cv=none; d=google.com; s=arc-20160816; b=TVOMgVkwuDHFSS++n5OAP7a1I+ItMfA+7V4ILYp/I0urCldQCJDTFFsHSnkSp+26rr dviQtv8CJW7qv/6/hfMIN1VJN5V6WiXYX4nbmzCCn8guDyakJ1w0cG9XzjqYT0zu8+zw vQOEDGNfp7uNf1Nia6XzgNIbEljLChG3OppVniHWYS07CmQXvTRLTrLIjXeABdBtotk2 Prb3FqSTdNtqHMSVOVlp4UaluSBSgIKRc5P6D4xTKiJF6CiNEYsc2AY7GCR/7Fbxu7RL YpKvDoe2AHuI2MBJtHCY3Fl7LXMmtQia4gO5T3F5Y2gUjd3pQSA8E1MGo75vBbUe+W/r U8Ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:date:to:cc:from:subject:references :in-reply-to:content-transfer-encoding:mime-version:message-id :dkim-signature; bh=jxqqA8hKbX1P+MGFD6r0FL7uvDc4IVAgHOvqUjiaLD4=; b=QcXxdzd1HkrwdkVa7NLOZuAzSNS41Tb98CXqh7V7MHE7e5KnZluTaWBaGBDeDQLety fzue1Htv1qxTy+VBdQTwG8uXyhf3rm/T7Mi4M98xTMLL/Hw4F5HusG2NKqbGm7QQRCXt s5Z96KtZOG/CSSq65D0a8hTcwehXAYHKe/CjU/A7qVpXn14m9/QurJpmSaG38DXEhRxQ vOYivrowOT8VMCxUApmj3BkjGRRUIORStVfGpg4tKA+oEmLbcTpXx8iXLU+2ibtyuDhK 6JXHwRqczURRi5xiE3owkHl6DblYF9sDSppE+LxZmmBBYeNbTqhNDd0gmx1AeYVl7gml Sh3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cmCJnDxv; 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 u8-20020a637908000000b00543c1b205a5si16229645pgc.149.2023.06.16.13.02.22; Fri, 16 Jun 2023 13:02:47 -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=cmCJnDxv; 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 S1346181AbjFPTXX (ORCPT + 99 others); Fri, 16 Jun 2023 15:23:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346251AbjFPTXD (ORCPT ); Fri, 16 Jun 2023 15:23:03 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0109D46BB; Fri, 16 Jun 2023 12:21:04 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CE0BE60B66; Fri, 16 Jun 2023 19:21:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 29BCEC433C0; Fri, 16 Jun 2023 19:21:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686943264; bh=jxqqA8hKbX1P+MGFD6r0FL7uvDc4IVAgHOvqUjiaLD4=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=cmCJnDxvweAkTJuxcJHrETAjNXl0iPu4lQukowFXXRonO4we27DpflLjuC0O7oQd0 k3DE+oKEc/ln302jaTTsSQHo20oI3NjhbdrLdcYxQj8I4uLlASaFdrgcajXByKMrKO x1a8O9Sj+QO+bDD9bx8NUiXMC50HkbW1IidRNnlKFBP7+HV2WD3XIEM05FyLnJfsOe o/OjRzdsiNjoSPX2gUpDMqHo1kBSAhPahLFz2LE9Gww4Y0F0Ow6mkR0zG1Ksqul99U VRkaxj6j0japH1Ea7FTS2Ydu/aMaIHHXVj/VrFFah6KuThb1oSxv1E7MpZ3+J3DvWz Kl4BAYOzzI3NA== Message-ID: Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <20230615122051.546985-2-angelogioacchino.delregno@collabora.com> References: <20230615122051.546985-1-angelogioacchino.delregno@collabora.com> <20230615122051.546985-2-angelogioacchino.delregno@collabora.com> Subject: Re: [PATCH 1/3] clk: mediatek: clk-mtk: Grab iomem pointer for divider clocks From: Stephen Boyd Cc: mturquette@baylibre.com, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, wenst@chromium.org, u.kleine-koenig@pengutronix.de, msp@baylibre.com, miles.chen@mediatek.com, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, kernel@collabora.com To: AngeloGioacchino Del Regno Date: Fri, 16 Jun 2023 12:21:01 -0700 User-Agent: alot/0.10 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 AngeloGioacchino Del Regno (2023-06-15 05:20:49) > In the rare case in which one of the clock drivers has divider clocks > but not composite clocks, mtk_clk_simple_probe() would not io(re)map, > hence passing a NULL pointer to mtk_clk_register_dividers(). >=20 > To fix this issue, extend the `if` conditional to also check if any > divider clocks are present. While at it, also make sure the iomem > pointer is NULL if no composite/divider clocks are declared, as we > are checking for that when iounmapping it in the error path. >=20 > This hasn't been seen on any MediaTek clock driver as the current ones > always declare composite clocks along with divider clocks, but this is > still an important fix for a future potential KP. >=20 > Fixes: 1fe074b1f112 ("clk: mediatek: Add divider clocks to mtk_clk_simple= _{probe,remove}()") > Signed-off-by: AngeloGioacchino Del Regno > --- Applied to clk-next