linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] No longer produce error messages when dphy is deferred
@ 2024-11-08 13:53 Dragan Simic
  2024-11-08 13:53 ` [PATCH 1/2] drm/rockchip: dsi: Perform trivial code cleanups Dragan Simic
  2024-11-08 13:53 ` [PATCH 2/2] drm/rockchip: dsi: Don't log errors on deferred dphy Dragan Simic
  0 siblings, 2 replies; 12+ messages in thread
From: Dragan Simic @ 2024-11-08 13:53 UTC (permalink / raw)
  To: linux-rockchip, dri-devel
  Cc: heiko, hjc, andy.yan, maarten.lankhorst, mripard, tzimmermann,
	airlied, simona, linux-arm-kernel, linux-kernel

This is a small series that makes the deferred dphy no longer emit error
messages to the kernel log, which may even be repeated multiple times, to
avoid possible false impression of some issues.

This series also performs a few small, rather trivial code cleanups, to
make the code a bit easier to read and a bit more consistent.

Dragan Simic (2):
  drm/rockchip: dsi: Perform trivial code cleanups
  drm/rockchip: dsi: Don't log errors on deferred dphy

 drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)



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

* [PATCH 1/2] drm/rockchip: dsi: Perform trivial code cleanups
  2024-11-08 13:53 [PATCH 0/2] No longer produce error messages when dphy is deferred Dragan Simic
@ 2024-11-08 13:53 ` Dragan Simic
  2024-11-08 13:56   ` Heiko Stübner
  2024-11-08 13:53 ` [PATCH 2/2] drm/rockchip: dsi: Don't log errors on deferred dphy Dragan Simic
  1 sibling, 1 reply; 12+ messages in thread
From: Dragan Simic @ 2024-11-08 13:53 UTC (permalink / raw)
  To: linux-rockchip, dri-devel
  Cc: heiko, hjc, andy.yan, maarten.lankhorst, mripard, tzimmermann,
	airlied, simona, linux-arm-kernel, linux-kernel

Perform a few trivial code cleanups, to make one logged message a bit more
consistent with the other logged messages by capitalizing its first word, and
to avoid line wrapping by using the 100-column width better.

No intended functional changes are introduced by these code cleanups.

Signed-off-by: Dragan Simic <dsimic@manjaro.org>
---
 drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
index 58a44af0e9ad..f451e70efbdd 100644
--- a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
+++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
@@ -1379,7 +1379,7 @@ static int dw_mipi_dsi_rockchip_probe(struct platform_device *pdev)
 	}
 
 	if (!dsi->cdata) {
-		DRM_DEV_ERROR(dev, "no dsi-config for %s node\n", np->name);
+		DRM_DEV_ERROR(dev, "No dsi-config for %s node\n", np->name);
 		return -EINVAL;
 	}
 
@@ -1408,19 +1408,16 @@ static int dw_mipi_dsi_rockchip_probe(struct platform_device *pdev)
 			dsi->pllref_clk = NULL;
 		} else {
 			ret = PTR_ERR(dsi->pllref_clk);
-			DRM_DEV_ERROR(dev,
-				      "Unable to get pll reference clock: %d\n",
-				      ret);
+			DRM_DEV_ERROR(dev, "Unable to get pll reference clock: %d\n", ret);
 			return ret;
 		}
 	}
 
 	if (dsi->cdata->flags & DW_MIPI_NEEDS_PHY_CFG_CLK) {
 		dsi->phy_cfg_clk = devm_clk_get(dev, "phy_cfg");
 		if (IS_ERR(dsi->phy_cfg_clk)) {
 			ret = PTR_ERR(dsi->phy_cfg_clk);
-			DRM_DEV_ERROR(dev,
-				      "Unable to get phy_cfg_clk: %d\n", ret);
+			DRM_DEV_ERROR(dev, "Unable to get phy_cfg_clk: %d\n", ret);
 			return ret;
 		}
 	}
@@ -1465,8 +1462,7 @@ static int dw_mipi_dsi_rockchip_probe(struct platform_device *pdev)
 	if (IS_ERR(dsi->dmd)) {
 		ret = PTR_ERR(dsi->dmd);
 		if (ret != -EPROBE_DEFER)
-			DRM_DEV_ERROR(dev,
-				      "Failed to probe dw_mipi_dsi: %d\n", ret);
+			DRM_DEV_ERROR(dev, "Failed to probe dw_mipi_dsi: %d\n", ret);
 		return ret;
 	}
 


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

* [PATCH 2/2] drm/rockchip: dsi: Don't log errors on deferred dphy
  2024-11-08 13:53 [PATCH 0/2] No longer produce error messages when dphy is deferred Dragan Simic
  2024-11-08 13:53 ` [PATCH 1/2] drm/rockchip: dsi: Perform trivial code cleanups Dragan Simic
@ 2024-11-08 13:53 ` Dragan Simic
  2024-11-08 14:08   ` Sebastian Reichel
  1 sibling, 1 reply; 12+ messages in thread
From: Dragan Simic @ 2024-11-08 13:53 UTC (permalink / raw)
  To: linux-rockchip, dri-devel
  Cc: heiko, hjc, andy.yan, maarten.lankhorst, mripard, tzimmermann,
	airlied, simona, linux-arm-kernel, linux-kernel, Diederik de Haas

