Skip to contentSkip to conversation

clocksource/drivers/timer-ti-dm: Don't fail probe if int not found

PATCH Applied Judith Mendez 3 participants 3 messages Oct 11, 2024 – Nov 13, 2024 Clocksource, clockevent drivers

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 clocksource/drivers/timer-ti-dm: Don't fail probe if int not found

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.

---
Changes since v1:
- Switch to dev_info()
- Drop fixes tag

Link to v1: https://lore.kernel.org/all/[email protected]/

---
 drivers/clocksource/timer-ti-dm.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/clocksource/timer-ti-dm.c +6 -2
index b7a34b1a975e..3666d94cc8dd 100644
@@ -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_info(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

Signature · 1 line
2.47.0
#1 lore raw
Quoted 7 lines · 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.

---

Applied, thanks

Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
merge bot Applied
#2 lore raw
In reply to Judith Mendez
The following commit has been merged into the timers/core branch of tip:

The following commit has been merged into the timers/core branch of tip:

Commit-ID:     314413317b6d78cc76cd48f0296fde9fcfdec400
Gitweb:        https://git.kernel.org/tip/314413317b6d78cc76cd48f0296fde9fcfdec400
Author:        Judith Mendez <[email protected]>
AuthorDate:    Fri, 11 Oct 2024 12:52:03 -05:00
Committer:     Daniel Lezcano <[email protected]>
CommitterDate: Wed, 13 Nov 2024 13:49:33 +01:00

clocksource/drivers/timer-ti-dm: Don't fail probe if int not found

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.

---
 drivers/clocksource/timer-ti-dm.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/clocksource/timer-ti-dm.c +6 -2
index b7a34b1..3666d94 100644
@@ -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_info(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))