Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1405579
| Path | csiph.com!news.mixmin.net!aioe.org!gothmog.csi.it!bofh.it!news.nic.it!robomod |
|---|---|
| From | Crestez Dan Leonard <leonard.crestez@intel.com> |
| Newsgroups | linux.kernel |
| Subject | [RFC 0/7] Deal with iio trigger names |
| Date | Mon, 23 May 2016 20:50:03 +0200 |
| Message-ID | <rC35n-13f-3@gated-at.bofh.it> (permalink) |
| X-Original-To | Jonathan Cameron <jic23@kernel.org>, linux-iio@vger.kernel.org |
| X-Extloop1 | 1 |
| X-Ironport-Av | E=Sophos;i="5.26,356,1459839600"; d="scan'208";a="813091908" |
| X-Mailer | git-send-email 2.5.5 |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 60 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | linux-kernel@vger.kernel.org, Hartmut Knaack <knaack.h@gmx.de>, Lars-Peter Clausen <lars@metafoo.de>, Peter Meerwald-Stadler <pmeerw@pmeerw.net>, Daniel Baluta <daniel.baluta@intel.com>, Crestez Dan Leonard <leonard.crestez@intel.com> |
| X-Original-Date | Mon, 23 May 2016 21:39:55 +0300 |
| X-Original-Message-ID | <cover.1464027859.git.leonard.crestez@intel.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1405579 |
Show key headers only | View raw
IIO documents that trigger names are unique but does not actually guarantee this. You can easily create a software trigger with a duplicate name if you enable CONFIG_IIO_HRTIMER_TRIGGER: mkdir /sys/kernel/config/iio/triggers/hrtimer/\ `cat /sys/bus/iio/devices/trigger0/name` You can also get in this situation if you connect two identical st_sensors. My attempt to fix this is by adding a new 'current_trigger_id' ABI which is a numeric ID (X from triggerX) rather than a non-unique string. I tested that this works as expected when connecting two LIS3DH to the same system. This is in patches 4,5. In theory the current_trigger ABI could be overloaded to looks for something matching "trigger[0-9]+" but this would be nastier. There would be a need to prevent registering triggers that match that expression in order to prevent stuff like: mkdir /sys/kernel/config/iio/triggers/hrtimer/trigger1 Such an overload wouldn't work on read and make it impossible to unambigiously determine the currently selected trigger. Patch 6 disallows registering duplicate trigger names. This makes drivers which currently do that break at probe time. Patch 7 attempts to ensure that all drivers include indio_dev->id when calling iio_trigger_alloc. This obviously changes trigger names. Either 4,5 or 6,7 fix this issue, but 4,5 causes fewer compat issues. Patches 1,2,3 are just minor features in tools/generic_buffer. They supersede the v2 I posted earlier: https://www.spinics.net/lists/linux-iio/msg24867.html Crestez Dan Leonard (7): iio: generic_buffer: Cleanup when receiving signals iio: generic_buffer: Add --device-num option iio: generic_buffer: Add --trigger-num option iio: Add current_trigger_id alternative iio: generic_buffer: Use current_trigger_id iio: Refuse to register triggers with duplicate names iio: Make trigger names unique Documentation/ABI/testing/sysfs-bus-iio | 9 + Documentation/DocBook/iio.tmpl | 4 +- drivers/iio/adc/max1027.c | 4 +- drivers/iio/common/st_sensors/st_sensors_trigger.c | 2 +- drivers/iio/industrialio-trigger.c | 136 ++++++++--- drivers/iio/light/gp2ap020a00f.c | 4 +- tools/iio/generic_buffer.c | 269 ++++++++++++++------- 7 files changed, 309 insertions(+), 119 deletions(-) -- 2.5.5
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[RFC 0/7] Deal with iio trigger names Crestez Dan Leonard <leonard.crestez@intel.com> - 2016-05-23 20:50 +0200 Re: [RFC 0/7] Deal with iio trigger names Jonathan Cameron <jic23@kernel.org> - 2016-05-29 21:50 +0200
csiph-web