Skip to contentSkip to conversation

IIO hrtimer trigger

PATCH New Denis CIOCCA 3 participants 8 messages Sep 29, 2013 – Jun 19, 2014 IIO

lore
Share & tools
lore
#0 lore raw

Hi Lars,

Thanks for your review.
I reviewed the code in accordance with your comments, for the other point can you explain me better please?
You intend to use one driver to manage all triggers added by sysfs?

Thanks,
Denis

#1 lore raw

PATCH 1/1 iio:trigger: Added iio-hrtimer-trigger

This patch adds high resolution timer trigger support for iio framework.

---
 drivers/iio/trigger/Kconfig            |    9 +
 drivers/iio/trigger/Makefile           |    1 +
 drivers/iio/trigger/iio-trig-hrtimer.c |  292 ++++++++++++++++++++++++++++++++
 3 files changed, 302 insertions(+)
 create mode 100644 drivers/iio/trigger/iio-trig-hrtimer.c
drivers/iio/trigger/Kconfig +9 -0
index 7999612..f0da684 100644
@@ -5,6 +5,15 @@
 
 menu "Triggers - standalone"
 
+config IIO_HRTIMER_TRIGGER
+	tristate "HRTIMER trigger"
+	help
+	  Provides support for using HRTIMER entries as IIO triggers.
+	  If unsure, say N (but it's safe to say "Y").
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called iio-trig-hrtimer.
+
 config IIO_INTERRUPT_TRIGGER
 	tristate "Generic interrupt trigger"
 	help
drivers/iio/trigger/Makefile +1 -0
index 0694dae..424032c 100644
@@ -3,5 +3,6 @@
 #
 
 # When adding new entries keep the list in alphabetical order
+obj-$(CONFIG_IIO_HRTIMER_TRIGGER) += iio-trig-hrtimer.o
 obj-$(CONFIG_IIO_INTERRUPT_TRIGGER) += iio-trig-interrupt.o
 obj-$(CONFIG_IIO_SYSFS_TRIGGER) += iio-trig-sysfs.o
drivers/iio/trigger/iio-trig-hrtimer.c new file +292 -0

292 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#2 lore raw
In reply to Denis CIOCCA
Quoted 6 lines · Denis CIOCCA

Hi Lars,

Thanks for your review.
I reviewed the code in accordance with your comments, for the other point can you explain me better please?
You intend to use one driver to manage all triggers added by sysfs?

Not necessarily, but I think we should have some common code that manages the software triggers. But what I'm most concerned about is the userspace ABI, since once we have added it, we have to maintain it forever. So the big question do we think that the current ABI implemented by that patch is good enough. Some thoughts:

* Should it maybe be called timer instead of hrtimer.
* Do we only want to allow names which follow "hrtimer-%d" or do we want to allow arbitrary names.
* Do we want to have a top-level folder for each sw trigger type
* Is sysfs actually the right place for this, or should it go into configfs? Quote from Documentation/filesystems/configs:
"configfs is a ram-based filesystem that provides the converse of
sysfs's functionality. Where sysfs is a filesystem-based view of kernel objects, configfs is a filesystem-based manager of kernel objects, or config_items. [...] Unlike sysfs, the
lifetime of the representation is completely driven by userspace. The kernel modules backing the items must respond to this."

I think especially the last one deserves some though.

- Lars

maintainer
#3 lore raw
Quoted 10 lines · Lars-Peter Clausen
Quoted 6 lines · Denis CIOCCA

Hi Lars,

Thanks for your review.
I reviewed the code in accordance with your comments, for the other point can you explain me better please?
You intend to use one driver to manage all triggers added by sysfs?

Not necessarily, but I think we should have some common code that manages the software triggers.

That is fair enough.

Quoted 4 lines

But what I'm most concerned about is the userspace
ABI, since once we have added it, we have to maintain it forever. So the big question do we think that the current ABI implemented by that patch is good enough.

We are pretty much stuck with that for the sysfs trigger already...

Quoted 3 lines

Some thoughts:

* Should it maybe be called timer instead of hrtimer.

Agreed.

Quoted 2 lines

* Do we only want to allow names which follow "hrtimer-%d" or do we want to allow arbitrary names.

Arbitary would be fine.

Quoted 1 line

* Do we want to have a top-level folder for each sw trigger type

I'm not that bothered about this we are hardly talking a huge number of such folders.

Quoted 8 lines

* Is sysfs actually the right place for this, or should it go into configfs? Quote from Documentation/filesystems/configs:
"configfs is a ram-based filesystem that provides the converse of
sysfs's functionality. Where sysfs is a filesystem-based view of kernel objects, configfs is a filesystem-based manager of kernel objects, or config_items. [...] Unlike sysfs, the
lifetime of the representation is completely driven by userspace. The kernel modules backing the items must respond to this."

Hmm. maybe, I'm not sure how cleanly this would work and it adds an additional dependency for all these types of drivers. I'll take the lazy option:
Go on Lars, put together a full proposal on the actual interface ;)

