All of lore.kernel.org
 help / color / mirror / Atom feed
From: AngeloGioacchino Del Regno  <angelogioacchino.delregno@collabora.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	mturquette@baylibre.com
Cc: sboyd@kernel.org, matthias.bgg@gmail.com, robh+dt@kernel.org,
	krzysztof.kozlowski+dt@linaro.org, wenst@chromium.org,
	johnson.wang@mediatek.com, miles.chen@mediatek.com,
	fparent@baylibre.com, chun-jie.chen@mediatek.com,
	sam.shih@mediatek.com, y.oudjana@protonmail.com,
	nfraprado@collabora.com, rex-bc.chen@mediatek.com,
	ryder.lee@kernel.org, daniel@makrotopia.org,
	jose.exposito89@gmail.com, yangyingliang@huawei.com,
	pablo.sun@mediatek.com, msp@baylibre.com, weiyi.lu@mediatek.com,
	ikjn@chromium.org, linux-kernel@vger.kernel.org,
	linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org,
	kernel@collabora.com
Subject: Re: [PATCH v1 08/25] dt-bindings: clock: mt8173: Add dummy clock ID
Date: Fri, 23 Dec 2022 10:28:53 +0100	[thread overview]
Message-ID: <a9f9a86d-459e-314d-446e-e24b5ee469fe@collabora.com> (raw)
In-Reply-To: <46edd627-c128-b979-823f-0a94fe9d425b@linaro.org>

Il 23/12/22 10:26, Krzysztof Kozlowski ha scritto:
> On 23/12/2022 10:21, AngeloGioacchino Del Regno wrote:
>> Il 23/12/22 09:52, Krzysztof Kozlowski ha scritto:
>>> On 22/12/2022 12:48, AngeloGioacchino Del Regno wrote:
>>>> Some old MediaTek clock drivers are starting the clock count (so, the
>>>> clock ID) from one instead of zero and this is logically incorrect,
>>>> as we should start from 0.
>>>> During a cleanup an issue emerged due to that and the cleanest and
>>>> shortest way to keep devicetree backwards compatibility while still
>>>> performing the well deserved cleanup is to add a dummy clock where
>>>> needed, with ID 0.
>>>
>>> Unfortunately I do not understand at all why adding dummy (fake) ID
>>> cleans anything here. Unifying IDs to start from 0 is not an argument on
>>> DT bindings header IDs.
>>>
>>> Best regards,
>>> Krzysztof
>>>
>>>
>>
>> All clocks are in one or multiple arrays, and if we don't register ID 0,
>> devicetrees will reference the wrong clock, as the IDs will shift back by
>> one during registration.
> 
> So what stops you to register some 0-dummy clock? Why do you need a
> binding for it?
> 
>> This was done for a commonization of probe() and remove() callbacks for
>> MediaTek clock drivers... since we have 3 affected SoCs (MT8173, MT2701
>> and MT6779) out of *19* (soon 20), to me, it didn't make sense to write
>> commonized code to address this just because of 3 out of 20 SoCs (note
>> that each SoC has around 4 clock drivers).
>>
>> Any suggestion to keep this one short, while not touching dt-bindings?
> 
> Just add a clock or better empty entry in your table, without touching
> bindings.
> 


Okay, now that's embarassing - that's a simpler and obvious solution I
should've thought of before sending this series. Heh.

Thanks, by the way!

Regards,
Angelo

WARNING: multiple messages have this Message-ID (diff)
From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	mturquette@baylibre.com
Cc: sboyd@kernel.org, matthias.bgg@gmail.com, robh+dt@kernel.org,
	krzysztof.kozlowski+dt@linaro.org, wenst@chromium.org,
	johnson.wang@mediatek.com, miles.chen@mediatek.com,
	fparent@baylibre.com, chun-jie.chen@mediatek.com,
	sam.shih@mediatek.com, y.oudjana@protonmail.com,
	nfraprado@collabora.com, rex-bc.chen@mediatek.com,
	ryder.lee@kernel.org, daniel@makrotopia.org,
	jose.exposito89@gmail.com, yangyingliang@huawei.com,
	pablo.sun@mediatek.com, msp@baylibre.com, weiyi.lu@mediatek.com,
	ikjn@chromium.org, linux-kernel@vger.kernel.org,
	linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org,
	kernel@collabora.com
Subject: Re: [PATCH v1 08/25] dt-bindings: clock: mt8173: Add dummy clock ID
Date: Fri, 23 Dec 2022 10:28:53 +0100	[thread overview]
Message-ID: <a9f9a86d-459e-314d-446e-e24b5ee469fe@collabora.com> (raw)
In-Reply-To: <46edd627-c128-b979-823f-0a94fe9d425b@linaro.org>

