2016-10-17 14:06:15

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 0/7] net: Fix module autoload for several platform drivers

Hello David,

I noticed that module autoload won't be working in a bunch of platform
drivers in the net subsystem and this patch series contains the fixes.

Best regards,
Javier


Javier Martinez Canillas (7):
net: nps_enet: Fix module autoload
net: ethernet: nb8800: Fix module autoload
net: hns: Fix hns_dsaf module autoload for OF registration
net: qcom/emac: Fix module autoload for OF registration
net: hisilicon: Fix hns_mdio module autoload for OF registration
net: dsa: b53: Fix module autoload
net: dsa: bcm_sf2: Fix module autoload for OF registration

drivers/net/dsa/b53/b53_mmap.c | 1 +
drivers/net/dsa/bcm_sf2.c | 1 +
drivers/net/ethernet/aurora/nb8800.c | 1 +
drivers/net/ethernet/ezchip/nps_enet.c | 1 +
drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c | 1 +
drivers/net/ethernet/hisilicon/hns_mdio.c | 1 +
drivers/net/ethernet/qualcomm/emac/emac.c | 1 +
7 files changed, 7 insertions(+)

--
2.7.4


2016-10-17 14:06:40

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 2/7] net: ethernet: nb8800: Fix module autoload

If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.

Export the module alias information using the MODULE_DEVICE_TABLE() macro.

Before this patch:

$ $ modinfo drivers/net/ethernet/aurora/nb8800.ko | grep alias
$

After this patch:

$ modinfo drivers/net/ethernet/aurora/nb8800.ko | grep alias
alias: of:N*T*Csigma,smp8734-ethernetC*
alias: of:N*T*Csigma,smp8734-ethernet
alias: of:N*T*Csigma,smp8642-ethernetC*
alias: of:N*T*Csigma,smp8642-ethernet
alias: of:N*T*Caurora,nb8800C*
alias: of:N*T*Caurora,nb8800

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/net/ethernet/aurora/nb8800.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/aurora/nb8800.c b/drivers/net/ethernet/aurora/nb8800.c
index 453dc0967125..d5f2ad1a5a30 100644
--- a/drivers/net/ethernet/aurora/nb8800.c
+++ b/drivers/net/ethernet/aurora/nb8800.c
@@ -1357,6 +1357,7 @@ static const struct of_device_id nb8800_dt_ids[] = {
},
{ }
};
+MODULE_DEVICE_TABLE(of, nb8800_dt_ids);

static int nb8800_probe(struct platform_device *pdev)
{
--
2.7.4

2016-10-17 14:06:51

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 1/7] net: nps_enet: Fix module autoload

If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.

Export the module alias information using the MODULE_DEVICE_TABLE() macro.

Before this patch:

$ modinfo drivers/net/ethernet/ezchip/nps_enet.ko | grep alias
$

After this patch:

$ modinfo drivers/net/ethernet/ezchip/nps_enet.ko | grep alias
alias: of:N*T*Cezchip,nps-mgt-enetC*
alias: of:N*T*Cezchip,nps-mgt-enet

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/net/ethernet/ezchip/nps_enet.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/ezchip/nps_enet.c b/drivers/net/ethernet/ezchip/nps_enet.c
index f928e6f79c89..223f35cc034c 100644
--- a/drivers/net/ethernet/ezchip/nps_enet.c
+++ b/drivers/net/ethernet/ezchip/nps_enet.c
@@ -669,6 +669,7 @@ static const struct of_device_id nps_enet_dt_ids[] = {
{ .compatible = "ezchip,nps-mgt-enet" },
{ /* Sentinel */ }
};
+MODULE_DEVICE_TABLE(of, nps_enet_dt_ids);

static struct platform_driver nps_enet_driver = {
.probe = nps_enet_probe,
--
2.7.4

2016-10-17 14:07:13

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 7/7] net: dsa: bcm_sf2: Fix module autoload for OF registration

If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.

Export the module alias information using the MODULE_DEVICE_TABLE() macro.

Before this patch:

$ modinfo drivers/net/dsa/bcm_sf2.ko | grep alias
alias: platform:brcm-sf2

After this patch:

$ modinfo drivers/net/dsa/bcm_sf2.ko | grep alias
alias: platform:brcm-sf2
alias: of:N*T*Cbrcm,bcm7445-switch-v4.0C*
alias: of:N*T*Cbrcm,bcm7445-switch-v4.0

Signed-off-by: Javier Martinez Canillas <[email protected]>

---

drivers/net/dsa/bcm_sf2.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c
index e218887f18b7..0427009bc924 100644
--- a/drivers/net/dsa/bcm_sf2.c
+++ b/drivers/net/dsa/bcm_sf2.c
@@ -1158,6 +1158,7 @@ static const struct of_device_id bcm_sf2_of_match[] = {
{ .compatible = "brcm,bcm7445-switch-v4.0" },
{ /* sentinel */ },
};
+MODULE_DEVICE_TABLE(of, bcm_sf2_of_match);

