2020-09-18 18:16:30

by Kevin Hilman

[permalink] [raw]
Subject: [PATCH] pci: meson: build as module by default

Enable pci-meson to build as a module whenever ARCH_MESON is enabled.

Cc: Yue Wang <[email protected]>
Signed-off-by: Kevin Hilman <[email protected]>
---
Tested on Khadas VIM3 and Khadas VIM3 using NVMe SSD devices.

drivers/pci/controller/dwc/Kconfig | 3 ++-
drivers/pci/controller/dwc/pci-meson.c | 8 +++++++-
2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/controller/dwc/Kconfig b/drivers/pci/controller/dwc/Kconfig
index 044a3761c44f..bc049865f8e0 100644
--- a/drivers/pci/controller/dwc/Kconfig
+++ b/drivers/pci/controller/dwc/Kconfig
@@ -237,8 +237,9 @@ config PCIE_HISI_STB
Say Y here if you want PCIe controller support on HiSilicon STB SoCs

config PCI_MESON
- bool "MESON PCIe controller"
+ tristate "MESON PCIe controller"
depends on PCI_MSI_IRQ_DOMAIN
+ default m if ARCH_MESON
select PCIE_DW_HOST
help
Say Y here if you want to enable PCI controller support on Amlogic
diff --git a/drivers/pci/controller/dwc/pci-meson.c b/drivers/pci/controller/dwc/pci-meson.c
index 4f183b96afbb..7a1fb55ee44a 100644
--- a/drivers/pci/controller/dwc/pci-meson.c
+++ b/drivers/pci/controller/dwc/pci-meson.c
@@ -17,6 +17,7 @@
#include <linux/resource.h>
#include <linux/types.h>
#include <linux/phy/phy.h>
+#include <linux/module.h>

#include "pcie-designware.h"

@@ -589,6 +590,7 @@ static const struct of_device_id meson_pcie_of_match[] = {
},
{},
};
+MODULE_DEVICE_TABLE(of, meson_pcie_of_match);

static struct platform_driver meson_pcie_driver = {
.probe = meson_pcie_probe,
@@ -598,4 +600,8 @@ static struct platform_driver meson_pcie_driver = {
},
};

-builtin_platform_driver(meson_pcie_driver);
+module_platform_driver(meson_pcie_driver);
+
+MODULE_AUTHOR("Yue Wang <[email protected]>");
+MODULE_DESCRIPTION("Amlogic PCIe Controller driver");
+MODULE_LICENSE("Dual BSD/GPL");
--
2.28.0


2020-09-21 15:35:44

by Neil Armstrong

[permalink] [raw]
Subject: Re: [PATCH] pci: meson: build as module by default

On 18/09/2020 20:12, Kevin Hilman wrote:
> Enable pci-meson to build as a module whenever ARCH_MESON is enabled.
>
> Cc: Yue Wang <[email protected]>
> Signed-off-by: Kevin Hilman <[email protected]>
> ---
> Tested on Khadas VIM3 and Khadas VIM3 using NVMe SSD devices.
>
> drivers/pci/controller/dwc/Kconfig | 3 ++-
> drivers/pci/controller/dwc/pci-meson.c | 8 +++++++-
> 2 files changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pci/controller/dwc/Kconfig b/drivers/pci/controller/dwc/Kconfig
> index 044a3761c44f..bc049865f8e0 100644
> --- a/drivers/pci/controller/dwc/Kconfig
> +++ b/drivers/pci/controller/dwc/Kconfig
> @@ -237,8 +237,9 @@ config PCIE_HISI_STB
> Say Y here if you want PCIe controller support on HiSilicon STB SoCs
>
> config PCI_MESON
> - bool "MESON PCIe controller"
> + tristate "MESON PCIe controller"
> depends on PCI_MSI_IRQ_DOMAIN
> + default m if ARCH_MESON
> select PCIE_DW_HOST
> help
> Say Y here if you want to enable PCI controller support on Amlogic
> diff --git a/drivers/pci/controller/dwc/pci-meson.c b/drivers/pci/controller/dwc/pci-meson.c
> index 4f183b96afbb..7a1fb55ee44a 100644
> --- a/drivers/pci/controller/dwc/pci-meson.c
> +++ b/drivers/pci/controller/dwc/pci-meson.c
> @@ -17,6 +17,7 @@
> #include <linux/resource.h>
> #include <linux/types.h>
> #include <linux/phy/phy.h>
> +#include <linux/module.h>
>
> #include "pcie-designware.h"
>
> @@ -589,6 +590,7 @@ static const struct of_device_id meson_pcie_of_match[] = {
> },
> {},
> };
> +MODULE_DEVICE_TABLE(of, meson_pcie_of_match);
>
> static struct platform_driver meson_pcie_driver = {
> .probe = meson_pcie_probe,
> @@ -598,4 +600,8 @@ static struct platform_driver meson_pcie_driver = {
> },
> };
>
> -builtin_platform_driver(meson_pcie_driver);
> +module_platform_driver(meson_pcie_driver);
> +
> +MODULE_AUTHOR("Yue Wang <[email protected]>");
> +MODULE_DESCRIPTION("Amlogic PCIe Controller driver");
> +MODULE_LICENSE("Dual BSD/GPL");
>