Deferred driver probing shouldn't result in errors or warnings being logged,
because their presence in the kernel log provides no value and may actually
cause false impression that some issues exist.  Thus, let's no longer produce
error messages when getting the dphy results in deferred probing.

This prevents misleading error messages like the following one, which was
observed on a Pine64 PineTab2, from appearing in the kernel log.  To make
matters worse, the following error message was observed appearing multiple
times in the kernel log of a single PineTab2 boot:

  dw-mipi-dsi-rockchip fe060000.dsi: [drm:dw_mipi_dsi_rockchip_probe \
  [rockchipdrm]] *ERROR* failed to get mipi dphy: -517

At the same time, make the adjusted logged message a bit more consistent with
the other logged messages by capitalizing its first word.

Reported-by: Diederik de Haas <didi.debian@cknow.org>
Signed-off-by: Dragan Simic <dsimic@manjaro.org>
---
 drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
index f451e70efbdd..ffa7f2bc640d 100644
--- a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
+++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
@@ -1387,7 +1387,8 @@ static int dw_mipi_dsi_rockchip_probe(struct platform_device *pdev)
 	dsi->phy = devm_phy_optional_get(dev, "dphy");
 	if (IS_ERR(dsi->phy)) {
 		ret = PTR_ERR(dsi->phy);
-		DRM_DEV_ERROR(dev, "failed to get mipi dphy: %d\n", ret);
+		if (ret != -EPROBE_DEFER)
+			DRM_DEV_ERROR(dev, "Failed to get mipi dphy: %d\n", ret);
 		return ret;
 	}
 


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

* Re: [PATCH 1/2] drm/rockchip: dsi: Perform trivial code cleanups
  2024-11-08 13:53 ` [PATCH 1/2] drm/rockchip: dsi: Perform trivial code cleanups Dragan Simic
@ 2024-11-08 13:56   ` Heiko Stübner
  2024-11-08 14:05     ` Dragan Simic
  0 siblings, 1 reply; 12+ messages in thread
From: Heiko Stübner @ 2024-11-08 13:56 UTC (permalink / raw)
  To: linux-rockchip, dri-devel, Dragan Simic
  Cc: hjc, andy.yan, maarten.lankhorst, mripard, tzimmermann, airlied,
	simona, linux-arm-kernel, linux-kernel

Hey Dragan,

Am Freitag, 8. November 2024, 14:53:57 CET schrieb Dragan Simic:
> Perform a few trivial code cleanups, to make one logged message a bit more
> consistent with the other logged messages by capitalizing its first word, and
> to avoid line wrapping by using the 100-column width better.
> 
> No intended functional changes are introduced by these code cleanups.
> 
> Signed-off-by: Dragan Simic <dsimic@manjaro.org>
> ---
>  drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
> index 58a44af0e9ad..f451e70efbdd 100644
> --- a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
> +++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
> @@ -1379,7 +1379,7 @@ static int dw_mipi_dsi_rockchip_probe(struct platform_device *pdev)
>  	}
>  
>  	if (!dsi->cdata) {
> -		DRM_DEV_ERROR(dev, "no dsi-config for %s node\n", np->name);
> +		DRM_DEV_ERROR(dev, "No dsi-config for %s node\n", np->name);

this is all probe-related, why not convert to dev_err_probe?

As the doc states [0], DRM_DEV_ERROR is deprecated in favor of dev_err.
So dev_err_probe would be the correct way to go?



[0] https://elixir.bootlin.com/linux/v6.11.6/source/include/drm/drm_print.h#L431

>  		return -EINVAL;
>  	}
>  
> @@ -1408,19 +1408,16 @@ static int dw_mipi_dsi_rockchip_probe(struct platform_device *pdev)
>  			dsi->pllref_clk = NULL;
>  		} else {
>  			ret = PTR_ERR(dsi->pllref_clk);
> -			DRM_DEV_ERROR(dev,
> -				      "Unable to get pll reference clock: %d\n",
> -				      ret);
> +			DRM_DEV_ERROR(dev, "Unable to get pll reference clock: %d\n", ret);
>  			return ret;
>  		}
>  	}
>  
>  	if (dsi->cdata->flags & DW_MIPI_NEEDS_PHY_CFG_CLK) {
>  		dsi->phy_cfg_clk = devm_clk_get(dev, "phy_cfg");
>  		if (IS_ERR(dsi->phy_cfg_clk)) {
>  			ret = PTR_ERR(dsi->phy_cfg_clk);
> -			DRM_DEV_ERROR(dev,
> -				      "Unable to get phy_cfg_clk: %d\n", ret);
> +			DRM_DEV_ERROR(dev, "Unable to get phy_cfg_clk: %d\n", ret);
>  			return ret;
>  		}
>  	}
> @@ -1465,8 +1462,7 @@ static int dw_mipi_dsi_rockchip_probe(struct platform_device *pdev)
>  	if (IS_ERR(dsi->dmd)) {
>  		ret = PTR_ERR(dsi->dmd);
>  		if (ret != -EPROBE_DEFER)
> -			DRM_DEV_ERROR(dev,
> -				      "Failed to probe dw_mipi_dsi: %d\n", ret);
> +			DRM_DEV_ERROR(dev, "Failed to probe dw_mipi_dsi: %d\n", ret);
>  		return ret;
>  	}
>  
> 






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

* Re: [PATCH 1/2] drm/rockchip: dsi: Perform trivial code cleanups
  2024-11-08 13:56   ` Heiko Stübner