static struct platform_driver bcm_sf2_driver = {
.probe = bcm_sf2_sw_probe,
--
2.7.4

2016-10-17 14:07:32

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 6/7] net: dsa: b53: Fix module autoload

If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.

Export the module alias information using the MODULE_DEVICE_TABLE() macro.

Before this patch:

$ modinfo drivers/net/dsa/b53/b53_mmap.ko | grep alias
$

After this patch:

$ modinfo drivers/net/dsa/b53/b53_mmap.ko | grep alias
alias: of:N*T*Cbrcm,bcm63xx-switchC*
alias: of:N*T*Cbrcm,bcm63xx-switch
alias: of:N*T*Cbrcm,bcm6368-switchC*
alias: of:N*T*Cbrcm,bcm6368-switch
alias: of:N*T*Cbrcm,bcm6328-switchC*
alias: of:N*T*Cbrcm,bcm6328-switch
alias: of:N*T*Cbrcm,bcm3384-switchC*
alias: of:N*T*Cbrcm,bcm3384-switch

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/net/dsa/b53/b53_mmap.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/net/dsa/b53/b53_mmap.c b/drivers/net/dsa/b53/b53_mmap.c
index 76fb8552c9d9..ef63d24fef81 100644
--- a/drivers/net/dsa/b53/b53_mmap.c
+++ b/drivers/net/dsa/b53/b53_mmap.c
@@ -256,6 +256,7 @@ static const struct of_device_id b53_mmap_of_table[] = {
{ .compatible = "brcm,bcm63xx-switch" },
{ /* sentinel */ },
};
+MODULE_DEVICE_TABLE(of, b53_mmap_of_table);

static struct platform_driver b53_mmap_driver = {
.probe = b53_mmap_probe,
--
2.7.4

2016-10-17 14:07:51

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 5/7] net: hisilicon: Fix hns_mdio module autoload for OF registration

If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.

Export the module alias information using the MODULE_DEVICE_TABLE() macro.

Before this patch:

$ modinfo drivers/net/ethernet/hisilicon//hns_mdio.ko | grep alias
alias: platform:Hi-HNS_MDIO
alias: acpi*:HISI0141:*

After this patch:

$ modinfo drivers/net/ethernet/hisilicon//hns_mdio.ko | grep alias
alias: platform:Hi-HNS_MDIO
alias: of:N*T*Chisilicon,hns-mdioC*
alias: of:N*T*Chisilicon,hns-mdio
alias: of:N*T*Chisilicon,mdioC*
alias: of:N*T*Chisilicon,mdio
alias: acpi*:HISI0141:*

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/net/ethernet/hisilicon/hns_mdio.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/hisilicon/hns_mdio.c b/drivers/net/ethernet/hisilicon/hns_mdio.c
index 33f4c483af0f..501eb2090ca6 100644
--- a/drivers/net/ethernet/hisilicon/hns_mdio.c
+++ b/drivers/net/ethernet/hisilicon/hns_mdio.c
@@ -563,6 +563,7 @@ static const struct of_device_id hns_mdio_match[] = {
{.compatible = "hisilicon,hns-mdio"},
{}
};
+MODULE_DEVICE_TABLE(of, hns_mdio_match);

static const struct acpi_device_id hns_mdio_acpi_match[] = {
{ "HISI0141", 0 },
--
2.7.4

2016-10-17 14:08:11

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 3/7] net: hns: Fix hns_dsaf module autoload for OF registration

If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.

Export the module alias information using the MODULE_DEVICE_TABLE() macro.

Before this patch:

$ modinfo drivers/net/ethernet/hisilicon/hns/hns_dsaf.ko | grep alias
alias: acpi*:HISI00B2:*
alias: acpi*:HISI00B1:*

After this patch:

$ modinfo drivers/net/ethernet/hisilicon/hns/hns_dsaf.ko | grep alias
alias: acpi*:HISI00B2:*
alias: acpi*:HISI00B1:*
alias: of:N*T*Chisilicon,hns-dsaf-v2C*
alias: of:N*T*Chisilicon,hns-dsaf-v2
alias: of:N*T*Chisilicon,hns-dsaf-v1C*
alias: of:N*T*Chisilicon,hns-dsaf-v1

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c
index 8d70377f6624..8ea3d95fa483 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c
@@ -2751,6 +2751,7 @@ static const struct of_device_id g_dsaf_match[] = {
{.compatible = "hisilicon,hns-dsaf-v2"},
{}
};
+MODULE_DEVICE_TABLE(of, g_dsaf_match);

