Skip to contentSkip to conversation

time64.h: Consolidated PSEC_PER_SEC definition

PATCH Superseded Andy Shevchenko 4 participants 4 messages Jan 12, 2021 – Jan 14, 2021 1 message not in the archive

Subsystems (7)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 time64.h: Consolidated PSEC_PER_SEC definition

We have currently three users of the PSEC_PER_SEC each of them defining it individually. Instead, move it to time64.h to be available for everyone.

There is a new user coming with the same constant in use. It will also make its life easier.

---
 drivers/net/ethernet/mscc/ocelot_ptp.c           | 2 ++
 drivers/phy/phy-core-mipi-dphy.c                 | 2 --
 drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c | 8 ++++----
 include/soc/mscc/ocelot_ptp.h                    | 2 --
 include/vdso/time64.h                            | 1 +
 5 files changed, 7 insertions(+), 8 deletions(-)
drivers/net/ethernet/mscc/ocelot_ptp.c +2 -0
index a33ab315cc6b..87ad2137ba06 100644
@@ -4,6 +4,8 @@
  * Copyright (c) 2017 Microsemi Corporation
  * Copyright 2020 NXP
  */
+#include <linux/time64.h>
+
 #include <soc/mscc/ocelot_ptp.h>
 #include <soc/mscc/ocelot_sys.h>
 #include <soc/mscc/ocelot.h>
drivers/phy/phy-core-mipi-dphy.c +0 -2
index 14e0551cd319..77fe65367ce5 100644
@@ -12,8 +12,6 @@
 #include <linux/phy/phy.h>
 #include <linux/phy/phy-mipi-dphy.h>
 
-#define PSEC_PER_SEC	1000000000000LL
-
 /*
  * Minimum D-PHY timings based on MIPI D-PHY specification. Derived
  * from the valid ranges specified in Section 6.9, Table 14, Page 41
drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c +4 -4
index 8af8c6c5cc02..347dc79a18c1 100644
@@ -11,16 +11,16 @@
 #include <linux/clk-provider.h>
 #include <linux/delay.h>
 #include <linux/init.h>
+#include <linux/mfd/syscon.h>
 #include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
+#include <linux/pm_runtime.h>
 #include <linux/reset.h>
+#include <linux/time64.h>
+
 #include <linux/phy/phy.h>
 #include <linux/phy/phy-mipi-dphy.h>
-#include <linux/pm_runtime.h>
-#include <linux/mfd/syscon.h>
-
-#define PSEC_PER_SEC	1000000000000LL
 
 #define UPDATE(x, h, l)	(((x) << (l)) & GENMASK((h), (l)))
 
include/soc/mscc/ocelot_ptp.h +0 -2
index 6a7388fa7cc5..ded497d72bdb 100644
@@ -37,8 +37,6 @@ enum {
 
 #define PTP_CFG_MISC_PTP_EN		BIT(2)
 
-#define PSEC_PER_SEC			1000000000000LL
-
 #define PTP_CFG_CLK_ADJ_CFG_ENA		BIT(0)
 #define PTP_CFG_CLK_ADJ_CFG_DIR		BIT(1)
 
include/vdso/time64.h +1 -0
index 9d43c3f5e89d..b40cfa2aa33c 100644
@@ -9,6 +9,7 @@
 #define NSEC_PER_MSEC	1000000L
 #define USEC_PER_SEC	1000000L
 #define NSEC_PER_SEC	1000000000L
+#define PSEC_PER_SEC	1000000000000LL
 #define FSEC_PER_SEC	1000000000000000LL
 
 #endif /* __VDSO_TIME64_H */
Signature · 1 line
2.29.2
maintainer Acked-by on v1 1/1
#1 lore raw

Am Dienstag, 12. Januar 2021, 16:37:09 CET schrieb Andy Shevchenko:

Quoted 11 lines

We have currently three users of the PSEC_PER_SEC each of them defining it individually. Instead, move it to time64.h to be available for everyone.

There is a new user coming with the same constant in use. It will also make its life easier.

---
 drivers/net/ethernet/mscc/ocelot_ptp.c           | 2 ++
 drivers/phy/phy-core-mipi-dphy.c                 | 2 --
 drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c | 8 ++++----

for the Rockchip-part:

though not sure if that reordering of other includes should be in there or separate. Don't have a hard opinion, and will let others decide ;-)

