Netdev Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v1 1/1] time64.h: Consolidated PSEC_PER_SEC definition
@ 2021-01-12 15:37 Andy Shevchenko
  2021-01-12 15:41 ` Heiko Stübner
  2021-01-14  3:39 ` Jakub Kicinski
  0 siblings, 2 replies; 4+ messages in thread
From: Andy Shevchenko @ 2021-01-12 15:37 UTC (permalink / raw)
  To: netdev, linux-kernel, linux-arm-kernel, linux-rockchip
  Cc: Vladimir Oltean, Claudiu Manoil, Alexandre Belloni,
	UNGLinuxDriver, David S. Miller, Jakub Kicinski,
	Kishon Vijay Abraham I, Vinod Koul, Heiko Stuebner,
	Andy Lutomirski, Thomas Gleixner, Vincenzo Frascino, Yangbo Lu,
	Andy Shevchenko, Gwendal Grignou, linux-iio

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.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 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(-)

diff --git a/drivers/net/ethernet/mscc/ocelot_ptp.c b/drivers/net/ethernet/mscc/ocelot_ptp.c
index a33ab315cc6b..87ad2137ba06 100644
--- a/drivers/net/ethernet/mscc/ocelot_ptp.c
+++ b/drivers/net/ethernet/mscc/ocelot_ptp.c
@@ -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>
diff --git a/drivers/phy/phy-core-mipi-dphy.c b/drivers/phy/phy-core-mipi-dphy.c
index 14e0551cd319..77fe65367ce5 100644
--- a/drivers/phy/phy-core-mipi-dphy.c
+++ b/drivers/phy/phy-core-mipi-dphy.c
@@ -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
diff --git a/drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c b/drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c
index 8af8c6c5cc02..347dc79a18c1 100644
--- a/drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c
+++ b/drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c
@@ -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)))
 
diff --git a/include/soc/mscc/ocelot_ptp.h b/include/soc/mscc/ocelot_ptp.h
index 6a7388fa7cc5..ded497d72bdb 100644
--- a/include/soc/mscc/ocelot_ptp.h
+++ b/include/soc/mscc/ocelot_ptp.h
@@ -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)
 
diff --git a/include/vdso/time64.h b/include/vdso/time64.h
index 9d43c3f5e89d..b40cfa2aa33c 100644
--- a/include/vdso/time64.h
+++ b/include/vdso/time64.h
@@ -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 */
-- 
2.29.2


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

* Re: [PATCH v1 1/1] time64.h: Consolidated PSEC_PER_SEC definition
  2021-01-12 15:37 [PATCH v1 1/1] time64.h: Consolidated PSEC_PER_SEC definition Andy Shevchenko
@ 2021-01-12 15:41 ` Heiko Stübner
  2021-01-14  3:39 ` Jakub Kicinski
  1 sibling, 0 replies; 4+ messages in thread
From: Heiko Stübner @ 2021-01-12 15:41 UTC (permalink / raw)
  To: netdev, linux-kernel, linux-arm-kernel, linux-rockchip, Andy Shevchenko
  Cc: Vladimir Oltean, Claudiu Manoil, Alexandre Belloni,
	UNGLinuxDriver, David S. Miller, Jakub Kicinski,
	Kishon Vijay Abraham I, Vinod Koul, Andy Lutomirski,
	Thomas Gleixner, Vincenzo Frascino, Yangbo Lu, Andy Shevchenko,
	Gwendal Grignou, linux-iio

Am Dienstag, 12. Januar 2021, 16:37:09 CET schrieb Andy Shevchenko:
> 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.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  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:
Acked-by: Heiko Stuebner <heiko@sntech.de>

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