@ 2024-11-08 14:05     ` Dragan Simic
  2024-11-08 14:09       ` Heiko Stübner
  0 siblings, 1 reply; 12+ messages in thread
From: Dragan Simic @ 2024-11-08 14:05 UTC (permalink / raw)
  To: Heiko Stübner
  Cc: linux-rockchip, dri-devel, hjc, andy.yan, maarten.lankhorst,
	mripard, tzimmermann, airlied, simona, linux-arm-kernel,
	linux-kernel

Hello Heiko,

On 2024-11-08 14:56, Heiko Stübner wrote:
> Am Freitag, 8. November 2024, 14:53:57 CET schrieb Dragan Simic:
>> Perform a few trivial code cleanups, to make one logged message a bit 
>> more
>> consistent with the other logged messages by capitalizing its first 
>> word, and
>> to avoid line wrapping by using the 100-column width better.
>> 
>> No intended functional changes are introduced by these code cleanups.
>> 
>> Signed-off-by: Dragan Simic <dsimic@manjaro.org>
>> ---
>>  drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 12 ++++--------
>>  1 file changed, 4 insertions(+), 8 deletions(-)
>> 
>> diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c 
>> b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
>> index 58a44af0e9ad..f451e70efbdd 100644
>> --- a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
>> +++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
>> @@ -1379,7 +1379,7 @@ static int dw_mipi_dsi_rockchip_probe(struct 
>> platform_device *pdev)
>>  	}
>> 
>>  	if (!dsi->cdata) {
>> -		DRM_DEV_ERROR(dev, "no dsi-config for %s node\n", np->name);
>> +		DRM_DEV_ERROR(dev, "No dsi-config for %s node\n", np->name);
> 
> this is all probe-related, why not convert to dev_err_probe?
> 
> As the doc states [0], DRM_DEV_ERROR is deprecated in favor of dev_err.
> So dev_err_probe would be the correct way to go?

Thanks for your quick response!  Seeing that DRM_DEV_ERROR() is now
deprecated (which I originally missed, in all honesty) makes me very
happy. :)  I've never been a huge fan of the format of the messages
that DRM_DEV_ERROR() produces.

However, perhaps it would be better to keep these patches as-is, as
some kind of an intermediate, limited-scope cleanup + bugfix combo,
and leave the complete DRM_DEV_ERROR() --> dev_err()/dev_err_probe()
conversion to separate patches.  I think it would be better to avoid
a partial conversion, and I'll be more than happy to put the complete
conversion on my TODO list. :)

> [0] 
> https://elixir.bootlin.com/linux/v6.11.6/source/include/drm/drm_print.h#L431
> 
>>  		return -EINVAL;
>>  	}
>> 
>> @@ -1408,19 +1408,16 @@ static int dw_mipi_dsi_rockchip_probe(struct 
>> platform_device *pdev)
>>  			dsi->pllref_clk = NULL;
>>  		} else {
>>  			ret = PTR_ERR(dsi->pllref_clk);
>> -			DRM_DEV_ERROR(dev,
>> -				      "Unable to get pll reference clock: %d\n",
>> -				      ret);
>> +			DRM_DEV_ERROR(dev, "Unable to get pll reference clock: %d\n", 
>> ret);
>>  			return ret;
>>  		}
>>  	}
>> 
>>  	if (dsi->cdata->flags & DW_MIPI_NEEDS_PHY_CFG_CLK) {
>>  		dsi->phy_cfg_clk = devm_clk_get(dev, "phy_cfg");
>>  		if (IS_ERR(dsi->phy_cfg_clk)) {
>>  			ret = PTR_ERR(dsi->phy_cfg_clk);
>> -			DRM_DEV_ERROR(dev,
>> -				      "Unable to get phy_cfg_clk: %d\n", ret);
>> +			DRM_DEV_ERROR(dev, "Unable to get phy_cfg_clk: %d\n", ret);
>>  			return ret;
>>  		}
>>  	}
>> @@ -1465,8 +1462,7 @@ static int dw_mipi_dsi_rockchip_probe(struct 
>> platform_device *pdev)
>>  	if (IS_ERR(dsi->dmd)) {
>>  		ret = PTR_ERR(dsi->dmd);
>>  		if (ret != -EPROBE_DEFER)
>> -			DRM_DEV_ERROR(dev,
>> -				      "Failed to probe dw_mipi_dsi: %d\n", ret);
>> +			DRM_DEV_ERROR(dev, "Failed to probe dw_mipi_dsi: %d\n", ret);
>>  		return ret;
>>  	}
>> 
>> 


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

