public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND] clocksource/drivers/timer-ti-dm: Don't fail probe if int not found
@ 2024-10-10 14:44 Judith Mendez
  2024-10-10 21:18 ` Bryan Brattlof
  2024-10-12  0:24 ` Kevin Hilman
  0 siblings, 2 replies; 4+ messages in thread
From: Judith Mendez @ 2024-10-10 14:44 UTC (permalink / raw)
  To: Daniel Lezcano, Thomas Gleixner
  Cc: linux-kernel, Vignesh Raghavendra, Bryan Brattlof, Judith Mendez

Some timers may not have an interrupt routed to
the A53 GIC, but the timer PWM functionality can still
be used by Linux Kernel. Therefore, do not fail probe
if interrupt is not found and ti,timer-pwm exists.

Fixes: df28472a1b28 ("ARM: OMAP: dmtimer: platform driver")
Signed-off-by: Judith Mendez <jm@ti.com>
---
Changes since v1:
- Rebased, add to CC list, add fixes tag
---
 drivers/clocksource/timer-ti-dm.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/clocksource/timer-ti-dm.c b/drivers/clocksource/timer-ti-dm.c
index b7a34b1a975e..1b61fefed213 100644
--- a/drivers/clocksource/timer-ti-dm.c
+++ b/drivers/clocksource/timer-ti-dm.c
@@ -1104,8 +1104,12 @@ static int omap_dm_timer_probe(struct platform_device *pdev)
 		return  -ENOMEM;
 
 	timer->irq = platform_get_irq(pdev, 0);
-	if (timer->irq < 0)
-		return timer->irq;
+	if (timer->irq < 0) {
+		if (of_property_read_bool(dev->of_node, "ti,timer-pwm"))
+			dev_err(dev, "Did not find timer interrupt, timer usable in PWM mode only\n");
+		else
+			return timer->irq;
+	}
 
 	timer->io_base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(timer->io_base))

base-commit: d3d1556696c1a993eec54ac585fe5bf677e07474
-- 
2.46.2


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

* Re: [PATCH RESEND] clocksource/drivers/timer-ti-dm: Don't fail probe if int not found
  2024-10-10 14:44 [PATCH RESEND] clocksource/drivers/timer-ti-dm: Don't fail probe if int not found Judith Mendez
@ 2024-10-10 21:18 ` Bryan Brattlof
  2024-10-11 17:39   ` Judith Mendez
  2024-10-12  0:24 ` Kevin Hilman
  1 sibling, 1 reply; 4+ messages in thread
From: Bryan Brattlof @ 2024-10-10 21:18 UTC (permalink / raw)
  To: Judith Mendez
  Cc: Daniel Lezcano, Thomas Gleixner, linux-kernel,
	Vignesh Raghavendra

On October 10, 2024 thus sayeth Judith Mendez:
> Some timers may not have an interrupt routed to
> the A53 GIC, but the timer PWM functionality can still
> be used by Linux Kernel. Therefore, do not fail probe
> if interrupt is not found and ti,timer-pwm exists.
> 
> Fixes: df28472a1b28 ("ARM: OMAP: dmtimer: platform driver")
> Signed-off-by: Judith Mendez <jm@ti.com>
> ---
> Changes since v1:
> - Rebased, add to CC list, add fixes tag
> ---
>  drivers/clocksource/timer-ti-dm.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/clocksource/timer-ti-dm.c b/drivers/clocksource/timer-ti-dm.c
> index b7a34b1a975e..1b61fefed213 100644
> --- a/drivers/clocksource/timer-ti-dm.c
> +++ b/drivers/clocksource/timer-ti-dm.c
> @@ -1104,8 +1104,12 @@ static int omap_dm_timer_probe(struct platform_device *pdev)
>  		return  -ENOMEM;
>  
>  	timer->irq = platform_get_irq(pdev, 0);
> -	if (timer->irq < 0)
> -		return timer->irq;
> +	if (timer->irq < 0) {
> +		if (of_property_read_bool(dev->of_node, "ti,timer-pwm"))
> +			dev_err(dev, "Did not find timer interrupt, timer usable in PWM mode only\n");

Is this really an error? or more of a dev_info() type problem. It looks
like we changed how we integrated the timer in K3 chips that broke some 
assumptions made in OMAP.

~Bryan

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

* Re: [PATCH RESEND] clocksource/drivers/timer-ti-dm: Don't fail probe if int not found
  2024-10-10 21:18 ` Bryan Brattlof