Another vague thought was the on demand creation of timer based triggers that I think zio provides. Basically if a non existent trigger is requested the subsystem figures out what is requested and creates it. Not terribly nice to implement, and to my mind unnecessary and possibly confusing...

Jonathan

Quoted 7 lines

I think especially the last one deserves some though.

- Lars

#4 lore raw
Quoted 11 lines · Jonathan Cameron
Quoted 10 lines · Lars-Peter Clausen
Quoted 6 lines · Denis CIOCCA

Hi Lars,

Thanks for your review.
I reviewed the code in accordance with your comments, for the other point can you explain me better please?
You intend to use one driver to manage all triggers added by sysfs?

Not necessarily, but I think we should have some common code that manages the software triggers.

Quoted 7 lines

That is fair enough.

Quoted 4 lines

But what I'm most concerned about is the userspace
ABI, since once we have added it, we have to maintain it forever. So the big question do we think that the current ABI implemented by that patch is good enough.

We are pretty much stuck with that for the sysfs trigger already...

Unfortunately yes. I never liked its API and I still don't like it and we have to live with it. But this doesn't mean we have to add more of the same.

Quoted 19 lines
Quoted 4 lines

Some thoughts:

* Should it maybe be called timer instead of hrtimer.

Agreed.

Quoted 2 lines

* Do we only want to allow names which follow "hrtimer-%d" or do we want to allow arbitrary names.

Arbitary would be fine.

Quoted 1 line

* Do we want to have a top-level folder for each sw trigger type

I'm not that bothered about this we are hardly talking a huge number of such folders.

Quoted 8 lines

* Is sysfs actually the right place for this, or should it go into configfs? Quote from Documentation/filesystems/configs:
"configfs is a ram-based filesystem that provides the converse of
sysfs's functionality. Where sysfs is a filesystem-based view of kernel objects, configfs is a filesystem-based manager of kernel objects, or config_items. [...] Unlike sysfs, the
lifetime of the representation is completely driven by userspace. The kernel modules backing the items must respond to this."

Quoted 3 lines

Hmm. maybe, I'm not sure how cleanly this would work and it adds an additional dependency for all these types of drivers. I'll take the lazy option:
Go on Lars, put together a full proposal on the actual interface ;)

I'll do that but that might take a few weeks until I get to it.

Quoted 6 lines

Another vague thought was the on demand creation of timer based triggers that I think zio provides. Basically if a non existent trigger is requested the subsystem figures out what is requested and creates it. Not terribly nice to implement, and to my mind unnecessary and possibly confusing...

I don't think that would work to nicely in our case.

Quoted 5 lines

Jonathan

Quoted 4 lines

I think especially the last one deserves some though.

- Lars

maintainer
#5 lore raw
Quoted 42 lines · Lars-Peter Clausen
Quoted 11 lines · Jonathan Cameron
Quoted 10 lines · Lars-Peter Clausen
Quoted 6 lines · Denis CIOCCA

Hi Lars,

