From: "Chunfeng Yun (云春峰)" <Chunfeng.Yun@mediatek.com>
To: "mika.westerberg@linux.intel.com" <mika.westerberg@linux.intel.com>
Cc: "linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
"westeri@kernel.org" <westeri@kernel.org>,
"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
"YehezkelShB@gmail.com" <YehezkelShB@gmail.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"andreas.noever@gmail.com" <andreas.noever@gmail.com>,
"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
"linux-mediatek@lists.infradead.org"
<linux-mediatek@lists.infradead.org>
Subject: Re: [PATCH 2/4] thunderbolt: add support optional dedicated wakeup irq
Date: Tue, 3 Nov 2026 09:05:45 +0000 [thread overview]
Message-ID: <34de87bb4da20626d440346f9aa0cf7873ef85d1.camel@mediatek.com> (raw)
In-Reply-To: <20261030084854.GQ158991@black.igk.intel.com>
On Fri, 2026-10-30 at 09:48 +0100, Mika Westerberg wrote:
> On Fri, Oct 30, 2026 at 04:25:37PM +0800, Chunfeng Yun wrote:
> > There is a dedicated wakeup irq on nvidia n1/n2 SoCs.
>
> Okay but why it is needed?
due to mac/phy is in power domain which its power/clock will be turn
off when enter into sleep mode, so can not use the mac's irq to trigger
wakeup signal, instead add a dedicated irq to send wake signal which
stay in always-on power domain.
> Can you add this to the commit message?
OK, will add more info
>
> And why you did not add it already in the first commit that added the
> platform driver there anyway?
OK.
because I test base funtion first, then support suspend/resume
Thank you
>
> >
> > Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
> > ---
> > drivers/thunderbolt/plat.c | 16 ++++++++++++++++
> > include/linux/thunderbolt.h | 1 +
> > 2 files changed, 17 insertions(+)
> >
> > diff --git a/drivers/thunderbolt/plat.c
> > b/drivers/thunderbolt/plat.c
> > index 85a00cd391d4..8d83b484d942 100644
> > --- a/drivers/thunderbolt/plat.c
> > +++ b/drivers/thunderbolt/plat.c
> > @@ -11,6 +11,7 @@
> > #include <linux/of.h>
> > #include <linux/platform_device.h>
> > #include <linux/pm_runtime.h>
> > +#include <linux/pm_wakeirq.h>
> > #include <linux/slab.h>
> >
> > #include "nhi.h"
> > @@ -46,6 +47,15 @@ static int nhi_plat_init_irq(struct tb_nhi *nhi)
> > if (ret)
> > return dev_err_probe(nhi->dev, ret, "request irq
> > failed\n");
> >
> > + if (nhi->wake_irq) {
> > + ret = dev_pm_set_dedicated_wake_irq(nhi->dev, nhi-
> > >wake_irq);
> > + if (ret) {
> > + dev_err_probe(nhi->dev, ret, "set wake irq
> > %d failed\n", nhi->wake_irq);
> > + return ret;
> > + }
> > + dev_info(nhi->dev, "wake irq %d\n", nhi-
> > >wake_irq);
> > + }
> > +
> > return 0;
> > }
> >
> > @@ -53,6 +63,7 @@ static void nhi_plat_exit(struct tb_nhi *nhi)
> > {
> > devm_free_irq(nhi->dev, nhi->irq, nhi);
> > flush_work(&nhi->interrupt_work);
> > + dev_pm_clear_wake_irq(nhi->dev);
> >
> > pm_runtime_put_noidle(nhi->dev);
> > pm_runtime_disable(nhi->dev);
> > @@ -85,6 +96,11 @@ static int nhi_plat_probe(struct platform_device
> > *pdev)
> > if (nhi->irq < 0)
> > return dev_err_probe(dev, nhi->irq, "get irq
> > failed\n");
> >
> > + /* ignore error */
> > + nhi->wake_irq = platform_get_irq_optional(pdev, 1);
> > + if (nhi->wake_irq < 0)
> > + nhi->wake_irq = 0;
> > +
> > return nhi_probe(nhi);
> > }
> >
> > diff --git a/include/linux/thunderbolt.h
> > b/include/linux/thunderbolt.h
> > index 212c8fea6571..06b90d452ee2 100644
> > --- a/include/linux/thunderbolt.h
> > +++ b/include/linux/thunderbolt.h
> > @@ -533,6 +533,7 @@ struct tb_nhi {
> > bool going_away;
> > bool iommu_dma_protection;
> > int irq;
> > + int wake_irq;
> > struct work_struct interrupt_work;
> > u32 hop_count;
> > unsigned long quirks;
> > --
> > 2.43.0
next prev parent reply other threads:[~2026-11-03 9:05 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-30 8:25 [PATCH 0/4] add support platform nhi driver Chunfeng Yun
2026-10-30 8:25 ` [PATCH 1/4] thunderbolt: add " Chunfeng Yun
2026-10-30 8:47 ` Mika Westerberg
2026-10-31 3:41 ` kernel test robot
2026-10-31 20:03 ` kernel test robot
2026-10-30 8:25 ` [PATCH 2/4] thunderbolt: add support optional dedicated wakeup irq Chunfeng Yun
2026-10-30 8:48 ` Mika Westerberg
2026-11-03 9:05 ` Chunfeng Yun (云春峰) [this message]
2026-11-03 11:59 ` mika.westerberg
2026-10-30 8:25 ` [PATCH 3/4] thunderbolt: improve usb3 adapter link up timeout value Chunfeng Yun
2026-10-30 8:50 ` Mika Westerberg
2026-11-03 8:13 ` Chunfeng Yun (云春峰)
2026-10-30 8:25 ` [PATCH 4/4] thunderbolt: prevent pcie tunnel activation/teardown warnings Chunfeng Yun
2026-10-30 8:56 ` Mika Westerberg
2026-11-03 8:33 ` Chunfeng Yun (云春峰)
2026-11-03 12:48 ` mika.westerberg
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=34de87bb4da20626d440346f9aa0cf7873ef85d1.camel@mediatek.com \
--to=chunfeng.yun@mediatek.com \
--cc=YehezkelShB@gmail.com \
--cc=andreas.noever@gmail.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-usb@vger.kernel.org \
--cc=matthias.bgg@gmail.com \
--cc=mika.westerberg@linux.intel.com \
--cc=westeri@kernel.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
all inboxes | Powered by JetHome®