linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gpio: omap: prevent module from being unloaded while in use
@ 2015-06-25 15:13 Grygorii Strashko
  2015-06-30 13:52 ` Alexandre Courbot
  2015-07-16 12:27 ` Linus Walleij
  0 siblings, 2 replies; 4+ messages in thread
From: Grygorii Strashko @ 2015-06-25 15:13 UTC (permalink / raw)
  To: Linus Walleij, Alexandre Courbot, tony
  Cc: Sekhar Nori, Santosh Shilimkar, Javier Martinez Canillas,
	linux-omap, linux-gpio, linux-kernel, Grygorii Strashko

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.

Cc: Tony Lindgren <tony@atomide.com>
Fixes: cac089f9026e ('gpio: omap: Allow building as a loadable module')
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
---
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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] gpio: omap: prevent module from being unloaded while in use
  2015-06-25 15:13 [PATCH] gpio: omap: prevent module from being unloaded while in use Grygorii Strashko
@ 2015-06-30 13:52 ` Alexandre Courbot
  2015-07-06 15:15   ` Grygorii Strashko
  2015-07-16 12:27 ` Linus Walleij
  1 sibling, 1 reply; 4+ messages in thread
From: Alexandre Courbot @ 2015-06-30 13:52 UTC (permalink / raw)
  To: Grygorii Strashko
  Cc: Linus Walleij, tony, Sekhar Nori, Santosh Shilimkar,
	Javier Martinez Canillas, Linux OMAP Mailing List, linux-gpio,
	Linux Kernel Mailing List

On Fri, Jun 26, 2015 at 12:13 AM, Grygorii Strashko
<grygorii.strashko@ti.com> 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 <acourbot@nvidia.com>

For inclusion into -rc if the other patch is for the next cycle.

>
> Cc: Tony Lindgren <tony@atomide.com>
> Fixes: cac089f9026e ('gpio: omap: Allow building as a loadable module')
> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
> ---
> 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
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] gpio: omap: prevent module from being unloaded while in use
  2015-06-30 13:52 ` Alexandre Courbot
@ 2015-07-06 15:15   ` Grygorii Strashko
  0 siblings, 0 replies; 4+ messages in thread
From: Grygorii Strashko @ 2015-07-06 15:15 UTC (permalink / raw)
  To: Alexandre Courbot
  Cc: Linus Walleij, tony, Sekhar Nori, Santosh Shilimkar,
	Javier Martinez Canillas, Linux OMAP Mailing List, linux-gpio,
	Linux Kernel Mailing List

On 06/30/2015 04:52 PM, Alexandre Courbot wrote:
> On Fri, Jun 26, 2015 at 12:13 AM, Grygorii Strashko
> <grygorii.strashko@ti.com> 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 <acourbot@nvidia.com>
> 
> For inclusion into -rc if the other patch is for the next cycle.

Yes. I've sent this one for -rc as it's 100% fix and was not sure about
destiny of patch "gpiolib: assign chip owner.." :)


> 
>>
>> Cc: Tony Lindgren <tony@atomide.com>
>> Fixes: cac089f9026e ('gpio: omap: Allow building as a loadable module')
>> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
>> ---
>> 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
>>


-- 
regards,
-grygorii

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] gpio: omap: prevent module from being unloaded while in use
  2015-06-25 15:13 [PATCH] gpio: omap: prevent module from being unloaded while in use Grygorii Strashko
  2015-06-30 13:52 ` Alexandre Courbot
@ 2015-07-16 12:27 ` Linus Walleij
  1 sibling, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2015-07-16 12:27 UTC (permalink / raw)
  To: Grygorii Strashko
  Cc: Alexandre Courbot, Tony Lindgren, Sekhar Nori, Santosh Shilimkar,
	Javier Martinez Canillas, Linux-OMAP, linux-gpio, linux-kernel

On Thu, Jun 25, 2015 at 5:13 PM, Grygorii Strashko
<grygorii.strashko@ti.com> 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.
>
> Cc: Tony Lindgren <tony@atomide.com>
> Fixes: cac089f9026e ('gpio: omap: Allow building as a loadable module')
> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
> ---
> Hi Linus,
>
> Seems this one is for 4.2-rc.

Yup applied for fixes with Alex' ACK.

The bigger fix is applied for devel and the best way to handle this
is open for discussion.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-07-16 12:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-25 15:13 [PATCH] gpio: omap: prevent module from being unloaded while in use Grygorii Strashko
2015-06-30 13:52 ` Alexandre Courbot
2015-07-06 15:15   ` Grygorii Strashko
2015-07-16 12:27 ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).