* Re: [PATCH 2/2] drm/rockchip: dsi: Don't log errors on deferred dphy
  2024-11-08 13:53 ` [PATCH 2/2] drm/rockchip: dsi: Don't log errors on deferred dphy Dragan Simic
@ 2024-11-08 14:08   ` Sebastian Reichel
  2024-11-08 14:18     ` Dragan Simic
  0 siblings, 1 reply; 12+ messages in thread
From: Sebastian Reichel @ 2024-11-08 14:08 UTC (permalink / raw)
  To: Dragan Simic
  Cc: linux-rockchip, dri-devel, heiko, hjc, andy.yan,
	maarten.lankhorst, mripard, tzimmermann, airlied, simona,
	linux-arm-kernel, linux-kernel, Diederik de Haas

[-- Attachment #1: Type: text/plain, Size: 2330 bytes --]

Hi,

On Fri, Nov 08, 2024 at 02:53:58PM +0100, Dragan Simic wrote:
> Deferred driver probing shouldn't result in errors or warnings being logged,
> because their presence in the kernel log provides no value and may actually
> cause false impression that some issues exist.  Thus, let's no longer produce
> error messages when getting the dphy results in deferred probing.
> 
> This prevents misleading error messages like the following one, which was
> observed on a Pine64 PineTab2, from appearing in the kernel log.  To make
> matters worse, the following error message was observed appearing multiple
> times in the kernel log of a single PineTab2 boot:
> 
>   dw-mipi-dsi-rockchip fe060000.dsi: [drm:dw_mipi_dsi_rockchip_probe \
>   [rockchipdrm]] *ERROR* failed to get mipi dphy: -517
> 
> At the same time, make the adjusted logged message a bit more consistent with
> the other logged messages by capitalizing its first word.
> 
> Reported-by: Diederik de Haas <didi.debian@cknow.org>
> Signed-off-by: Dragan Simic <dsimic@manjaro.org>
> ---

From include/drm/drm_print.h:

 * DRM_DEV_ERROR() - Error output.
 *
 * NOTE: this is deprecated in favor of drm_err() or dev_err().

The recommended way to do this nowadays looks like this:

return dev_err_probe(dev, PTR_ERR(dsi->phy), "Failed to get mipi dphy");

That will not print anything for -EPROBE_DEFER, but capture
the reason and make it available through
/sys/kernel/debug/devices_deferred if the device never probes.

Greetings,

-- Sebastian

>  drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
> index f451e70efbdd..ffa7f2bc640d 100644
> --- a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
> +++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
> @@ -1387,7 +1387,8 @@ static int dw_mipi_dsi_rockchip_probe(struct platform_device *pdev)
>  	dsi->phy = devm_phy_optional_get(dev, "dphy");
>  	if (IS_ERR(dsi->phy)) {
>  		ret = PTR_ERR(dsi->phy);
> -		DRM_DEV_ERROR(dev, "failed to get mipi dphy: %d\n", ret);
> +		if (ret != -EPROBE_DEFER)
> +			DRM_DEV_ERROR(dev, "Failed to get mipi dphy: %d\n", ret);
>  		return ret;
>  	}
>  

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH 1/2] drm/rockchip: dsi: Perform trivial code cleanups
  2024-11-08 14:05     ` Dragan Simic
@ 2024-11-08 14:09       ` Heiko Stübner
  2024-11-08 14:13         ` Dragan Simic
  0 siblings, 1 reply; 12+ messages in thread
From: Heiko Stübner @ 2024-11-08 14:09 UTC (permalink / raw)
  To: Dragan Simic
  Cc: linux-rockchip, dri-devel, hjc, andy.yan, maarten.lankhorst,
	mripard, tzimmermann, airlied, simona, linux-arm-kernel,
	linux-kernel

Am Freitag, 8. November 2024, 15:05:02 CET schrieb Dragan Simic:
> Hello Heiko,
> 
> On 2024-11-08 14:56, Heiko Stübner wrote:
> > Am Freitag, 8. November 2024, 14:53:57 CET schrieb Dragan Simic:
> >> Perform a few trivial code cleanups, to make one logged message a bit 
> >> more
> >> consistent with the other logged messages by capitalizing its first 
> >> word, and
> >> to avoid line wrapping by using the 100-column width better.
> >> 
> >> No intended functional changes are introduced by these code cleanups.
> >> 
> >> Signed-off-by: Dragan Simic <dsimic@manjaro.org>
> >> ---
> >>  drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 12 ++++--------
> >>  1 file changed, 4 insertions(+), 8 deletions(-)
> >> 
> >> diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c 
> >> b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
> >> index 58a44af0e9ad..f451e70efbdd 100644
> >> --- a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
> >> +++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
> >> @@ -1379,7 +1379,7 @@ static int dw_mipi_dsi_rockchip_probe(struct 
> >> platform_device *pdev)
> >>  	}
> >> 
> >>  	if (!dsi->cdata) {
> >> -		DRM_DEV_ERROR(dev, "no dsi-config for %s node\n", np->name);
> >> +		DRM_DEV_ERROR(dev, "No dsi-config for %s node\n", np->name);
> > 
> > this is all probe-related, why not convert to dev_err_probe?
> > 
> > As the doc states [0], DRM_DEV_ERROR is deprecated in favor of dev_err.
> > So dev_err_probe would be the correct way to go?
> 
> Thanks for your quick response!  Seeing that DRM_DEV_ERROR() is now
> deprecated (which I originally missed, in all honesty) makes me very
> happy. :)  I've never been a huge fan of the format of the messages
> that DRM_DEV_ERROR() produces.
> 
> However, perhaps it would be better to keep these patches as-is, as
> some kind of an intermediate, limited-scope cleanup + bugfix combo,
> and leave the complete DRM_DEV_ERROR() --> dev_err()/dev_err_probe()
> conversion to separate patches.  I think it would be better to avoid
> a partial conversion, and I'll be more than happy to put the complete
> conversion on my TODO list. :)

