[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMZdPi8W750LSFLNOCrgRqbS78kWTZEe5hsJenEWNVjA=Tw+Kg@mail.gmail.com>
Date: Tue, 22 Jun 2021 15:51:41 +0200
From: Loic Poulain <loic.poulain@...aro.org>
To: Sergey Ryazanov <ryazanov.s.a@...il.com>
Cc: Johannes Berg <johannes@...solutions.net>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Network Development <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next v2 07/10] wwan: core: no more hold netdev ops
owning module
On Tue, 22 Jun 2021 at 00:51, Sergey Ryazanov <ryazanov.s.a@...il.com> wrote:
>
> The WWAN netdev ops owner holding was used to protect from the
> unexpected memory disappear. This approach causes a dependency cycle
> (driver -> core -> driver) and effectively prevents a WWAN driver
> unloading. E.g. WWAN hwsim could not be unloaded until all simulated
> devices are removed:
>
> ~# modprobe wwan_hwsim devices=2
> ~# lsmod | grep wwan
> wwan_hwsim 16384 2
> wwan 20480 1 wwan_hwsim
> ~# rmmod wwan_hwsim
> rmmod: ERROR: Module wwan_hwsim is in use
> ~# echo > /sys/kernel/debug/wwan_hwsim/hwsim0/destroy
> ~# echo > /sys/kernel/debug/wwan_hwsim/hwsim1/destroy
> ~# lsmod | grep wwan
> wwan_hwsim 16384 0
> wwan 20480 1 wwan_hwsim
> ~# rmmod wwan_hwsim
>
> For a real device driver this will cause an inability to unload module
> until a served device is physically detached.
>
> Since the last commit we are removing all child netdev(s) when a driver
> unregister the netdev ops. This allows us to permit the driver
> unloading, since any sane driver will call ops unregistering on a device
> deinitialization. So, remove the holding of an ops owner to make it
> easier to unload a driver module. The owner field has also beed removed
> from the ops structure as there are no more users of this field.
>
> Signed-off-by: Sergey Ryazanov <ryazanov.s.a@...il.com>
Reviewed-by: Loic Poulain <loic.poulain@...aro.org>
Powered by blists - more mailing lists