On Mon, Apr 25, 2016 at 11:32 AM, Cao Minh Hiep <cm-hiep@xxxxxxxxxxx> wrote: > Hello Linus Walleij-san > > We have tested Linux upstream v4.6-rc2 on Renesas's Lager board. > When we tried to unbind the e6051000.gpio, the following warning messages > occurs: > > "root@linaro-nano:/sys/bus/platform/drivers/gpio_rcar# echo e6051000.gpio > > unbind > [ 241.511034] ------------[ cut here ]------------ > [ 241.525054] WARNING: CPU: 0 PID: 2104 at fs/proc/generic.c:575 > remove_proc_entry+0x13c/0x160 > [ 241.550456] remove_proc_entry: removing non-empty directory 'irq/169', > leaking at least '6-0039' Do you mean that you set up a handler in userspace, using the deprecated sysfs ABI and then unbind the module providing the IRQ resource? > And we found a patch between v4.5 and v4.6-rc2 that causing of this issue. > The patch is "ff2b1359 gpio: make the gpiochip a real device" It seems the issue is not a bug in the kernel, the issue is that the kernel is warning you about something that was wrong also before but you didn't get a warning for it until now. It is not OK to unbind a driver providing IRQs. It is even unclear if we should even allow modules to provide IRQs because there is no way to handle irqchips going away when it has consumers. Maybe we should just do this? diff --git a/drivers/gpio/gpio-rcar.c b/drivers/gpio/gpio-rcar.c index 3fe8e773d95c..ae5e81358ec5 100644 --- a/drivers/gpio/gpio-rcar.c +++ b/drivers/gpio/gpio-rcar.c @@ -562,6 +562,7 @@ static struct platform_driver gpio_rcar_device_driver = { .driver = { .name = "gpio_rcar", .of_match_table = of_match_ptr(gpio_rcar_of_table), + .suppress_bind_attrs = true, } }; Yours, Linus Walleij