But your patch-2 really just open-codes, what dev_err_probe is meant
to fix. So with going this way, you're sort of making things worse first,
until that second step happens.

Similarly, reflowing lines for things that get removed in a week do not
serve a purpose - those line-breaks have been that way for years
already.




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

* Re: [PATCH 1/2] drm/rockchip: dsi: Perform trivial code cleanups
  2024-11-08 14:09       ` Heiko Stübner
@ 2024-11-08 14:13         ` Dragan Simic
  2024-11-08 14:22           ` Heiko Stübner
  0 siblings, 1 reply; 12+ messages in thread
From: Dragan Simic @ 2024-11-08 14:13 UTC (permalink / raw)
  To: Heiko Stübner
  Cc: linux-rockchip, dri-devel, hjc, andy.yan, maarten.lankhorst,
	mripard, tzimmermann, airlied, simona, linux-arm-kernel,
	linux-kernel

On 2024-11-08 15:09, Heiko Stübner wrote:
> Am Freitag, 8. November 2024, 15:05:02 CET schrieb Dragan Simic:
>> On 2024-11-08 14:56, Heiko Stübner wrote:
>> > Am Freitag, 8. November 2024, 14:53:57 CET schrieb Dragan Simic:
>> >> Perform a few trivial code cleanups, to make one logged message a bit
>> >> more
>> >> consistent with the other logged messages by capitalizing its first
>> >> word, and
>> >> to avoid line wrapping by using the 100-column width better.
>> >>
>> >> No intended functional changes are introduced by these code cleanups.
>> >>
>> >> Signed-off-by: Dragan Simic <dsimic@manjaro.org>
>> >> ---
>> >>  drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 12 ++++--------
>> >>  1 file changed, 4 insertions(+), 8 deletions(-)
>> >>
>> >> diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
>> >> b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
>> >> index 58a44af0e9ad..f451e70efbdd 100644
>> >> --- a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
>> >> +++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
>> >> @@ -1379,7 +1379,7 @@ static int dw_mipi_dsi_rockchip_probe(struct
>> >> platform_device *pdev)
>> >>  	}
>> >>
>> >>  	if (!dsi->cdata) {
>> >> -		DRM_DEV_ERROR(dev, "no dsi-config for %s node\n", np->name);
>> >> +		DRM_DEV_ERROR(dev, "No dsi-config for %s node\n", np->name);
>> >
>> > this is all probe-related, why not convert to dev_err_probe?
>> >
>> > As the doc states [0], DRM_DEV_ERROR is deprecated in favor of dev_err.
>> > So dev_err_probe would be the correct way to go?
>> 
>> Thanks for your quick response!  Seeing that DRM_DEV_ERROR() is now
>> deprecated (which I originally missed, in all honesty) makes me very
>> happy. :)  I've never been a huge fan of the format of the messages
>> that DRM_DEV_ERROR() produces.
>> 
>> However, perhaps it would be better to keep these patches as-is, as
>> some kind of an intermediate, limited-scope cleanup + bugfix combo,
>> and leave the complete DRM_DEV_ERROR() --> dev_err()/dev_err_probe()
>> conversion to separate patches.  I think it would be better to avoid
>> a partial conversion, and I'll be more than happy to put the complete
>> conversion on my TODO list. :)
> 
> But your patch-2 really just open-codes, what dev_err_probe is meant
> to fix. So with going this way, you're sort of making things worse 
> first,
> until that second step happens.
> 
> Similarly, reflowing lines for things that get removed in a week do not
> serve a purpose - those line-breaks have been that way for years
> already.

Hmm, it makes sense when described that way.  I'll see to perform the
complete conversion in the next few days.


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

* Re: [PATCH 2/2] drm/rockchip: dsi: Don't log errors on deferred dphy
  2024-11-08 14:08   ` Sebastian Reichel