@ 2024-10-11 17:39   ` Judith Mendez
  0 siblings, 0 replies; 4+ messages in thread
From: Judith Mendez @ 2024-10-11 17:39 UTC (permalink / raw)
  To: Bryan Brattlof
  Cc: Daniel Lezcano, Thomas Gleixner, linux-kernel,
	Vignesh Raghavendra

Hi Bryan,

On 10/10/24 4:18 PM, Bryan Brattlof wrote:
> On October 10, 2024 thus sayeth Judith Mendez:
>> Some timers may not have an interrupt routed to
>> the A53 GIC, but the timer PWM functionality can still
>> be used by Linux Kernel. Therefore, do not fail probe
>> if interrupt is not found and ti,timer-pwm exists.
>>
>> Fixes: df28472a1b28 ("ARM: OMAP: dmtimer: platform driver")
>> Signed-off-by: Judith Mendez <jm@ti.com>
>> ---
>> Changes since v1:
>> - Rebased, add to CC list, add fixes tag
>> ---
>>   drivers/clocksource/timer-ti-dm.c | 8 ++++++--
>>   1 file changed, 6 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/clocksource/timer-ti-dm.c b/drivers/clocksource/timer-ti-dm.c
>> index b7a34b1a975e..1b61fefed213 100644
>> --- a/drivers/clocksource/timer-ti-dm.c
>> +++ b/drivers/clocksource/timer-ti-dm.c
>> @@ -1104,8 +1104,12 @@ static int omap_dm_timer_probe(struct platform_device *pdev)
>>   		return  -ENOMEM;
>>   
>>   	timer->irq = platform_get_irq(pdev, 0);
>> -	if (timer->irq < 0)
>> -		return timer->irq;
>> +	if (timer->irq < 0) {
>> +		if (of_property_read_bool(dev->of_node, "ti,timer-pwm"))
>> +			dev_err(dev, "Did not find timer interrupt, timer usable in PWM mode only\n");
> 
> Is this really an error? or more of a dev_info() type problem. It looks
> like we changed how we integrated the timer in K3 chips that broke some
> assumptions made in OMAP.

I can switch to dev_info() no problem, thanks for reviewing!

~ Judith

> 
> ~Bryan


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

* Re: [PATCH RESEND] clocksource/drivers/timer-ti-dm: Don't fail probe if int not found
  2024-10-10 14:44 [PATCH RESEND] clocksource/drivers/timer-ti-dm: Don't fail probe if int not found Judith Mendez
  2024-10-10 21:18 ` Bryan Brattlof
@ 2024-10-12  0:24 ` Kevin Hilman
  1 sibling, 0 replies; 4+ messages in thread
From: Kevin Hilman @ 2024-10-12  0:24 UTC (permalink / raw)
  To: Judith Mendez, Daniel Lezcano, Thomas Gleixner
  Cc: linux-kernel, Vignesh Raghavendra, Bryan Brattlof, Judith Mendez

Judith Mendez <jm@ti.com> writes:

> Some timers may not have an interrupt routed to
> the A53 GIC, but the timer PWM functionality can still
> be used by Linux Kernel. Therefore, do not fail probe
> if interrupt is not found and ti,timer-pwm exists.
>
> Fixes: df28472a1b28 ("ARM: OMAP: dmtimer: platform driver")
> Signed-off-by: Judith Mendez <jm@ti.com>
> ---
> Changes since v1:
> - Rebased, add to CC list, add fixes tag
> ---
>  drivers/clocksource/timer-ti-dm.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/clocksource/timer-ti-dm.c b/drivers/clocksource/timer-ti-dm.c
> index b7a34b1a975e..1b61fefed213 100644
> --- a/drivers/clocksource/timer-ti-dm.c
> +++ b/drivers/clocksource/timer-ti-dm.c
> @@ -1104,8 +1104,12 @@ static int omap_dm_timer_probe(struct platform_device *pdev)
>  		return  -ENOMEM;
>  
>  	timer->irq = platform_get_irq(pdev, 0);
> -	if (timer->irq < 0)
> -		return timer->irq;
> +	if (timer->irq < 0) {
> +		if (of_property_read_bool(dev->of_node, "ti,timer-pwm"))

nit: this propoery is read from the DT again just a bit lower.  Rather
than parse the DT for this property twice, can you move this after the
DT properties are already parsed, and then just check for
(timer->capability & OMAP_TIMER_HAS_PWM) ?

Kevin

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

end of thread, other threads:[~2024-10-12  0:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-10 14:44 [PATCH RESEND] clocksource/drivers/timer-ti-dm: Don't fail probe if int not found Judith Mendez
2024-10-10 21:18 ` Bryan Brattlof
2024-10-11 17:39   ` Judith Mendez
2024-10-12  0:24 ` Kevin Hilman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox