Re: [PATCH 2/3] usb: xhci: Add support for Google XHCI controller

From: Puma Hsu
Date: Wed Feb 21 2024 - 04:33:58 EST


On Mon, Feb 19, 2024 at 8:22 PM Krzysztof Kozlowski <krzk@xxxxxxxxxx> wrote:
>
> On 19/02/2024 07:10, Puma Hsu wrote:
> > In our SoC platform, we support allocating dedicated memory spaces
> > other than system memory for XHCI, which also requires IOMMU mapping.
> > The rest of driver probing and executing will use the generic
> > xhci-plat driver.
> >
> > We support USB dual roles and switch roles by generic dwc3 driver,
> > the dwc3 driver always probes xhci-plat driver now, so we introduce
> > a device tree property to probe a XHCI glue driver.
> >
> > Sample:
> > xhci_dma: xhci_dma@99C0000 {
> > compatible = "shared-dma-pool";
> > reg = <0x00000000 0x99C0000 0x00000000 0x40000>;
> > no-map;
> > };
> >
> > dwc3: dwc3@c400000 {
> > compatible = "snps,dwc3";
> > reg = <0 0x0c400000 0 0x10000>;
> > xhci-glue = "xhci-hcd-goog";
>
> NAK, that's not DWC3 hardware in such case.

By introducing this property, users can specify the name of their
dedicated driver in the device tree. The generic dwc3 driver will
read this property to initiate the probing of the dedicated driver.
The motivation behind this is that we have dedicated things
(described in commit message) to do for the XHCI driver in our
device. BTW, I put this property here because currently there is
no xhci node, xhci related properties are put under dwc3 node.
It will be appreciated if there are alternative or more appropriate
approaches, we welcome discussion to explore the best possible
solution. Thanks.

>
> ...
>
> > return -ENOMEM;
> > diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
> > index 4448d0ab06f0..1c1613c548d9 100644
> > --- a/drivers/usb/host/Kconfig
> > +++ b/drivers/usb/host/Kconfig
> > @@ -61,6 +61,12 @@ config USB_XHCI_PLATFORM
> >
> > If unsure, say N.
> >
> > +config USB_XHCI_GOOG
> > + tristate "xHCI support for Google Tensor SoCs"
> > + help
>
> Please always Cc Google Tensor SoC maintainers and Samsung SoC
> maintainers on your contributions around Google Tensor SoC.
>
> Anyway you just tried to push vendor code to upstream without aligning
> it to usptream code style and to proper driver model. That's not good.
> Please work with your colleagues in Google to explain how to upstream
> vendor code. There were many, many trainings and presentations. One
> coming from Dmitry will be in EOSS24 in two months.

Thank you for advising. I will find the training and study it first, and will cc
the related maintainers in future code uploading.

>
> Best regards,
> Krzysztof
>