From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3CC33C3DA7C for ; Fri, 30 Dec 2022 08:10:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234717AbiL3IKP (ORCPT ); Fri, 30 Dec 2022 03:10:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234544AbiL3IKL (ORCPT ); Fri, 30 Dec 2022 03:10:11 -0500 Received: from mail-vs1-xe35.google.com (mail-vs1-xe35.google.com [IPv6:2607:f8b0:4864:20::e35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE194183B9 for ; Fri, 30 Dec 2022 00:10:10 -0800 (PST) Received: by mail-vs1-xe35.google.com with SMTP id m2so20582857vsv.9 for ; Fri, 30 Dec 2022 00:10:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=6m26YMbks5w9j7aA1kyB8fHaCoQJomo7rPAPrntLOog=; b=da0u9H3i2xBt3fWJah+Dv2qxTKOgSPA3AOzUFkMKqyZBIZZP1P0UGdJuaICzOxt4fH Mm1wEa0yAJTOmV4DWB4J14oTVDAi63M5Vz3MP/SaMgYICVkVtF/81mtEBJvcpGuYIkY9 crEd8lqVWmWgaSLClDuFEAsKqpu5aflcbck8I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=6m26YMbks5w9j7aA1kyB8fHaCoQJomo7rPAPrntLOog=; b=2rJnPO0VXWsFwjd+J8JloIw79xHpYn0xeQbiPMf6lQHk7tVX6mKGzIdXJvtf3Pscrm 7IjKTiaMjWfyvlEBAu0NqaJU1CAZwZiGXdz6hixxhs+zRUdWl+SaD+3TFZOoO+kdowCK qb2wv3JrTJv9Q0A/tauD1MLLtaI01G400Mzjopxl1Ce/hlf4o2EEEE9eojJmIDbxDTIM TA1hE2KRCUSI+hjr8xv6WOEKBc+7Y60ShvQtKBbZ/ZiJzWtewkDZlJ2j4I66t4TB9gt4 vsFST7iXq7asvlJR4IMHjt/f67dVTZjaln3jktZEn7xhnGosE9dTLnbTnWwNiIFYYRk2 CV4w== X-Gm-Message-State: AFqh2koTy5KZP5bXmxqNU0+C+nM2jod4Y9dVXuUdJmQSB4QmcjJA0zMM SCCdbyiESMFrB65/IUl0sSKFLfauU+gJFeGqZDeO2w== X-Google-Smtp-Source: AMrXdXu42OIXcFU1BSE54ydAcv7zw3Gqh5WM+YiUnvG/dZqYgZpVZP5X5dL1GmIq2Knsf9WEE8McGyC3+t2WX/bbKjs= X-Received: by 2002:a67:fbc2:0:b0:3cc:fb59:8c71 with SMTP id o2-20020a67fbc2000000b003ccfb598c71mr21878vsr.65.1672387810048; Fri, 30 Dec 2022 00:10:10 -0800 (PST) MIME-Version: 1.0 References: <20221223094259.87373-16-angelogioacchino.delregno@collabora.com> <20221228083123.15298-1-miles.chen@mediatek.com> In-Reply-To: <20221228083123.15298-1-miles.chen@mediatek.com> From: Chen-Yu Tsai Date: Fri, 30 Dec 2022 16:09:59 +0800 Message-ID: Subject: Re: [PATCH v2 15/23] clk: mediatek: mt8192: Join top_adj_divs and top_muxes To: Miles Chen Cc: angelogioacchino.delregno@collabora.com, chun-jie.chen@mediatek.com, daniel@makrotopia.org, devicetree@vger.kernel.org, fparent@baylibre.com, ikjn@chromium.org, johnson.wang@mediatek.com, jose.exposito89@gmail.com, kernel@collabora.com, krzysztof.kozlowski+dt@linaro.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, matthias.bgg@gmail.com, msp@baylibre.com, mturquette@baylibre.com, nfraprado@collabora.com, pablo.sun@mediatek.com, rex-bc.chen@mediatek.com, robh+dt@kernel.org, ryder.lee@kernel.org, sam.shih@mediatek.com, sboyd@kernel.org, weiyi.lu@mediatek.com, y.oudjana@protonmail.com, yangyingliang@huawei.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 28, 2022 at 4:31 PM Miles Chen wrote: > > Hi, > > > These two are both mtk_composite arrays, one dependent on another, but > > that's something that the clock framework is supposed to sort out and > > anyway registering them separately isn't going to ease the framework's > > job in checking dependencies. > > > > Put the contents of top_adj_divs in top_muxes to join them together > > and register them in one shot. > > > > In mt8192, we can join top_adj_divs and top_muxes: > > mtk_clk_register_composites(top_muxes, ARRAY_SIZE(top_muxes), base, &mt8192_clk_lock, > top_clk_data); > mtk_clk_register_composites(top_adj_divs, ARRAY_SIZE(top_adj_divs), base, &mt8192_clk_lock, > top_clk_data); > > However, there are other top_adj_divs[] and top_muxes[] in different types so > we cannot join them. > > For example: > in drivers/clk/mediatek/clk-mt8167.c:mtk_topckgen_init(): > > mtk_clk_register_composites(top_muxes, ARRAY_SIZE(top_muxes), base, > &mt8167_clk_lock, clk_data); > mtk_clk_register_dividers(top_adj_divs, ARRAY_SIZE(top_adj_divs), > base, &mt8167_clk_lock, clk_data); > > So we can join top_adj_divs and top_muxes in some platforms, but we > cannot join top_adj_divs and top_muxes in some other platforms. > > I'm afraid that this will confuses people. I think the confusion comes from the macro names. It's not exactly clear that DIV_GATE is for composite clocks, while DIV_ADJ is for divider clocks. Doubly so for the mux related types. Either way, using the wrong macro or the wrong type will cause the compiler to complain, so I think it's something we can live with. If it's still not working out, maybe we should rethink the naming. ChenYu From mboxrd@z Thu Jan 1 00:00:00 1970 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 CC9B3C4167B for ; Fri, 30 Dec 2022 08:17:00 +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:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Ar3cEoPYwiWkDe4C7EAXeKDmk8EnjxY2NGHQO8Bo3vc=; b=Gfj8yyjSTtV+Pj auU5EJaaVD019jdoSdt6Q67yOCLBZbGVugkvCOWRb4Kg7eNhMHQnYzruEJ1G02nqJJEOH+NNe5SSG Y4eADVXZxW7yPip/+rwaF8+Vlyxqgd2xQlhuEfvW2ucuxkpE2eHSzxFd0+UjPLFoAqy1x2ex1lFP6 pEoZmPRGjO0oEkPOOlviHhxaoccBE++2E5zqr1eW3l8AL/TTpEYNTTH9kCQx4ua1OA7ikX6/tyMSQ 8QvE/LWKO2UQVp8VNjGUNST1lOxMJRRlwqm1jgKF8IheT84smUMBv4f4ArvQNZY8ZeCPUl+DdXPOn PBmSBaY87rUQb1zLBadQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pBAXu-007CEe-14; Fri, 30 Dec 2022 08:15:18 +0000 Received: from mail-vs1-xe36.google.com ([2607:f8b0:4864:20::e36]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pBASx-007AF1-OX for linux-arm-kernel@lists.infradead.org; Fri, 30 Dec 2022 08:10:18 +0000 Received: by mail-vs1-xe36.google.com with SMTP id i188so20624477vsi.8 for ; Fri, 30 Dec 2022 00:10:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=6m26YMbks5w9j7aA1kyB8fHaCoQJomo7rPAPrntLOog=; b=da0u9H3i2xBt3fWJah+Dv2qxTKOgSPA3AOzUFkMKqyZBIZZP1P0UGdJuaICzOxt4fH Mm1wEa0yAJTOmV4DWB4J14oTVDAi63M5Vz3MP/SaMgYICVkVtF/81mtEBJvcpGuYIkY9 crEd8lqVWmWgaSLClDuFEAsKqpu5aflcbck8I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=6m26YMbks5w9j7aA1kyB8fHaCoQJomo7rPAPrntLOog=; b=orzJJjchJKneDXypHG99Bu/Q8VjcZWjgJRt8iOy8HnDWLIa1VljLMdnFlKYCBKgf8J bk0yjKddr6ccXYiskT2/jjHWHXrkyt4QTEjU3pAP2WpXlJUN/Boj7W0y4nReNYn+fRwd zfni8Hb/e8n8sF21S0m+HG3rNsxhTvPsYNlH9loIYxfhNoOs3GmyjiZfJiNMTkEuI+q1 Lr7hIjaAR9hkrYBveNlgse4s88s6Xfcuep6PJF0GK1h4i0KqkFtq6B59KufQJqdHA8PC l7JKx5qhw9QHLmJnWMRYiip3+T1VTK9V6CqZhKGH8KbfySjCd0aVyexB6nLGUF7CT37E iNRw== X-Gm-Message-State: AFqh2kqjXpqUIb7ga22P2xBdaEYAF1L7IAl9tp+hCpEoLcDUwY8mIHwC o2YFcD+pVLISJ7carjF5dpu5tA7o7I3GJyFAAAvKQg== X-Google-Smtp-Source: AMrXdXu42OIXcFU1BSE54ydAcv7zw3Gqh5WM+YiUnvG/dZqYgZpVZP5X5dL1GmIq2Knsf9WEE8McGyC3+t2WX/bbKjs= X-Received: by 2002:a67:fbc2:0:b0:3cc:fb59:8c71 with SMTP id o2-20020a67fbc2000000b003ccfb598c71mr21878vsr.65.1672387810048; Fri, 30 Dec 2022 00:10:10 -0800 (PST) MIME-Version: 1.0 References: <20221223094259.87373-16-angelogioacchino.delregno@collabora.com> <20221228083123.15298-1-miles.chen@mediatek.com> In-Reply-To: <20221228083123.15298-1-miles.chen@mediatek.com> From: Chen-Yu Tsai Date: Fri, 30 Dec 2022 16:09:59 +0800 Message-ID: Subject: Re: [PATCH v2 15/23] clk: mediatek: mt8192: Join top_adj_divs and top_muxes To: Miles Chen Cc: angelogioacchino.delregno@collabora.com, chun-jie.chen@mediatek.com, daniel@makrotopia.org, devicetree@vger.kernel.org, fparent@baylibre.com, ikjn@chromium.org, johnson.wang@mediatek.com, jose.exposito89@gmail.com, kernel@collabora.com, krzysztof.kozlowski+dt@linaro.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, matthias.bgg@gmail.com, msp@baylibre.com, mturquette@baylibre.com, nfraprado@collabora.com, pablo.sun@mediatek.com, rex-bc.chen@mediatek.com, robh+dt@kernel.org, ryder.lee@kernel.org, sam.shih@mediatek.com, sboyd@kernel.org, weiyi.lu@mediatek.com, y.oudjana@protonmail.com, yangyingliang@huawei.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221230_001012_888855_33EAC14E X-CRM114-Status: GOOD ( 17.61 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Dec 28, 2022 at 4:31 PM Miles Chen wrote: > > Hi, > > > These two are both mtk_composite arrays, one dependent on another, but > > that's something that the clock framework is supposed to sort out and > > anyway registering them separately isn't going to ease the framework's > > job in checking dependencies. > > > > Put the contents of top_adj_divs in top_muxes to join them together > > and register them in one shot. > > > > In mt8192, we can join top_adj_divs and top_muxes: > > mtk_clk_register_composites(top_muxes, ARRAY_SIZE(top_muxes), base, &mt8192_clk_lock, > top_clk_data); > mtk_clk_register_composites(top_adj_divs, ARRAY_SIZE(top_adj_divs), base, &mt8192_clk_lock, > top_clk_data); > > However, there are other top_adj_divs[] and top_muxes[] in different types so > we cannot join them. > > For example: > in drivers/clk/mediatek/clk-mt8167.c:mtk_topckgen_init(): > > mtk_clk_register_composites(top_muxes, ARRAY_SIZE(top_muxes), base, > &mt8167_clk_lock, clk_data); > mtk_clk_register_dividers(top_adj_divs, ARRAY_SIZE(top_adj_divs), > base, &mt8167_clk_lock, clk_data); > > So we can join top_adj_divs and top_muxes in some platforms, but we > cannot join top_adj_divs and top_muxes in some other platforms. > > I'm afraid that this will confuses people. I think the confusion comes from the macro names. It's not exactly clear that DIV_GATE is for composite clocks, while DIV_ADJ is for divider clocks. Doubly so for the mux related types. Either way, using the wrong macro or the wrong type will cause the compiler to complain, so I think it's something we can live with. If it's still not working out, maybe we should rethink the naming. ChenYu _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel