[bisected] Re: Module removal-related regression?

From: Jakub Kicinski
Date: Sat Sep 09 2017 - 15:27:48 EST

On Sat, 9 Sep 2017 19:41:21 +0200, Jakub Kicinski wrote:
> Hi!
> I'm having trouble with modules on linux/master. rmmod succeeds but the
> module is still loaded and the refcount goes to 1:
> #rmmod nfp; insmod ./src/nfp.ko nfp_pf_netdev=0 ; \
> /opt/netronome/bin/nfp-hwinfo -n 2 assembly.partno \
> lsmod | grep nfp; \
> rmmod nfp; \
> lsmod | grep nfp
> nfp 249856 0
> nfp 200704 1
> If I rmmod again the module will be actually unloaded. The user space
> is mostly Ubuntu 14.04. Has anyone seen this? I'm trying to bisect
> now...

Got 'em!

commit 1455cf8dbfd06aa7651dcfccbadb7a093944ca65 (HEAD, refs/bisect/bad)
Author: Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx>
Date: Wed Jul 19 17:24:30 2017 -0700

driver core: emit uevents when device is bound to a driver

There are certain touch controllers that may come up in either normal
(application) or boot mode, depending on whether firmware/configuration is
corrupted when they are powered on. In boot mode the kernel does not create
input device instance (because it does not necessarily know the
characteristics of the input device in question).

Another number of controllers does not store firmware in a non-volatile
memory, and they similarly need to have firmware loaded before input device
instance is created. There are also other types of devices with similar

There is a desire to be able to trigger firmware loading via udev, but it
has to happen only when driver is bound to a physical device (i2c or spi).
These udev actions can not use ADD events, as those happen too early, so we
are introducing BIND and UNBIND events that are emitted at the right

Also, many drivers create additional driver-specific device attributes
when binding to the device, to provide userspace with additional controls.
The new events allow userspace to adjust these driver-specific attributes
without worrying that they are not there yet.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

Heeello... :)