Il 23/12/22 10:26, Krzysztof Kozlowski ha scritto:
> On 23/12/2022 10:21, AngeloGioacchino Del Regno wrote:
>> Il 23/12/22 09:52, Krzysztof Kozlowski ha scritto:
>>> On 22/12/2022 12:48, AngeloGioacchino Del Regno wrote:
>>>> Some old MediaTek clock drivers are starting the clock count (so, the
>>>> clock ID) from one instead of zero and this is logically incorrect,
>>>> as we should start from 0.
>>>> During a cleanup an issue emerged due to that and the cleanest and
>>>> shortest way to keep devicetree backwards compatibility while still
>>>> performing the well deserved cleanup is to add a dummy clock where
>>>> needed, with ID 0.
>>>
>>> Unfortunately I do not understand at all why adding dummy (fake) ID
>>> cleans anything here. Unifying IDs to start from 0 is not an argument on
>>> DT bindings header IDs.
>>>
>>> Best regards,
>>> Krzysztof
>>>
>>>
>>
>> All clocks are in one or multiple arrays, and if we don't register ID 0,
>> devicetrees will reference the wrong clock, as the IDs will shift back by
>> one during registration.
> 
> So what stops you to register some 0-dummy clock? Why do you need a
> binding for it?
> 
>> This was done for a commonization of probe() and remove() callbacks for
>> MediaTek clock drivers... since we have 3 affected SoCs (MT8173, MT2701
>> and MT6779) out of *19* (soon 20), to me, it didn't make sense to write
>> commonized code to address this just because of 3 out of 20 SoCs (note
>> that each SoC has around 4 clock drivers).
>>
>> Any suggestion to keep this one short, while not touching dt-bindings?
> 
> Just add a clock or better empty entry in your table, without touching
> bindings.
> 


Okay, now that's embarassing - that's a simpler and obvious solution I
should've thought of before sending this series. Heh.

Thanks, by the way!

