linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] gpiolib: cdev: allow edge event timestamps to be configured as REALTIME
@ 2020-10-14 23:11 Kent Gibson
  2020-10-14 23:11 ` [PATCH v2 1/3] " Kent Gibson
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: Kent Gibson @ 2020-10-14 23:11 UTC (permalink / raw)
  To: linux-kernel, linux-gpio, bgolaszewski, linus.walleij; +Cc: Kent Gibson

This patch set adds the option to select CLOCK_REALTIME as the source
clock for line events.

The first patch is the core of the change, while the remaining two update
the GPIO tools to make use of the new option.

Changes for v2:
 - change line_event_timestamp() return to u64 to avoid clipping to 32bits
   on 32bit platforms.
 - fix the line spacing after line_event_timestamp()

Kent Gibson (3):
  gpiolib: cdev: allow edge event timestamps to be configured as
    REALTIME
  tools: gpio: add support for reporting realtime event clock to lsgpio
  tools: gpio: add option to report wall-clock time to gpio-event-mon

 drivers/gpio/gpiolib-cdev.c | 21 ++++++++++++++++++---
 drivers/gpio/gpiolib.h      |  1 +
 include/uapi/linux/gpio.h   | 12 +++++++++---
 tools/gpio/gpio-event-mon.c |  6 +++++-
 tools/gpio/lsgpio.c         |  4 ++++
 5 files changed, 37 insertions(+), 7 deletions(-)

-- 
2.28.0


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

* [PATCH v2 1/3] gpiolib: cdev: allow edge event timestamps to be configured as REALTIME
  2020-10-14 23:11 [PATCH v2 0/3] gpiolib: cdev: allow edge event timestamps to be configured as REALTIME Kent Gibson
@ 2020-10-14 23:11 ` Kent Gibson
  2020-10-16 14:13   ` Andy Shevchenko
  2020-10-14 23:11 ` [PATCH v2 2/3] tools: gpio: add support for reporting realtime event clock to lsgpio Kent Gibson
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 15+ messages in thread
From: Kent Gibson @ 2020-10-14 23:11 UTC (permalink / raw)
  To: linux-kernel, linux-gpio, bgolaszewski, linus.walleij
  Cc: Kent Gibson, Jack Winch

Using CLOCK_REALTIME as the source for event timestamps is crucial for
some specific applications, particularly those requiring timetamps
relative to a PTP clock, so provide an option to switch the event
timestamp source from the default CLOCK_MONOTONIC to CLOCK_REALTIME.

Note that CLOCK_REALTIME was the default source clock for GPIO until
Linux 5.7 when it was changed to CLOCK_MONOTONIC due to issues with the
shifting of the realtime clock.
Providing this option maintains the CLOCK_MONOTONIC as the default,
while also providing a path forward for those dependent on the pre-5.7
behaviour.

Suggested-by: Jack Winch <sunt.un.morcov@gmail.com>
Signed-off-by: Kent Gibson <warthog618@gmail.com>
---
 drivers/gpio/gpiolib-cdev.c | 21 ++++++++++++++++++---
 drivers/gpio/gpiolib.h      |  1 +
 include/uapi/linux/gpio.h   | 12 +++++++++---
 3 files changed, 28 insertions(+), 6 deletions(-)

