linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Distinguish mediatek drivers
@ 2021-11-05 20:29 Bjorn Helgaas
  2021-11-08  3:17 ` Jianjun Wang
  0 siblings, 1 reply; 5+ messages in thread
From: Bjorn Helgaas @ 2021-11-05 20:29 UTC (permalink / raw)
  To: Ryder Lee, Jianjun Wang
  Cc: Lorenzo Pieralisi, Rob Herring, Krzysztof Wilczyński,
	Fan Fei, Matthias Brugger, linux-mediatek, linux-pci

We have two MediaTek drivers: pcie-mediatek.c, which claims:

  .compatible = "mediatek,mt2701-pcie"
  .compatible = "mediatek,mt7623-pcie"
  .compatible = "mediatek,mt2712-pcie"
  .compatible = "mediatek,mt7622-pcie"
  .compatible = "mediatek,mt7629-pcie"

and pcie-mediatek-gen3.c, which claims:

  .compatible = "mediatek,mt8192-pcie"

The Kconfig text does not distinguish them.  Can somebody update these
entries so they do?  It's nice if we can mention model numbers or
product names that a user would recognize.

  config PCIE_MEDIATEK
        tristate "MediaTek PCIe controller"
        depends on ARCH_MEDIATEK || COMPILE_TEST
        depends on OF
        depends on PCI_MSI_IRQ_DOMAIN
        help
          Say Y here if you want to enable PCIe controller support on
          MediaTek SoCs.

  config PCIE_MEDIATEK_GEN3
        tristate "MediaTek Gen3 PCIe controller"
        depends on ARCH_MEDIATEK || COMPILE_TEST
        depends on PCI_MSI_IRQ_DOMAIN
        help
          Adds support for PCIe Gen3 MAC controller for MediaTek SoCs.
          This PCIe controller is compatible with Gen3, Gen2 and Gen1 speed,
          and support up to 256 MSI interrupt numbers for
          multi-function devices.

          Say Y here if you want to enable Gen3 PCIe controller support on
          MediaTek SoCs.

Both drivers are also named "mtk-pcie" and use the same internal
"mtk_" prefix on structs and functions.  Not a *huge* problem, but not
really ideal either.

Bjorn

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Distinguish mediatek drivers
  2021-11-05 20:29 Distinguish mediatek drivers Bjorn Helgaas
@ 2021-11-08  3:17 ` Jianjun Wang
  2021-11-08 15:52   ` Krzysztof Wilczyński
  0 siblings, 1 reply; 5+ messages in thread
From: Jianjun Wang @ 2021-11-08  3:17 UTC (permalink / raw)
  To: Bjorn Helgaas, Ryder Lee
  Cc: Lorenzo Pieralisi, Rob Herring, Krzysztof Wilczyński,
	Fan Fei, Matthias Brugger, linux-mediatek, linux-pci

Hi Bjorn,

Thanks for the reminder, I will send patches to update these entries.

Thanks.

On Fri, 2021-11-05 at 15:29 -0500, Bjorn Helgaas wrote:
> We have two MediaTek drivers: pcie-mediatek.c, which claims:
> 
>   .compatible = "mediatek,mt2701-pcie"
>   .compatible = "mediatek,mt7623-pcie"
>   .compatible = "mediatek,mt2712-pcie"
>   .compatible = "mediatek,mt7622-pcie"
>   .compatible = "mediatek,mt7629-pcie"
> 
> and pcie-mediatek-gen3.c, which claims:
> 
>   .compatible = "mediatek,mt8192-pcie"
> 
> The Kconfig text does not distinguish them.  Can somebody update
> these
> entries so they do?  It's nice if we can mention model numbers or
> product names that a user would recognize.
> 
>   config PCIE_MEDIATEK
>         tristate "MediaTek PCIe controller"
>         depends on ARCH_MEDIATEK || COMPILE_TEST
>         depends on OF
>         depends on PCI_MSI_IRQ_DOMAIN
>         help
>           Say Y here if you want to enable PCIe controller support on
>           MediaTek SoCs.
> 
>   config PCIE_MEDIATEK_GEN3
>         tristate "MediaTek Gen3 PCIe controller"
>         depends on ARCH_MEDIATEK || COMPILE_TEST
>         depends on PCI_MSI_IRQ_DOMAIN
>         help
>           Adds support for PCIe Gen3 MAC controller for MediaTek
> SoCs.
>           This PCIe controller is compatible with Gen3, Gen2 and Gen1
> speed,
>           and support up to 256 MSI interrupt numbers for
>           multi-function devices.
> 
>           Say Y here if you want to enable Gen3 PCIe controller
> support on
>           MediaTek SoCs.
> 
> Both drivers are also named "mtk-pcie" and use the same internal
> "mtk_" prefix on structs and functions.  Not a *huge* problem, but
> not
> really ideal either.
> 
> Bjorn

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Distinguish mediatek drivers
  2021-11-08  3:17 ` Jianjun Wang