Thanks for your review.
I reviewed the code in accordance with your comments, for the other point can you explain me better please?
You intend to use one driver to manage all triggers added by sysfs?

Not necessarily, but I think we should have some common code that manages the software triggers.

Quoted 7 lines

That is fair enough.

Quoted 4 lines

But what I'm most concerned about is the userspace
ABI, since once we have added it, we have to maintain it forever. So the big question do we think that the current ABI implemented by that patch is good enough.

We are pretty much stuck with that for the sysfs trigger already...

Unfortunately yes. I never liked its API and I still don't like it and we have to live with it. But this doesn't mean we have to add more of the same.

Quoted 19 lines
Quoted 4 lines

Some thoughts:

* Should it maybe be called timer instead of hrtimer.

Agreed.

Quoted 2 lines

* Do we only want to allow names which follow "hrtimer-%d" or do we want to allow arbitrary names.

Arbitary would be fine.

Quoted 1 line

* Do we want to have a top-level folder for each sw trigger type

I'm not that bothered about this we are hardly talking a huge number of such folders.

Quoted 8 lines

* Is sysfs actually the right place for this, or should it go into configfs? Quote from Documentation/filesystems/configs:
"configfs is a ram-based filesystem that provides the converse of
sysfs's functionality. Where sysfs is a filesystem-based view of kernel objects, configfs is a filesystem-based manager of kernel objects, or config_items. [...] Unlike sysfs, the
lifetime of the representation is completely driven by userspace. The kernel modules backing the items must respond to this."

Quoted 5 lines
Quoted 3 lines

Hmm. maybe, I'm not sure how cleanly this would work and it adds an additional dependency for all these types of drivers. I'll take the lazy option:
Go on Lars, put together a full proposal on the actual interface ;)

I'll do that but that might take a few weeks until I get to it.

Bump. Do we want to still wait for this, or should we just go ahead with the hrtimer as is. It may not be ideal, but it's useful and lets us kill off some much worse options..

Quoted 15 lines
Quoted 7 lines

Another vague thought was the on demand creation of timer based triggers that I think zio provides. Basically if a non existent trigger is requested the subsystem figures out what is requested and creates it. Not terribly nice to implement, and to my mind unnecessary and possibly confusing...

I don't think that would work to nicely in our case.

Quoted 5 lines

Jonathan

Quoted 4 lines

I think especially the last one deserves some though.

- Lars

#6 lore raw
Quoted 50 lines · Jonathan Cameron
Quoted 49 lines · Lars-Peter Clausen
Quoted 11 lines · Jonathan Cameron
Quoted 10 lines · Lars-Peter Clausen
Quoted 6 lines · Denis CIOCCA

Hi Lars,

Thanks for your review.
I reviewed the code in accordance with your comments, for the other point can you explain me better please?
You intend to use one driver to manage all triggers added by sysfs?

Not necessarily, but I think we should have some common code that manages the software triggers.

Quoted 8 lines

That is fair enough.

Quoted 5 lines

But what I'm most concerned about is the userspace
ABI, since once we have added it, we have to maintain it forever. So the big
question do we think that the current ABI implemented by that patch is good enough.

We are pretty much stuck with that for the sysfs trigger already...

Unfortunately yes. I never liked its API and I still don't like it and we have to live with it. But this doesn't mean we have to add more of the same.

Quoted 24 lines
Quoted 4 lines

Some thoughts:

* Should it maybe be called timer instead of hrtimer.

Agreed.

Quoted 2 lines

* Do we only want to allow names which follow "hrtimer-%d" or do we want to allow arbitrary names.

Arbitary would be fine.

Quoted 1 line

* Do we want to have a top-level folder for each sw trigger type

I'm not that bothered about this we are hardly talking a huge number of such folders.

Quoted 9 lines

* Is sysfs actually the right place for this, or should it go into configfs?
Quote from Documentation/filesystems/configs:
"configfs is a ram-based filesystem that provides the converse of
sysfs's functionality. Where sysfs is a filesystem-based view of kernel objects, configfs is a filesystem-based manager of kernel objects, or config_items. [...] Unlike sysfs, the
lifetime of the representation is completely driven by userspace. The kernel modules backing the items must respond to this."