diff --git a/drivers/gpio/gpiolib-cdev.c b/drivers/gpio/gpiolib-cdev.c
index 678de9264617..ea787eb3810d 100644
--- a/drivers/gpio/gpiolib-cdev.c
+++ b/drivers/gpio/gpiolib-cdev.c
@@ -515,6 +515,7 @@ struct linereq {
 	 GPIO_V2_LINE_DIRECTION_FLAGS | \
 	 GPIO_V2_LINE_DRIVE_FLAGS | \
 	 GPIO_V2_LINE_EDGE_FLAGS | \
+	 GPIO_V2_LINE_FLAG_EVENT_CLOCK_REALTIME | \
 	 GPIO_V2_LINE_BIAS_FLAGS)
 
 static void linereq_put_event(struct linereq *lr,
@@ -535,6 +536,14 @@ static void linereq_put_event(struct linereq *lr,
 		pr_debug_ratelimited("event FIFO is full - event dropped\n");
 }
 
+static u64 line_event_timestamp(struct line *line)
+{
+	if (test_bit(FLAG_EVENT_CLOCK_REALTIME, &line->desc->flags))
+		return ktime_get_real_ns();
+
+	return ktime_get_ns();
+}
+
 static irqreturn_t edge_irq_thread(int irq, void *p)
 {
 	struct line *line = p;
@@ -553,7 +562,7 @@ static irqreturn_t edge_irq_thread(int irq, void *p)
 		 * which case we didn't get the timestamp from
 		 * edge_irq_handler().
 		 */
-		le.timestamp_ns = ktime_get_ns();
+		le.timestamp_ns = line_event_timestamp(line);
 		if (lr->num_lines != 1)
 			line->req_seqno = atomic_inc_return(&lr->seqno);
 	}
@@ -598,7 +607,7 @@ static irqreturn_t edge_irq_handler(int irq, void *p)
 	 * Just store the timestamp in hardirq context so we get it as
 	 * close in time as possible to the actual event.
 	 */
-	line->timestamp_ns = ktime_get_ns();
+	line->timestamp_ns = line_event_timestamp(line);
 
 	if (lr->num_lines != 1)
 		line->req_seqno = atomic_inc_return(&lr->seqno);
@@ -673,7 +682,7 @@ static void debounce_work_func(struct work_struct *work)
 	memset(&le, 0, sizeof(le));
 
 	lr = line->req;
-	le.timestamp_ns = ktime_get_ns();
+	le.timestamp_ns = line_event_timestamp(line);
 	le.offset = gpio_chip_hwgpio(line->desc);
 	line->line_seqno++;
 	le.line_seqno = line->line_seqno;
@@ -977,6 +986,9 @@ static void gpio_v2_line_config_flags_to_desc_flags(u64 flags,
 		   flags & GPIO_V2_LINE_FLAG_BIAS_PULL_DOWN);
 	assign_bit(FLAG_BIAS_DISABLE, flagsp,
 		   flags & GPIO_V2_LINE_FLAG_BIAS_DISABLED);
+
+	assign_bit(FLAG_EVENT_CLOCK_REALTIME, flagsp,
+		   flags & GPIO_V2_LINE_FLAG_EVENT_CLOCK_REALTIME);
 }
 
 static long linereq_get_values(struct linereq *lr, void __user *ip)