>  include/soc/mscc/ocelot_ptp.h                    | 2 --
>  include/vdso/time64.h                            | 1 +
>  5 files changed, 7 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/net/ethernet/mscc/ocelot_ptp.c b/drivers/net/ethernet/mscc/ocelot_ptp.c
> index a33ab315cc6b..87ad2137ba06 100644
> --- a/drivers/net/ethernet/mscc/ocelot_ptp.c
> +++ b/drivers/net/ethernet/mscc/ocelot_ptp.c
> @@ -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>
> diff --git a/drivers/phy/phy-core-mipi-dphy.c b/drivers/phy/phy-core-mipi-dphy.c
> index 14e0551cd319..77fe65367ce5 100644
> --- a/drivers/phy/phy-core-mipi-dphy.c
> +++ b/drivers/phy/phy-core-mipi-dphy.c
> @@ -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
> diff --git a/drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c b/drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c
> index 8af8c6c5cc02..347dc79a18c1 100644
> --- a/drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c
> +++ b/drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c
> @@ -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)))
>  
> diff --git a/include/soc/mscc/ocelot_ptp.h b/include/soc/mscc/ocelot_ptp.h
> index 6a7388fa7cc5..ded497d72bdb 100644
> --- a/include/soc/mscc/ocelot_ptp.h
> +++ b/include/soc/mscc/ocelot_ptp.h
> @@ -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)
>  
> diff --git a/include/vdso/time64.h b/include/vdso/time64.h
> index 9d43c3f5e89d..b40cfa2aa33c 100644
> --- a/include/vdso/time64.h
> +++ b/include/vdso/time64.h
> @@ -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 */
> 





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

* Re: [PATCH v1 1/1] time64.h: Consolidated PSEC_PER_SEC definition
  2021-01-12 15:37 [PATCH v1 1/1] time64.h: Consolidated PSEC_PER_SEC definition Andy Shevchenko
  2021-01-12 15:41 ` Heiko Stübner
@ 2021-01-14  3:39 ` Jakub Kicinski
       [not found]   ` <CAHp75VeeRRjm=bnyXGgf3j=bKB2wH-v=aDzH3OrQ0dO3BMTrDA@mail.gmail.com>
  1 sibling, 1 reply; 4+ messages in thread
From: Jakub Kicinski @ 2021-01-14  3:39 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: netdev, linux-kernel, linux-arm-kernel, linux-rockchip,
	Vladimir Oltean, Claudiu Manoil, Alexandre Belloni,
	UNGLinuxDriver, David S. Miller, Kishon Vijay Abraham I,
	Vinod Koul, Heiko Stuebner, Andy Lutomirski, Thomas Gleixner,
	Vincenzo Frascino, Yangbo Lu, Gwendal Grignou, linux-iio

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.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

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

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

* Re: [PATCH v1 1/1] time64.h: Consolidated PSEC_PER_SEC definition
       [not found]   ` <CAHp75VeeRRjm=bnyXGgf3j=bKB2wH-v=aDzH3OrQ0dO3BMTrDA@mail.gmail.com>
@ 2021-01-14  8:09     ` Vinod Koul
  0 siblings, 0 replies; 4+ messages in thread
From: Vinod Koul @ 2021-01-14  8:09 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Jakub Kicinski, Andy Shevchenko, netdev, linux-kernel,
	linux-arm-kernel, linux-rockchip, Vladimir Oltean,
	Claudiu Manoil, Alexandre Belloni, UNGLinuxDriver,
	David S. Miller, Kishon Vijay Abraham I, Heiko Stuebner,
	Andy Lutomirski, Thomas Gleixner, Vincenzo Frascino, Yangbo Lu,
	Gwendal Grignou, linux-iio

On 14-01-21, 09:10, Andy Shevchenko wrote:
> On Thursday, January 14, 2021, Jakub Kicinski <kuba@kernel.org> wrote:
> 
> > 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.
> > >
> > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> >
> > 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
-- 
~Vinod

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

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-12 15:37 [PATCH v1 1/1] time64.h: Consolidated PSEC_PER_SEC definition Andy Shevchenko
2021-01-12 15:41 ` Heiko Stübner
2021-01-14  3:39 ` Jakub Kicinski
     [not found]   ` <CAHp75VeeRRjm=bnyXGgf3j=bKB2wH-v=aDzH3OrQ0dO3BMTrDA@mail.gmail.com>
2021-01-14  8:09     ` Vinod Koul

Netdev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/netdev/0 netdev/git/0.git
	git clone --mirror https://lore.kernel.org/netdev/1 netdev/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 netdev netdev/ https://lore.kernel.org/netdev \
		netdev@vger.kernel.org
	public-inbox-index netdev

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.netdev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git