All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nikhil Devshatwar <nikhil.nd@ti.com>
To: Tomi Valkeinen <tomi.valkeinen@ti.com>,
	Swapnil Jakhade <sjakhade@cadence.com>,
	Yuti Amonkar <yamonkar@cadence.com>
Cc: Yuti Amonkar <yamonkar@cadence.com>, Sekhar Nori <nsekhar@ti.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	dri-devel@lists.freedesktop.org,
	Swapnil Jakhade <sjakhade@cadence.com>
Subject: Re: [PATCH v2 6/6] drm/bridge: cdns-mhdp8546: Fix the interrupt enable/disable
Date: Tue, 10 Nov 2020 19:23:15 +0530	[thread overview]
Message-ID: <20201110135315.53ehiqmwunmwzhod@NiksLab> (raw)
In-Reply-To: <9d23f838-a9bc-ba5d-adfe-9b3bfc26c223@ti.com>

On 14:27-20201110, Tomi Valkeinen wrote:
> On 10/11/2020 12:27, Nikhil Devshatwar wrote:
> > On 11:21-20201110, Tomi Valkeinen wrote:
> >> On 09/11/2020 19:06, Nikhil Devshatwar wrote:
> >>> When removing the tidss driver, there is a warning reported by
> >>> kernel about an unhandled interrupt for mhdp driver.
> >>>
> >>> [   43.238895] irq 31: nobody cared (try booting with the "irqpoll" option)
> >>> ... [snipped backtrace]
> >>> [   43.330735] handlers:
> >>> [   43.333020] [<000000005367c4f9>] irq_default_primary_handler threaded [<000000007e02b601>]
> >>> cdns_mhdp_irq_handler [cdns_mhdp8546]
> >>> [   43.344607] Disabling IRQ #31
> >>>
> >>> This happens because as part of cdns_mhdp_bridge_hpd_disable, driver tries
> >>> to disable the interrupts. While disabling the SW_EVENT interrupts,
> >>> it accidentally enables the MBOX interrupts, which are not handled by
> >>> the driver.
> >>>
> >>> Fix this with a read-modify-write to update only required bits.
> >>> Do the same for enabling interrupts as well.
> >>>
> >>> Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
> >>> ---
> >>>  drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c | 7 +++++--
> >>>  1 file changed, 5 insertions(+), 2 deletions(-)
> >>>
> >>> diff --git a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
> >>> index 2cd809eed827..6beccd2a408e 100644
> >>> --- a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
> >>> +++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
> >>> @@ -2146,7 +2146,8 @@ static void cdns_mhdp_bridge_hpd_enable(struct drm_bridge *bridge)
> >>>  
> >>>  	/* Enable SW event interrupts */
> >>>  	if (mhdp->bridge_attached)
> >>> -		writel(~(u32)CDNS_APB_INT_MASK_SW_EVENT_INT,
> >>> +		writel(readl(mhdp->regs + CDNS_APB_INT_MASK) &
> >>> +		       ~CDNS_APB_INT_MASK_SW_EVENT_INT,
> >>>  		       mhdp->regs + CDNS_APB_INT_MASK);
> >>>  }
> >>>  
> >>> @@ -2154,7 +2155,9 @@ static void cdns_mhdp_bridge_hpd_disable(struct drm_bridge *bridge)
> >>>  {
> >>>  	struct cdns_mhdp_device *mhdp = bridge_to_mhdp(bridge);
> >>>  
> >>> -	writel(CDNS_APB_INT_MASK_SW_EVENT_INT, mhdp->regs + CDNS_APB_INT_MASK);
> >>> +	writel(readl(mhdp->regs + CDNS_APB_INT_MASK) |
> >>> +	       CDNS_APB_INT_MASK_SW_EVENT_INT,
> >>> +	       mhdp->regs + CDNS_APB_INT_MASK);
> >>>  }
> >>>  
> >>>  static const struct drm_bridge_funcs cdns_mhdp_bridge_funcs = {
> >>
> >> Good catch. I wonder why we need the above functions... We already enable and disable the interrupts
> >> when attaching/detaching the driver. And I think we want to get the interrupt even if we won't
> >> report HPD (but I think we always do report it), as we need the interrupts to track the link status.
> >>
> > 
> > I read from the code that there is TODO for handling the mailbox
> > interrupts in the driver. Once that is supported, you will be able to
> > explictily enable/disable interrupts for SW_EVENTS (like hotplug) as
> > well as mailbox events. This enabling specific bits in the interrupt
> > status.
> 
> But SW_EVENTS is not the same as HPD, at least in theory. If we disable SW_EVENT_INT in
> hpd_disable(), we lose all SW_EVENT interrupts.

I am not sure, what exactly is covered in the SW events apart from the hotplug.

Swapnil, Yuti, Please fill in..

Nikhil D
> 
>  Tomi
> 
> -- 
> Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
> Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2020-11-10 13:53 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-09 17:05 [PATCH v2 0/6] drm/tidss: Use new connector model for tidss Nikhil Devshatwar
2020-11-09 17:05 ` [PATCH v2 1/6] drm: bridge: Propagate the bus flags from bridge->timings Nikhil Devshatwar
2020-11-11 11:38   ` Tomi Valkeinen
2020-11-09 17:05 ` [PATCH v2 2/6] drm/bridge: tfp410: Support format negotiation hooks Nikhil Devshatwar
2020-11-11 11:41   ` Tomi Valkeinen
2020-11-09 17:05 ` [PATCH v2 3/6] drm/bridge: mhdp8546: Add minimal format negotiation Nikhil Devshatwar
2020-11-11 11:42   ` Tomi Valkeinen
2020-11-09 17:05 ` [PATCH v2 4/6] drm/tidss: Set bus_format correctly from bridge/connector Nikhil Devshatwar
2020-11-11 11:52   ` Tomi Valkeinen
2020-11-09 17:06 ` [PATCH v2 5/6] drm/tidss: Move to newer connector model Nikhil Devshatwar
2020-11-11 11:55   ` Tomi Valkeinen
2020-11-09 17:06 ` [PATCH v2 6/6] drm/bridge: cdns-mhdp8546: Fix the interrupt enable/disable Nikhil Devshatwar
2020-11-10  9:21   ` Tomi Valkeinen
2020-11-10 10:27     ` Nikhil Devshatwar
2020-11-10 12:27       ` Tomi Valkeinen
2020-11-10 13:53         ` Nikhil Devshatwar [this message]
2020-11-10 14:32           ` Swapnil Kashinath Jakhade
2020-11-10 14:50             ` Nikhil Devshatwar
2020-11-11 17:05   ` Swapnil Kashinath Jakhade
2020-11-10  9:02 ` [PATCH v2 0/6] drm/tidss: Use new connector model for tidss Tomi Valkeinen
2020-11-10 10:30   ` Nikhil Devshatwar

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=20201110135315.53ehiqmwunmwzhod@NiksLab \
    --to=nikhil.nd@ti.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=nsekhar@ti.com \
    --cc=sjakhade@cadence.com \
    --cc=tomi.valkeinen@ti.com \
    --cc=yamonkar@cadence.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.