@ 2024-11-08 14:18     ` Dragan Simic
  0 siblings, 0 replies; 12+ messages in thread
From: Dragan Simic @ 2024-11-08 14:18 UTC (permalink / raw)
  To: Sebastian Reichel
  Cc: linux-rockchip, dri-devel, heiko, hjc, andy.yan,
	maarten.lankhorst, mripard, tzimmermann, airlied, simona,
	linux-arm-kernel, linux-kernel, Diederik de Haas

Hello Sebastian,

On 2024-11-08 15:08, Sebastian Reichel wrote:
> On Fri, Nov 08, 2024 at 02:53:58PM +0100, Dragan Simic wrote:
>> Deferred driver probing shouldn't result in errors or warnings being 
>> logged,
>> because their presence in the kernel log provides no value and may 
>> actually
>> cause false impression that some issues exist.  Thus, let's no longer 
>> produce
>> error messages when getting the dphy results in deferred probing.
>> 
>> This prevents misleading error messages like the following one, which 
>> was
>> observed on a Pine64 PineTab2, from appearing in the kernel log.  To 
>> make
>> matters worse, the following error message was observed appearing 
>> multiple
>> times in the kernel log of a single PineTab2 boot:
>> 
>>   dw-mipi-dsi-rockchip fe060000.dsi: [drm:dw_mipi_dsi_rockchip_probe \
>>   [rockchipdrm]] *ERROR* failed to get mipi dphy: -517
>> 
>> At the same time, make the adjusted logged message a bit more 
>> consistent with
>> the other logged messages by capitalizing its first word.
>> 
>> Reported-by: Diederik de Haas <didi.debian@cknow.org>
>> Signed-off-by: Dragan Simic <dsimic@manjaro.org>
>> ---
> 
> From include/drm/drm_print.h:
> 
>  * DRM_DEV_ERROR() - Error output.
>  *
>  * NOTE: this is deprecated in favor of drm_err() or dev_err().
> 
> The recommended way to do this nowadays looks like this:
> 
> return dev_err_probe(dev, PTR_ERR(dsi->phy), "Failed to get mipi 
> dphy");
> 
> That will not print anything for -EPROBE_DEFER, but capture
> the reason and make it available through
> /sys/kernel/debug/devices_deferred if the device never probes.

Thanks for your quick response!  As already discussed with Heiko,
I'll move forward with implementing a complete file-level conversion.
At first, I thought that a partial bugfix would be beneficial, [1]
but now I agree that performing a complete file-level coversion is
the way to go. [2]

I've got to admit, I love seeing that DRM_DEV_ERROR() is deprecated,
because I've never been a big fan of the format of the messages
it produces.

[1] 
https://lore.kernel.org/dri-devel/3734f6a5424e3537d717c587a058fc85@manjaro.org/
[2] 
https://lore.kernel.org/dri-devel/047164cc6e88dcbc7701cb0e28d564db@manjaro.org/

>>  drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>> 
>> diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c 
>> b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
>> index f451e70efbdd..ffa7f2bc640d 100644
>> --- a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
>> +++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
>> @@ -1387,7 +1387,8 @@ static int dw_mipi_dsi_rockchip_probe(struct 
>> platform_device *pdev)
>>  	dsi->phy = devm_phy_optional_get(dev, "dphy");
>>  	if (IS_ERR(dsi->phy)) {
>>  		ret = PTR_ERR(dsi->phy);
>> -		DRM_DEV_ERROR(dev, "failed to get mipi dphy: %d\n", ret);
>> +		if (ret != -EPROBE_DEFER)
>> +			DRM_DEV_ERROR(dev, "Failed to get mipi dphy: %d\n", ret);
>>  		return ret;
>>  	}
>> 


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

* Re: [PATCH 1/2] drm/rockchip: dsi: Perform trivial code cleanups
  2024-11-08 14:13         ` Dragan Simic
@ 2024-11-08 14:22           ` Heiko Stübner
  2024-11-08 14:30             ` Dragan Simic
  0 siblings, 1 reply; 12+ messages in thread
From: Heiko Stübner @ 2024-11-08 14:22 UTC (permalink / raw)
  To: Dragan Simic
  Cc: linux-rockchip, dri-devel, hjc, andy.yan, maarten.lankhorst,
	mripard, tzimmermann, airlied, simona, linux-arm-kernel,
	linux-kernel

Am Freitag, 8. November 2024, 15:13:33 CET schrieb Dragan Simic:
> On 2024-11-08 15:09, Heiko Stübner wrote:
> > Am Freitag, 8. November 2024, 15:05:02 CET schrieb Dragan Simic:
> >> On 2024-11-08 14:56, Heiko Stübner wrote:
> >> > Am Freitag, 8. November 2024, 14:53:57 CET schrieb Dragan Simic:
> >> >> Perform a few trivial code cleanups, to make one logged message a bit
> >> >> more
> >> >> consistent with the other logged messages by capitalizing its first
> >> >> word, and
> >> >> to avoid line wrapping by using the 100-column width better.
> >> >>
> >> >> No intended functional changes are introduced by these code cleanups.
> >> >>
> >> >> Signed-off-by: Dragan Simic <dsimic@manjaro.org>
> >> >> ---
> >> >>  drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 12 ++++--------
> >> >>  1 file changed, 4 insertions(+), 8 deletions(-)
> >> >>
> >> >> diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
> >> >> b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
> >> >> index 58a44af0e9ad..f451e70efbdd 100644
> >> >> --- a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
> >> >> +++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
> >> >> @@ -1379,7 +1379,7 @@ static int dw_mipi_dsi_rockchip_probe(struct
> >> >> platform_device *pdev)
> >> >>  	}
> >> >>
> >> >>  	if (!dsi->cdata) {
> >> >> -		DRM_DEV_ERROR(dev, "no dsi-config for %s node\n", np->name);
> >> >> +		DRM_DEV_ERROR(dev, "No dsi-config for %s node\n", np->name);
> >> >
> >> > this is all probe-related, why not convert to dev_err_probe?
> >> >
> >> > As the doc states [0], DRM_DEV_ERROR is deprecated in favor of dev_err.
> >> > So dev_err_probe would be the correct way to go?
> >> 
> >> Thanks for your quick response!  Seeing that DRM_DEV_ERROR() is now
> >> deprecated (which I originally missed, in all honesty) makes me very
> >> happy. :)  I've never been a huge fan of the format of the messages
> >> that DRM_DEV_ERROR() produces.
> >> 
> >> However, perhaps it would be better to keep these patches as-is, as
> >> some kind of an intermediate, limited-scope cleanup + bugfix combo,
> >> and leave the complete DRM_DEV_ERROR() --> dev_err()/dev_err_probe()
> >> conversion to separate patches.  I think it would be better to avoid
> >> a partial conversion, and I'll be more than happy to put the complete
> >> conversion on my TODO list. :)
> > 
> > But your patch-2 really just open-codes, what dev_err_probe is meant
> > to fix. So with going this way, you're sort of making things worse 
> > first,
> > until that second step happens.
> > 
> > Similarly, reflowing lines for things that get removed in a week do not
> > serve a purpose - those line-breaks have been that way for years
> > already.
> 
> Hmm, it makes sense when described that way.  I'll see to perform the
> complete conversion in the next few days.

