linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pwm: bcm-iproc: prevent unloading the driver module while in use
@ 2019-10-17 19:22 Uwe Kleine-König
  2019-10-17 19:29 ` Florian Fainelli
  2019-10-24  7:36 ` Uwe Kleine-König
  0 siblings, 2 replies; 3+ messages in thread
From: Uwe Kleine-König @ 2019-10-17 19:22 UTC (permalink / raw)
  To: Thierry Reding, Yendapally Reddy Dhananjaya Reddy, Ray Jui,
	Scott Branden
  Cc: linux-pwm, bcm-kernel-feedback-list, kernel, linux-arm-kernel

The owner member of struct pwm_ops must be set to THIS_MODULE to
increase the reference count of the module such that the module cannot
be removed while its code is in use.

Fixes: daa5abc41c80 ("pwm: Add support for Broadcom iProc PWM controller")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/pwm/pwm-bcm-iproc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/pwm/pwm-bcm-iproc.c b/drivers/pwm/pwm-bcm-iproc.c
index 56c38cfae92c..1f829edd8ee7 100644
--- a/drivers/pwm/pwm-bcm-iproc.c
+++ b/drivers/pwm/pwm-bcm-iproc.c
@@ -187,6 +187,7 @@ static int iproc_pwmc_apply(struct pwm_chip *chip, struct pwm_device *pwm,
 static const struct pwm_ops iproc_pwm_ops = {
 	.apply = iproc_pwmc_apply,
 	.get_state = iproc_pwmc_get_state,
+	.owner = THIS_MODULE,
 };
 
 static int iproc_pwmc_probe(struct platform_device *pdev)
-- 
2.23.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] pwm: bcm-iproc: prevent unloading the driver module while in use
  2019-10-17 19:22 [PATCH] pwm: bcm-iproc: prevent unloading the driver module while in use Uwe Kleine-König
@ 2019-10-17 19:29 ` Florian Fainelli
  2019-10-24  7:36 ` Uwe Kleine-König
  1 sibling, 0 replies; 3+ messages in thread
From: Florian Fainelli @ 2019-10-17 19:29 UTC (permalink / raw)
  To: Uwe Kleine-König, Thierry Reding,
	Yendapally Reddy Dhananjaya Reddy, Ray Jui, Scott Branden
  Cc: linux-pwm, bcm-kernel-feedback-list, kernel, linux-arm-kernel



On 10/17/2019 12:22 PM, Uwe Kleine-König wrote:
> The owner member of struct pwm_ops must be set to THIS_MODULE to
> increase the reference count of the module such that the module cannot
> be removed while its code is in use.
> 
> Fixes: daa5abc41c80 ("pwm: Add support for Broadcom iProc PWM controller")
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] pwm: bcm-iproc: prevent unloading the driver module while in use
  2019-10-17 19:22 [PATCH] pwm: bcm-iproc: prevent unloading the driver module while in use Uwe Kleine-König
  2019-10-17 19:29 ` Florian Fainelli
@ 2019-10-24  7:36 ` Uwe Kleine-König
  1 sibling, 0 replies; 3+ messages in thread
From: Uwe Kleine-König @ 2019-10-24  7:36 UTC (permalink / raw)
  To: Thierry Reding, Yendapally Reddy Dhananjaya Reddy, Ray Jui,
	Scott Branden
  Cc: linux-pwm, bcm-kernel-feedback-list, kernel, linux-arm-kernel

Hello,

On Thu, Oct 17, 2019 at 09:22:18PM +0200, Uwe Kleine-König wrote:
> The owner member of struct pwm_ops must be set to THIS_MODULE to
> increase the reference count of the module such that the module cannot
> be removed while its code is in use.
> 
> Fixes: daa5abc41c80 ("pwm: Add support for Broadcom iProc PWM controller")
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Assuming you will send another PR to Linus for 5.4 with the revert of
01ccf903edd65f6421612321648fa5a7f4b7cb10 I suggest to add this patch,
too.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2019-10-24  7:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-17 19:22 [PATCH] pwm: bcm-iproc: prevent unloading the driver module while in use Uwe Kleine-König
2019-10-17 19:29 ` Florian Fainelli
2019-10-24  7:36 ` Uwe Kleine-König

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).