mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Chunfeng Yun (云春峰)" <Chunfeng.Yun@mediatek.com>
To: "konrad.dybcio@oss.qualcomm.com" <konrad.dybcio@oss.qualcomm.com>,
	"sven@kernel.org" <sven@kernel.org>,
	"westeri@kernel.org" <westeri@kernel.org>
Cc: "linux-usb@vger.kernel.org" <linux-usb@vger.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 1/4] thunderbolt: add platform nhi driver
Date: Wed, 11 Nov 2026 13:25:19 +0000	[thread overview]
Message-ID: <7113cfd5e83bd2319f7cd85ee49dadf5a4cbf86f.camel@mediatek.com> (raw)
In-Reply-To: <747061c1-def6-44ed-af18-18c4b7c2df09@oss.qualcomm.com>

On 一, 2026-11-09 at 14:56 +0100, Konrad Dybcio wrote:
> 
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
> 
> 
> On 11/7/26 8:04 PM, Sven Peter wrote:
> > > Add a new file plat.c to register platform NHI driver for
> > > MediaTek
> > > mt8901/mt8992 SoCs.
> > > 
> > > Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
> > > 
> > 
> > [...]
> > 
> > > +
> > > +static void nhi_plat_shutdown(struct platform_device *pdev)
> > > +{
> > > +    nhi_plat_do_remove(pdev, true);
> > > +}
> > > +
> > > +
> > > +#ifdef CONFIG_OF
> > > +static const struct of_device_id nhi_plat_of_match[] = {
> > > +    { .compatible = "thunderbolt-platform" },
> > 
> > Do you already have hardware that probes via device tree? You'll
> > have to
> > write bindings and get them reviewed before adding any compatible
> > here.
> > Generic ones like you used here aren't usually allowed.
> > 
> > If you don't have a dts based platform I'd probably drop this, not
> > much of
> > this code here is e.g. re-usable for Apple since they like to think
> > very
> > different, see my series in [1] that I can pick up again now that
> > we
> > made progress on how to represent connections between the NHI and
> > the
> > protocol adapters.
> > 
> > Not sure about qualcom since I haven't seen a series for the NHI
> > yet but
> > I'm sure Konrad can comment there. I kinda expect that it won't
> > have
> > much shared code either.
> 
> We're in the same boat regarding thinking different. This driver is
> for implementations where the underlying hardware is abstracted away
> (be it through architecture or intermediate firmware) and the TBT
> layer writes are enough to e.g. power sequence the connected buses,
> just like on Intel.
You are right, on MediaTek platforms, all vendor-specific operations
and power sequencing are hidden inside the firmware and handled via
ACPI events, so no vendor quirks are needed in the kernel driver
ideally, at least until now. This allows the exact same firmware to
support both Windows and Linux (Ubuntu) using a generic usb4 driver.

Thanks
> 
> For the OF compatible, we definitely do need bindings and I too would
> like to know if this is actually exercised - if not, we should cut it
> out and trivially bring it back when/if the need comes around.
> 
> > Take a look at e.g. more recent drivers in drivers/usb/dwc3: They
> > usually add a dwc3-$vendor.c file that takes care of all the
> > vendor-specific quirks and that ends up being nicer than a single
> > platform.c file with tons of quirks and separate code paths for
> > each and
> > every vendor.
> 
> Yeah, this is a nice parallel. Adding to it, there not only exist
> dwc3-$vendor drivers that take care of the additional registers and
> whatnot, but also everything around the USB subsystem - PHYs, perhaps
> some NoC drivers, and all the infra that feeds into there, and it
> compounds back into the size of some of those dwc3 glue drivers..
> 
> 
> That being said, the makers of the spec probably wanted/expected the
> hardware to have exactly this neat level of abstraction and I
> wouldn't be surprised if more designs end up being compatible. Or if
> the platform firmware makes it appear so.
> 
> Konrad


  parent reply	other threads:[~2026-11-11 13:25 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-30  8:25 [PATCH 0/4] add support " Chunfeng Yun
2026-10-30  8:25 ` [PATCH 1/4] thunderbolt: add " Chunfeng Yun
2026-10-30  8:47   ` Mika Westerberg
2026-11-04  7:34     ` Chunfeng Yun (云春峰)
2026-11-04  7:48       ` mika.westerberg
2026-11-05  9:13         ` Chunfeng Yun (云春峰)
2026-10-31  3:41   ` kernel test robot
2026-10-31 20:03   ` kernel test robot
2026-11-07 19:04   ` Sven Peter
2026-11-09 13:56     ` Konrad Dybcio
2026-11-09 17:35       ` Sven Peter
2026-11-11 13:25       ` Chunfeng Yun (云春峰) [this message]
2026-11-11 13:09     ` Chunfeng Yun (云春峰)
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 (云春峰)
2026-11-03 11:59       ` mika.westerberg
2026-11-04  7:05         ` Chunfeng Yun (云春峰)
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
2026-11-04  7:09         ` Chunfeng Yun (云春峰)
2026-11-04  8:08           ` mika.westerberg
2026-11-11  2:16             ` Chunfeng Yun (云春峰)

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=7113cfd5e83bd2319f7cd85ee49dadf5a4cbf86f.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=konrad.dybcio@oss.qualcomm.com \
    --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=sven@kernel.org \
    --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®