just a note, as written on IRC earlier, I am sitting on a dev_err_probe
conversion for dw-dsi-rockchip.

I was waiting to see if more cleanups turned up, so didn't sent that yet.

Don't want to steal your spotlight though, so not sure if I should send
that or wait for your conversion ;-)


Heiko





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

* Re: [PATCH 1/2] drm/rockchip: dsi: Perform trivial code cleanups
  2024-11-08 14:22           ` Heiko Stübner
@ 2024-11-08 14:30             ` Dragan Simic
  2024-11-08 14:36               ` Dragan Simic
  0 siblings, 1 reply; 12+ messages in thread
From: Dragan Simic @ 2024-11-08 14:30 UTC (permalink / raw)
  To: Heiko Stübner
  Cc: linux-rockchip, dri-devel, hjc, andy.yan, maarten.lankhorst,
	mripard, tzimmermann, airlied, simona, linux-arm-kernel,
	linux-kernel

On 2024-11-08 15:22, Heiko Stübner wrote:
> Am Freitag, 8. November 2024, 15:13:33 CET schrieb Dragan Simic:
>> On 2024-11-08 15:09, Heiko Stübner wrote:
>> > Am Freitag, 8. November 2024, 15:05:02 CET schrieb Dragan Simic:
>> >> On 2024-11-08 14:56, Heiko Stübner wrote:
>> >> > Am Freitag, 8. November 2024, 14:53:57 CET schrieb Dragan Simic:
>> >> >> Perform a few trivial code cleanups, to make one logged message a bit
>> >> >> more
>> >> >> consistent with the other logged messages by capitalizing its first
>> >> >> word, and
>> >> >> to avoid line wrapping by using the 100-column width better.
>> >> >>
>> >> >> No intended functional changes are introduced by these code cleanups.
>> >> >>
>> >> >> Signed-off-by: Dragan Simic <dsimic@manjaro.org>
>> >> >> ---
>> >> >>  drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 12 ++++--------
>> >> >>  1 file changed, 4 insertions(+), 8 deletions(-)
>> >> >>
>> >> >> diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
>> >> >> b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
>> >> >> index 58a44af0e9ad..f451e70efbdd 100644
>> >> >> --- a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
>> >> >> +++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
>> >> >> @@ -1379,7 +1379,7 @@ static int dw_mipi_dsi_rockchip_probe(struct
>> >> >> platform_device *pdev)
>> >> >>  	}
>> >> >>
>> >> >>  	if (!dsi->cdata) {
>> >> >> -		DRM_DEV_ERROR(dev, "no dsi-config for %s node\n", np->name);
>> >> >> +		DRM_DEV_ERROR(dev, "No dsi-config for %s node\n", np->name);
>> >> >
>> >> > this is all probe-related, why not convert to dev_err_probe?
>> >> >
>> >> > As the doc states [0], DRM_DEV_ERROR is deprecated in favor of dev_err.
>> >> > So dev_err_probe would be the correct way to go?
>> >>
>> >> Thanks for your quick response!  Seeing that DRM_DEV_ERROR() is now
>> >> deprecated (which I originally missed, in all honesty) makes me very
>> >> happy. :)  I've never been a huge fan of the format of the messages
>> >> that DRM_DEV_ERROR() produces.
>> >>
>> >> However, perhaps it would be better to keep these patches as-is, as
>> >> some kind of an intermediate, limited-scope cleanup + bugfix combo,
>> >> and leave the complete DRM_DEV_ERROR() --> dev_err()/dev_err_probe()
>> >> conversion to separate patches.  I think it would be better to avoid
>> >> a partial conversion, and I'll be more than happy to put the complete
>> >> conversion on my TODO list. :)
>> >
>> > But your patch-2 really just open-codes, what dev_err_probe is meant
>> > to fix. So with going this way, you're sort of making things worse
>> > first,
>> > until that second step happens.
>> >
>> > Similarly, reflowing lines for things that get removed in a week do not
>> > serve a purpose - those line-breaks have been that way for years
>> > already.
>> 
>> Hmm, it makes sense when described that way.  I'll see to perform the
>> complete conversion in the next few days.
> 
> just a note, as written on IRC earlier, I am sitting on a dev_err_probe
> conversion for dw-dsi-rockchip.
> 
> I was waiting to see if more cleanups turned up, so didn't sent that 
> yet.
> 
> Don't want to steal your spotlight though, so not sure if I should send
> that or wait for your conversion ;-)

I see no reasons why should we duplicate some effort. :)  If you're
already nearing the file-level conversion to its completion, please
feel free to send it, and we can drop this series. :)


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

* Re: [PATCH 1/2] drm/rockchip: dsi: Perform trivial code cleanups
  2024-11-08 14:30             ` Dragan Simic
