From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753630AbbF3Nwy (ORCPT ); Tue, 30 Jun 2015 09:52:54 -0400 Received: from mail-oi0-f46.google.com ([209.85.218.46]:34425 "EHLO mail-oi0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752379AbbF3Nwp (ORCPT ); Tue, 30 Jun 2015 09:52:45 -0400 MIME-Version: 1.0 In-Reply-To: <1435245213-17858-1-git-send-email-grygorii.strashko@ti.com> References: <1435245213-17858-1-git-send-email-grygorii.strashko@ti.com> From: Alexandre Courbot Date: Tue, 30 Jun 2015 22:52:21 +0900 Message-ID: Subject: Re: [PATCH] gpio: omap: prevent module from being unloaded while in use To: Grygorii Strashko Cc: Linus Walleij , tony@atomide.com, Sekhar Nori , Santosh Shilimkar , Javier Martinez Canillas , Linux OMAP Mailing List , "linux-gpio@vger.kernel.org" , Linux Kernel Mailing List Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 26, 2015 at 12:13 AM, Grygorii Strashko wrote: > OMAP GPIO driver allowed to be built as loadable module, but it > doesn't set owner field in GPIO chip structure. As result, > module_get/put() API is not working and it's possible to unload > OMAP driver while in use: > > omap_gpio 48051000.gpio: REMOVING GPIOCHIP WITH GPIOS STILL REQUESTED > > Hence, add missing configuration. Isn't this also fixed by your other patch "gpiolib: assign chip owner to dev->driver->owner if not set"? Nevertheless, Acked-by: Alexandre Courbot For inclusion into -rc if the other patch is for the next cycle. > > Cc: Tony Lindgren > Fixes: cac089f9026e ('gpio: omap: Allow building as a loadable module') > Signed-off-by: Grygorii Strashko > --- > Hi Linus, > > Seems this one is for 4.2-rc. > > drivers/gpio/gpio-omap.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c > index a0ad803..61a731f 100644 > --- a/drivers/gpio/gpio-omap.c > +++ b/drivers/gpio/gpio-omap.c > @@ -1187,6 +1187,7 @@ static int omap_gpio_probe(struct platform_device *pdev) > bank->irq = res->start; > bank->dev = dev; > bank->chip.dev = dev; > + bank->chip.owner = THIS_MODULE; > bank->dbck_flag = pdata->dbck_flag; > bank->stride = pdata->bank_stride; > bank->width = pdata->bank_width; > -- > 2.4.4 >