Re: [PATCH] drm/msm/dpu: make error messages at dpu_core_irq_register_callback() more sensible

2024-03-30 Thread Marijn Suijten
On 2024-03-30 11:31:37, Marijn Suijten wrote:
> On 2024-03-30 05:53:22, Dmitry Baryshkov wrote:
> > There is little point in using %ps to print a value known to be NULL. On
> > the other hand it makes sense to print the callback symbol in the
> > 'invalid IRQ' message. Correct those two error messages to make more
> > sense.
> > 
> > Fixes: 6893199183f8 ("drm/msm/dpu: stop using raw IRQ indices in the kernel 
> > output")
> > Signed-off-by: Dmitry Baryshkov 
> 
> Agreed, this is a lot more clear:
> 
> Reviewed-by: Marijn Suijten 

Note that, as seen in [1], there are still a few codepaths that only print
"invalid IRQ" without any additional context (if we could even add it - __func__
might be a good start) and inconsistently use DPU_ERROR vs pr_err too :/

Any possibility to address that?

- Marijn

[1]: 
https://lore.kernel.org/linux-arm-msm/mxwrvnqth5f2vd4m55ryzqgyj7brykiqynzldelanxkuj2zny3@4pqi6p57c2q2/

> > ---
> >  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c | 8 
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c 
> > b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c
> > index 946dd0135dff..6a0a74832fb6 100644
> > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c
> > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c
> > @@ -525,14 +525,14 @@ int dpu_core_irq_register_callback(struct dpu_kms 
> > *dpu_kms,
> > int ret;
> >  
> > if (!irq_cb) {
> > -   DPU_ERROR("invalid IRQ=[%d, %d] irq_cb:%ps\n",
> > - DPU_IRQ_REG(irq_idx), DPU_IRQ_BIT(irq_idx), irq_cb);
> > +   DPU_ERROR("IRQ=[%d, %d] NULL callback\n",
> > + DPU_IRQ_REG(irq_idx), DPU_IRQ_BIT(irq_idx));
> > return -EINVAL;
> > }
> >  
> > if (!dpu_core_irq_is_valid(irq_idx)) {
> > -   DPU_ERROR("invalid IRQ=[%d, %d]\n",
> > - DPU_IRQ_REG(irq_idx), DPU_IRQ_BIT(irq_idx));
> > +   DPU_ERROR("invalid IRQ=[%d, %d] irq_cb:%ps\n",
> > + DPU_IRQ_REG(irq_idx), DPU_IRQ_BIT(irq_idx), irq_cb);
> > return -EINVAL;
> > }
> >  
> > 
> > ---
> > base-commit: 13ee4a7161b6fd938aef6688ff43b163f6d83e37
> > change-id: 20240330-dpu-irq-messages-5cf13fd7568c
> > 
> > Best regards,
> > -- 
> > Dmitry Baryshkov 
> > 


Re: [PATCH] drm/msm/dpu: fix vblank IRQ handling for command panels

2024-03-30 Thread Abhinav Kumar




On 3/30/2024 9:49 AM, Marijn Suijten wrote:

On 2024-03-30 05:52:29, Dmitry Baryshkov wrote:

In case of CMD DSI panels, the vblank IRQ can be used outside of
irq_enable/irq_disable pair. This results in the following kind of


Can you clarify when exactly that is?  Is it via ops.control_vblank_irq in
dpu_encoder_toggle_vblank_for_crtc()?



Yes, please explain the sequence of events a litte bit more.


messages. Move assignment of IRQ indices to atomic_enable /
atomic_disable callbacks.

[dpu error]invalid IRQ=[134217727, 31]
[drm:dpu_encoder_phys_cmd_control_vblank_irq] *ERROR* vblank irq err id:31 pp:0 
ret:-22, enable true/0
[drm:dpu_encoder_phys_cmd_control_vblank_irq] *ERROR* vblank irq err id:31 pp:0 
ret:-22, enable false/0


You are right that such messages are common, both at random but also seemingly
around toggling the `ACTIVE` property on the CRTC:

[   45.878300] panel-samsung-souxp ae94000.dsi.0: 
samsung_souxp00_disable
[   45.909941] panel-samsung-souxp ae94000.dsi.0: 
samsung_souxp00_unprepare
[   46.093234] [drm:dpu_encoder_helper_wait_for_irq] *ERROR* encoder is 
disabled id=31, callback=dpu_encoder_phys_cmd_ctl_start_irq, IRQ=[134217727, 31]
[   46.130421] panel-samsung-souxp ae94000.dsi.0: 
samsung_souxp00_prepare
[   46.340457] panel-samsung-souxp ae94000.dsi.0: samsung_souxp00_enable
[   65.520323] [dpu error]invalid IRQ=[134217727, 31] 
irq_cb:dpu_encoder_phys_cmd_te_rd_ptr_irq
[   65.520463] [drm:dpu_encoder_phys_cmd_control_vblank_irq] *ERROR* 
vblank irq err id:31 pp:0 ret:-22, enable true/0
[   65.630199] [drm:dpu_encoder_phys_cmd_control_vblank_irq] *ERROR* 
vblank irq err id:31 pp:0 ret:-22, enable false/0
[  166.576465] panel-samsung-souxp ae94000.dsi.0: 
samsung_souxp00_disable
[  166.609674] panel-samsung-souxp ae94000.dsi.0: 
samsung_souxp00_unprepare
[  166.781967] [drm:dpu_encoder_helper_wait_for_irq] *ERROR* encoder is 
disabled id=31, callback=dpu_encoder_phys_cmd_ctl_start_irq, IRQ=[134217727, 31]
[  166.829805] panel-samsung-souxp ae94000.dsi.0: 
samsung_souxp00_prepare
[  167.040476] panel-samsung-souxp ae94000.dsi.0: samsung_souxp00_enable
[  337.449827] [dpu error]invalid IRQ=[134217727, 31] 
irq_cb:dpu_encoder_phys_cmd_te_rd_ptr_irq
[  337.450434] [drm:dpu_encoder_phys_cmd_control_vblank_irq] *ERROR* 
vblank irq err id:31 pp:0 ret:-22, enable true/0
[  337.569526] [drm:dpu_encoder_phys_cmd_control_vblank_irq] *ERROR* 
vblank irq err id:31 pp:0 ret:-22, enable false/0
[  354.980357] [dpu error]invalid IRQ=[134217727, 31] 
irq_cb:dpu_encoder_phys_cmd_te_rd_ptr_irq
[  354.980495] [drm:dpu_encoder_phys_cmd_control_vblank_irq] *ERROR* 
vblank irq err id:31 pp:0 ret:-22, enable true/0
[  355.090460] [drm:dpu_encoder_phys_cmd_control_vblank_irq] *ERROR* 
vblank irq err id:31 pp:0 ret:-22, enable false/0

Unfortunately with this patch, turning the CRTC off via ./modetest -M msm -a
-w 81:ACTIVE:0 immediately triggers a bunch of WARNs (note that the CRTC turns
on immediately again when the command returns, that's probably the framebuffer
console taking over again).  Running it a few times in succession this may or
may not happen, or reboot the phone (Xperia Griffin) entirely:

[   23.423930] panel-samsung-souxp ae94000.dsi.0: 
samsung_souxp00_disable
[   23.461013] [dpu error]invalid IRQ=[134217727, 31]
[   23.461144] [dpu error]invalid IRQ=[134217727, 31]
[   23.461208] [drm:dpu_encoder_phys_cmd_control_vblank_irq] *ERROR* 
vblank irq err id:31 pp:0 ret:-22, enable false/1
[   23.461340] [dpu error]invalid IRQ=[134217727, 31]
[   23.461406] panel-samsung-souxp ae94000.dsi.0: 
samsung_souxp00_unprepare
[   23.641721] [drm:dpu_encoder_helper_wait_for_irq] *ERROR* encoder is 
disabled id=31, callback=dpu_encoder_phys_cmd_ctl_start_irq, IRQ=[134217727, 31]
[   23.679938] panel-samsung-souxp ae94000.dsi.0: 
samsung_souxp00_prepare
[   23.900465] [ cut here ]
[   23.900813] WARNING: CPU: 1 PID: 747 at 
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c:545 
dpu_core_irq_register_callback+0x1b4/0x244
[   23.901450] Modules linked in:
[   23.901814] CPU: 1 PID: 747 Comm: modetest Tainted: G U  
   6.9.0-rc1-next-20240328-SoMainline-02555-g27abbea53b6b #19
[   23.902402] Hardware name: Sony Xperia 1 (DT)
[   23.902674] pstate: 804000c5 (Nzcv daIF +PAN -UAO -TCO -DIT -SSBS 
BTYPE=--)
[   23.903133] pc : dpu_core_irq_register_callback+0x1b4/0x244
[   23.903455] lr : dpu_encoder_phys_cmd_irq_enable+0x30/0x8c
[   23.903880] sp : 800086833930
[   23.904123] x29: 800086833930 x28: 0001 x27: 
0273834522d0
[   23.904604] x26: d46ebdb5edc8 x25: d46ebe0f1228 x24: 
02738106b280
[   23.904973] x23: 

Re: [PATCH] drm/msm/dpu: make error messages at dpu_core_irq_register_callback() more sensible

2024-03-30 Thread Abhinav Kumar




On 3/29/2024 8:53 PM, Dmitry Baryshkov wrote:

There is little point in using %ps to print a value known to be NULL. On
the other hand it makes sense to print the callback symbol in the
'invalid IRQ' message. Correct those two error messages to make more
sense.

Fixes: 6893199183f8 ("drm/msm/dpu: stop using raw IRQ indices in the kernel 
output")
Signed-off-by: Dmitry Baryshkov 
---
  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c | 8 
  1 file changed, 4 insertions(+), 4 deletions(-)



Reviewed-by: Abhinav Kumar 


Re: [PATCH] drm/msm/dpu: fix vblank IRQ handling for command panels

2024-03-30 Thread Marijn Suijten
On 2024-03-30 05:52:29, Dmitry Baryshkov wrote:
> In case of CMD DSI panels, the vblank IRQ can be used outside of
> irq_enable/irq_disable pair. This results in the following kind of

Can you clarify when exactly that is?  Is it via ops.control_vblank_irq in
dpu_encoder_toggle_vblank_for_crtc()?

> messages. Move assignment of IRQ indices to atomic_enable /
> atomic_disable callbacks.
> 
> [dpu error]invalid IRQ=[134217727, 31]
> [drm:dpu_encoder_phys_cmd_control_vblank_irq] *ERROR* vblank irq err id:31 
> pp:0 ret:-22, enable true/0
> [drm:dpu_encoder_phys_cmd_control_vblank_irq] *ERROR* vblank irq err id:31 
> pp:0 ret:-22, enable false/0

You are right that such messages are common, both at random but also seemingly
around toggling the `ACTIVE` property on the CRTC:

[   45.878300] panel-samsung-souxp ae94000.dsi.0: 
samsung_souxp00_disable
[   45.909941] panel-samsung-souxp ae94000.dsi.0: 
samsung_souxp00_unprepare
[   46.093234] [drm:dpu_encoder_helper_wait_for_irq] *ERROR* encoder is 
disabled id=31, callback=dpu_encoder_phys_cmd_ctl_start_irq, IRQ=[134217727, 31]
[   46.130421] panel-samsung-souxp ae94000.dsi.0: 
samsung_souxp00_prepare
[   46.340457] panel-samsung-souxp ae94000.dsi.0: samsung_souxp00_enable
[   65.520323] [dpu error]invalid IRQ=[134217727, 31] 
irq_cb:dpu_encoder_phys_cmd_te_rd_ptr_irq
[   65.520463] [drm:dpu_encoder_phys_cmd_control_vblank_irq] *ERROR* 
vblank irq err id:31 pp:0 ret:-22, enable true/0
[   65.630199] [drm:dpu_encoder_phys_cmd_control_vblank_irq] *ERROR* 
vblank irq err id:31 pp:0 ret:-22, enable false/0
[  166.576465] panel-samsung-souxp ae94000.dsi.0: 
samsung_souxp00_disable
[  166.609674] panel-samsung-souxp ae94000.dsi.0: 
samsung_souxp00_unprepare
[  166.781967] [drm:dpu_encoder_helper_wait_for_irq] *ERROR* encoder is 
disabled id=31, callback=dpu_encoder_phys_cmd_ctl_start_irq, IRQ=[134217727, 31]
[  166.829805] panel-samsung-souxp ae94000.dsi.0: 
samsung_souxp00_prepare
[  167.040476] panel-samsung-souxp ae94000.dsi.0: samsung_souxp00_enable
[  337.449827] [dpu error]invalid IRQ=[134217727, 31] 
irq_cb:dpu_encoder_phys_cmd_te_rd_ptr_irq
[  337.450434] [drm:dpu_encoder_phys_cmd_control_vblank_irq] *ERROR* 
vblank irq err id:31 pp:0 ret:-22, enable true/0
[  337.569526] [drm:dpu_encoder_phys_cmd_control_vblank_irq] *ERROR* 
vblank irq err id:31 pp:0 ret:-22, enable false/0
[  354.980357] [dpu error]invalid IRQ=[134217727, 31] 
irq_cb:dpu_encoder_phys_cmd_te_rd_ptr_irq
[  354.980495] [drm:dpu_encoder_phys_cmd_control_vblank_irq] *ERROR* 
vblank irq err id:31 pp:0 ret:-22, enable true/0
[  355.090460] [drm:dpu_encoder_phys_cmd_control_vblank_irq] *ERROR* 
vblank irq err id:31 pp:0 ret:-22, enable false/0

Unfortunately with this patch, turning the CRTC off via ./modetest -M msm -a
-w 81:ACTIVE:0 immediately triggers a bunch of WARNs (note that the CRTC turns
on immediately again when the command returns, that's probably the framebuffer
console taking over again).  Running it a few times in succession this may or
may not happen, or reboot the phone (Xperia Griffin) entirely:

[   23.423930] panel-samsung-souxp ae94000.dsi.0: 
samsung_souxp00_disable
[   23.461013] [dpu error]invalid IRQ=[134217727, 31]
[   23.461144] [dpu error]invalid IRQ=[134217727, 31]
[   23.461208] [drm:dpu_encoder_phys_cmd_control_vblank_irq] *ERROR* 
vblank irq err id:31 pp:0 ret:-22, enable false/1
[   23.461340] [dpu error]invalid IRQ=[134217727, 31]
[   23.461406] panel-samsung-souxp ae94000.dsi.0: 
samsung_souxp00_unprepare
[   23.641721] [drm:dpu_encoder_helper_wait_for_irq] *ERROR* encoder is 
disabled id=31, callback=dpu_encoder_phys_cmd_ctl_start_irq, IRQ=[134217727, 31]
[   23.679938] panel-samsung-souxp ae94000.dsi.0: 
samsung_souxp00_prepare
[   23.900465] [ cut here ]
[   23.900813] WARNING: CPU: 1 PID: 747 at 
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c:545 
dpu_core_irq_register_callback+0x1b4/0x244
[   23.901450] Modules linked in:
[   23.901814] CPU: 1 PID: 747 Comm: modetest Tainted: G U  
   6.9.0-rc1-next-20240328-SoMainline-02555-g27abbea53b6b #19
[   23.902402] Hardware name: Sony Xperia 1 (DT)
[   23.902674] pstate: 804000c5 (Nzcv daIF +PAN -UAO -TCO -DIT -SSBS 
BTYPE=--)
[   23.903133] pc : dpu_core_irq_register_callback+0x1b4/0x244
[   23.903455] lr : dpu_encoder_phys_cmd_irq_enable+0x30/0x8c
[   23.903880] sp : 800086833930
[   23.904123] x29: 800086833930 x28: 0001 x27: 
0273834522d0
[   23.904604] x26: d46ebdb5edc8 x25: d46ebe0f1228 x24: 
02738106b280
[   23.904973] x23: 027383452000 x22: d46ebd086290 x21: 

[   23.905452] x20: 027382712080 

Re: [PATCH 1/4] dt-bindings: display/msm: sm8150-mdss: add DP node

2024-03-30 Thread Krzysztof Kozlowski
On 27/03/2024 11:11, Krzysztof Kozlowski wrote:
> On 26/03/2024 21:02, Dmitry Baryshkov wrote:
>> As Qualcomm SM8150 got support for the DisplayPort, add displayport@
>> node as a valid child to the MDSS node.
>>
>> Signed-off-by: Dmitry Baryshkov 
>> ---
> 
> Reviewed-by: Krzysztof Kozlowski 

If there is going to be resend, please switch to "contains" and only
sm8150 compatible just like:

https://lore.kernel.org/all/20240329-sm6350-dp-v2-2-e46dceb32...@fairphone.com/

(but no need to resend just for that)

Best regards,
Krzysztof



Re: [PATCH v2 2/3] dt-bindings: display: msm: sm6350-mdss: document DP controller subnode

2024-03-30 Thread Krzysztof Kozlowski
On 29/03/2024 08:45, Luca Weiss wrote:
> Document the displayport controller subnode of the SM6350 MDSS.
> 
> Signed-off-by: Luca Weiss 
> ---

Reviewed-by: Krzysztof Kozlowski 

Best regards,
Krzysztof



Re: [PATCH] drm/msm/dpu: make error messages at dpu_core_irq_register_callback() more sensible

2024-03-30 Thread Marijn Suijten
On 2024-03-30 05:53:22, Dmitry Baryshkov wrote:
> There is little point in using %ps to print a value known to be NULL. On
> the other hand it makes sense to print the callback symbol in the
> 'invalid IRQ' message. Correct those two error messages to make more
> sense.
> 
> Fixes: 6893199183f8 ("drm/msm/dpu: stop using raw IRQ indices in the kernel 
> output")
> Signed-off-by: Dmitry Baryshkov 

Agreed, this is a lot more clear:

Reviewed-by: Marijn Suijten 

> ---
>  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c 
> b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c
> index 946dd0135dff..6a0a74832fb6 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c
> @@ -525,14 +525,14 @@ int dpu_core_irq_register_callback(struct dpu_kms 
> *dpu_kms,
>   int ret;
>  
>   if (!irq_cb) {
> - DPU_ERROR("invalid IRQ=[%d, %d] irq_cb:%ps\n",
> -   DPU_IRQ_REG(irq_idx), DPU_IRQ_BIT(irq_idx), irq_cb);
> + DPU_ERROR("IRQ=[%d, %d] NULL callback\n",
> +   DPU_IRQ_REG(irq_idx), DPU_IRQ_BIT(irq_idx));
>   return -EINVAL;
>   }
>  
>   if (!dpu_core_irq_is_valid(irq_idx)) {
> - DPU_ERROR("invalid IRQ=[%d, %d]\n",
> -   DPU_IRQ_REG(irq_idx), DPU_IRQ_BIT(irq_idx));
> + DPU_ERROR("invalid IRQ=[%d, %d] irq_cb:%ps\n",
> +   DPU_IRQ_REG(irq_idx), DPU_IRQ_BIT(irq_idx), irq_cb);
>   return -EINVAL;
>   }
>  
> 
> ---
> base-commit: 13ee4a7161b6fd938aef6688ff43b163f6d83e37
> change-id: 20240330-dpu-irq-messages-5cf13fd7568c
> 
> Best regards,
> -- 
> Dmitry Baryshkov 
>