@@ -1940,6 +1952,9 @@ static void gpio_desc_to_lineinfo(struct gpio_desc *desc,
 	if (test_bit(FLAG_EDGE_FALLING, &desc->flags))
 		info->flags |= GPIO_V2_LINE_FLAG_EDGE_FALLING;
 
+	if (test_bit(FLAG_EVENT_CLOCK_REALTIME, &desc->flags))
+		info->flags |= GPIO_V2_LINE_FLAG_EVENT_CLOCK_REALTIME;
+
 	debounce_period_us = READ_ONCE(desc->debounce_period_us);
 	if (debounce_period_us) {
 		info->attrs[num_attrs].id = GPIO_V2_LINE_ATTR_ID_DEBOUNCE;
diff --git a/drivers/gpio/gpiolib.h b/drivers/gpio/gpiolib.h
index b674b5bb980e..2f228ffe8320 100644
--- a/drivers/gpio/gpiolib.h
+++ b/drivers/gpio/gpiolib.h
@@ -116,6 +116,7 @@ struct gpio_desc {
 #define FLAG_BIAS_DISABLE    15	/* GPIO has pull disabled */
 #define FLAG_EDGE_RISING     16	/* GPIO CDEV detects rising edge events */
 #define FLAG_EDGE_FALLING    17	/* GPIO CDEV detects falling edge events */
+#define FLAG_EVENT_CLOCK_REALTIME	18 /* GPIO CDEV reports REALTIME timestamps in events */
 
 	/* Connection label */
 	const char		*label;
diff --git a/include/uapi/linux/gpio.h b/include/uapi/linux/gpio.h
index 2072c260f5d0..e4eb0b8c5cf9 100644
--- a/include/uapi/linux/gpio.h
+++ b/include/uapi/linux/gpio.h
@@ -65,6 +65,7 @@ struct gpiochip_info {
  * @GPIO_V2_LINE_FLAG_BIAS_PULL_UP: line has pull-up bias enabled
  * @GPIO_V2_LINE_FLAG_BIAS_PULL_DOWN: line has pull-down bias enabled
  * @GPIO_V2_LINE_FLAG_BIAS_DISABLED: line has bias disabled
+ * @GPIO_V2_LINE_FLAG_EVENT_CLOCK_REALTIME: line events contain REALTIME timestamps
  */
 enum gpio_v2_line_flag {
 	GPIO_V2_LINE_FLAG_USED			= _BITULL(0),
@@ -78,6 +79,7 @@ enum gpio_v2_line_flag {
 	GPIO_V2_LINE_FLAG_BIAS_PULL_UP		= _BITULL(8),
 	GPIO_V2_LINE_FLAG_BIAS_PULL_DOWN	= _BITULL(9),
 	GPIO_V2_LINE_FLAG_BIAS_DISABLED		= _BITULL(10),
+	GPIO_V2_LINE_FLAG_EVENT_CLOCK_REALTIME	= _BITULL(11),
 };
 
 /**
@@ -270,9 +272,6 @@ enum gpio_v2_line_event_id {
 /**
  * struct gpio_v2_line_event - The actual event being pushed to userspace
  * @timestamp_ns: best estimate of time of event occurrence, in nanoseconds.
- * The @timestamp_ns is read from %CLOCK_MONOTONIC and is intended to allow
- * the accurate measurement of the time between events. It does not provide
- * the wall-clock time.
  * @id: event identifier with value from &enum gpio_v2_line_event_id
  * @offset: the offset of the line that triggered the event
  * @seqno: the sequence number for this event in the sequence of events for
@@ -280,6 +279,13 @@ enum gpio_v2_line_event_id {
  * @line_seqno: the sequence number for this event in the sequence of
  * events on this particular line
  * @padding: reserved for future use
+ *
+ * By default the @timestamp_ns is read from %CLOCK_MONOTONIC and is
+ * intended to allow the accurate measurement of the time between events.
+ * It does not provide the wall-clock time.
+ *
+ * If the %GPIO_V2_LINE_FLAG_EVENT_CLOCK_REALTIME flag is set then the
+ * @timestamp_ns is read from %CLOCK_REALTIME.
  */
 struct gpio_v2_line_event {
 	__aligned_u64 timestamp_ns;
-- 
2.28.0


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

* [PATCH v2 2/3] tools: gpio: add support for reporting realtime event clock to lsgpio
  2020-10-14 23:11 [PATCH v2 0/3] gpiolib: cdev: allow edge event timestamps to be configured as REALTIME Kent Gibson
  2020-10-14 23:11 ` [PATCH v2 1/3] " Kent Gibson
@ 2020-10-14 23:11 ` Kent Gibson
  2020-10-14 23:11 ` [PATCH v2 3/3] tools: gpio: add option to report wall-clock time to gpio-event-mon Kent Gibson
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 15+ messages in thread
From: Kent Gibson @ 2020-10-14 23:11 UTC (permalink / raw)
  To: linux-kernel, linux-gpio, bgolaszewski, linus.walleij; +Cc: Kent Gibson

Add support for reporting if a line is configured to report realtime
timestamps in events.

Signed-off-by: Kent Gibson <warthog618@gmail.com>
---
 tools/gpio/lsgpio.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/gpio/lsgpio.c b/tools/gpio/lsgpio.c
index 5a05a454d0c9..c61d061247e1 100644
--- a/tools/gpio/lsgpio.c
+++ b/tools/gpio/lsgpio.c
@@ -65,6 +65,10 @@ struct gpio_flag flagnames[] = {
 		.name = "bias-disabled",
 		.mask = GPIO_V2_LINE_FLAG_BIAS_DISABLED,
 	},
+	{
+		.name = "clock-realtime",
+		.mask = GPIO_V2_LINE_FLAG_EVENT_CLOCK_REALTIME,
+	},
 };
 
 static void print_attributes(struct gpio_v2_line_info *info)
-- 
2.28.0


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

* [PATCH v2 3/3] tools: gpio: add option to report wall-clock time to gpio-event-mon
  2020-10-14 23:11 [PATCH v2 0/3] gpiolib: cdev: allow edge event timestamps to be configured as REALTIME Kent Gibson
  2020-10-14 23:11 ` [PATCH v2 1/3] " Kent Gibson
  2020-10-14 23:11 ` [PATCH v2 2/3] tools: gpio: add support for reporting realtime event clock to lsgpio Kent Gibson
@ 2020-10-14 23:11 ` Kent Gibson
  2020-10-28 16:01 ` [PATCH v2 0/3] gpiolib: cdev: allow edge event timestamps to be configured as REALTIME Linus Walleij
  2020-12-05 22:23 ` Linus Walleij
  4 siblings, 0 replies; 15+ messages in thread
From: Kent Gibson @ 2020-10-14 23:11 UTC (permalink / raw)
  To: linux-kernel, linux-gpio, bgolaszewski, linus.walleij; +Cc: Kent Gibson

Add support for selecting the realtime clock for events.

Signed-off-by: Kent Gibson <warthog618@gmail.com>
---
 tools/gpio/gpio-event-mon.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tools/gpio/gpio-event-mon.c b/tools/gpio/gpio-event-mon.c
index 90c3155f05b1..cacd66ad7926 100644
--- a/tools/gpio/gpio-event-mon.c
+++ b/tools/gpio/gpio-event-mon.c
@@ -148,6 +148,7 @@ void print_usage(void)
 		"  -s         Set line as open source\n"
 		"  -r         Listen for rising edges\n"
 		"  -f         Listen for falling edges\n"
+		"  -w         Report the wall-clock time for events\n"
 		"  -b <n>     Debounce the line with period n microseconds\n"
 		" [-c <n>]    Do <n> loops (optional, infinite loop if not stated)\n"
 		"  -?         This helptext\n"
@@ -173,7 +174,7 @@ int main(int argc, char **argv)
 
 	memset(&config, 0, sizeof(config));
 	config.flags = GPIO_V2_LINE_FLAG_INPUT;
-	while ((c = getopt(argc, argv, "c:n:o:b:dsrf?")) != -1) {
+	while ((c = getopt(argc, argv, "c:n:o:b:dsrfw?")) != -1) {
 		switch (c) {
 		case 'c':
 			loops = strtoul(optarg, NULL, 10);
@@ -204,6 +205,9 @@ int main(int argc, char **argv)
 		case 'f':
 			config.flags |= GPIO_V2_LINE_FLAG_EDGE_FALLING;
 			break;
+		case 'w':
+			config.flags |= GPIO_V2_LINE_FLAG_EVENT_CLOCK_REALTIME;
+			break;
 		case '?':
 			print_usage();
 			return -1;
-- 
2.28.0


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

* Re: [PATCH v2 1/3] gpiolib: cdev: allow edge event timestamps to be configured as REALTIME
  2020-10-14 23:11 ` [PATCH v2 1/3] " Kent Gibson
@ 2020-10-16 14:13   ` Andy Shevchenko
  2020-10-16 23:27     ` Kent Gibson
  0 siblings, 1 reply; 15+ messages in thread
From: Andy Shevchenko @ 2020-10-16 14:13 UTC (permalink / raw)
  To: Kent Gibson
  Cc: Linux Kernel Mailing List, open list:GPIO SUBSYSTEM,
	Bartosz Golaszewski, Linus Walleij, Jack Winch

On Thu, Oct 15, 2020 at 6:53 AM Kent Gibson <warthog618@gmail.com> wrote:
>
> Using CLOCK_REALTIME as the source for event timestamps is crucial for
> some specific applications, particularly those requiring timetamps
> relative to a PTP clock, so provide an option to switch the event
> timestamp source from the default CLOCK_MONOTONIC to CLOCK_REALTIME.
>
> Note that CLOCK_REALTIME was the default source clock for GPIO until
> Linux 5.7 when it was changed to CLOCK_MONOTONIC due to issues with the
> shifting of the realtime clock.
> Providing this option maintains the CLOCK_MONOTONIC as the default,
> while also providing a path forward for those dependent on the pre-5.7
> behaviour.

...

>          GPIO_V2_LINE_DIRECTION_FLAGS | \
>          GPIO_V2_LINE_DRIVE_FLAGS | \
>          GPIO_V2_LINE_EDGE_FLAGS | \
> +        GPIO_V2_LINE_FLAG_EVENT_CLOCK_REALTIME | \

Wondering if we would have something like

          GPIO_V2_LINE_CLOCK_FLAGS | \

here for the sake of consistency.

>          GPIO_V2_LINE_BIAS_FLAGS)

...

> +static u64 line_event_timestamp(struct line *line)
> +{

> +       if (test_bit(FLAG_EVENT_CLOCK_REALTIME, &line->desc->flags))

I dunno if we can actually drop the word EVENT from these definitions.
I don't think we would have in the near future something similar for
the non-event data.

> +               return ktime_get_real_ns();
> +
> +       return ktime_get_ns();
> +}

In general it looks good, thanks!

-- 
With Best Regards,
Andy Shevchenko

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

* Re: [PATCH v2 1/3] gpiolib: cdev: allow edge event timestamps to be configured as REALTIME
  2020-10-16 14:13   ` Andy Shevchenko
@ 2020-10-16 23:27     ` Kent Gibson
  0 siblings, 0 replies; 15+ messages in thread
From: Kent Gibson @ 2020-10-16 23:27 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Linux Kernel Mailing List, open list:GPIO SUBSYSTEM,
	Bartosz Golaszewski, Linus Walleij, Jack Winch

On Fri, Oct 16, 2020 at 05:13:22PM +0300, Andy Shevchenko wrote:
> On Thu, Oct 15, 2020 at 6:53 AM Kent Gibson <warthog618@gmail.com> wrote:
> >
> > Using CLOCK_REALTIME as the source for event timestamps is crucial for
> > some specific applications, particularly those requiring timetamps
> > relative to a PTP clock, so provide an option to switch the event
> > timestamp source from the default CLOCK_MONOTONIC to CLOCK_REALTIME.
> >
> > Note that CLOCK_REALTIME was the default source clock for GPIO until
> > Linux 5.7 when it was changed to CLOCK_MONOTONIC due to issues with the
> > shifting of the realtime clock.
> > Providing this option maintains the CLOCK_MONOTONIC as the default,
> > while also providing a path forward for those dependent on the pre-5.7
> > behaviour.
> 
> ...
> 
> >          GPIO_V2_LINE_DIRECTION_FLAGS | \
> >          GPIO_V2_LINE_DRIVE_FLAGS | \
> >          GPIO_V2_LINE_EDGE_FLAGS | \
> > +        GPIO_V2_LINE_FLAG_EVENT_CLOCK_REALTIME | \
> 
> Wondering if we would have something like
> 
>           GPIO_V2_LINE_CLOCK_FLAGS | \
> 
> here for the sake of consistency.
> 

I considered it, but thought the chance of there ever being another
CLOCK flag to be near zero - the remaining clocks relate to CPU or
thread time which don't have any relevance for external events like
GPIO.  If there ever is one we can split it out then.

And it is consistent with the GPIO_V2_LINE_FLAG_ACTIVE_LOW flag that you
pruned out in your response. i.e. lone flags don't get grouped.

> >          GPIO_V2_LINE_BIAS_FLAGS)
> 
> ...
> 
> > +static u64 line_event_timestamp(struct line *line)
> > +{
> 
> > +       if (test_bit(FLAG_EVENT_CLOCK_REALTIME, &line->desc->flags))
> 
> I dunno if we can actually drop the word EVENT from these definitions.
> I don't think we would have in the near future something similar for
> the non-event data.
> 

I considered this too, as another clock flag seems unlikely.
But if we ever add a non-event clock flag then this one would become
confusing, and the overhead of the long name seemed minor compared to
the clarity it brings with it.

Cheers,
Kent.

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

* Re: [PATCH v2 0/3] gpiolib: cdev: allow edge event timestamps to be configured as REALTIME
  2020-10-14 23:11 [PATCH v2 0/3] gpiolib: cdev: allow edge event timestamps to be configured as REALTIME Kent Gibson
                   ` (2 preceding siblings ...)
  2020-10-14 23:11 ` [PATCH v2 3/3] tools: gpio: add option to report wall-clock time to gpio-event-mon Kent Gibson
@ 2020-10-28 16:01 ` Linus Walleij
  2020-10-28 23:22   ` Kent Gibson
  2020-12-05 22:23 ` Linus Walleij
  4 siblings, 1 reply; 15+ messages in thread
From: Linus Walleij @ 2020-10-28 16:01 UTC (permalink / raw)
  To: Kent Gibson; +Cc: linux-kernel, open list:GPIO SUBSYSTEM, Bartosz Golaszewski

On Thu, Oct 15, 2020 at 1:12 AM Kent Gibson <warthog618@gmail.com> wrote:

> This patch set adds the option to select CLOCK_REALTIME as the source
> clock for line events.
>
> The first patch is the core of the change, while the remaining two update
> the GPIO tools to make use of the new option.
>
> Changes for v2:
>  - change line_event_timestamp() return to u64 to avoid clipping to 32bits
>    on 32bit platforms.
>  - fix the line spacing after line_event_timestamp()

Where are we standing with this patch set? Good to go so
I should just try to merge it?

Yours,
Linus Walleij

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

* Re: [PATCH v2 0/3] gpiolib: cdev: allow edge event timestamps to be configured as REALTIME
  2020-10-28 16:01 ` [PATCH v2 0/3] gpiolib: cdev: allow edge event timestamps to be configured as REALTIME Linus Walleij
@ 2020-10-28 23:22   ` Kent Gibson
  2020-10-30 14:49     ` Bartosz Golaszewski
  0 siblings, 1 reply; 15+ messages in thread
From: Kent Gibson @ 2020-10-28 23:22 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-kernel, open list:GPIO SUBSYSTEM, Bartosz Golaszewski

On Wed, Oct 28, 2020 at 05:01:49PM +0100, Linus Walleij wrote:
> On Thu, Oct 15, 2020 at 1:12 AM Kent Gibson <warthog618@gmail.com> wrote:
> 
> > This patch set adds the option to select CLOCK_REALTIME as the source
> > clock for line events.
> >
> > The first patch is the core of the change, while the remaining two update
> > the GPIO tools to make use of the new option.
> >
> > Changes for v2:
> >  - change line_event_timestamp() return to u64 to avoid clipping to 32bits
> >    on 32bit platforms.
> >  - fix the line spacing after line_event_timestamp()
> 
> Where are we standing with this patch set? Good to go so
> I should just try to merge it?
> 

I'm fine with it, especially now that I've tested it on 32bit platforms
as well as 64bit.

Bart was ok with v1, and I doubt the changes for v2 would negatively
impact that, though I did overlook adding his review tag.

Cheers,
Kent.

> Yours,
> Linus Walleij

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

* Re: [PATCH v2 0/3] gpiolib: cdev: allow edge event timestamps to be configured as REALTIME
  2020-10-28 23:22   ` Kent Gibson
@ 2020-10-30 14:49     ` Bartosz Golaszewski
  2020-10-30 14:52       ` Bartosz Golaszewski
  0 siblings, 1 reply; 15+ messages in thread
From: Bartosz Golaszewski @ 2020-10-30 14:49 UTC (permalink / raw)
  To: Kent Gibson; +Cc: Linus Walleij, linux-kernel, open list:GPIO SUBSYSTEM

On Thu, Oct 29, 2020 at 12:22 AM Kent Gibson <warthog618@gmail.com> wrote:
>
> On Wed, Oct 28, 2020 at 05:01:49PM +0100, Linus Walleij wrote:
> > On Thu, Oct 15, 2020 at 1:12 AM Kent Gibson <warthog618@gmail.com> wrote:
> >
> > > This patch set adds the option to select CLOCK_REALTIME as the source
> > > clock for line events.
> > >
> > > The first patch is the core of the change, while the remaining two update
> > > the GPIO tools to make use of the new option.
> > >
> > > Changes for v2:
> > >  - change line_event_timestamp() return to u64 to avoid clipping to 32bits
> > >    on 32bit platforms.
> > >  - fix the line spacing after line_event_timestamp()
> >
> > Where are we standing with this patch set? Good to go so
> > I should just try to merge it?
> >
>
> I'm fine with it, especially now that I've tested it on 32bit platforms
> as well as 64bit.
>
> Bart was ok with v1, and I doubt the changes for v2 would negatively
> impact that, though I did overlook adding his review tag.
>
> Cheers,
> Kent.
>
> > Yours,
> > Linus Walleij

I'll take it through my tree then.

Bartosz

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

* Re: [PATCH v2 0/3] gpiolib: cdev: allow edge event timestamps to be configured as REALTIME
  2020-10-30 14:49     ` Bartosz Golaszewski
@ 2020-10-30 14:52       ` Bartosz Golaszewski
  2020-10-31  0:01         ` Kent Gibson
  0 siblings, 1 reply; 15+ messages in thread
From: Bartosz Golaszewski @ 2020-10-30 14:52 UTC (permalink / raw)
  To: Kent Gibson; +Cc: Linus Walleij, linux-kernel, open list:GPIO SUBSYSTEM

On Fri, Oct 30, 2020 at 3:49 PM Bartosz Golaszewski
<bgolaszewski@baylibre.com> wrote:
>
> On Thu, Oct 29, 2020 at 12:22 AM Kent Gibson <warthog618@gmail.com> wrote:
> >
> > On Wed, Oct 28, 2020 at 05:01:49PM +0100, Linus Walleij wrote:
> > > On Thu, Oct 15, 2020 at 1:12 AM Kent Gibson <warthog618@gmail.com> wrote:
> > >
> > > > This patch set adds the option to select CLOCK_REALTIME as the source
> > > > clock for line events.
> > > >
> > > > The first patch is the core of the change, while the remaining two update
> > > > the GPIO tools to make use of the new option.
> > > >
> > > > Changes for v2:
> > > >  - change line_event_timestamp() return to u64 to avoid clipping to 32bits
> > > >    on 32bit platforms.
> > > >  - fix the line spacing after line_event_timestamp()
> > >
> > > Where are we standing with this patch set? Good to go so
> > > I should just try to merge it?
> > >
> >
> > I'm fine with it, especially now that I've tested it on 32bit platforms
> > as well as 64bit.
> >
> > Bart was ok with v1, and I doubt the changes for v2 would negatively
> > impact that, though I did overlook adding his review tag.
> >
> > Cheers,
> > Kent.
> >
> > > Yours,
> > > Linus Walleij
>
> I'll take it through my tree then.
>
> Bartosz

The series no longer applies on top of v5.10-rc1. Could you rebase and resend?

Bartosz

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

* Re: [PATCH v2 0/3] gpiolib: cdev: allow edge event timestamps to be configured as REALTIME
  2020-10-30 14:52       ` Bartosz Golaszewski
@ 2020-10-31  0:01         ` Kent Gibson
  2020-11-02  8:56           ` Bartosz Golaszewski
  2020-11-06 13:49           ` Linus Walleij
  0 siblings, 2 replies; 15+ messages in thread
From: Kent Gibson @ 2020-10-31  0:01 UTC (permalink / raw)
  To: Bartosz Golaszewski; +Cc: Linus Walleij, linux-kernel, open list:GPIO SUBSYSTEM

On Fri, Oct 30, 2020 at 03:52:24PM +0100, Bartosz Golaszewski wrote:
> On Fri, Oct 30, 2020 at 3:49 PM Bartosz Golaszewski
> <bgolaszewski@baylibre.com> wrote:
> >
> > On Thu, Oct 29, 2020 at 12:22 AM Kent Gibson <warthog618@gmail.com> wrote:
> > >
> > > On Wed, Oct 28, 2020 at 05:01:49PM +0100, Linus Walleij wrote:
> > > > On Thu, Oct 15, 2020 at 1:12 AM Kent Gibson <warthog618@gmail.com> wrote:
> > > >
> > > > > This patch set adds the option to select CLOCK_REALTIME as the source
> > > > > clock for line events.
> > > > >
> > > > > The first patch is the core of the change, while the remaining two update
> > > > > the GPIO tools to make use of the new option.
> > > > >
> > > > > Changes for v2:
> > > > >  - change line_event_timestamp() return to u64 to avoid clipping to 32bits
> > > > >    on 32bit platforms.
> > > > >  - fix the line spacing after line_event_timestamp()
> > > >
> > > > Where are we standing with this patch set? Good to go so
> > > > I should just try to merge it?
> > > >
> > >
> > > I'm fine with it, especially now that I've tested it on 32bit platforms
> > > as well as 64bit.
> > >
> > > Bart was ok with v1, and I doubt the changes for v2 would negatively
> > > impact that, though I did overlook adding his review tag.
> > >
> > > Cheers,
> > > Kent.
> > >
> > > > Yours,
> > > > Linus Walleij
> >
> > I'll take it through my tree then.
> >
> > Bartosz
> 
> The series no longer applies on top of v5.10-rc1. Could you rebase and resend?
> 

Nuts, it relies on my doc tidy-up series that Linus has pulled into
fixes, and so will likely go into v5.10-rc2??

Specifically it is based over/conflicts with:
2cc522d3931b gpio: uapi: kernel-doc formatting improvements

If I rebase it onto devel then you will get a conflict when those merge.
Is that what you want?

Cheers,
Kent.

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

* Re: [PATCH v2 0/3] gpiolib: cdev: allow edge event timestamps to be configured as REALTIME
  2020-10-31  0:01         ` Kent Gibson
@ 2020-11-02  8:56           ` Bartosz Golaszewski
  2020-11-06 13:49           ` Linus Walleij
  1 sibling, 0 replies; 15+ messages in thread
From: Bartosz Golaszewski @ 2020-11-02  8:56 UTC (permalink / raw)
  To: Kent Gibson, Linus Walleij; +Cc: linux-kernel, open list:GPIO SUBSYSTEM

On Sat, Oct 31, 2020 at 1:01 AM Kent Gibson <warthog618@gmail.com> wrote:
>
> On Fri, Oct 30, 2020 at 03:52:24PM +0100, Bartosz Golaszewski wrote:
> > On Fri, Oct 30, 2020 at 3:49 PM Bartosz Golaszewski
> > <bgolaszewski@baylibre.com> wrote:
> > >
> > > On Thu, Oct 29, 2020 at 12:22 AM Kent Gibson <warthog618@gmail.com> wrote:
> > > >
> > > > On Wed, Oct 28, 2020 at 05:01:49PM +0100, Linus Walleij wrote:
> > > > > On Thu, Oct 15, 2020 at 1:12 AM Kent Gibson <warthog618@gmail.com> wrote:
> > > > >
> > > > > > This patch set adds the option to select CLOCK_REALTIME as the source
> > > > > > clock for line events.
> > > > > >
> > > > > > The first patch is the core of the change, while the remaining two update
> > > > > > the GPIO tools to make use of the new option.
> > > > > >
> > > > > > Changes for v2:
> > > > > >  - change line_event_timestamp() return to u64 to avoid clipping to 32bits
> > > > > >    on 32bit platforms.
> > > > > >  - fix the line spacing after line_event_timestamp()
> > > > >
> > > > > Where are we standing with this patch set? Good to go so
> > > > > I should just try to merge it?
> > > > >
> > > >
> > > > I'm fine with it, especially now that I've tested it on 32bit platforms
> > > > as well as 64bit.
> > > >
> > > > Bart was ok with v1, and I doubt the changes for v2 would negatively
> > > > impact that, though I did overlook adding his review tag.
> > > >
> > > > Cheers,
> > > > Kent.
> > > >
> > > > > Yours,
> > > > > Linus Walleij
> > >
> > > I'll take it through my tree then.
> > >
> > > Bartosz
> >
> > The series no longer applies on top of v5.10-rc1. Could you rebase and resend?
> >
>
> Nuts, it relies on my doc tidy-up series that Linus has pulled into
> fixes, and so will likely go into v5.10-rc2??
>
> Specifically it is based over/conflicts with:
> 2cc522d3931b gpio: uapi: kernel-doc formatting improvements
>
> If I rebase it onto devel then you will get a conflict when those merge.
> Is that what you want?
>
> Cheers,
> Kent.

I'll let Linus take these through his tree then.

Bartosz

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

* Re: [PATCH v2 0/3] gpiolib: cdev: allow edge event timestamps to be configured as REALTIME
  2020-10-31  0:01         ` Kent Gibson
  2020-11-02  8:56           ` Bartosz Golaszewski
@ 2020-11-06 13:49           ` Linus Walleij
  2020-12-01 18:20             ` Bartosz Golaszewski
  1 sibling, 1 reply; 15+ messages in thread
From: Linus Walleij @ 2020-11-06 13:49 UTC (permalink / raw)
  To: Kent Gibson; +Cc: Bartosz Golaszewski, linux-kernel, open list:GPIO SUBSYSTEM

On Sat, Oct 31, 2020 at 1:01 AM Kent Gibson <warthog618@gmail.com> wrote:
> On Fri, Oct 30, 2020 at 03:52:24PM +0100, Bartosz Golaszewski wrote:

> > The series no longer applies on top of v5.10-rc1. Could you rebase and resend?
>
> Nuts, it relies on my doc tidy-up series that Linus has pulled into
> fixes, and so will likely go into v5.10-rc2??

If I have time to get the GPIO fixes into -rc2. Otherwise -rc3
and then I need to merge the resulting -rc into the devel branch
before applying.

I will get to it sooner or later, I think Bartosz might have some
more GPIO fixes that I need to pull first before sending any
fixes upstream.

Yours,
Linus Walleij

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

* Re: [PATCH v2 0/3] gpiolib: cdev: allow edge event timestamps to be configured as REALTIME
  2020-11-06 13:49           ` Linus Walleij
@ 2020-12-01 18:20             ` Bartosz Golaszewski
  0 siblings, 0 replies; 15+ messages in thread
From: Bartosz Golaszewski @ 2020-12-01 18:20 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Kent Gibson, Bartosz Golaszewski, linux-kernel, open list:GPIO SUBSYSTEM

On Fri, Nov 6, 2020 at 2:49 PM Linus Walleij <linus.walleij@linaro.org> wrote:
>
> On Sat, Oct 31, 2020 at 1:01 AM Kent Gibson <warthog618@gmail.com> wrote:
> > On Fri, Oct 30, 2020 at 03:52:24PM +0100, Bartosz Golaszewski wrote:
>
> > > The series no longer applies on top of v5.10-rc1. Could you rebase and resend?
> >
> > Nuts, it relies on my doc tidy-up series that Linus has pulled into
> > fixes, and so will likely go into v5.10-rc2??
>
> If I have time to get the GPIO fixes into -rc2. Otherwise -rc3
> and then I need to merge the resulting -rc into the devel branch
> before applying.
>
> I will get to it sooner or later, I think Bartosz might have some
> more GPIO fixes that I need to pull first before sending any
> fixes upstream.
>
> Yours,
> Linus Walleij

Hi Linus,

Just a gentle ping on this, so it doesn't get forgotten before the
next merge window.

Bartosz

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

* Re: [PATCH v2 0/3] gpiolib: cdev: allow edge event timestamps to be configured as REALTIME
  2020-10-14 23:11 [PATCH v2 0/3] gpiolib: cdev: allow edge event timestamps to be configured as REALTIME Kent Gibson
                   ` (3 preceding siblings ...)
  2020-10-28 16:01 ` [PATCH v2 0/3] gpiolib: cdev: allow edge event timestamps to be configured as REALTIME Linus Walleij
@ 2020-12-05 22:23 ` Linus Walleij
  4 siblings, 0 replies; 15+ messages in thread
From: Linus Walleij @ 2020-12-05 22:23 UTC (permalink / raw)
  To: Kent Gibson; +Cc: linux-kernel, open list:GPIO SUBSYSTEM, Bartosz Golaszewski

On Thu, Oct 15, 2020 at 1:12 AM Kent Gibson <warthog618@gmail.com> wrote:

> This patch set adds the option to select CLOCK_REALTIME as the source
> clock for line events.
>
> The first patch is the core of the change, while the remaining two update
> the GPIO tools to make use of the new option.
>
> Changes for v2:
>  - change line_event_timestamp() return to u64 to avoid clipping to 32bits
>    on 32bit platforms.
>  - fix the line spacing after line_event_timestamp()

I applied the v2 patch set for v5.11 now, it seems to work fine!

Yours,
Linus Walleij

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

end of thread, other threads:[~2020-12-05 22:24 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-14 23:11 [PATCH v2 0/3] gpiolib: cdev: allow edge event timestamps to be configured as REALTIME Kent Gibson
2020-10-14 23:11 ` [PATCH v2 1/3] " Kent Gibson
2020-10-16 14:13   ` Andy Shevchenko
2020-10-16 23:27     ` Kent Gibson
2020-10-14 23:11 ` [PATCH v2 2/3] tools: gpio: add support for reporting realtime event clock to lsgpio Kent Gibson
2020-10-14 23:11 ` [PATCH v2 3/3] tools: gpio: add option to report wall-clock time to gpio-event-mon Kent Gibson
2020-10-28 16:01 ` [PATCH v2 0/3] gpiolib: cdev: allow edge event timestamps to be configured as REALTIME Linus Walleij
2020-10-28 23:22   ` Kent Gibson
2020-10-30 14:49     ` Bartosz Golaszewski
2020-10-30 14:52       ` Bartosz Golaszewski
2020-10-31  0:01         ` Kent Gibson
2020-11-02  8:56           ` Bartosz Golaszewski
2020-11-06 13:49           ` Linus Walleij
2020-12-01 18:20             ` Bartosz Golaszewski
2020-12-05 22:23 ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).