Regards,
Angelo

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2022-12-23  9:29 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-22 11:48 [PATCH v1 00/25] MediaTek clocks cleanups and improvements AngeloGioacchino Del Regno
2022-12-22 11:48 ` AngeloGioacchino Del Regno
2022-12-22 11:48 ` [PATCH v1 01/25] clk: mediatek: mt8192: Correctly unregister and free clocks on failure AngeloGioacchino Del Regno
2022-12-22 11:48   ` AngeloGioacchino Del Regno
2022-12-22 11:48 ` [PATCH v1 02/25] clk: mediatek: mt8192: Propagate struct device for gate clocks AngeloGioacchino Del Regno
2022-12-22 11:48   ` AngeloGioacchino Del Regno
2022-12-22 11:48 ` [PATCH v1 03/25] clk: mediatek: clk-gate: Propagate struct device with mtk_clk_register_gates() AngeloGioacchino Del Regno
2022-12-22 11:48   ` AngeloGioacchino Del Regno
2022-12-22 11:48 ` [PATCH v1 04/25] clk: mediatek: cpumux: Propagate struct device where possible AngeloGioacchino Del Regno
2022-12-22 11:48   ` AngeloGioacchino Del Regno
2022-12-22 11:48 ` [PATCH v1 05/25] clk: mediatek: clk-mtk: Propagate struct device for composites AngeloGioacchino Del Regno
2022-12-22 11:48   ` AngeloGioacchino Del Regno
2022-12-22 11:48 ` [PATCH v1 06/25] clk: mediatek: clk-mux: Propagate struct device for mtk-mux AngeloGioacchino Del Regno
2022-12-22 11:48   ` AngeloGioacchino Del Regno
2022-12-22 11:48 ` [PATCH v1 07/25] clk: mediatek: clk-mtk: Add dummy clock ops AngeloGioacchino Del Regno
2022-12-22 11:48   ` AngeloGioacchino Del Regno
2022-12-22 11:48 ` [PATCH v1 08/25] dt-bindings: clock: mt8173: Add dummy clock ID AngeloGioacchino Del Regno
2022-12-22 11:48   ` AngeloGioacchino Del Regno
2022-12-23  8:52   ` Krzysztof Kozlowski
2022-12-23  8:52     ` Krzysztof Kozlowski
2022-12-23  9:21     ` AngeloGioacchino Del Regno
2022-12-23  9:21       ` AngeloGioacchino Del Regno
2022-12-23  9:26       ` Krzysztof Kozlowski
2022-12-23  9:26         ` Krzysztof Kozlowski
2022-12-23  9:28         ` AngeloGioacchino Del Regno [this message]
2022-12-23  9:28           ` AngeloGioacchino Del Regno
2022-12-22 11:48 ` [PATCH v1 09/25] clk: mediatek: mt8173: Migrate to platform driver and common probe AngeloGioacchino Del Regno
2022-12-22 11:48   ` AngeloGioacchino Del Regno
2022-12-22 11:48 ` [PATCH v1 10/25] clk: mediatek: mt8173: Remove mtk_clk_enable_critical() AngeloGioacchino Del Regno
2022-12-22 11:48   ` AngeloGioacchino Del Regno
2022-12-22 11:48 ` [PATCH v1 11/25] clk: mediatek: mt8173: Break down clock drivers and allow module build AngeloGioacchino Del Regno
2022-12-22 11:48   ` AngeloGioacchino Del Regno
2022-12-22 11:48 ` [PATCH v1 12/25] dt-bindings: clock: mt2701/mt6779: Add dummy clock with ID 0 AngeloGioacchino Del Regno
2022-12-22 11:48   ` AngeloGioacchino Del Regno
2022-12-22 11:48 ` [PATCH v1 13/25] clk: mediatek: Switch to mtk_clk_simple_probe() where possible AngeloGioacchino Del Regno
2022-12-22 11:48   ` AngeloGioacchino Del Regno
2022-12-22 11:48 ` [PATCH v1 14/25] clk: mediatek: clk-mtk: Extend mtk_clk_simple_probe() AngeloGioacchino Del Regno
2022-12-22 11:48   ` AngeloGioacchino Del Regno
2022-12-22 11:48 ` [PATCH v1 15/25] clk: mediatek: mt8173: Migrate pericfg/topckgen to mtk_clk_simple_probe() AngeloGioacchino Del Regno
2022-12-22 11:48   ` AngeloGioacchino Del Regno
2022-12-22 11:48 ` [PATCH v1 16/25] clk: mediatek: clk-mt8192: Move CLK_TOP_CSW_F26M_D2 in top_divs AngeloGioacchino Del Regno
2022-12-22 11:48   ` AngeloGioacchino Del Regno
2022-12-22 11:48 ` [PATCH v1 17/25] clk: mediatek: mt8192: Join top_adj_divs and top_muxes AngeloGioacchino Del Regno
2022-12-22 11:48   ` AngeloGioacchino Del Regno
2022-12-22 11:48 ` [PATCH v1 18/25] clk: mediatek: mt8186: Join top_adj_div " AngeloGioacchino Del Regno
2022-12-22 11:48   ` AngeloGioacchino Del Regno
2022-12-22 11:48 ` [PATCH v1 19/25] clk: mediatek: clk-mt8183: Join top_aud_muxes and top_aud_divs AngeloGioacchino Del Regno
2022-12-22 11:48   ` AngeloGioacchino Del Regno
2022-12-22 11:48 ` [PATCH v1 20/25] clk: mediatek: clk-mtk: Register MFG notifier in mtk_clk_simple_probe() AngeloGioacchino Del Regno
2022-12-22 11:48   ` AngeloGioacchino Del Regno
2022-12-22 11:48 ` [PATCH v1 21/25] clk: mediatek: clk-mt8192: Migrate topckgen to mtk_clk_simple_probe() AngeloGioacchino Del Regno
2022-12-22 11:48   ` AngeloGioacchino Del Regno
2022-12-22 11:48 ` [PATCH v1 22/25] clk: mediatek: clk-mt8186-topckgen: Migrate " AngeloGioacchino Del Regno
2022-12-22 11:48   ` AngeloGioacchino Del Regno
2022-12-22 11:48 ` [PATCH v1 23/25] clk: mediatek: clk-mt6795-topckgen: " AngeloGioacchino Del Regno
2022-12-22 11:48   ` AngeloGioacchino Del Regno
2022-12-22 11:48 ` [PATCH v1 24/25] clk: mediatek: clk-mt7986-topckgen: Properly keep some clocks enabled AngeloGioacchino Del Regno
2022-12-22 11:48   ` AngeloGioacchino Del Regno
2022-12-22 11:48 ` [PATCH v1 25/25] clk: mediatek: clk-mt7986-topckgen: Migrate to mtk_clk_simple_probe() AngeloGioacchino Del Regno
2022-12-22 11:48   ` AngeloGioacchino Del Regno

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a9f9a86d-459e-314d-446e-e24b5ee469fe@collabora.com \
    --to=angelogioacchino.delregno@collabora.com \
    --cc=chun-jie.chen@mediatek.com \
    --cc=daniel@makrotopia.org \
    --cc=devicetree@vger.kernel.org \
    --cc=fparent@baylibre.com \
    --cc=ikjn@chromium.org \
    --cc=johnson.wang@mediatek.com \
    --cc=jose.exposito89@gmail.com \
    --cc=kernel@collabora.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=miles.chen@mediatek.com \
    --cc=msp@baylibre.com \
    --cc=mturquette@baylibre.com \
    --cc=nfraprado@collabora.com \
    --cc=pablo.sun@mediatek.com \
    --cc=rex-bc.chen@mediatek.com \
    --cc=robh+dt@kernel.org \
    --cc=ryder.lee@kernel.org \
    --cc=sam.shih@mediatek.com \
    --cc=sboyd@kernel.org \
    --cc=weiyi.lu@mediatek.com \
    --cc=wenst@chromium.org \
    --cc=y.oudjana@protonmail.com \
    --cc=yangyingliang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.