Reviewed-by: Neil Armstrong <[email protected]>

2020-09-25 21:14:58

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH] pci: meson: build as module by default

On Fri, Sep 18, 2020 at 11:12:51AM -0700, Kevin Hilman wrote:
> Enable pci-meson to build as a module whenever ARCH_MESON is enabled.
>
> Cc: Yue Wang <[email protected]>
> Signed-off-by: Kevin Hilman <[email protected]>
> ---
> Tested on Khadas VIM3 and Khadas VIM3 using NVMe SSD devices.
>
> drivers/pci/controller/dwc/Kconfig | 3 ++-
> drivers/pci/controller/dwc/pci-meson.c | 8 +++++++-
> 2 files changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pci/controller/dwc/Kconfig b/drivers/pci/controller/dwc/Kconfig
> index 044a3761c44f..bc049865f8e0 100644
> --- a/drivers/pci/controller/dwc/Kconfig
> +++ b/drivers/pci/controller/dwc/Kconfig
> @@ -237,8 +237,9 @@ config PCIE_HISI_STB
> Say Y here if you want PCIe controller support on HiSilicon STB SoCs
>
> config PCI_MESON
> - bool "MESON PCIe controller"
> + tristate "MESON PCIe controller"
> depends on PCI_MSI_IRQ_DOMAIN
> + default m if ARCH_MESON
> select PCIE_DW_HOST
> help
> Say Y here if you want to enable PCI controller support on Amlogic
> diff --git a/drivers/pci/controller/dwc/pci-meson.c b/drivers/pci/controller/dwc/pci-meson.c
> index 4f183b96afbb..7a1fb55ee44a 100644
> --- a/drivers/pci/controller/dwc/pci-meson.c
> +++ b/drivers/pci/controller/dwc/pci-meson.c
> @@ -17,6 +17,7 @@
> #include <linux/resource.h>
> #include <linux/types.h>
> #include <linux/phy/phy.h>
> +#include <linux/module.h>
>
> #include "pcie-designware.h"
>
> @@ -589,6 +590,7 @@ static const struct of_device_id meson_pcie_of_match[] = {
> },
> {},
> };
> +MODULE_DEVICE_TABLE(of, meson_pcie_of_match);
>
> static struct platform_driver meson_pcie_driver = {
> .probe = meson_pcie_probe,

You need a remove hook to tear down the PCI bus at least.

Really I'd like to add a devres hook in pci_host_probe to do that for
all the drivers.

> @@ -598,4 +600,8 @@ static struct platform_driver meson_pcie_driver = {
> },
> };
>
> -builtin_platform_driver(meson_pcie_driver);
> +module_platform_driver(meson_pcie_driver);
> +
> +MODULE_AUTHOR("Yue Wang <[email protected]>");
> +MODULE_DESCRIPTION("Amlogic PCIe Controller driver");
> +MODULE_LICENSE("Dual BSD/GPL");

First line is: SPDX-License-Identifier: GPL-2.0

> --
> 2.28.0
>
>
> _______________________________________________
> linux-amlogic mailing list
> [email protected]
> http://lists.infradead.org/mailman/listinfo/linux-amlogic

2020-09-28 16:38:17

by Lorenzo Pieralisi

[permalink] [raw]
Subject: Re: [PATCH] pci: meson: build as module by default

On Fri, Sep 18, 2020 at 11:12:51AM -0700, Kevin Hilman wrote:
> Enable pci-meson to build as a module whenever ARCH_MESON is enabled.
>
> Cc: Yue Wang <[email protected]>
> Signed-off-by: Kevin Hilman <[email protected]>
> ---
> Tested on Khadas VIM3 and Khadas VIM3 using NVMe SSD devices.
>
> drivers/pci/controller/dwc/Kconfig | 3 ++-
> drivers/pci/controller/dwc/pci-meson.c | 8 +++++++-
> 2 files changed, 9 insertions(+), 2 deletions(-)

Applied to pci/meson, thanks.

Lorenzo

