* [PATCH v1] pps: generators: tio: fix platform_set_drvdata()
@ 2025-03-15 13:31 Raag Jadav
2025-03-16 15:24 ` Rodolfo Giometti
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Raag Jadav @ 2025-03-15 13:31 UTC (permalink / raw)
To: giometti, gregkh, andriy.shevchenko; +Cc: linux-kernel, Raag Jadav
Set driver_data correctly and fix illegal memory access on driver reload.
Fixes: c89755d1111f ("pps: generators: Add PPS Generator TIO Driver")
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
---
drivers/pps/generators/pps_gen_tio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pps/generators/pps_gen_tio.c b/drivers/pps/generators/pps_gen_tio.c
index 6c46b46c66cd..6e4a383957d9 100644
--- a/drivers/pps/generators/pps_gen_tio.c
+++ b/drivers/pps/generators/pps_gen_tio.c
@@ -230,7 +230,7 @@ static int pps_gen_tio_probe(struct platform_device *pdev)
hrtimer_init(&tio->timer, CLOCK_REALTIME, HRTIMER_MODE_ABS);
tio->timer.function = hrtimer_callback;
spin_lock_init(&tio->lock);
- platform_set_drvdata(pdev, &tio);
+ platform_set_drvdata(pdev, tio);
return 0;
}
base-commit: 6f119e3da79ce5e586340059403ab77201c1bb45
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v1] pps: generators: tio: fix platform_set_drvdata()
2025-03-15 13:31 [PATCH v1] pps: generators: tio: fix platform_set_drvdata() Raag Jadav
@ 2025-03-16 15:24 ` Rodolfo Giometti
2025-03-17 7:26 ` Andy Shevchenko
2025-03-17 7:32 ` Greg KH
2 siblings, 0 replies; 7+ messages in thread
From: Rodolfo Giometti @ 2025-03-16 15:24 UTC (permalink / raw)
To: Raag Jadav, gregkh, andriy.shevchenko; +Cc: linux-kernel
On 15/03/25 14:31, Raag Jadav wrote:
> Set driver_data correctly and fix illegal memory access on driver reload.
>
> Fixes: c89755d1111f ("pps: generators: Add PPS Generator TIO Driver")
> Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Acked-by: Rodolfo Giometti <giometti@enneenne.com>
> ---
> drivers/pps/generators/pps_gen_tio.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pps/generators/pps_gen_tio.c b/drivers/pps/generators/pps_gen_tio.c
> index 6c46b46c66cd..6e4a383957d9 100644
> --- a/drivers/pps/generators/pps_gen_tio.c
> +++ b/drivers/pps/generators/pps_gen_tio.c
> @@ -230,7 +230,7 @@ static int pps_gen_tio_probe(struct platform_device *pdev)
> hrtimer_init(&tio->timer, CLOCK_REALTIME, HRTIMER_MODE_ABS);
> tio->timer.function = hrtimer_callback;
> spin_lock_init(&tio->lock);
> - platform_set_drvdata(pdev, &tio);
> + platform_set_drvdata(pdev, tio);
>
> return 0;
> }
>
> base-commit: 6f119e3da79ce5e586340059403ab77201c1bb45
--
GNU/Linux Solutions e-mail: giometti@enneenne.com
Linux Device Driver giometti@linux.it
Embedded Systems phone: +39 349 2432127
UNIX programming
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v1] pps: generators: tio: fix platform_set_drvdata()
2025-03-15 13:31 [PATCH v1] pps: generators: tio: fix platform_set_drvdata() Raag Jadav
2025-03-16 15:24 ` Rodolfo Giometti
@ 2025-03-17 7:26 ` Andy Shevchenko
2025-03-17 7:40 ` Raag Jadav
2025-03-17 7:32 ` Greg KH
2 siblings, 1 reply; 7+ messages in thread
From: Andy Shevchenko @ 2025-03-17 7:26 UTC (permalink / raw)
To: Raag Jadav; +Cc: giometti, gregkh, linux-kernel
On Sat, Mar 15, 2025 at 07:01:40PM +0530, Raag Jadav wrote:
> Set driver_data correctly and fix illegal memory access on driver reload.
Do you have it in practice or you are thinking it will be like this?
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v1] pps: generators: tio: fix platform_set_drvdata()
2025-03-15 13:31 [PATCH v1] pps: generators: tio: fix platform_set_drvdata() Raag Jadav
2025-03-16 15:24 ` Rodolfo Giometti
2025-03-17 7:26 ` Andy Shevchenko
@ 2025-03-17 7:32 ` Greg KH
2025-03-17 7:43 ` Raag Jadav
2 siblings, 1 reply; 7+ messages in thread
From: Greg KH @ 2025-03-17 7:32 UTC (permalink / raw)
To: Raag Jadav; +Cc: giometti, andriy.shevchenko, linux-kernel
On Sat, Mar 15, 2025 at 07:01:40PM +0530, Raag Jadav wrote:
> Set driver_data correctly and fix illegal memory access on driver reload.
>
> Fixes: c89755d1111f ("pps: generators: Add PPS Generator TIO Driver")
> Signed-off-by: Raag Jadav <raag.jadav@intel.com>
> ---
> drivers/pps/generators/pps_gen_tio.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pps/generators/pps_gen_tio.c b/drivers/pps/generators/pps_gen_tio.c
> index 6c46b46c66cd..6e4a383957d9 100644
> --- a/drivers/pps/generators/pps_gen_tio.c
> +++ b/drivers/pps/generators/pps_gen_tio.c
> @@ -230,7 +230,7 @@ static int pps_gen_tio_probe(struct platform_device *pdev)
> hrtimer_init(&tio->timer, CLOCK_REALTIME, HRTIMER_MODE_ABS);
> tio->timer.function = hrtimer_callback;
> spin_lock_init(&tio->lock);
> - platform_set_drvdata(pdev, &tio);
> + platform_set_drvdata(pdev, tio);
What does reload have to do with this? Either the data pointer is set
to the expected type or not, so that it can work properly, which has
nothing to do with when the device is unbound and then rebound (which is
what I think you mean by reload?)
So I think your changelog needs a lot of work here, as it's not really
explaining what is happening properly.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v1] pps: generators: tio: fix platform_set_drvdata()
2025-03-17 7:26 ` Andy Shevchenko
@ 2025-03-17 7:40 ` Raag Jadav
2025-03-17 7:47 ` Andy Shevchenko
0 siblings, 1 reply; 7+ messages in thread
From: Raag Jadav @ 2025-03-17 7:40 UTC (permalink / raw)
To: Andy Shevchenko; +Cc: giometti, gregkh, linux-kernel
On Mon, Mar 17, 2025 at 09:26:59AM +0200, Andy Shevchenko wrote:
> On Sat, Mar 15, 2025 at 07:01:40PM +0530, Raag Jadav wrote:
> > Set driver_data correctly and fix illegal memory access on driver reload.
>
> Do you have it in practice or you are thinking it will be like this?
I reproduced it but didn't want to bloat the commit message for an
obvious fix.
Raag
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v1] pps: generators: tio: fix platform_set_drvdata()
2025-03-17 7:32 ` Greg KH
@ 2025-03-17 7:43 ` Raag Jadav
0 siblings, 0 replies; 7+ messages in thread
From: Raag Jadav @ 2025-03-17 7:43 UTC (permalink / raw)
To: Greg KH; +Cc: giometti, andriy.shevchenko, linux-kernel
On Mon, Mar 17, 2025 at 08:32:29AM +0100, Greg KH wrote:
> On Sat, Mar 15, 2025 at 07:01:40PM +0530, Raag Jadav wrote:
> > Set driver_data correctly and fix illegal memory access on driver reload.
> >
> > Fixes: c89755d1111f ("pps: generators: Add PPS Generator TIO Driver")
> > Signed-off-by: Raag Jadav <raag.jadav@intel.com>
> > ---
> > drivers/pps/generators/pps_gen_tio.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/pps/generators/pps_gen_tio.c b/drivers/pps/generators/pps_gen_tio.c
> > index 6c46b46c66cd..6e4a383957d9 100644
> > --- a/drivers/pps/generators/pps_gen_tio.c
> > +++ b/drivers/pps/generators/pps_gen_tio.c
> > @@ -230,7 +230,7 @@ static int pps_gen_tio_probe(struct platform_device *pdev)
> > hrtimer_init(&tio->timer, CLOCK_REALTIME, HRTIMER_MODE_ABS);
> > tio->timer.function = hrtimer_callback;
> > spin_lock_init(&tio->lock);
> > - platform_set_drvdata(pdev, &tio);
> > + platform_set_drvdata(pdev, tio);
>
> What does reload have to do with this? Either the data pointer is set
> to the expected type or not, so that it can work properly, which has
> nothing to do with when the device is unbound and then rebound (which is
> what I think you mean by reload?)
->remove() is the only user of driver_data here.
> So I think your changelog needs a lot of work here, as it's not really
> explaining what is happening properly.
Sure, will update.
Raag
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v1] pps: generators: tio: fix platform_set_drvdata()
2025-03-17 7:40 ` Raag Jadav
@ 2025-03-17 7:47 ` Andy Shevchenko
0 siblings, 0 replies; 7+ messages in thread
From: Andy Shevchenko @ 2025-03-17 7:47 UTC (permalink / raw)
To: Raag Jadav; +Cc: giometti, gregkh, linux-kernel
On Mon, Mar 17, 2025 at 09:40:34AM +0200, Raag Jadav wrote:
> On Mon, Mar 17, 2025 at 09:26:59AM +0200, Andy Shevchenko wrote:
> > On Sat, Mar 15, 2025 at 07:01:40PM +0530, Raag Jadav wrote:
> > > Set driver_data correctly and fix illegal memory access on driver reload.
> >
> > Do you have it in practice or you are thinking it will be like this?
>
> I reproduced it but didn't want to bloat the commit message for an
> obvious fix.
Then add a few (~3-5) lines of the traceback and update commit message
to explain that this is a real case.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2025-03-17 7:47 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-15 13:31 [PATCH v1] pps: generators: tio: fix platform_set_drvdata() Raag Jadav
2025-03-16 15:24 ` Rodolfo Giometti
2025-03-17 7:26 ` Andy Shevchenko
2025-03-17 7:40 ` Raag Jadav
2025-03-17 7:47 ` Andy Shevchenko
2025-03-17 7:32 ` Greg KH
2025-03-17 7:43 ` Raag Jadav
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox