public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
From: Minas Harutyunyan <Minas.Harutyunyan@synopsys.com>
To: Oliver Neukum <oneukum@suse.com>,
	Minas Harutyunyan <Minas.Harutyunyan@synopsys.com>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>
Subject: Re: [PATCH] USB: dwc2: hande irq on dead controller correctly
Date: Mon, 28 Aug 2023 10:52:57 +0000	[thread overview]
Message-ID: <af261002-dcec-cd80-ef5f-4acf8b87f565@synopsys.com> (raw)
In-Reply-To: <20230822112455.18957-1-oneukum@suse.com>

Hi Oliver,

On 8/22/23 15:24, Oliver Neukum wrote:
> If the controller is dead, the honest answer to the
> question whether it has caused an irq is: unknown
> As the purpose of the irq return is to trigger switching
> off an IRQ, the correct response if you cannot
> determine if your device has caused the interrupt is
> IRQ_HANDLED
> 

If core is dead then it can not assert interrupt, it's more possible 
that it's spurious interrupt or interrupt from other device (IRQ is 
shared) and nothing should be handled. In this case reply by IRQ_HANDLED 
is incorrect because nothing is handled.

Thanks,
Minas

> Signed-off-by: Oliver Neukum <oneukum@suse.com>
> ---
>   drivers/usb/dwc2/hcd_intr.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/dwc2/hcd_intr.c b/drivers/usb/dwc2/hcd_intr.c
> index c9740caa5974..0144ca8350c3 100644
> --- a/drivers/usb/dwc2/hcd_intr.c
> +++ b/drivers/usb/dwc2/hcd_intr.c
> @@ -2203,11 +2203,13 @@ static void dwc2_hc_intr(struct dwc2_hsotg *hsotg)
>   irqreturn_t dwc2_handle_hcd_intr(struct dwc2_hsotg *hsotg)
>   {
>   	u32 gintsts, dbg_gintsts;
> -	irqreturn_t retval = IRQ_NONE;
> +	irqreturn_t retval = IRQ_HANDLED;
>   
>   	if (!dwc2_is_controller_alive(hsotg)) {
>   		dev_warn(hsotg->dev, "Controller is dead\n");
>   		return retval;
> +	} else {
> +		retval = IRQ_NONE;
>   	}
>   
>   	spin_lock(&hsotg->lock);

  reply	other threads:[~2023-08-28 10:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-22 11:24 [PATCH] USB: dwc2: hande irq on dead controller correctly Oliver Neukum
2023-08-28 10:52 ` Minas Harutyunyan [this message]
2023-08-28 11:53   ` Oliver Neukum

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=af261002-dcec-cd80-ef5f-4acf8b87f565@synopsys.com \
    --to=minas.harutyunyan@synopsys.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=oneukum@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox