Skip to contentSkip to conversation

clockevents / clocksource changes for 4.18

GIT PULL New Daniel Lezcano 1 participant 8 messages May 29, 2018

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

Hi Thomas,

this pull request contains the following changes:

- Fix Kconfig dependency on the spreadtrum timer (Chunyan Zhang)

- Add comment describing in details the reason why the local interrupt
is disabled (Eugeniy Paltsev)

- Fix outdated file path and add the SPDX tag for the imx timers family
(Fabio Estevam)

- Add pr_fmt and reword pr_* messages (Matt Redfearn)

Thanks!

-- Daniel

The following changes since commit db6f9e55c8d80a4a1a329b9b68a1d370bffb6aad:

clocksource: Move inline keyword to the beginning of function
declarations (2018-05-16 22:21:32 +0200)

are available in the git repository at:

https://git.linaro.org/people/daniel.lezcano/linux.git clockevents/4.18

for you to fetch changes up to e45e778f078efaac085e50366fe06d7b83c8b881:

clocksource/drivers/mxs_timer: Switch to SPDX identifier (2018-05-23
07:39:09 +0200)

----------------------------------------------------------------
Chunyan Zhang (1):
clocksource/drivers/sprd: Fix Kconfig dependency

Eugeniy Paltsev (1):
clocksource/drivers/arc_timer: Add comments about locking while
read GFRC

Fabio Estevam (4):
clocksource/drivers/timer-imx-gpt: Remove outdated file path clocksource/drivers/timer-imx-gpt: Switch to SPDX identifier clocksource/drivers/timer-imx-tpm: Switch to SPDX identifier clocksource/drivers/mxs_timer: Switch to SPDX identifier

Matt Redfearn (1):
clocksource/drivers/mips-gic-timer: Add pr_fmt and reword pr_*
messages

 drivers/clocksource/Kconfig          |  4 +++-
 drivers/clocksource/arc_timer.c      | 14 ++++++++++++++
 drivers/clocksource/mips-gic-timer.c | 18 ++++++++++--------
 drivers/clocksource/mxs_timer.c      | 28 +++++++---------------------
 drivers/clocksource/timer-imx-gpt.c  | 28 ++++++----------------------
 drivers/clocksource/timer-imx-tpm.c  | 13 ++++---------
 6 files changed, 44 insertions(+), 61 deletions(-)
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
#1 lore raw

PATCH 1/7 clocksource/drivers/sprd: Fix Kconfig dependency

From: Chunyan Zhang <[email protected]>

SPRD arch doesn't select SPRD_TIMER, so this config would not appear even if ARCH_SPRD is set but COMPILE_TEST not.

Fix the dependency of this config with SPRD arch, and set a default value for it, also leave other choices for EXPERT.

---
 drivers/clocksource/Kconfig | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/clocksource/Kconfig +3 -1
index 8e8a097..dec0dd8 100644
@@ -450,8 +450,10 @@ config MTK_TIMER
 	  Support for Mediatek timer driver.
 
 config SPRD_TIMER
-	bool "Spreadtrum timer driver" if COMPILE_TEST
+	bool "Spreadtrum timer driver" if EXPERT
 	depends on HAS_IOMEM
+	depends on (ARCH_SPRD || COMPILE_TEST)
+	default ARCH_SPRD
 	select TIMER_OF
 	help
 	  Enables support for the Spreadtrum timer driver.
Signature · 1 line
2.7.4
#2 lore raw

PATCH 2/7 clocksource/drivers/mips-gic-timer: Add pr_fmt and reword pr_* messages

From: Matt Redfearn <[email protected]>

Several messages from the MIPS GIC driver include the text "GIC", "GIC timer", etc, but the format is not standard. Add a pr_fmt of "mips-gic-timer: " and reword the messages now that they will be prefixed with the driver name.

---
 drivers/clocksource/mips-gic-timer.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)
drivers/clocksource/mips-gic-timer.c +10 -8
index 986b679..54f8a33 100644
@@ -5,6 +5,9 @@
  *
  * Copyright (C) 2012 MIPS Technologies, Inc.  All rights reserved.
  */
+
+#define pr_fmt(fmt) "mips-gic-timer: " fmt
+
 #include <linux/clk.h>
 #include <linux/clockchips.h>
 #include <linux/cpu.h>
@@ -136,8 +139,7 @@ static int gic_clockevent_init(void)
 
 	ret = setup_percpu_irq(gic_timer_irq, &gic_compare_irqaction);
 	if (ret < 0) {
-		pr_err("GIC timer IRQ %d setup failed: %d\n",
-		       gic_timer_irq, ret);
+		pr_err("IRQ %d setup failed (%d)\n", gic_timer_irq, ret);
 		return ret;
 	}
 
@@ -176,7 +178,7 @@ static int __init __gic_clocksource_init(void)
 
 	ret = clocksource_register_hz(&gic_clocksource, gic_frequency);
 	if (ret < 0)
-		pr_warn("GIC: Unable to register clocksource\n");
+		pr_warn("Unable to register clocksource\n");
 
 	return ret;
 }
@@ -188,7 +190,7 @@ static int __init gic_clocksource_of_init(struct device_node *node)
 
 	if (!mips_gic_present() || !node->parent ||
 	    !of_device_is_compatible(node->parent, "mti,gic")) {
-		pr_warn("No DT definition for the mips gic driver\n");
+		pr_warn("No DT definition\n");
 		return -ENXIO;
 	}
 
@@ -196,7 +198,7 @@ static int __init gic_clocksource_of_init(struct device_node *node)
 	if (!IS_ERR(clk)) {
 		ret = clk_prepare_enable(clk);
 		if (ret < 0) {
-			pr_err("GIC failed to enable clock\n");
+			pr_err("Failed to enable clock\n");
 			clk_put(clk);
 			return ret;
 		}
@@ -204,12 +206,12 @@ static int __init gic_clocksource_of_init(struct device_node *node)
 		gic_frequency = clk_get_rate(clk);
 	} else if (of_property_read_u32(node, "clock-frequency",
 					&gic_frequency)) {
-		pr_err("GIC frequency not specified.\n");
+		pr_err("Frequency not specified\n");
 		return -EINVAL;
 	}
 	gic_timer_irq = irq_of_parse_and_map(node, 0);
 	if (!gic_timer_irq) {
-		pr_err("GIC timer IRQ not specified.\n");
+		pr_err("IRQ not specified\n");
 		return -EINVAL;
 	}
 
@@ -220,7 +222,7 @@ static int __init gic_clocksource_of_init(struct device_node *node)
 	ret = gic_clockevent_init();
 	if (!ret && !IS_ERR(clk)) {
 		if (clk_notifier_register(clk, &gic_clk_nb) < 0)
-			pr_warn("GIC: Unable to register clock notifier\n");
+			pr_warn("Unable to register clock notifier\n");
 	}
 
 	/* And finally start the counter */
Signature · 1 line
2.7.4
#3 lore raw

PATCH 3/7 clocksource/drivers/arc_timer: Add comments about locking while read GFRC

In reply to Daniel Lezcano

From: Eugeniy Paltsev <[email protected]>

This came to light in some internal discussions and it is nice to have this documented rather than digging up the PRM (Prog Ref Manual) again.

Signed-off-by Eugeniy Paltsev <Eugeniy.Paltsev at synopsys.com>
Acked-by Vineet Gupta <vgupta at synopsys.com>
Signed-off-by Daniel Lezcano <daniel.lezcano at linaro.org>
---
 drivers/clocksource/arc_timer.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
drivers/clocksource/arc_timer.c +14 -0
index 471b428..20da9b1 100644
@@ -61,6 +61,20 @@ static u64 arc_read_gfrc(struct clocksource *cs)
 	unsigned long flags;
 	u32 l, h;
 
+	/*
+	 * From a programming model pov, there seems to be just one instance of
+	 * MCIP_CMD/MCIP_READBACK however micro-architecturally there's
+	 * an instance PER ARC CORE (not per cluster), and there are dedicated
+	 * hardware decode logic (per core) inside ARConnect to handle
+	 * simultaneous read/write accesses from cores via those two registers.
+	 * So several concurrent commands to ARConnect are OK if they are
+	 * trying to access two different sub-components (like GFRC,
+	 * inter-core interrupt, etc...). HW also supports simultaneously
+	 * accessing GFRC by multiple cores.
+	 * That's why it is safe to disable hard interrupts on the local CPU
+	 * before access to GFRC instead of taking global MCIP spinlock
+	 * defined in arch/arc/kernel/mcip.c
+	 */
 	local_irq_save(flags);
 
 	__mcip_cmd(CMD_GFRC_READ_LO, 0);
Signature · 1 line
2.7.4
#4 lore raw

PATCH 4/7 clocksource/drivers/timer-imx-gpt: Remove outdated file path

In reply to Daniel Lezcano