Heiko

Quoted 74 lines
 include/soc/mscc/ocelot_ptp.h                    | 2 --
 include/vdso/time64.h                            | 1 +
 5 files changed, 7 insertions(+), 8 deletions(-)
drivers/net/ethernet/mscc/ocelot_ptp.c +2 -0
index a33ab315cc6b..87ad2137ba06 100644
@@ -4,6 +4,8 @@
  * Copyright (c) 2017 Microsemi Corporation
  * Copyright 2020 NXP
  */
+#include <linux/time64.h>
+
 #include <soc/mscc/ocelot_ptp.h>
 #include <soc/mscc/ocelot_sys.h>
 #include <soc/mscc/ocelot.h>
drivers/phy/phy-core-mipi-dphy.c +0 -2
index 14e0551cd319..77fe65367ce5 100644
@@ -12,8 +12,6 @@
 #include <linux/phy/phy.h>
 #include <linux/phy/phy-mipi-dphy.h>
 
-#define PSEC_PER_SEC	1000000000000LL
-
 /*
  * Minimum D-PHY timings based on MIPI D-PHY specification. Derived
  * from the valid ranges specified in Section 6.9, Table 14, Page 41
drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c +4 -4
index 8af8c6c5cc02..347dc79a18c1 100644
@@ -11,16 +11,16 @@
 #include <linux/clk-provider.h>
 #include <linux/delay.h>
 #include <linux/init.h>
+#include <linux/mfd/syscon.h>
 #include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
+#include <linux/pm_runtime.h>
 #include <linux/reset.h>
+#include <linux/time64.h>
+
 #include <linux/phy/phy.h>
 #include <linux/phy/phy-mipi-dphy.h>
-#include <linux/pm_runtime.h>
-#include <linux/mfd/syscon.h>
-
-#define PSEC_PER_SEC	1000000000000LL
 
 #define UPDATE(x, h, l)	(((x) << (l)) & GENMASK((h), (l)))
 
include/soc/mscc/ocelot_ptp.h +0 -2
index 6a7388fa7cc5..ded497d72bdb 100644
@@ -37,8 +37,6 @@ enum {
 
 #define PTP_CFG_MISC_PTP_EN		BIT(2)
 
-#define PSEC_PER_SEC			1000000000000LL
-
 #define PTP_CFG_CLK_ADJ_CFG_ENA		BIT(0)
 #define PTP_CFG_CLK_ADJ_CFG_DIR		BIT(1)
 
include/vdso/time64.h +0 -0
index 9d43c3f5e89d..b40cfa2aa33c 100644

include/vdso/time64.h line 15

Quoted 7 lines
include/vdso/time64.h +1 -0
@@ -9,6 +9,7 @@
 #define NSEC_PER_MSEC	1000000L
 #define USEC_PER_SEC	1000000L
 #define NSEC_PER_SEC	1000000000L
+#define PSEC_PER_SEC	1000000000000LL
 #define FSEC_PER_SEC	1000000000000000LL
 
 #endif /* __VDSO_TIME64_H */

_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip

maintainer
#2 lore raw
In reply to Andy Shevchenko
Quoted 7 lines · On Tue, 12 Jan 2021 17:37:09 +0200 Andy Shevchenko wrote:

We have currently three users of the PSEC_PER_SEC each of them defining it individually. Instead, move it to time64.h to be available for everyone.

There is a new user coming with the same constant in use. It will also make its life easier.

Which tree will you send the new user to? I'm not sure who you're expecting to take this patch :S

_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip

maintainer
#4 lore raw
In reply to a message not in the archive
Quoted 10 lines · Andy Shevchenko
Quoted 8 lines · Jakub Kicinski
Quoted 1 line · On Tue, 12 Jan 2021 17:37:09 +0200 Andy Shevchenko wrote:

We have currently three users of the PSEC_PER_SEC each of them defining

it

Quoted 5 lines

individually. Instead, move it to time64.h to be available for everyone.

There is a new user coming with the same constant in use. It will also make its life easier.

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

Which tree will you send the new user to? I'm not sure who you're expecting to take this patch :S

I think PHY tree is the best candidate with providing an immutable branch for others.

Sure I can do that, I would wait for other folks to ack this

Thanks

Signature · 6 lines
~Vinod

_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip