Marvell10g driver missing MODULE_INIT & MODULE_EXIT

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Marvell10g driver missing MODULE_INIT & MODULE_EXIT

跳至解决方案
990 次查看
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 项奖励
回复
1 解答
843 次查看
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 项奖励
回复
3 回复数
890 次查看
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 项奖励
回复
867 次查看
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 项奖励
回复
844 次查看
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 项奖励
回复