RE: [PATCH net v2 2/2] net: phylink: Add module_exit_stub()

From: Gan, Yi Fang
Date: Thu Jan 04 2024 - 04:46:09 EST


Hi Andrew,

The function phylink_init() is introduced by others.
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-6.6.y&id=eca68a3c7d05b38b4e728cead0c49718f2bc1d5a
The module_exit() is added by referring to
https://elixir.bootlin.com/linux/latest/source/kernel/module/main.c#L738.
Since the macro function is rejected, I will send a V3.
Let's see if Rusell King has any comment. Thanks.


Best Regards,
Gan Yi Fang

> -----Original Message-----
> From: Andrew Lunn <andrew@xxxxxxx>
> Sent: Thursday, December 21, 2023 5:23 PM
> To: Gan, Yi Fang <yi.fang.gan@xxxxxxxxx>
> Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>; Andrew Halaney
> <ahalaney@xxxxxxxxxx>; Javier Martinez Canillas <javierm@xxxxxxxxxx>; John
> Stultz <jstultz@xxxxxxxxxx>; Rafael J . Wysocki <rafael@xxxxxxxxxx>; Jens Axboe
> <axboe@xxxxxxxxx>; Russell King <linux@xxxxxxxxxxxxxxx>; Heiner Kallweit
> <hkallweit1@xxxxxxxxx>; David S . Miller <davem@xxxxxxxxxxxxx>; Eric
> Dumazet <edumazet@xxxxxxxxxx>; Jakub Kicinski <kuba@xxxxxxxxxx>; Paolo
> Abeni <pabeni@xxxxxxxxxx>; Marek Behún <kabel@xxxxxxxxxx>;
> netdev@xxxxxxxxxxxxxxx; linux-stm32@xxxxxxxxxxxxxxxxxxxxxxxxxxxx; linux-
> arm-kernel@xxxxxxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; Looi, Hong Aun
> <hong.aun.looi@xxxxxxxxx>; Voon, Weifeng <weifeng.voon@xxxxxxxxx>; Song,
> Yoong Siang <yoong.siang.song@xxxxxxxxx>; Lai, Peter Jun Ann
> <peter.jun.ann.lai@xxxxxxxxx>; Choong, Yong Liang
> <yong.liang.choong@xxxxxxxxx>
> Subject: Re: [PATCH net v2 2/2] net: phylink: Add module_exit_stub()
>
> On Thu, Dec 21, 2023 at 04:51:09PM +0800, Gan, Yi Fang wrote:
> > In delete_module(), if mod->init callback is defined but mod->exit
> > callback is not defined, it will assume the module cannot be removed
> > and return EBUSY. The module_exit() is missing from current phylink
> > module drive causing failure while unloading it.
>
> You are missing justification it is actually safe to remove phylink. Maybe Russell
> King deliberately did not implement
> module_exit() because it can explode in interesting ways if it was?
>
> Andrew