Hmm. maybe, I'm not sure how cleanly this would work and it adds an additional
dependency for all these types of drivers. I'll take the lazy option:
Go on Lars, put together a full proposal on the actual interface ;)

Quoted 4 lines
Quoted 1 line

I'll do that but that might take a few weeks until I get to it.

Bump. Do we want to still wait for this, or should we just go ahead with the hrtimer as is. It may not be ideal, but it's useful and lets us kill off some much worse options..

I'd really prefer to not compromise on user-space ABI. Quick hacks are sometimes fine for kernel internal things since we can clean them up later. But for userspace ABI we'll be stuck with it forever.

maintainer
#7 lore raw
Quoted 68 lines · Lars-Peter Clausen
Quoted 8 lines · Jonathan Cameron
Quoted 7 lines · Lars-Peter Clausen
Quoted 6 lines · Jonathan Cameron
Quoted 5 lines · Lars-Peter Clausen
Quoted 4 lines · Denis CIOCCA

Hi Lars,

Thanks for your review.
I reviewed the code in accordance with your comments, for the

other point

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

can you explain me better please?
You intend to use one driver to manage all triggers added by

sysfs?

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Not necessarily, but I think we should have some common code that

manages

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 1 line

the software triggers.

That is fair enough.

Quoted 2 lines

But what I'm most concerned about is the userspace
ABI, since once we have added it, we have to maintain it forever.

So the

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

big
question do we think that the current ABI implemented by that

patch is good

Quoted 4 lines
Quoted 4 lines
Quoted 2 lines
Quoted 1 line

enough.

We are pretty much stuck with that for the sysfs trigger already...

Unfortunately yes. I never liked its API and I still don't like it

and we

Quoted 1 line
Quoted 1 line

have to live with it. But this doesn't mean we have to add more of

the same.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines

Some thoughts:

* Should it maybe be called timer instead of hrtimer.

Agreed.

Quoted 1 line

* Do we only want to allow names which follow "hrtimer-%d" or do

we want to

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 1 line

allow arbitrary names.

Arbitary would be fine.

Quoted 1 line

* Do we want to have a top-level folder for each sw trigger type

I'm not that bothered about this we are hardly talking a huge

number of such

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

folders.

Quoted 4 lines

* Is sysfs actually the right place for this, or should it go into configfs?
Quote from Documentation/filesystems/configs:
"configfs is a ram-based filesystem that provides the converse

of

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

sysfs's functionality. Where sysfs is a filesystem-based view

of

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

kernel objects, configfs is a filesystem-based manager of

kernel

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

objects, or config_items. [...] Unlike sysfs, the lifetime of the representation is completely driven by

userspace. The

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 1 line

kernel modules backing the items must respond to this."

Hmm. maybe, I'm not sure how cleanly this would work and it adds an additional
dependency for all these types of drivers. I'll take the lazy

option:

Quoted 4 lines
Quoted 3 lines
Quoted 1 line

Go on Lars, put together a full proposal on the actual interface ;)

I'll do that but that might take a few weeks until I get to it.

Bump. Do we want to still wait for this, or should we just go ahead

with the

Quoted 8 lines
Quoted 1 line

hrtimer as is. It may not be ideal, but it's useful and lets us kill

off

Quoted 1 line

some much worse options..

I'd really prefer to not compromise on user-space ABI. Quick hacks are sometimes fine for kernel internal things since we can clean them up later.
But for userspace ABI we'll be stuck with it forever.

I am slightly less bothered by this than normal because we obliged to keep the sysfs
trigger interface around indefinitely anyway and this would be much the same.

I am yet to be convinced that dragging in configfs makes sense...

Still, other purpose of restarting this thread was to hope to move it forward!

Signature · 1 line
Sent from my Android phone with K-9 Mail. Please excuse my brevity.