From: Fabio Estevam <[email protected]>

imx gpt timer driver has been moved from arch/arm/mach-imx to drivers/clocksource/ a long time ago, so remove the reference to the old file path.

---
 drivers/clocksource/timer-imx-gpt.c | 2 --
 1 file changed, 2 deletions(-)
drivers/clocksource/timer-imx-gpt.c +0 -2
index 6ec6d79..b63b834 100644
@@ -1,6 +1,4 @@
 /*
- *  linux/arch/arm/plat-mxc/time.c
- *
  *  Copyright (C) 2000-2001 Deep Blue Solutions
  *  Copyright (C) 2002 Shane Nay ([email protected])
  *  Copyright (C) 2006-2007 Pavel Pisa ([email protected])
Signature · 1 line
2.7.4
#5 lore raw

PATCH 5/7 clocksource/drivers/timer-imx-gpt: Switch to SPDX identifier

In reply to Daniel Lezcano

From: Fabio Estevam <[email protected]>

Adopt the SPDX license identifier headers to ease license compliance management.

---
 drivers/clocksource/timer-imx-gpt.c | 26 ++++++--------------------
 1 file changed, 6 insertions(+), 20 deletions(-)
drivers/clocksource/timer-imx-gpt.c +6 -20
index b63b834..165fbbb 100644
@@ -1,23 +1,9 @@
-/*
- *  Copyright (C) 2000-2001 Deep Blue Solutions
- *  Copyright (C) 2002 Shane Nay ([email protected])
- *  Copyright (C) 2006-2007 Pavel Pisa ([email protected])
- *  Copyright (C) 2008 Juergen Beisert ([email protected])
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- */
+// SPDX-License-Identifier: GPL-2.0+
+//
+//  Copyright (C) 2000-2001 Deep Blue Solutions
+//  Copyright (C) 2002 Shane Nay ([email protected])
+//  Copyright (C) 2006-2007 Pavel Pisa ([email protected])
+//  Copyright (C) 2008 Juergen Beisert ([email protected])
 
 #include <linux/interrupt.h>
 #include <linux/irq.h>
Signature · 1 line
2.7.4
#6 lore raw

PATCH 6/7 clocksource/drivers/timer-imx-tpm: Switch to SPDX identifier

In reply to Daniel Lezcano

From: Fabio Estevam <[email protected]>

Adopt the SPDX license identifier headers to ease license compliance management.

---
 drivers/clocksource/timer-imx-tpm.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)
drivers/clocksource/timer-imx-tpm.c +4 -9
index 6c83184..b7aa2b8 100644
@@ -1,12 +1,7 @@
-/*
- * Copyright 2016 Freescale Semiconductor, Inc.
- * Copyright 2017 NXP
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- */
+// SPDX-License-Identifier: GPL-2.0+
+//
+// Copyright 2016 Freescale Semiconductor, Inc.
+// Copyright 2017 NXP
 
 #include <linux/clk.h>
 #include <linux/clockchips.h>
Signature · 1 line
2.7.4
#7 lore raw

PATCH 7/7 clocksource/drivers/mxs_timer: Switch to SPDX identifier

In reply to Daniel Lezcano

From: Fabio Estevam <[email protected]>

Adopt the SPDX license identifier headers to ease license compliance management.

---
 drivers/clocksource/mxs_timer.c | 28 +++++++---------------------
 1 file changed, 7 insertions(+), 21 deletions(-)
drivers/clocksource/mxs_timer.c +7 -21
index a03434e..f6ddae3 100644
@@ -1,24 +1,10 @@
-/*
- *  Copyright (C) 2000-2001 Deep Blue Solutions
- *  Copyright (C) 2002 Shane Nay ([email protected])
- *  Copyright (C) 2006-2007 Pavel Pisa ([email protected])
- *  Copyright (C) 2008 Juergen Beisert ([email protected])
- *  Copyright (C) 2010 Freescale Semiconductor, Inc. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- */
+// SPDX-License-Identifier: GPL-2.0+
+//
+//  Copyright (C) 2000-2001 Deep Blue Solutions
+//  Copyright (C) 2002 Shane Nay ([email protected])
+//  Copyright (C) 2006-2007 Pavel Pisa ([email protected])
+//  Copyright (C) 2008 Juergen Beisert ([email protected])
+//  Copyright (C) 2010 Freescale Semiconductor, Inc. All Rights Reserved.
 
 #include <linux/err.h>
 #include <linux/interrupt.h>
Signature · 1 line
2.7.4