dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Lucas Stach <l.stach@pengutronix.de>
To: Marek Vasut <marex@denx.de>, dri-devel@lists.freedesktop.org
Cc: Peng Fan <peng.fan@nxp.com>,
	Alexander Stein <alexander.stein@ew.tq-group.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Sam Ravnborg <sam@ravnborg.org>, Robby Cai <robby.cai@nxp.com>
Subject: Re: [PATCH v2 2/7] drm: mxsfb: Simplify LCDIF IRQ handling
Date: Wed, 06 Apr 2022 21:41:17 +0200	[thread overview]
Message-ID: <ffc23134df69d9fe6ba7229e6a3239ebd131e68e.camel@pengutronix.de> (raw)
In-Reply-To: <20220311170601.50995-2-marex@denx.de>

Am Freitag, dem 11.03.2022 um 18:05 +0100 schrieb Marek Vasut:
> The call to drm_crtc_vblank_off(&lcdif->crtc); disables IRQ generation
> from the LCDIF block already and this is called in mxsfb_load() before
> request_irq(), so explicitly disabling IRQ using custom function like
> mxsfb_irq_disable() is not needed, remove it.
> 

Have you checked that the drm_vblank_off in probe actually results in a
call to mxsfb_crtc_disable_vblank? From my reading of the core code,
this should be a no-op without a previous drm_vblank_on, so it would
not result in the desired masking before the IRQ is requested.

Regards,
Lucas

>  The request_irq() call
> would return -ENOTCONN if IRQ is IRQ_NOTCONNECTED already, so remove
> the unnecessary check. Finally, remove both mxsfb_irq_install() and
> mxsfb_irq_uninstall() as well, since they are no longer useful.
> 
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Alexander Stein <alexander.stein@ew.tq-group.com>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: Lucas Stach <l.stach@pengutronix.de>
> Cc: Peng Fan <peng.fan@nxp.com>
> Cc: Robby Cai <robby.cai@nxp.com>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> Cc: Stefan Agner <stefan@agner.ch>
> ---
> V2: No change
> ---
>  drivers/gpu/drm/mxsfb/mxsfb_drv.c | 38 +++++++------------------------
>  1 file changed, 8 insertions(+), 30 deletions(-)
> 
> diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> index c790aeff0a6f0..94cafff7f68d5 100644
> --- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> +++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> @@ -157,33 +157,6 @@ static irqreturn_t mxsfb_irq_handler(int irq, void *data)
>  	return IRQ_HANDLED;
>  }
>  
> -static void mxsfb_irq_disable(struct drm_device *drm)
> -{
> -	struct mxsfb_drm_private *mxsfb = drm->dev_private;
> -
> -	/* Disable and clear VBLANK IRQ */
> -	writel(CTRL1_CUR_FRAME_DONE_IRQ_EN, mxsfb->base + LCDC_CTRL1 + REG_CLR);
> -	writel(CTRL1_CUR_FRAME_DONE_IRQ, mxsfb->base + LCDC_CTRL1 + REG_CLR);
> -}
> -
> -static int mxsfb_irq_install(struct drm_device *dev, int irq)
> -{
> -	if (irq == IRQ_NOTCONNECTED)
> -		return -ENOTCONN;
> -
> -	mxsfb_irq_disable(dev);
> -
> -	return request_irq(irq, mxsfb_irq_handler, 0,  dev->driver->name, dev);
> -}
> -
> -static void mxsfb_irq_uninstall(struct drm_device *dev)
> -{
> -	struct mxsfb_drm_private *mxsfb = dev->dev_private;
> -
> -	mxsfb_irq_disable(dev);
> -	free_irq(mxsfb->irq, dev);
> -}
> -
>  static int mxsfb_load(struct drm_device *drm,
>  		      const struct mxsfb_devdata *devdata)
>  {
> @@ -259,7 +232,8 @@ static int mxsfb_load(struct drm_device *drm,
>  		return ret;
>  	mxsfb->irq = ret;
>  
> -	ret = mxsfb_irq_install(drm, mxsfb->irq);
> +	ret = request_irq(mxsfb->irq, mxsfb_irq_handler, 0,
> +			  drm->driver->name, drm);
>  	if (ret < 0) {
>  		dev_err(drm->dev, "Failed to install IRQ handler\n");
>  		return ret;
> @@ -276,16 +250,20 @@ static int mxsfb_load(struct drm_device *drm,
>  
>  static void mxsfb_unload(struct drm_device *drm)
>  {
> +	struct mxsfb_drm_private *mxsfb = drm->dev_private;
> +
>  	pm_runtime_get_sync(drm->dev);
>  
> +	drm_crtc_vblank_off(&mxsfb->crtc);
> +
>  	drm_kms_helper_poll_fini(drm);
>  	drm_mode_config_cleanup(drm);
>  
> -	mxsfb_irq_uninstall(drm);
> -
>  	pm_runtime_put_sync(drm->dev);
>  	pm_runtime_disable(drm->dev);
>  
> +	free_irq(mxsfb->irq, drm->dev);
> +
>  	drm->dev_private = NULL;
>  }
>  



  reply	other threads:[~2022-04-06 19:41 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-11 17:05 [PATCH v2 1/7] drm: mxsfb: Simplify LCDIF clock handling Marek Vasut
2022-03-11 17:05 ` [PATCH v2 2/7] drm: mxsfb: Simplify LCDIF IRQ handling Marek Vasut
2022-04-06 19:41   ` Lucas Stach [this message]
2022-04-06 22:03     ` Marek Vasut
2022-04-07  8:01       ` Lucas Stach
2022-04-17  1:04         ` Marek Vasut
2022-03-11 17:05 ` [PATCH v2 3/7] drm: mxsfb: Wrap FIFO reset and comments into mxsfb_reset_block() Marek Vasut
2022-04-06 19:42   ` Lucas Stach
2022-03-11 17:05 ` [PATCH v2 4/7] drm: mxsfb: Move mxsfb_get_fb_paddr() away from register IO functions Marek Vasut
2022-04-06 19:45   ` Lucas Stach
2022-04-06 22:05     ` Marek Vasut
2022-04-07  9:47       ` Lucas Stach
2022-04-10 22:17         ` Marek Vasut
2022-04-11  9:46           ` Lucas Stach
2022-03-11 17:05 ` [PATCH v2 5/7] drm: mxsfb: Factor out mxsfb_set_mode() Marek Vasut
2022-04-06 19:47   ` Lucas Stach
2022-04-06 22:06     ` Marek Vasut
2022-03-11 17:06 ` [PATCH v2 6/7] drm: mxsfb: Reorder mxsfb_crtc_mode_set_nofb() Marek Vasut
2022-04-06 19:48   ` Lucas Stach
2022-03-11 17:06 ` [PATCH v2 7/7] drm: mxsfb: Factor out mxsfb_update_buffer() Marek Vasut
2022-04-06 19:49   ` Lucas Stach
2022-04-06 19:32 ` [PATCH v2 1/7] drm: mxsfb: Simplify LCDIF clock handling Lucas Stach
2022-04-06 21:45   ` Marek Vasut
2022-04-07  7:57     ` Lucas Stach
2022-04-17  1:05       ` Marek Vasut

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ffc23134df69d9fe6ba7229e6a3239ebd131e68e.camel@pengutronix.de \
    --to=l.stach@pengutronix.de \
    --cc=alexander.stein@ew.tq-group.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=marex@denx.de \
    --cc=peng.fan@nxp.com \
    --cc=robby.cai@nxp.com \
    --cc=sam@ravnborg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).