dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/bridge: nwl-dsi: Remove superfluous write to NWL_DSI_IRQ_MASK register
@ 2022-02-16  8:58 Liu Ying
  2022-03-02 11:34 ` Guido Günther
  0 siblings, 1 reply; 3+ messages in thread
From: Liu Ying @ 2022-02-16  8:58 UTC (permalink / raw)
  To: dri-devel, linux-kernel; +Cc: agx, linux-imx, robert.foss

To initialize register NWL_DSI_IRQ_MASK, it's enough to write it
only once in function nwl_dsi_init_interrupts().

Signed-off-by: Liu Ying <victor.liu@nxp.com>
---
 drivers/gpu/drm/bridge/nwl-dsi.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/bridge/nwl-dsi.c b/drivers/gpu/drm/bridge/nwl-dsi.c
index af07eeb47ca0..fcc4a2889ad4 100644
--- a/drivers/gpu/drm/bridge/nwl-dsi.c
+++ b/drivers/gpu/drm/bridge/nwl-dsi.c
@@ -333,17 +333,13 @@ static int nwl_dsi_config_dpi(struct nwl_dsi *dsi)
 
 static int nwl_dsi_init_interrupts(struct nwl_dsi *dsi)
 {
-	u32 irq_enable;
-
-	nwl_dsi_write(dsi, NWL_DSI_IRQ_MASK, 0xffffffff);
-	nwl_dsi_write(dsi, NWL_DSI_IRQ_MASK2, 0x7);
-
-	irq_enable = ~(u32)(NWL_DSI_TX_PKT_DONE_MASK |
-			    NWL_DSI_RX_PKT_HDR_RCVD_MASK |
-			    NWL_DSI_TX_FIFO_OVFLW_MASK |
-			    NWL_DSI_HS_TX_TIMEOUT_MASK);
+	u32 irq_enable = ~(u32)(NWL_DSI_TX_PKT_DONE_MASK |
+				NWL_DSI_RX_PKT_HDR_RCVD_MASK |
+				NWL_DSI_TX_FIFO_OVFLW_MASK |
+				NWL_DSI_HS_TX_TIMEOUT_MASK);
 
 	nwl_dsi_write(dsi, NWL_DSI_IRQ_MASK, irq_enable);
+	nwl_dsi_write(dsi, NWL_DSI_IRQ_MASK2, 0x7);
 
 	return nwl_dsi_clear_error(dsi);
 }
-- 
2.25.1


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

* Re: [PATCH] drm/bridge: nwl-dsi: Remove superfluous write to NWL_DSI_IRQ_MASK register
  2022-02-16  8:58 [PATCH] drm/bridge: nwl-dsi: Remove superfluous write to NWL_DSI_IRQ_MASK register Liu Ying
@ 2022-03-02 11:34 ` Guido Günther
  2022-03-02 13:12   ` Robert Foss
  0 siblings, 1 reply; 3+ messages in thread
From: Guido Günther @ 2022-03-02 11:34 UTC (permalink / raw)
  To: Liu Ying; +Cc: robert.foss, linux-kernel, dri-devel, linux-imx

Hi Liu,
On Wed, Feb 16, 2022 at 04:58:42PM +0800, Liu Ying wrote:
> To initialize register NWL_DSI_IRQ_MASK, it's enough to write it
> only once in function nwl_dsi_init_interrupts().
> 
> Signed-off-by: Liu Ying <victor.liu@nxp.com>
> ---
>  drivers/gpu/drm/bridge/nwl-dsi.c | 14 +++++---------
>  1 file changed, 5 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/bridge/nwl-dsi.c b/drivers/gpu/drm/bridge/nwl-dsi.c
> index af07eeb47ca0..fcc4a2889ad4 100644
> --- a/drivers/gpu/drm/bridge/nwl-dsi.c
> +++ b/drivers/gpu/drm/bridge/nwl-dsi.c
> @@ -333,17 +333,13 @@ static int nwl_dsi_config_dpi(struct nwl_dsi *dsi)
>  
>  static int nwl_dsi_init_interrupts(struct nwl_dsi *dsi)
>  {
> -	u32 irq_enable;
> -
> -	nwl_dsi_write(dsi, NWL_DSI_IRQ_MASK, 0xffffffff);
> -	nwl_dsi_write(dsi, NWL_DSI_IRQ_MASK2, 0x7);
> -
> -	irq_enable = ~(u32)(NWL_DSI_TX_PKT_DONE_MASK |
> -			    NWL_DSI_RX_PKT_HDR_RCVD_MASK |
> -			    NWL_DSI_TX_FIFO_OVFLW_MASK |
> -			    NWL_DSI_HS_TX_TIMEOUT_MASK);
> +	u32 irq_enable = ~(u32)(NWL_DSI_TX_PKT_DONE_MASK |
> +				NWL_DSI_RX_PKT_HDR_RCVD_MASK |
> +				NWL_DSI_TX_FIFO_OVFLW_MASK |
> +				NWL_DSI_HS_TX_TIMEOUT_MASK);
>  
>  	nwl_dsi_write(dsi, NWL_DSI_IRQ_MASK, irq_enable);
> +	nwl_dsi_write(dsi, NWL_DSI_IRQ_MASK2, 0x7);

Works fine here. I thought it was due to some hw quirk but can't find
any note in it so:

Reviewed-by: Guido Günther <agx@sigxcpu.org>

Thanks,
 -- Guido

>  
>  	return nwl_dsi_clear_error(dsi);
>  }
> -- 
> 2.25.1
> 

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

* Re: [PATCH] drm/bridge: nwl-dsi: Remove superfluous write to NWL_DSI_IRQ_MASK register
  2022-03-02 11:34 ` Guido Günther
