* [PATCH 2/2] drm/mediatek/hdmi: Simplify with dev_err_probe
2025-01-12 13:47 [PATCH 1/2] drm/mediatek/hdmi: Use syscon_regmap_lookup_by_phandle_args Krzysztof Kozlowski
@ 2025-01-12 13:47 ` Krzysztof Kozlowski
2025-01-13 12:41 ` AngeloGioacchino Del Regno
2025-01-13 12:41 ` [PATCH 1/2] drm/mediatek/hdmi: Use syscon_regmap_lookup_by_phandle_args AngeloGioacchino Del Regno
2025-02-13 6:39 ` CK Hu (胡俊光)
2 siblings, 1 reply; 15+ messages in thread
From: Krzysztof Kozlowski @ 2025-01-12 13:47 UTC (permalink / raw)
To: Chun-Kuang Hu, Philipp Zabel, David Airlie, Simona Vetter,
Matthias Brugger, AngeloGioacchino Del Regno, dri-devel,
linux-mediatek, linux-kernel, linux-arm-kernel
Cc: Krzysztof Kozlowski
Use dev_err_probe() to make error code and deferred probe handling
simpler.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
drivers/gpu/drm/mediatek/mtk_hdmi.c | 22 +++++++---------------
1 file changed, 7 insertions(+), 15 deletions(-)
diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c b/drivers/gpu/drm/mediatek/mtk_hdmi.c
index 4b0eb7dc25d8..22935fdc5afe 100644
--- a/drivers/gpu/drm/mediatek/mtk_hdmi.c
+++ b/drivers/gpu/drm/mediatek/mtk_hdmi.c
@@ -1429,19 +1429,13 @@ static int mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *hdmi,
int ret;
ret = mtk_hdmi_get_all_clk(hdmi, np);
- if (ret) {
- if (ret != -EPROBE_DEFER)
- dev_err(dev, "Failed to get clocks: %d\n", ret);
-
- return ret;
- }
+ if (ret)
+ return dev_err_probe(dev, ret, "Failed to get clocks\n");
/* The CEC module handles HDMI hotplug detection */
cec_np = of_get_compatible_child(np->parent, "mediatek,mt8173-cec");
- if (!cec_np) {
- dev_err(dev, "Failed to find CEC node\n");
- return -EINVAL;
- }
+ if (!cec_np)
+ return dev_err_probe(dev, -EINVAL, "Failed to find CEC node\n");
cec_pdev = of_find_device_by_node(cec_np);
if (!cec_pdev) {
@@ -1492,10 +1486,9 @@ static int mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *hdmi,
i2c_np = of_parse_phandle(remote, "ddc-i2c-bus", 0);
if (!i2c_np) {
- dev_err(dev, "Failed to find ddc-i2c-bus node in %pOF\n",
- remote);
+ ret = dev_err_probe(dev, -EINVAL, "Failed to find ddc-i2c-bus node in %pOF\n",
+ remote);
of_node_put(remote);
- ret = -EINVAL;
goto put_device;
}
of_node_put(remote);
@@ -1503,8 +1496,7 @@ static int mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *hdmi,
hdmi->ddc_adpt = of_find_i2c_adapter_by_node(i2c_np);
of_node_put(i2c_np);
if (!hdmi->ddc_adpt) {
- dev_err(dev, "Failed to get ddc i2c adapter by node\n");
- ret = -EINVAL;
+ ret = dev_err_probe(dev, -EINVAL, "Failed to get ddc i2c adapter by node\n");
goto put_device;
}
--
2.43.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH 2/2] drm/mediatek/hdmi: Simplify with dev_err_probe
2025-01-12 13:47 ` [PATCH 2/2] drm/mediatek/hdmi: Simplify with dev_err_probe Krzysztof Kozlowski
@ 2025-01-13 12:41 ` AngeloGioacchino Del Regno
2025-01-13 13:07 ` Krzysztof Kozlowski
0 siblings, 1 reply; 15+ messages in thread
From: AngeloGioacchino Del Regno @ 2025-01-13 12:41 UTC (permalink / raw)
To: Krzysztof Kozlowski, Chun-Kuang Hu, Philipp Zabel, David Airlie,
Simona Vetter, Matthias Brugger, dri-devel, linux-mediatek,
linux-kernel, linux-arm-kernel
Il 12/01/25 14:47, Krzysztof Kozlowski ha scritto:
> Use dev_err_probe() to make error code and deferred probe handling
> simpler.
>
That's already done in [1] so you can drop this commit.
[1]:
https://lore.kernel.org/r/20250108112744.64686-1-angelogioacchino.delregno@collabora.com
Cheers,
Angelo
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
> drivers/gpu/drm/mediatek/mtk_hdmi.c | 22 +++++++---------------
> 1 file changed, 7 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c b/drivers/gpu/drm/mediatek/mtk_hdmi.c
> index 4b0eb7dc25d8..22935fdc5afe 100644
> --- a/drivers/gpu/drm/mediatek/mtk_hdmi.c
> +++ b/drivers/gpu/drm/mediatek/mtk_hdmi.c
> @@ -1429,19 +1429,13 @@ static int mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *hdmi,
> int ret;
>
> ret = mtk_hdmi_get_all_clk(hdmi, np);
> - if (ret) {
> - if (ret != -EPROBE_DEFER)
> - dev_err(dev, "Failed to get clocks: %d\n", ret);
> -
> - return ret;
> - }
> + if (ret)
> + return dev_err_probe(dev, ret, "Failed to get clocks\n");
>
> /* The CEC module handles HDMI hotplug detection */
> cec_np = of_get_compatible_child(np->parent, "mediatek,mt8173-cec");
> - if (!cec_np) {
> - dev_err(dev, "Failed to find CEC node\n");
> - return -EINVAL;
> - }
> + if (!cec_np)
> + return dev_err_probe(dev, -EINVAL, "Failed to find CEC node\n");
>
> cec_pdev = of_find_device_by_node(cec_np);
> if (!cec_pdev) {
> @@ -1492,10 +1486,9 @@ static int mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *hdmi,
>
> i2c_np = of_parse_phandle(remote, "ddc-i2c-bus", 0);
> if (!i2c_np) {
> - dev_err(dev, "Failed to find ddc-i2c-bus node in %pOF\n",
> - remote);
> + ret = dev_err_probe(dev, -EINVAL, "Failed to find ddc-i2c-bus node in %pOF\n",
> + remote);
> of_node_put(remote);
> - ret = -EINVAL;
> goto put_device;
> }
> of_node_put(remote);
> @@ -1503,8 +1496,7 @@ static int mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *hdmi,
> hdmi->ddc_adpt = of_find_i2c_adapter_by_node(i2c_np);
> of_node_put(i2c_np);
> if (!hdmi->ddc_adpt) {
> - dev_err(dev, "Failed to get ddc i2c adapter by node\n");
> - ret = -EINVAL;
> + ret = dev_err_probe(dev, -EINVAL, "Failed to get ddc i2c adapter by node\n");
> goto put_device;
> }
>
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH 2/2] drm/mediatek/hdmi: Simplify with dev_err_probe
2025-01-13 12:41 ` AngeloGioacchino Del Regno
@ 2025-01-13 13:07 ` Krzysztof Kozlowski
2025-01-13 13:48 ` AngeloGioacchino Del Regno
0 siblings, 1 reply; 15+ messages in thread
From: Krzysztof Kozlowski @ 2025-01-13 13:07 UTC (permalink / raw)
To: AngeloGioacchino Del Regno, Chun-Kuang Hu, Philipp Zabel,
David Airlie, Simona Vetter, Matthias Brugger, dri-devel,
linux-mediatek, linux-kernel, linux-arm-kernel
On 13/01/2025 13:41, AngeloGioacchino Del Regno wrote:
> Il 12/01/25 14:47, Krzysztof Kozlowski ha scritto:
>> Use dev_err_probe() to make error code and deferred probe handling
>> simpler.
>>
>
> That's already done in [1] so you can drop this commit.
>
> [1]:
> https://lore.kernel.org/r/20250108112744.64686-1-angelogioacchino.delregno@collabora.com
>
Eh, this was first in v3 in the middle of Dec, so why you cannot get it
merged first? Creating such 34-behemoths causes simple cleanups to
unnecessarily wait.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 2/2] drm/mediatek/hdmi: Simplify with dev_err_probe
2025-01-13 13:07 ` Krzysztof Kozlowski
@ 2025-01-13 13:48 ` AngeloGioacchino Del Regno
2025-02-12 20:33 ` Krzysztof Kozlowski
0 siblings, 1 reply; 15+ messages in thread
From: AngeloGioacchino Del Regno @ 2025-01-13 13:48 UTC (permalink / raw)
To: Krzysztof Kozlowski, Chun-Kuang Hu, Philipp Zabel, David Airlie,
Simona Vetter, Matthias Brugger, dri-devel, linux-mediatek,
linux-kernel, linux-arm-kernel
Il 13/01/25 14:07, Krzysztof Kozlowski ha scritto:
> On 13/01/2025 13:41, AngeloGioacchino Del Regno wrote:
>> Il 12/01/25 14:47, Krzysztof Kozlowski ha scritto:
>>> Use dev_err_probe() to make error code and deferred probe handling
>>> simpler.
>>>
>>
>> That's already done in [1] so you can drop this commit.
>>
>> [1]:
>> https://lore.kernel.org/r/20250108112744.64686-1-angelogioacchino.delregno@collabora.com
>>
> Eh, this was first in v3 in the middle of Dec, so why you cannot get it
> merged first? Creating such 34-behemoths causes simple cleanups to
> unnecessarily wait.
>
Getting the series partially merged is okay for me, no complaints about that,
but then ... in v4, there are two minor comments to address (one of which
is a one-char nitpick!) that might as well be done while applying, depending
on what CK thinks about that, so there's no real benefit in getting 28 commits
out of 34 picked instead of, well, just everything...
Cheers!
Angelo
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 2/2] drm/mediatek/hdmi: Simplify with dev_err_probe
2025-01-13 13:48 ` AngeloGioacchino Del Regno
@ 2025-02-12 20:33 ` Krzysztof Kozlowski
2025-02-13 10:07 ` Krzysztof Kozlowski
0 siblings, 1 reply; 15+ messages in thread
From: Krzysztof Kozlowski @ 2025-02-12 20:33 UTC (permalink / raw)
To: AngeloGioacchino Del Regno, Chun-Kuang Hu, Philipp Zabel,
David Airlie, Simona Vetter, Matthias Brugger, dri-devel,
linux-mediatek, linux-kernel, linux-arm-kernel
On 13/01/2025 14:48, AngeloGioacchino Del Regno wrote:
> Il 13/01/25 14:07, Krzysztof Kozlowski ha scritto:
>> On 13/01/2025 13:41, AngeloGioacchino Del Regno wrote:
>>> Il 12/01/25 14:47, Krzysztof Kozlowski ha scritto:
>>>> Use dev_err_probe() to make error code and deferred probe handling
>>>> simpler.
>>>>
>>>
>>> That's already done in [1] so you can drop this commit.
>>>
>>> [1]:
>>> https://lore.kernel.org/r/20250108112744.64686-1-angelogioacchino.delregno@collabora.com
>>>
>> Eh, this was first in v3 in the middle of Dec, so why you cannot get it
>> merged first? Creating such 34-behemoths causes simple cleanups to
>> unnecessarily wait.
>>
>
> Getting the series partially merged is okay for me, no complaints about that,
> but then ... in v4, there are two minor comments to address (one of which
> is a one-char nitpick!) that might as well be done while applying, depending
> on what CK thinks about that, so there's no real benefit in getting 28 commits
> out of 34 picked instead of, well, just everything...
>
OK, month passed, I waited, so is your big patchset merged? If it is,
then this will effectively rebase my patch, as you requested.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 2/2] drm/mediatek/hdmi: Simplify with dev_err_probe
2025-02-12 20:33 ` Krzysztof Kozlowski
@ 2025-02-13 10:07 ` Krzysztof Kozlowski
2025-02-13 10:39 ` AngeloGioacchino Del Regno
0 siblings, 1 reply; 15+ messages in thread
From: Krzysztof Kozlowski @ 2025-02-13 10:07 UTC (permalink / raw)
To: AngeloGioacchino Del Regno, Chun-Kuang Hu, Philipp Zabel,
David Airlie, Simona Vetter, Matthias Brugger, dri-devel,
linux-mediatek, linux-kernel, linux-arm-kernel
On 12/02/2025 21:33, Krzysztof Kozlowski wrote:
> On 13/01/2025 14:48, AngeloGioacchino Del Regno wrote:
>> Il 13/01/25 14:07, Krzysztof Kozlowski ha scritto:
>>> On 13/01/2025 13:41, AngeloGioacchino Del Regno wrote:
>>>> Il 12/01/25 14:47, Krzysztof Kozlowski ha scritto:
>>>>> Use dev_err_probe() to make error code and deferred probe handling
>>>>> simpler.
>>>>>
>>>>
>>>> That's already done in [1] so you can drop this commit.
>>>>
>>>> [1]:
>>>> https://lore.kernel.org/r/20250108112744.64686-1-angelogioacchino.delregno@collabora.com
>>>>
>>> Eh, this was first in v3 in the middle of Dec, so why you cannot get it
>>> merged first? Creating such 34-behemoths causes simple cleanups to
>>> unnecessarily wait.
>>>
>>
>> Getting the series partially merged is okay for me, no complaints about that,
>> but then ... in v4, there are two minor comments to address (one of which
>> is a one-char nitpick!) that might as well be done while applying, depending
>> on what CK thinks about that, so there's no real benefit in getting 28 commits
>> out of 34 picked instead of, well, just everything...
>>
>
> OK, month passed, I waited, so is your big patchset merged? If it is,
> then this will effectively rebase my patch, as you requested.
I think I missed that you took the patch to your patchset, so sorry for
the noise.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 2/2] drm/mediatek/hdmi: Simplify with dev_err_probe
2025-02-13 10:07 ` Krzysztof Kozlowski
@ 2025-02-13 10:39 ` AngeloGioacchino Del Regno
0 siblings, 0 replies; 15+ messages in thread
From: AngeloGioacchino Del Regno @ 2025-02-13 10:39 UTC (permalink / raw)
To: Krzysztof Kozlowski, Chun-Kuang Hu, Philipp Zabel, David Airlie,
Simona Vetter, Matthias Brugger, dri-devel, linux-mediatek,
linux-kernel, linux-arm-kernel
Il 13/02/25 11:07, Krzysztof Kozlowski ha scritto:
> On 12/02/2025 21:33, Krzysztof Kozlowski wrote:
>> On 13/01/2025 14:48, AngeloGioacchino Del Regno wrote:
>>> Il 13/01/25 14:07, Krzysztof Kozlowski ha scritto:
>>>> On 13/01/2025 13:41, AngeloGioacchino Del Regno wrote:
>>>>> Il 12/01/25 14:47, Krzysztof Kozlowski ha scritto:
>>>>>> Use dev_err_probe() to make error code and deferred probe handling
>>>>>> simpler.
>>>>>>
>>>>>
>>>>> That's already done in [1] so you can drop this commit.
>>>>>
>>>>> [1]:
>>>>> https://lore.kernel.org/r/20250108112744.64686-1-angelogioacchino.delregno@collabora.com
>>>>>
>>>> Eh, this was first in v3 in the middle of Dec, so why you cannot get it
>>>> merged first? Creating such 34-behemoths causes simple cleanups to
>>>> unnecessarily wait.
>>>>
>>>
>>> Getting the series partially merged is okay for me, no complaints about that,
>>> but then ... in v4, there are two minor comments to address (one of which
>>> is a one-char nitpick!) that might as well be done while applying, depending
>>> on what CK thinks about that, so there's no real benefit in getting 28 commits
>>> out of 34 picked instead of, well, just everything...
>>>
>>
>> OK, month passed, I waited, so is your big patchset merged? If it is,
>> then this will effectively rebase my patch, as you requested.
>
> I think I missed that you took the patch to your patchset, so sorry for
> the noise.
No problem.
Cheers,
Angelo
>
> Best regards,
> Krzysztof
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 1/2] drm/mediatek/hdmi: Use syscon_regmap_lookup_by_phandle_args
2025-01-12 13:47 [PATCH 1/2] drm/mediatek/hdmi: Use syscon_regmap_lookup_by_phandle_args Krzysztof Kozlowski
2025-01-12 13:47 ` [PATCH 2/2] drm/mediatek/hdmi: Simplify with dev_err_probe Krzysztof Kozlowski
@ 2025-01-13 12:41 ` AngeloGioacchino Del Regno
2025-01-13 13:05 ` Krzysztof Kozlowski
2025-02-13 6:39 ` CK Hu (胡俊光)
2 siblings, 1 reply; 15+ messages in thread
From: AngeloGioacchino Del Regno @ 2025-01-13 12:41 UTC (permalink / raw)
To: Krzysztof Kozlowski, Chun-Kuang Hu, Philipp Zabel, David Airlie,
Simona Vetter, Matthias Brugger, dri-devel, linux-mediatek,
linux-kernel, linux-arm-kernel
Il 12/01/25 14:47, Krzysztof Kozlowski ha scritto:
> Use syscon_regmap_lookup_by_phandle_args() which is a wrapper over
> syscon_regmap_lookup_by_phandle() combined with getting the syscon
> argument. Except simpler code this annotates within one line that given
> phandle has arguments, so grepping for code would be easier.
>
> There is also no real benefit in printing errors on missing syscon
> argument, because this is done just too late: runtime check on
> static/build-time data. Dtschema and Devicetree bindings offer the
> static/build-time check for this already.
>
I agree with this change but can you please rebase it over [1]?
The same code got migrated to mtk_hdmi_common.c instead :-)
[1]:
https://lore.kernel.org/r/20250108112744.64686-1-angelogioacchino.delregno@collabora.com
Thanks,
Angelo
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
> drivers/gpu/drm/mediatek/mtk_hdmi.c | 14 +++++---------
> 1 file changed, 5 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c b/drivers/gpu/drm/mediatek/mtk_hdmi.c
> index ca82bc829cb9..4b0eb7dc25d8 100644
> --- a/drivers/gpu/drm/mediatek/mtk_hdmi.c
> +++ b/drivers/gpu/drm/mediatek/mtk_hdmi.c
> @@ -1458,15 +1458,11 @@ static int mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *hdmi,
> * MMSYS_CONFIG device and the register offset of the HDMI_SYS_CFG
> * registers it contains.
> */
> - regmap = syscon_regmap_lookup_by_phandle(np, "mediatek,syscon-hdmi");
> - ret = of_property_read_u32_index(np, "mediatek,syscon-hdmi", 1,
> - &hdmi->sys_offset);
> - if (IS_ERR(regmap))
> - ret = PTR_ERR(regmap);
> - if (ret) {
> - dev_err(dev,
> - "Failed to get system configuration registers: %d\n",
> - ret);
> + regmap = syscon_regmap_lookup_by_phandle_args(np, "mediatek,syscon-hdmi",
> + 1, &hdmi->sys_offset);
> + if (IS_ERR(regmap)) {
> + ret = dev_err_probe(dev, PTR_ERR(regmap),
> + "Failed to get system configuration registers\n");
> goto put_device;
> }
> hdmi->sys_regmap = regmap;
--
AngeloGioacchino Del Regno
Senior Software Engineer
Collabora Ltd.
Platinum Building, St John's Innovation Park, Cambridge CB4 0DS, UK
Registered in England & Wales, no. 5513718
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH 1/2] drm/mediatek/hdmi: Use syscon_regmap_lookup_by_phandle_args
2025-01-13 12:41 ` [PATCH 1/2] drm/mediatek/hdmi: Use syscon_regmap_lookup_by_phandle_args AngeloGioacchino Del Regno
@ 2025-01-13 13:05 ` Krzysztof Kozlowski
2025-01-13 13:58 ` AngeloGioacchino Del Regno
0 siblings, 1 reply; 15+ messages in thread
From: Krzysztof Kozlowski @ 2025-01-13 13:05 UTC (permalink / raw)
To: AngeloGioacchino Del Regno, Chun-Kuang Hu, Philipp Zabel,
David Airlie, Simona Vetter, Matthias Brugger, dri-devel,
linux-mediatek, linux-kernel, linux-arm-kernel
On 13/01/2025 13:41, AngeloGioacchino Del Regno wrote:
> Il 12/01/25 14:47, Krzysztof Kozlowski ha scritto:
>> Use syscon_regmap_lookup_by_phandle_args() which is a wrapper over
>> syscon_regmap_lookup_by_phandle() combined with getting the syscon
>> argument. Except simpler code this annotates within one line that given
>> phandle has arguments, so grepping for code would be easier.
>>
>> There is also no real benefit in printing errors on missing syscon
>> argument, because this is done just too late: runtime check on
>> static/build-time data. Dtschema and Devicetree bindings offer the
>> static/build-time check for this already.
>>
>
> I agree with this change but can you please rebase it over [1]?
>
> The same code got migrated to mtk_hdmi_common.c instead :-)
>
> [1]:
> https://lore.kernel.org/r/20250108112744.64686-1-angelogioacchino.delregno@collabora.com
My is 2-patch cleanup, your is 34 patch rework and new features with
existing build reports, so rebase is not reasonable. It would make this
2-patch cleanup wait for many cycles.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 1/2] drm/mediatek/hdmi: Use syscon_regmap_lookup_by_phandle_args
2025-01-13 13:05 ` Krzysztof Kozlowski
@ 2025-01-13 13:58 ` AngeloGioacchino Del Regno
2025-01-13 14:27 ` Krzysztof Kozlowski
0 siblings, 1 reply; 15+ messages in thread
From: AngeloGioacchino Del Regno @ 2025-01-13 13:58 UTC (permalink / raw)
To: Krzysztof Kozlowski, Chun-Kuang Hu, Philipp Zabel, David Airlie,
Simona Vetter, Matthias Brugger, dri-devel, linux-mediatek,
linux-kernel, linux-arm-kernel
Il 13/01/25 14:05, Krzysztof Kozlowski ha scritto:
> On 13/01/2025 13:41, AngeloGioacchino Del Regno wrote:
>> Il 12/01/25 14:47, Krzysztof Kozlowski ha scritto:
>>> Use syscon_regmap_lookup_by_phandle_args() which is a wrapper over
>>> syscon_regmap_lookup_by_phandle() combined with getting the syscon
>>> argument. Except simpler code this annotates within one line that given
>>> phandle has arguments, so grepping for code would be easier.
>>>
>>> There is also no real benefit in printing errors on missing syscon
>>> argument, because this is done just too late: runtime check on
>>> static/build-time data. Dtschema and Devicetree bindings offer the
>>> static/build-time check for this already.
>>>
>>
>> I agree with this change but can you please rebase it over [1]?
>>
>> The same code got migrated to mtk_hdmi_common.c instead :-)
>>
>> [1]:
>> https://lore.kernel.org/r/20250108112744.64686-1-angelogioacchino.delregno@collabora.com
> My is 2-patch cleanup, your is 34 patch rework and new features with
> existing build reports, so rebase is not reasonable. It would make this
> 2-patch cleanup wait for many cycles.
>
If adding the `#include <linux/bitfield.h>` line to a file would take
*many cycles*, that'd be a bit weird, wouldn't it? :-)
Regards,
Angelo
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 1/2] drm/mediatek/hdmi: Use syscon_regmap_lookup_by_phandle_args
2025-01-13 13:58 ` AngeloGioacchino Del Regno
@ 2025-01-13 14:27 ` Krzysztof Kozlowski
2025-01-13 14:31 ` Krzysztof Kozlowski
0 siblings, 1 reply; 15+ messages in thread
From: Krzysztof Kozlowski @ 2025-01-13 14:27 UTC (permalink / raw)
To: AngeloGioacchino Del Regno, Chun-Kuang Hu, Philipp Zabel,
David Airlie, Simona Vetter, Matthias Brugger, dri-devel,
linux-mediatek, linux-kernel, linux-arm-kernel
On 13/01/2025 14:58, AngeloGioacchino Del Regno wrote:
> Il 13/01/25 14:05, Krzysztof Kozlowski ha scritto:
>> On 13/01/2025 13:41, AngeloGioacchino Del Regno wrote:
>>> Il 12/01/25 14:47, Krzysztof Kozlowski ha scritto:
>>>> Use syscon_regmap_lookup_by_phandle_args() which is a wrapper over
>>>> syscon_regmap_lookup_by_phandle() combined with getting the syscon
>>>> argument. Except simpler code this annotates within one line that given
>>>> phandle has arguments, so grepping for code would be easier.
>>>>
>>>> There is also no real benefit in printing errors on missing syscon
>>>> argument, because this is done just too late: runtime check on
>>>> static/build-time data. Dtschema and Devicetree bindings offer the
>>>> static/build-time check for this already.
>>>>
>>>
>>> I agree with this change but can you please rebase it over [1]?
>>>
>>> The same code got migrated to mtk_hdmi_common.c instead :-)
>>>
>>> [1]:
>>> https://lore.kernel.org/r/20250108112744.64686-1-angelogioacchino.delregno@collabora.com
>> My is 2-patch cleanup, your is 34 patch rework and new features with
>> existing build reports, so rebase is not reasonable. It would make this
>> 2-patch cleanup wait for many cycles.
>>
> If adding the `#include <linux/bitfield.h>` line to a file would take
> *many cycles*, that'd be a bit weird, wouldn't it? :-)
It's not about include, it is about rebase. If I rebase on 34-patchset,
that's my dependency and this work cannot be merged before yours is.
And yours already have kbuild reports, so there will be v5, maybe v6 etc.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 1/2] drm/mediatek/hdmi: Use syscon_regmap_lookup_by_phandle_args
2025-01-13 14:27 ` Krzysztof Kozlowski
@ 2025-01-13 14:31 ` Krzysztof Kozlowski
2025-01-13 15:02 ` AngeloGioacchino Del Regno
0 siblings, 1 reply; 15+ messages in thread
From: Krzysztof Kozlowski @ 2025-01-13 14:31 UTC (permalink / raw)
To: AngeloGioacchino Del Regno, Chun-Kuang Hu, Philipp Zabel,
David Airlie, Simona Vetter, Matthias Brugger, dri-devel,
linux-mediatek, linux-kernel, linux-arm-kernel
On 13/01/2025 15:27, Krzysztof Kozlowski wrote:
> On 13/01/2025 14:58, AngeloGioacchino Del Regno wrote:
>> Il 13/01/25 14:05, Krzysztof Kozlowski ha scritto:
>>> On 13/01/2025 13:41, AngeloGioacchino Del Regno wrote:
>>>> Il 12/01/25 14:47, Krzysztof Kozlowski ha scritto:
>>>>> Use syscon_regmap_lookup_by_phandle_args() which is a wrapper over
>>>>> syscon_regmap_lookup_by_phandle() combined with getting the syscon
>>>>> argument. Except simpler code this annotates within one line that given
>>>>> phandle has arguments, so grepping for code would be easier.
>>>>>
>>>>> There is also no real benefit in printing errors on missing syscon
>>>>> argument, because this is done just too late: runtime check on
>>>>> static/build-time data. Dtschema and Devicetree bindings offer the
>>>>> static/build-time check for this already.
>>>>>
>>>>
>>>> I agree with this change but can you please rebase it over [1]?
>>>>
>>>> The same code got migrated to mtk_hdmi_common.c instead :-)
>>>>
>>>> [1]:
>>>> https://lore.kernel.org/r/20250108112744.64686-1-angelogioacchino.delregno@collabora.com
>>> My is 2-patch cleanup, your is 34 patch rework and new features with
>>> existing build reports, so rebase is not reasonable. It would make this
>>> 2-patch cleanup wait for many cycles.
>>>
>> If adding the `#include <linux/bitfield.h>` line to a file would take
>> *many cycles*, that'd be a bit weird, wouldn't it? :-)
> It's not about include, it is about rebase. If I rebase on 34-patchset,
> that's my dependency and this work cannot be merged before yours is.
>
> And yours already have kbuild reports, so there will be v5, maybe v6 etc.
Although "NO!!!! No more huge patch bombs to
linux-kernel@vger.kernel.org people!" was removed, but its spirit is
kind of still valid and requesting to rebase cleanups on top of patch
bombs with new features is just not reasonable.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 1/2] drm/mediatek/hdmi: Use syscon_regmap_lookup_by_phandle_args
2025-01-13 14:31 ` Krzysztof Kozlowski
@ 2025-01-13 15:02 ` AngeloGioacchino Del Regno
0 siblings, 0 replies; 15+ messages in thread
From: AngeloGioacchino Del Regno @ 2025-01-13 15:02 UTC (permalink / raw)
To: Krzysztof Kozlowski, Chun-Kuang Hu, Philipp Zabel, David Airlie,
Simona Vetter, Matthias Brugger, dri-devel, linux-mediatek,
linux-kernel, linux-arm-kernel
Il 13/01/25 15:31, Krzysztof Kozlowski ha scritto:
> On 13/01/2025 15:27, Krzysztof Kozlowski wrote:
>> On 13/01/2025 14:58, AngeloGioacchino Del Regno wrote:
>>> Il 13/01/25 14:05, Krzysztof Kozlowski ha scritto:
>>>> On 13/01/2025 13:41, AngeloGioacchino Del Regno wrote:
>>>>> Il 12/01/25 14:47, Krzysztof Kozlowski ha scritto:
>>>>>> Use syscon_regmap_lookup_by_phandle_args() which is a wrapper over
>>>>>> syscon_regmap_lookup_by_phandle() combined with getting the syscon
>>>>>> argument. Except simpler code this annotates within one line that given
>>>>>> phandle has arguments, so grepping for code would be easier.
>>>>>>
>>>>>> There is also no real benefit in printing errors on missing syscon
>>>>>> argument, because this is done just too late: runtime check on
>>>>>> static/build-time data. Dtschema and Devicetree bindings offer the
>>>>>> static/build-time check for this already.
>>>>>>
>>>>>
>>>>> I agree with this change but can you please rebase it over [1]?
>>>>>
>>>>> The same code got migrated to mtk_hdmi_common.c instead :-)
>>>>>
>>>>> [1]:
>>>>> https://lore.kernel.org/r/20250108112744.64686-1-angelogioacchino.delregno@collabora.com
>>>> My is 2-patch cleanup, your is 34 patch rework and new features with
>>>> existing build reports, so rebase is not reasonable. It would make this
>>>> 2-patch cleanup wait for many cycles.
>>>>
>>> If adding the `#include <linux/bitfield.h>` line to a file would take
>>> *many cycles*, that'd be a bit weird, wouldn't it? :-)
>> It's not about include, it is about rebase. If I rebase on 34-patchset,
>> that's my dependency and this work cannot be merged before yours is.
>>
>> And yours already have kbuild reports, so there will be v5, maybe v6 etc.
>
>
> Although "NO!!!! No more huge patch bombs to
> linux-kernel@vger.kernel.org people!" was removed, but its spirit is
> kind of still valid and requesting to rebase cleanups on top of patch
> bombs with new features is just not reasonable.
>
I understand Krzysztof, but since my 34-patchset should be ready and I don't
expect to send any v6 for how it is right now, your patch would make it
necessary to send yet another patchbomb on my side... we're kind-of in the
same situation here, and I feel like we're making a big issue out of something
that should not really be a problem.
I'm sorry about this situation, and I feel like this doesn't really depend
on me, as much as it doesn't really depend on you... let's just see what CK
thinks about this, or else, I don't know how to make this easier on all of
us - me, you and the maintainer.
If it felt like me being rude in any way, that wasn't my intention, btw.
I can offer to rebase this patch on my own keeping your authorship, if that
makes things easier.
Cheers,
Angelo
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 1/2] drm/mediatek/hdmi: Use syscon_regmap_lookup_by_phandle_args
2025-01-12 13:47 [PATCH 1/2] drm/mediatek/hdmi: Use syscon_regmap_lookup_by_phandle_args Krzysztof Kozlowski
2025-01-12 13:47 ` [PATCH 2/2] drm/mediatek/hdmi: Simplify with dev_err_probe Krzysztof Kozlowski
2025-01-13 12:41 ` [PATCH 1/2] drm/mediatek/hdmi: Use syscon_regmap_lookup_by_phandle_args AngeloGioacchino Del Regno
@ 2025-02-13 6:39 ` CK Hu (胡俊光)
2 siblings, 0 replies; 15+ messages in thread
From: CK Hu (胡俊光) @ 2025-02-13 6:39 UTC (permalink / raw)
To: krzysztof.kozlowski@linaro.org, simona@ffwll.ch,
dri-devel@lists.freedesktop.org, AngeloGioacchino Del Regno,
airlied@gmail.com, linux-kernel@vger.kernel.org,
chunkuang.hu@kernel.org, p.zabel@pengutronix.de,
matthias.bgg@gmail.com, linux-mediatek@lists.infradead.org,
linux-arm-kernel@lists.infradead.org
On Sun, 2025-01-12 at 14:47 +0100, Krzysztof Kozlowski wrote:
> External email : Please do not click links or open attachments until you have verified the sender or the content.
>
>
> Use syscon_regmap_lookup_by_phandle_args() which is a wrapper over
> syscon_regmap_lookup_by_phandle() combined with getting the syscon
> argument. Except simpler code this annotates within one line that given
> phandle has arguments, so grepping for code would be easier.
>
> There is also no real benefit in printing errors on missing syscon
> argument, because this is done just too late: runtime check on
> static/build-time data. Dtschema and Devicetree bindings offer the
> static/build-time check for this already.
Reviewed-by: CK Hu <ck.hu@mediatek.com>
I've not decided to apply this patch first or Angelo's patch first.
I'll fix conflict when I apply both patch.
Regards,
CK
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
> drivers/gpu/drm/mediatek/mtk_hdmi.c | 14 +++++---------
> 1 file changed, 5 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c b/drivers/gpu/drm/mediatek/mtk_hdmi.c
> index ca82bc829cb9..4b0eb7dc25d8 100644
> --- a/drivers/gpu/drm/mediatek/mtk_hdmi.c
> +++ b/drivers/gpu/drm/mediatek/mtk_hdmi.c
> @@ -1458,15 +1458,11 @@ static int mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *hdmi,
> * MMSYS_CONFIG device and the register offset of the HDMI_SYS_CFG
> * registers it contains.
> */
> - regmap = syscon_regmap_lookup_by_phandle(np, "mediatek,syscon-hdmi");
> - ret = of_property_read_u32_index(np, "mediatek,syscon-hdmi", 1,
> - &hdmi->sys_offset);
> - if (IS_ERR(regmap))
> - ret = PTR_ERR(regmap);
> - if (ret) {
> - dev_err(dev,
> - "Failed to get system configuration registers: %d\n",
> - ret);
> + regmap = syscon_regmap_lookup_by_phandle_args(np, "mediatek,syscon-hdmi",
> + 1, &hdmi->sys_offset);
> + if (IS_ERR(regmap)) {
> + ret = dev_err_probe(dev, PTR_ERR(regmap),
> + "Failed to get system configuration registers\n");
> goto put_device;
> }
> hdmi->sys_regmap = regmap;
> --
> 2.43.0
>
>
^ permalink raw reply [flat|nested] 15+ messages in thread