@ 2021-11-08 15:52   ` Krzysztof Wilczyński
  2021-11-09  5:58     ` Jianjun Wang
  0 siblings, 1 reply; 5+ messages in thread
From: Krzysztof Wilczyński @ 2021-11-08 15:52 UTC (permalink / raw)
  To: Jianjun Wang
  Cc: Bjorn Helgaas, Ryder Lee, Lorenzo Pieralisi, Rob Herring,
	Fan Fei, Matthias Brugger, linux-mediatek, linux-pci

Hello,

[...]
> > Both drivers are also named "mtk-pcie" and use the same internal
> > "mtk_" prefix on structs and functions.  Not a *huge* problem, but
> > not really ideal either.
[...]
> Thanks for the reminder, I will send patches to update these entries.

Perhaps a silly question, but would it be possible to combine both drivers
into a single one that handless devices across all generations?

	Krzysztof

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Distinguish mediatek drivers
  2021-11-08 15:52   ` Krzysztof Wilczyński
@ 2021-11-09  5:58     ` Jianjun Wang
  2021-11-14  3:37       ` Krzysztof Wilczyński
  0 siblings, 1 reply; 5+ messages in thread
From: Jianjun Wang @ 2021-11-09  5:58 UTC (permalink / raw)
  To: Krzysztof Wilczyński
  Cc: Bjorn Helgaas, Ryder Lee, Lorenzo Pieralisi, Rob Herring,
	Fan Fei, Matthias Brugger, linux-mediatek, linux-pci

Hi Krzysztof,

That's really a good idea, yes, we can combine both drivers into a
single one. 

But the real problem is that the old driver has been used to a lot of
platforms and it works stable for now. When we combine these drivers,
we will have a very huge effort to adjust the driver style and test it
in all platforms.

We will check the possibilities but it may take more time to finish the
work.

Thanks.

On Mon, 2021-11-08 at 16:52 +0100, Krzysztof Wilczyński wrote:
> Hello,
> 
> [...]
> > > Both drivers are also named "mtk-pcie" and use the same internal
> > > "mtk_" prefix on structs and functions.  Not a *huge* problem,
> > > but
> > > not really ideal either.
> 
> [...]
> > Thanks for the reminder, I will send patches to update these
> > entries.
> 
> Perhaps a silly question, but would it be possible to combine both
> drivers
> into a single one that handless devices across all generations?
> 
> 	Krzysztof

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Distinguish mediatek drivers
  2021-11-09  5:58     ` Jianjun Wang
@ 2021-11-14  3:37       ` Krzysztof Wilczyński
  0 siblings, 0 replies; 5+ messages in thread
From: Krzysztof Wilczyński @ 2021-11-14  3:37 UTC (permalink / raw)
  To: Jianjun Wang
  Cc: Bjorn Helgaas, Ryder Lee, Lorenzo Pieralisi, Rob Herring,
	Fan Fei, Matthias Brugger, linux-mediatek, linux-pci

Hello!

> That's really a good idea, yes, we can combine both drivers into a
> single one. 
> 
> But the real problem is that the old driver has been used to a lot of
> platforms and it works stable for now. When we combine these drivers,
> we will have a very huge effort to adjust the driver style and test it
> in all platforms.

Some very good points, indeed.  The idea seems like a good idea, but in
reality it's not feasible, like you say.

Thank you!

	Krzysztof

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-11-14  3:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-05 20:29 Distinguish mediatek drivers Bjorn Helgaas
2021-11-08  3:17 ` Jianjun Wang
2021-11-08 15:52   ` Krzysztof Wilczyński
2021-11-09  5:58     ` Jianjun Wang
2021-11-14  3:37       ` Krzysztof Wilczyński

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).