> diff --git a/drivers/pci/controller/dwc/Kconfig b/drivers/pci/controller/dwc/Kconfig
> index 044a3761c44f..bc049865f8e0 100644
> --- a/drivers/pci/controller/dwc/Kconfig
> +++ b/drivers/pci/controller/dwc/Kconfig
> @@ -237,8 +237,9 @@ config PCIE_HISI_STB
> Say Y here if you want PCIe controller support on HiSilicon STB SoCs
>
> config PCI_MESON
> - bool "MESON PCIe controller"
> + tristate "MESON PCIe controller"
> depends on PCI_MSI_IRQ_DOMAIN
> + default m if ARCH_MESON
> select PCIE_DW_HOST
> help
> Say Y here if you want to enable PCI controller support on Amlogic
> diff --git a/drivers/pci/controller/dwc/pci-meson.c b/drivers/pci/controller/dwc/pci-meson.c
> index 4f183b96afbb..7a1fb55ee44a 100644
> --- a/drivers/pci/controller/dwc/pci-meson.c
> +++ b/drivers/pci/controller/dwc/pci-meson.c
> @@ -17,6 +17,7 @@
> #include <linux/resource.h>
> #include <linux/types.h>
> #include <linux/phy/phy.h>
> +#include <linux/module.h>
>
> #include "pcie-designware.h"
>
> @@ -589,6 +590,7 @@ static const struct of_device_id meson_pcie_of_match[] = {
> },
> {},
> };
> +MODULE_DEVICE_TABLE(of, meson_pcie_of_match);
>
> static struct platform_driver meson_pcie_driver = {
> .probe = meson_pcie_probe,
> @@ -598,4 +600,8 @@ static struct platform_driver meson_pcie_driver = {
> },
> };
>
> -builtin_platform_driver(meson_pcie_driver);
> +module_platform_driver(meson_pcie_driver);
> +
> +MODULE_AUTHOR("Yue Wang <[email protected]>");
> +MODULE_DESCRIPTION("Amlogic PCIe Controller driver");
> +MODULE_LICENSE("Dual BSD/GPL");
> --
> 2.28.0
>

2020-10-02 18:55:07

by Kevin Hilman

[permalink] [raw]
Subject: Re: [PATCH] pci: meson: build as module by default

Hi Lorenzo,

Lorenzo Pieralisi <[email protected]> writes:

> On Fri, Sep 18, 2020 at 11:12:51AM -0700, Kevin Hilman wrote:
>> Enable pci-meson to build as a module whenever ARCH_MESON is enabled.
>>
>> Cc: Yue Wang <[email protected]>
>> Signed-off-by: Kevin Hilman <[email protected]>
>> ---
>> Tested on Khadas VIM3 and Khadas VIM3 using NVMe SSD devices.
>>
>> drivers/pci/controller/dwc/Kconfig | 3 ++-
>> drivers/pci/controller/dwc/pci-meson.c | 8 +++++++-
>> 2 files changed, 9 insertions(+), 2 deletions(-)
>
> Applied to pci/meson, thanks.

Rob pointed out that the MODULE_LICENCE wasn't the same as the SPDX
header. Could you squash the update below before submitting?

Thanks,

Kevin


diff --git a/drivers/pci/controller/dwc/pci-meson.c b/drivers/pci/controller/dwc/pci-meson.c
index 7a1fb55ee44a..35b167e907aa 100644
--- a/drivers/pci/controller/dwc/pci-meson.c
+++ b/drivers/pci/controller/dwc/pci-meson.c
@@ -604,4 +604,4 @@ module_platform_driver(meson_pcie_driver);

MODULE_AUTHOR("Yue Wang <[email protected]>");
MODULE_DESCRIPTION("Amlogic PCIe Controller driver");
-MODULE_LICENSE("Dual BSD/GPL");
+MODULE_LICENSE("GPL v2");

2020-10-05 12:07:56

by Lorenzo Pieralisi

[permalink] [raw]
Subject: Re: [PATCH] pci: meson: build as module by default

On Fri, Oct 02, 2020 at 11:53:27AM -0700, Kevin Hilman wrote:
> Hi Lorenzo,
>
> Lorenzo Pieralisi <[email protected]> writes:
>
> > On Fri, Sep 18, 2020 at 11:12:51AM -0700, Kevin Hilman wrote:
> >> Enable pci-meson to build as a module whenever ARCH_MESON is enabled.
> >>
> >> Cc: Yue Wang <[email protected]>
> >> Signed-off-by: Kevin Hilman <[email protected]>
> >> ---
> >> Tested on Khadas VIM3 and Khadas VIM3 using NVMe SSD devices.
> >>
> >> drivers/pci/controller/dwc/Kconfig | 3 ++-
> >> drivers/pci/controller/dwc/pci-meson.c | 8 +++++++-
> >> 2 files changed, 9 insertions(+), 2 deletions(-)
> >
> > Applied to pci/meson, thanks.
>
> Rob pointed out that the MODULE_LICENCE wasn't the same as the SPDX
> header. Could you squash the update below before submitting?

Hi Kevin,

done thanks.

Lorenzo