mirror of https://lore.kernel.org/linux-amlogic/
 help / color / mirror / Atom feed
* [PATCH] drm/meson: dw-hdmi: Fix devm_regulator_*get_enable*() conversion
       [not found] <CGME20230109220056eucas1p26418012878272961a3a21a365192ef60@eucas1p2.samsung.com>
@ 2023-01-09 22:00 ` Marek Szyprowski
  2023-01-10  8:26   ` Neil Armstrong
                     ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Marek Szyprowski @ 2023-01-09 22:00 UTC (permalink / raw)
  To: dri-devel, linux-amlogic
  Cc: Marek Szyprowski, Matti Vaittinen, Martin Blumenstingl,
	Neil Armstrong, David Airlie, Daniel Vetter, Kevin Hilman,
	Jerome Brunet

devm_regulator_get_enable_optional() function returns 0 on success, so
use it for the check if function succeded instead of the -ENODEV value.

Fixes: 429e87063661 ("drm/meson: dw-hdmi: Use devm_regulator_*get_enable*()")
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
 drivers/gpu/drm/meson/meson_dw_hdmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/meson/meson_dw_hdmi.c b/drivers/gpu/drm/meson/meson_dw_hdmi.c
index 7642f740272b..534621a13a34 100644
--- a/drivers/gpu/drm/meson/meson_dw_hdmi.c
+++ b/drivers/gpu/drm/meson/meson_dw_hdmi.c
@@ -718,7 +718,7 @@ static int meson_dw_hdmi_bind(struct device *dev, struct device *master,
 	dw_plat_data = &meson_dw_hdmi->dw_plat_data;
 
 	ret = devm_regulator_get_enable_optional(dev, "hdmi");
-	if (ret != -ENODEV)
+	if (ret < 0)
 		return ret;
 
 	meson_dw_hdmi->hdmitx_apb = devm_reset_control_get_exclusive(dev,
-- 
2.39.0


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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] drm/meson: dw-hdmi: Fix devm_regulator_*get_enable*() conversion
  2023-01-09 22:00 ` [PATCH] drm/meson: dw-hdmi: Fix devm_regulator_*get_enable*() conversion Marek Szyprowski
@ 2023-01-10  8:26   ` Neil Armstrong
  2023-01-10  8:32   ` Neil Armstrong
  2023-03-09  8:55   ` Ricardo Cañuelo
  2 siblings, 0 replies; 5+ messages in thread
From: Neil Armstrong @ 2023-01-10  8:26 UTC (permalink / raw)
  To: Marek Szyprowski, dri-devel, linux-amlogic
  Cc: Matti Vaittinen, Martin Blumenstingl, David Airlie,
	Daniel Vetter, Kevin Hilman, Jerome Brunet

On 09/01/2023 23:00, Marek Szyprowski wrote:
> devm_regulator_get_enable_optional() function returns 0 on success, so
> use it for the check if function succeded instead of the -ENODEV value.
> 
> Fixes: 429e87063661 ("drm/meson: dw-hdmi: Use devm_regulator_*get_enable*()")
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
>   drivers/gpu/drm/meson/meson_dw_hdmi.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/meson/meson_dw_hdmi.c b/drivers/gpu/drm/meson/meson_dw_hdmi.c
> index 7642f740272b..534621a13a34 100644
> --- a/drivers/gpu/drm/meson/meson_dw_hdmi.c
> +++ b/drivers/gpu/drm/meson/meson_dw_hdmi.c
> @@ -718,7 +718,7 @@ static int meson_dw_hdmi_bind(struct device *dev, struct device *master,
>   	dw_plat_data = &meson_dw_hdmi->dw_plat_data;
>   
>   	ret = devm_regulator_get_enable_optional(dev, "hdmi");
> -	if (ret != -ENODEV)
> +	if (ret < 0)
>   		return ret;
>   
>   	meson_dw_hdmi->hdmitx_apb = devm_reset_control_get_exclusive(dev,


Acked-by: Neil Armstrong <neil.armstrong@linaro.org>

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] drm/meson: dw-hdmi: Fix devm_regulator_*get_enable*() conversion
  2023-01-09 22:00 ` [PATCH] drm/meson: dw-hdmi: Fix devm_regulator_*get_enable*() conversion Marek Szyprowski
  2023-01-10  8:26   ` Neil Armstrong
@ 2023-01-10  8:32   ` Neil Armstrong
  2023-03-09  8:55   ` Ricardo Cañuelo
  2 siblings, 0 replies; 5+ messages in thread
From: Neil Armstrong @ 2023-01-10  8:32 UTC (permalink / raw)
  To: dri-devel, linux-amlogic, Marek Szyprowski
  Cc: Matti Vaittinen, Martin Blumenstingl, David Airlie,
	Daniel Vetter, Kevin Hilman, Jerome Brunet

Hi,

On Mon, 09 Jan 2023 23:00:33 +0100, Marek Szyprowski wrote:
> devm_regulator_get_enable_optional() function returns 0 on success, so
> use it for the check if function succeded instead of the -ENODEV value.
> 
> 

Thanks, Applied to https://anongit.freedesktop.org/git/drm/drm-misc.git (drm-misc-next)

[1/1] drm/meson: dw-hdmi: Fix devm_regulator_*get_enable*() conversion
      https://cgit.freedesktop.org/drm/drm-misc/commit/?id=67d0a30128c9f644595dfe67ac0fb941a716a6c9

-- 
Neil

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] drm/meson: dw-hdmi: Fix devm_regulator_*get_enable*() conversion
  2023-01-09 22:00 ` [PATCH] drm/meson: dw-hdmi: Fix devm_regulator_*get_enable*() conversion Marek Szyprowski
  2023-01-10  8:26   ` Neil Armstrong
  2023-01-10  8:32   ` Neil Armstrong
@ 2023-03-09  8:55   ` Ricardo Cañuelo
  2023-03-09 15:06     ` Marek Szyprowski
  2 siblings, 1 reply; 5+ messages in thread
From: Ricardo Cañuelo @ 2023-03-09  8:55 UTC (permalink / raw)
  To: Marek Szyprowski
  Cc: dri-devel, linux-amlogic, Matti Vaittinen, Martin Blumenstingl,
	Neil Armstrong, David Airlie, Daniel Vetter, Kevin Hilman,
	Jerome Brunet

Hi Marek,

On lun 09-01-2023 23:00:33, Marek Szyprowski wrote:
> devm_regulator_get_enable_optional() function returns 0 on success, so
> use it for the check if function succeded instead of the -ENODEV value.
> 
> Fixes: 429e87063661 ("drm/meson: dw-hdmi: Use devm_regulator_*get_enable*()")
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
>  drivers/gpu/drm/meson/meson_dw_hdmi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/meson/meson_dw_hdmi.c b/drivers/gpu/drm/meson/meson_dw_hdmi.c
> index 7642f740272b..534621a13a34 100644
> --- a/drivers/gpu/drm/meson/meson_dw_hdmi.c
> +++ b/drivers/gpu/drm/meson/meson_dw_hdmi.c
> @@ -718,7 +718,7 @@ static int meson_dw_hdmi_bind(struct device *dev, struct device *master,
>  	dw_plat_data = &meson_dw_hdmi->dw_plat_data;
>  
>  	ret = devm_regulator_get_enable_optional(dev, "hdmi");
> -	if (ret != -ENODEV)
> +	if (ret < 0)
>  		return ret;
>  
>  	meson_dw_hdmi->hdmitx_apb = devm_reset_control_get_exclusive(dev,
> -- 
> 2.39.0

This patch seems to have caused (or uncovered) a regression in the
bootrr.deferred-probe-empty test for meson-g12a-sei510. Apparently, this
causes a driver to stay in the deferred probe list after boot.

The bisection was found on mainline/master. Here's the full report:


* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* This automated bisection report was sent to you on the basis  *
* that you may be involved with the breaking commit it has      *
* found.  No manual investigation has been done to verify it,   *
* and the root cause of the problem may be somewhere else.      *
*                                                               *
* If you do send a fix, please include this trailer:            *
*   Reported-by: "kernelci.org bot" <bot@kernelci.org>          *
*                                                               *
* Hope this helps!                                              *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

mainline/master bisection: baseline.bootrr.deferred-probe-empty on meson-g12a-sei510

Summary:
  Start:      fe15c26ee26e Linux 6.3-rc1
  Plain log:  https://storage.kernelci.org/mainline/master/v6.3-rc1/arm64/defconfig/clang-11/lab-baylibre/baseline-meson-g12a-sei510.txt
  HTML log:   https://storage.kernelci.org/mainline/master/v6.3-rc1/arm64/defconfig/clang-11/lab-baylibre/baseline-meson-g12a-sei510.html
  Result:     67d0a30128c9 drm/meson: dw-hdmi: Fix devm_regulator_*get_enable*() conversion

Checks:
  revert:     PASS
  verify:     PASS

Parameters:
  Tree:       mainline
  URL:        https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
  Branch:     master
  Target:     meson-g12a-sei510
  CPU arch:   arm64
  Lab:        lab-baylibre
  Compiler:   clang-11
  Config:     defconfig
  Test case:  baseline.bootrr.deferred-probe-empty

Breaking commit found:

-------------------------------------------------------------------------------
commit 67d0a30128c9f644595dfe67ac0fb941a716a6c9
Author: Marek Szyprowski <m.szyprowski@samsung.com>
Date:   Mon Jan 9 23:00:33 2023 +0100

    drm/meson: dw-hdmi: Fix devm_regulator_*get_enable*() conversion
    
    devm_regulator_get_enable_optional() function returns 0 on success, so
    use it for the check if function succeeded instead of the -ENODEV value.
    
    Fixes: 429e87063661 ("drm/meson: dw-hdmi: Use devm_regulator_*get_enable*()")
    Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
    Acked-by: Neil Armstrong <neil.armstrong@linaro.org>
    Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
    [narmstrong: s/succeeded/succeeded/ in commit message]
    Link: https://patchwork.freedesktop.org/patch/msgid/20230109220033.31202-1-m.szyprowski@samsung.com

diff --git a/drivers/gpu/drm/meson/meson_dw_hdmi.c b/drivers/gpu/drm/meson/meson_dw_hdmi.c
index 7642f740272b..534621a13a34 100644
--- a/drivers/gpu/drm/meson/meson_dw_hdmi.c
+++ b/drivers/gpu/drm/meson/meson_dw_hdmi.c
@@ -718,7 +718,7 @@ static int meson_dw_hdmi_bind(struct device *dev, struct device *master,
 	dw_plat_data = &meson_dw_hdmi->dw_plat_data;
 
 	ret = devm_regulator_get_enable_optional(dev, "hdmi");
-	if (ret != -ENODEV)
+	if (ret < 0)
 		return ret;
 
 	meson_dw_hdmi->hdmitx_apb = devm_reset_control_get_exclusive(dev,
-------------------------------------------------------------------------------


Git bisection log:

-------------------------------------------------------------------------------
git bisect start
# good: [307e14c039063f0c9bd7a18a7add8f940580dcc9] Merge tag '6.3-rc-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6
git bisect good 307e14c039063f0c9bd7a18a7add8f940580dcc9
# bad: [fe15c26ee26efa11741a7b632e9f23b01aca4cc6] Linux 6.3-rc1
git bisect bad fe15c26ee26efa11741a7b632e9f23b01aca4cc6
# bad: [693fed981eb9bf6e70bfda66bb872e2bb8155671] Merge tag 'char-misc-6.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
git bisect bad 693fed981eb9bf6e70bfda66bb872e2bb8155671
# bad: [b72b5fecc1b8a2e595bd03d7d257c88ea3f9fd45] Merge tag 'trace-v6.3' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace
git bisect bad b72b5fecc1b8a2e595bd03d7d257c88ea3f9fd45
# bad: [7dd1be30f02f7115002fe00f1f6802bbcf79f857] Merge tag 'amd-drm-next-6.3-2023-01-20' of https://gitlab.freedesktop.org/agd5f/linux into drm-next
git bisect bad 7dd1be30f02f7115002fe00f1f6802bbcf79f857
# bad: [c37ea39c1fa880da0d7fd2c719e5c96be19f0fc5] Merge tag 'drm-misc-next-2023-01-12' of git://anongit.freedesktop.org/drm/drm-misc into drm-next
git bisect bad c37ea39c1fa880da0d7fd2c719e5c96be19f0fc5
# good: [fe91e41a6170c9fd73fa0bf9a1a3f3cc6ee5c1d2] drm/format-helper: Remove unnecessary conversion helpers
git bisect good fe91e41a6170c9fd73fa0bf9a1a3f3cc6ee5c1d2
# good: [e045aec89d1b6cd677ec3e253d87f85d44b17559] drm/amd: Load GFX11 microcode during early_init
git bisect good e045aec89d1b6cd677ec3e253d87f85d44b17559
# bad: [9cce08cadc6ce8670280d0a042cf0b6d2987d9f9] drm/panel-edp: fix name for IVO product id 854b
git bisect bad 9cce08cadc6ce8670280d0a042cf0b6d2987d9f9
# good: [977374cf481d3bea916b2775e6ecc682b9689550] drm/vc4: plane: Add 3:3:2 and 4:4:4:4 RGB/RGBX/RGBA formats
git bisect good 977374cf481d3bea916b2775e6ecc682b9689550
# bad: [0e4dcffd331fa7d2a6ae628b51a7f418dfa90367] drm/panel: raspberrypi-touchscreen: Convert to i2c's .probe_new()
git bisect bad 0e4dcffd331fa7d2a6ae628b51a7f418dfa90367
# bad: [67d0a30128c9f644595dfe67ac0fb941a716a6c9] drm/meson: dw-hdmi: Fix devm_regulator_*get_enable*() conversion
git bisect bad 67d0a30128c9f644595dfe67ac0fb941a716a6c9
# good: [771d6539f27bd55f43d8a95d53a7eeaaffa2681c] drm/vc4: hdmi: Correct interlaced timings again
git bisect good 771d6539f27bd55f43d8a95d53a7eeaaffa2681c
# good: [ef85db911134d103a7f713eae6689dbb15c3f96a] dt-bindings: display: panel: document the Visionox VTDR6130 AMOLED DSI Panel
git bisect good ef85db911134d103a7f713eae6689dbb15c3f96a
# good: [2349183d32d83a7635baa804934813bcad13fd62] drm/panel: add visionox vtdr6130 DSI panel driver
git bisect good 2349183d32d83a7635baa804934813bcad13fd62
# first bad commit: [67d0a30128c9f644595dfe67ac0fb941a716a6c9] drm/meson: dw-hdmi: Fix devm_regulator_*get_enable*() conversion
-------------------------------------------------------------------------------


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#38919): https://groups.io/g/kernelci-results/message/38919
Mute This Topic: https://groups.io/mt/97420961/7285812
Group Owner: kernelci-results+owner@groups.io
Unsubscribe: https://groups.io/g/kernelci-results/unsub [ricardo.canuelo@collabora.com]
-=-=-=-=-=-=-=-=-=-=-=-

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] drm/meson: dw-hdmi: Fix devm_regulator_*get_enable*() conversion
  2023-03-09  8:55   ` Ricardo Cañuelo
@ 2023-03-09 15:06     ` Marek Szyprowski
  0 siblings, 0 replies; 5+ messages in thread
From: Marek Szyprowski @ 2023-03-09 15:06 UTC (permalink / raw)
  To: Ricardo Cañuelo
  Cc: dri-devel, linux-amlogic, Matti Vaittinen, Martin Blumenstingl,
	Neil Armstrong, David Airlie, Daniel Vetter, Kevin Hilman,
	Jerome Brunet, Mark Brown

Hi Ricardo,

On 09.03.2023 09:55, Ricardo Cañuelo wrote:
> On lun 09-01-2023 23:00:33, Marek Szyprowski wrote:
>> devm_regulator_get_enable_optional() function returns 0 on success, so
>> use it for the check if function succeded instead of the -ENODEV value.
>>
>> Fixes: 429e87063661 ("drm/meson: dw-hdmi: Use devm_regulator_*get_enable*()")
>> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
>> ---
>>   drivers/gpu/drm/meson/meson_dw_hdmi.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/meson/meson_dw_hdmi.c b/drivers/gpu/drm/meson/meson_dw_hdmi.c
>> index 7642f740272b..534621a13a34 100644
>> --- a/drivers/gpu/drm/meson/meson_dw_hdmi.c
>> +++ b/drivers/gpu/drm/meson/meson_dw_hdmi.c
>> @@ -718,7 +718,7 @@ static int meson_dw_hdmi_bind(struct device *dev, struct device *master,
>>   	dw_plat_data = &meson_dw_hdmi->dw_plat_data;
>>   
>>   	ret = devm_regulator_get_enable_optional(dev, "hdmi");
>> -	if (ret != -ENODEV)
>> +	if (ret < 0)
>>   		return ret;
>>   
>>   	meson_dw_hdmi->hdmitx_apb = devm_reset_control_get_exclusive(dev,
>> -- 
>> 2.39.0
> This patch seems to have caused (or uncovered) a regression in the
> bootrr.deferred-probe-empty test for meson-g12a-sei510. Apparently, this
> causes a driver to stay in the deferred probe list after boot.

Indeed my fix causes regression on the platform, which doesn't have 
"hdmi" regulator. Thanks for pointing that. I was really convinced that 
devm_regulator_get_enable_*optional*() returns 0 if requested regulator 
is not present (as "_optional" suffix suggests). Unfortunately it 
returns -ENODEV, what breaks meson_dw_hdmi driver. I will send a fix in 
a few minutes.


Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland


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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-03-09 15:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20230109220056eucas1p26418012878272961a3a21a365192ef60@eucas1p2.samsung.com>
2023-01-09 22:00 ` [PATCH] drm/meson: dw-hdmi: Fix devm_regulator_*get_enable*() conversion Marek Szyprowski
2023-01-10  8:26   ` Neil Armstrong
2023-01-10  8:32   ` Neil Armstrong
2023-03-09  8:55   ` Ricardo Cañuelo
2023-03-09 15:06     ` Marek Szyprowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®