@ 2024-11-08 14:36               ` Dragan Simic
  0 siblings, 0 replies; 12+ messages in thread
From: Dragan Simic @ 2024-11-08 14:36 UTC (permalink / raw)
  To: Heiko Stübner
  Cc: linux-rockchip, dri-devel, hjc, andy.yan, maarten.lankhorst,
	mripard, tzimmermann, airlied, simona, linux-arm-kernel,
	linux-kernel

On 2024-11-08 15:30, Dragan Simic wrote:
> On 2024-11-08 15:22, Heiko Stübner wrote:
>> Am Freitag, 8. November 2024, 15:13:33 CET schrieb Dragan Simic:
>>> On 2024-11-08 15:09, Heiko Stübner wrote:
>>> > Am Freitag, 8. November 2024, 15:05:02 CET schrieb Dragan Simic:
>>> >> On 2024-11-08 14:56, Heiko Stübner wrote:
>>> >> > Am Freitag, 8. November 2024, 14:53:57 CET schrieb Dragan Simic:
>>> >> >> Perform a few trivial code cleanups, to make one logged message a bit
>>> >> >> more
>>> >> >> consistent with the other logged messages by capitalizing its first
>>> >> >> word, and
>>> >> >> to avoid line wrapping by using the 100-column width better.
>>> >> >>
>>> >> >> No intended functional changes are introduced by these code cleanups.
>>> >> >>
>>> >> >> Signed-off-by: Dragan Simic <dsimic@manjaro.org>
>>> >> >> ---
>>> >> >>  drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 12 ++++--------
>>> >> >>  1 file changed, 4 insertions(+), 8 deletions(-)
>>> >> >>
>>> >> >> diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
>>> >> >> b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
>>> >> >> index 58a44af0e9ad..f451e70efbdd 100644
>>> >> >> --- a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
>>> >> >> +++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
>>> >> >> @@ -1379,7 +1379,7 @@ static int dw_mipi_dsi_rockchip_probe(struct
>>> >> >> platform_device *pdev)
>>> >> >>  	}
>>> >> >>
>>> >> >>  	if (!dsi->cdata) {
>>> >> >> -		DRM_DEV_ERROR(dev, "no dsi-config for %s node\n", np->name);
>>> >> >> +		DRM_DEV_ERROR(dev, "No dsi-config for %s node\n", np->name);
>>> >> >
>>> >> > this is all probe-related, why not convert to dev_err_probe?
>>> >> >
>>> >> > As the doc states [0], DRM_DEV_ERROR is deprecated in favor of dev_err.
>>> >> > So dev_err_probe would be the correct way to go?
>>> >>
>>> >> Thanks for your quick response!  Seeing that DRM_DEV_ERROR() is now
>>> >> deprecated (which I originally missed, in all honesty) makes me very
>>> >> happy. :)  I've never been a huge fan of the format of the messages
>>> >> that DRM_DEV_ERROR() produces.
>>> >>
>>> >> However, perhaps it would be better to keep these patches as-is, as
>>> >> some kind of an intermediate, limited-scope cleanup + bugfix combo,
>>> >> and leave the complete DRM_DEV_ERROR() --> dev_err()/dev_err_probe()
>>> >> conversion to separate patches.  I think it would be better to avoid
>>> >> a partial conversion, and I'll be more than happy to put the complete
>>> >> conversion on my TODO list. :)
>>> >
>>> > But your patch-2 really just open-codes, what dev_err_probe is meant
>>> > to fix. So with going this way, you're sort of making things worse
>>> > first,
>>> > until that second step happens.
>>> >
>>> > Similarly, reflowing lines for things that get removed in a week do not
>>> > serve a purpose - those line-breaks have been that way for years
>>> > already.
>>> 
>>> Hmm, it makes sense when described that way.  I'll see to perform the
>>> complete conversion in the next few days.
>> 
>> just a note, as written on IRC earlier, I am sitting on a 
>> dev_err_probe
>> conversion for dw-dsi-rockchip.
>> 
>> I was waiting to see if more cleanups turned up, so didn't sent that 
>> yet.
>> 
>> Don't want to steal your spotlight though, so not sure if I should 
>> send
>> that or wait for your conversion ;-)
> 
> I see no reasons why should we duplicate some effort. :)  If you're
> already nearing the file-level conversion to its completion, please
> feel free to send it, and we can drop this series. :)

Sorry, I wasn't clear enough.  When I wrote "we can drop this series",
I actually referred to what this series might have turned into, i.e.
into my file-level conversion. :)


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

end of thread, other threads:[~2024-11-08 15:13 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-08 13:53 [PATCH 0/2] No longer produce error messages when dphy is deferred Dragan Simic
2024-11-08 13:53 ` [PATCH 1/2] drm/rockchip: dsi: Perform trivial code cleanups Dragan Simic
2024-11-08 13:56   ` Heiko Stübner
2024-11-08 14:05     ` Dragan Simic
2024-11-08 14:09       ` Heiko Stübner
2024-11-08 14:13         ` Dragan Simic
2024-11-08 14:22           ` Heiko Stübner
2024-11-08 14:30             ` Dragan Simic
2024-11-08 14:36               ` Dragan Simic
2024-11-08 13:53 ` [PATCH 2/2] drm/rockchip: dsi: Don't log errors on deferred dphy Dragan Simic
2024-11-08 14:08   ` Sebastian Reichel
2024-11-08 14:18     ` Dragan Simic

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).