From: Chunfeng Yun <chunfeng.yun@mediatek.com>
To: Sergey Shtylyov <s.shtylyov@omp.ru>, <linux-usb@vger.kernel.org>,
"Mathias Nyman" <mathias.nyman@intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Matthias Brugger <matthias.bgg@gmail.com>,
<linux-arm-kernel@lists.infradead.org>,
<linux-mediatek@lists.infradead.org>
Subject: Re: [PATCH v2 20/22] usb: host: xhci-mtk: deny IRQ0
Date: Wed, 27 Oct 2021 17:35:58 +0800 [thread overview]
Message-ID: <7811ffc8032eeb3201025085501da999e30a09d2.camel@mediatek.com> (raw)
In-Reply-To: <d7a7d79a-a1b9-3c3d-13e1-ab4ab8e9989a@omp.ru>
On Wed, 2021-10-27 at 12:25 +0300, Sergey Shtylyov wrote:
> On 27.10.2021 12:18, Chunfeng Yun wrote:
>
> > > If platform_get_irq() returns IRQ0 (considered invalid according
> > > to
> > > Linus)
> > > the driver blithely passes it to usb_add_hcd() that treats IRQ0
> > > as no
> > > IRQ
> > > at all. Deny IRQ0 right away, returning -EINVAL from the probe()
> > > method...
> > >
> > > Fixes: 0cbd4b34cda9 ("xhci: mediatek: support MTK xHCI host
> > > controller")
> > > Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
> > > ---
> > > drivers/usb/host/xhci-mtk.c | 4 +++-
> > > 1 file changed, 3 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-
> > > mtk.c
> > > index c53f6f276d5c..d2dc8d9863ee 100644
> > > --- a/drivers/usb/host/xhci-mtk.c
> > > +++ b/drivers/usb/host/xhci-mtk.c
> > > @@ -495,7 +495,7 @@ static int xhci_mtk_probe(struct
> > > platform_device
> > > *pdev)
> > > return ret;
> > >
> > > irq = platform_get_irq_byname_optional(pdev, "host");
> > > - if (irq < 0) {
> > > + if (irq <= 0) {
> > > if (irq == -EPROBE_DEFER)
> > > return irq;
> > >
> > > @@ -503,6 +503,8 @@ static int xhci_mtk_probe(struct
> > > platform_device
> > > *pdev)
> > > irq = platform_get_irq(pdev, 0);
Here, irq is updated again
> > > if (irq < 0)
> > > return irq;
> > > + if (!irq)
> >
> > it's "if (irq <= 0)"?
>
> No, if (irq == 0).
>
> > > + return -EINVAL;
add "else if (irq < 0), return irq;"? but not -EINVAL only, this may
drop EPROBE_DEFER
> > > }
> > >
> > > wakeup_irq = platform_get_irq_byname_optional(pdev,
> > > "wakeup");
>
> MBR, Sergey
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
prev parent reply other threads:[~2021-10-27 9:43 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20211026173943.6829-1-s.shtylyov@omp.ru>
2021-10-26 17:39 ` [PATCH v2 01/22] usb: host: ehci-exynos: deny IRQ0 Sergey Shtylyov
2021-10-30 8:54 ` Greg Kroah-Hartman
2021-11-01 20:39 ` Sergey Shtylyov
2021-11-02 13:55 ` Greg Kroah-Hartman
2021-11-02 20:45 ` Sergey Shtylyov
2021-10-26 17:39 ` [PATCH v2 05/22] usb: host: ehci-platform: " Sergey Shtylyov
2021-10-26 17:39 ` [PATCH v2 07/22] usb: host: ehci-st: " Sergey Shtylyov
2021-10-27 6:08 ` Patrice CHOTARD
2021-10-26 17:39 ` [PATCH v2 08/22] usb: host: ohci-at91: " Sergey Shtylyov
2021-10-26 17:39 ` [PATCH v2 10/22] usb: host: ohci-exynos: " Sergey Shtylyov
2021-10-26 17:39 ` [PATCH v2 11/22] usb: host: ohci-nxp: " Sergey Shtylyov
2021-10-26 18:25 ` Vladimir Zapolskiy
2021-10-26 17:39 ` [PATCH v2 17/22] usb: host: ohci-st: " Sergey Shtylyov
2021-10-27 6:08 ` Patrice CHOTARD
2021-10-26 17:39 ` [PATCH v2 20/22] usb: host: xhci-mtk: " Sergey Shtylyov
2021-10-27 8:54 ` Chunfeng Yun
2021-10-27 9:18 ` Chunfeng Yun
2021-10-27 9:25 ` Sergey Shtylyov
2021-10-27 9:35 ` Chunfeng Yun [this message]
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=7811ffc8032eeb3201025085501da999e30a09d2.camel@mediatek.com \
--to=chunfeng.yun@mediatek.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-usb@vger.kernel.org \
--cc=mathias.nyman@intel.com \
--cc=matthias.bgg@gmail.com \
--cc=s.shtylyov@omp.ru \
/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).