Marvell10g driver missing MODULE_INIT & MODULE_EXIT

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Marvell10g driver missing MODULE_INIT & MODULE_EXIT

Jump to solution
991 Views
gfine1
Contributor III

In an attempt to see if a driver is loading, we added a printk() to the probe and _init functions.  The text will not display.  

I noticed the driver is missing the MODULE_INIT and MODULE_EXIT macros that drivers usually have. 

How is this driver executing if it is missing these macros? I recompiled it as a kernel Loadable module (.ko). When I do an insmod marvell10g.ko there is no output to the console.  

This is the marvell10g.c file located in the kernel tree under drivers/net/phy

 Is there a fix or workaround or is this driver properly using the probe and init properly? 

0 Kudos
Reply
1 Solution
844 Views
yipingwang
NXP TechSupport
NXP TechSupport

Checked the marvell10g.c in kernel code, marvell driver is not a single module but loaded in module_phy_driver as below, so no need adding MODULE_INIT & MODULE_EXIT, two macros.
module_phy_driver(mv3310_drivers);
Another issue, text did not displayed in printk(). Please make sure you do right modification of device tree refer to this structure defined in marvell10g.c
static struct phy_driver mv3310_drivers[] = {
{
.phy_id = MARVELL_PHY_ID_88X3310,
.phy_id_mask = MARVELL_PHY_ID_MASK,
.match_phy_device = mv3310_match_phy_device,
.name = "mv88x3310",
.driver_data = &mv3310_type,
.get_features = mv3310_get_features,
.config_init = mv3310_config_init,
.probe = mv3310_probe,

Also please compared with the aquantia PHY code in kernel. What's more, please share your change in device tree, we can check it on my side.

View solution in original post

0 Kudos
Reply
3 Replies
891 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please refer to the following update from the AE team.

Firstly, in my opinion, no limitation that the driver must use those two Micro 'MODULE_INIT & MODULE_EXIT' in source code. What's more, please make sure that, using correct serdes configuration, Kernel configuration and right device tree setting.

0 Kudos
Reply
868 Views
gfine1
Contributor III

We need to see that the driver loads and inits and that printks are displayed. Usually, Linux drivers have an entry and exit point supplied by the aforementioned macros.  If they are not needed than what are the entry and exit points? We have the Device tree setup set to our configuration, and still no sign of the DD loading. 

0 Kudos
Reply
845 Views
yipingwang
NXP TechSupport
NXP TechSupport

Checked the marvell10g.c in kernel code, marvell driver is not a single module but loaded in module_phy_driver as below, so no need adding MODULE_INIT & MODULE_EXIT, two macros.
module_phy_driver(mv3310_drivers);
Another issue, text did not displayed in printk(). Please make sure you do right modification of device tree refer to this structure defined in marvell10g.c
static struct phy_driver mv3310_drivers[] = {
{
.phy_id = MARVELL_PHY_ID_88X3310,
.phy_id_mask = MARVELL_PHY_ID_MASK,
.match_phy_device = mv3310_match_phy_device,
.name = "mv88x3310",
.driver_data = &mv3310_type,
.get_features = mv3310_get_features,
.config_init = mv3310_config_init,
.probe = mv3310_probe,

Also please compared with the aquantia PHY code in kernel. What's more, please share your change in device tree, we can check it on my side.

0 Kudos
Reply