@ 2022-03-02 13:12   ` Robert Foss
  0 siblings, 0 replies; 3+ messages in thread
From: Robert Foss @ 2022-03-02 13:12 UTC (permalink / raw)
  To: Guido Günther; +Cc: Liu Ying, linux-kernel, dri-devel, linux-imx

On Wed, 2 Mar 2022 at 12:35, Guido Günther <agx@sigxcpu.org> wrote:
>
> Hi Liu,
> On Wed, Feb 16, 2022 at 04:58:42PM +0800, Liu Ying wrote:
> > To initialize register NWL_DSI_IRQ_MASK, it's enough to write it
> > only once in function nwl_dsi_init_interrupts().
> >
> > Signed-off-by: Liu Ying <victor.liu@nxp.com>
> > ---
> >  drivers/gpu/drm/bridge/nwl-dsi.c | 14 +++++---------
> >  1 file changed, 5 insertions(+), 9 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/bridge/nwl-dsi.c b/drivers/gpu/drm/bridge/nwl-dsi.c
> > index af07eeb47ca0..fcc4a2889ad4 100644
> > --- a/drivers/gpu/drm/bridge/nwl-dsi.c
> > +++ b/drivers/gpu/drm/bridge/nwl-dsi.c
> > @@ -333,17 +333,13 @@ static int nwl_dsi_config_dpi(struct nwl_dsi *dsi)
> >
> >  static int nwl_dsi_init_interrupts(struct nwl_dsi *dsi)
> >  {
> > -     u32 irq_enable;
> > -
> > -     nwl_dsi_write(dsi, NWL_DSI_IRQ_MASK, 0xffffffff);
> > -     nwl_dsi_write(dsi, NWL_DSI_IRQ_MASK2, 0x7);
> > -
> > -     irq_enable = ~(u32)(NWL_DSI_TX_PKT_DONE_MASK |
> > -                         NWL_DSI_RX_PKT_HDR_RCVD_MASK |
> > -                         NWL_DSI_TX_FIFO_OVFLW_MASK |
> > -                         NWL_DSI_HS_TX_TIMEOUT_MASK);
> > +     u32 irq_enable = ~(u32)(NWL_DSI_TX_PKT_DONE_MASK |
> > +                             NWL_DSI_RX_PKT_HDR_RCVD_MASK |
> > +                             NWL_DSI_TX_FIFO_OVFLW_MASK |
> > +                             NWL_DSI_HS_TX_TIMEOUT_MASK);
> >
> >       nwl_dsi_write(dsi, NWL_DSI_IRQ_MASK, irq_enable);
> > +     nwl_dsi_write(dsi, NWL_DSI_IRQ_MASK2, 0x7);
>
> Works fine here. I thought it was due to some hw quirk but can't find
> any note in it so:
>
> Reviewed-by: Guido Günther <agx@sigxcpu.org>
>
> Thanks,
>  -- Guido

Applied to drm-misc-next

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

end of thread, other threads:[~2022-03-02 13:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-16  8:58 [PATCH] drm/bridge: nwl-dsi: Remove superfluous write to NWL_DSI_IRQ_MASK register Liu Ying
2022-03-02 11:34 ` Guido Günther
2022-03-02 13:12   ` Robert Foss

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).