static struct platform_driver g_dsaf_driver = {
.probe = hns_dsaf_probe,
--
2.7.4

2016-10-17 14:08:21

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 4/7] net: qcom/emac: Fix module autoload for OF registration

If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.

Export the module alias information using the MODULE_DEVICE_TABLE() macro.

Before this patch:

$ modinfo drivers/net/ethernet/qualcomm/emac/qcom-emac.ko | grep alias
alias: platform:qcom-emac

After this patch:

$ modinfo drivers/net/ethernet/qualcomm/emac/qcom-emac.ko | grep alias
alias: platform:qcom-emac
alias: of:N*T*Cqcom,fsm9900-emacC*
alias: of:N*T*Cqcom,fsm9900-emac

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/net/ethernet/qualcomm/emac/emac.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/qualcomm/emac/emac.c b/drivers/net/ethernet/qualcomm/emac/emac.c
index 9bf3b2b82e95..4fede4b86538 100644
--- a/drivers/net/ethernet/qualcomm/emac/emac.c
+++ b/drivers/net/ethernet/qualcomm/emac/emac.c
@@ -575,6 +575,7 @@ static const struct of_device_id emac_dt_match[] = {
},
{}
};
+MODULE_DEVICE_TABLE(of, emac_dt_match);

#if IS_ENABLED(CONFIG_ACPI)
static const struct acpi_device_id emac_acpi_match[] = {
--
2.7.4

2016-10-17 14:16:01

by Måns Rullgård

[permalink] [raw]
Subject: Re: [PATCH 2/7] net: ethernet: nb8800: Fix module autoload

Javier Martinez Canillas <[email protected]> writes:

> If the driver is built as a module, autoload won't work because the module
> alias information is not filled. So user-space can't match the registered
> device with the corresponding module.
>
> Export the module alias information using the MODULE_DEVICE_TABLE() macro.
>
> Before this patch:
>
> $ $ modinfo drivers/net/ethernet/aurora/nb8800.ko | grep alias
> $
>
> After this patch:
>
> $ modinfo drivers/net/ethernet/aurora/nb8800.ko | grep alias
> alias: of:N*T*Csigma,smp8734-ethernetC*
> alias: of:N*T*Csigma,smp8734-ethernet
> alias: of:N*T*Csigma,smp8642-ethernetC*
> alias: of:N*T*Csigma,smp8642-ethernet
> alias: of:N*T*Caurora,nb8800C*
> alias: of:N*T*Caurora,nb8800
>
> Signed-off-by: Javier Martinez Canillas <[email protected]>

Acked-by: Mans Rullgard <[email protected]>

> ---
>
> drivers/net/ethernet/aurora/nb8800.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/ethernet/aurora/nb8800.c b/drivers/net/ethernet/aurora/nb8800.c
> index 453dc0967125..d5f2ad1a5a30 100644
> --- a/drivers/net/ethernet/aurora/nb8800.c
> +++ b/drivers/net/ethernet/aurora/nb8800.c
> @@ -1357,6 +1357,7 @@ static const struct of_device_id nb8800_dt_ids[] = {
> },
> { }
> };
> +MODULE_DEVICE_TABLE(of, nb8800_dt_ids);
>
> static int nb8800_probe(struct platform_device *pdev)
> {
> --

--
M?ns Rullg?rd

2016-10-17 14:40:42

by Timur Tabi

[permalink] [raw]
Subject: Re: [PATCH 4/7] net: qcom/emac: Fix module autoload for OF registration

Javier Martinez Canillas wrote:
> If the driver is built as a module, autoload won't work because the module
> alias information is not filled. So user-space can't match the registered
> device with the corresponding module.
>
> Export the module alias information using the MODULE_DEVICE_TABLE() macro.
>
> Before this patch:
>
> $ modinfo drivers/net/ethernet/qualcomm/emac/qcom-emac.ko | grep alias
> alias: platform:qcom-emac
>
> After this patch:
>
> $ modinfo drivers/net/ethernet/qualcomm/emac/qcom-emac.ko | grep alias
> alias: platform:qcom-emac
> alias: of:N*T*Cqcom,fsm9900-emacC*
> alias: of:N*T*Cqcom,fsm9900-emac
>
> Signed-off-by: Javier Martinez Canillas<[email protected]>

Acked-by: Timur Tabi <[email protected]>

--
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the
Code Aurora Forum, hosted by The Linux Foundation.

2016-10-17 17:06:01

by David Miller

[permalink] [raw]
Subject: Re: [PATCH 0/7] net: Fix module autoload for several platform drivers

From: Javier Martinez Canillas <[email protected]>
Date: Mon, 17 Oct 2016 11:05:39 -0300

> I noticed that module autoload won't be working in a bunch of platform
> drivers in the net subsystem and this patch series contains the fixes.

Looks good, series applied, thanks.