- Jan 18, 2013
-
-
Alessandro Rubini authored
This device accepts zero-sized output blocks: it uses the timestamp in the control to fire an event, which in this case is a printk message. Signed-off-by:
Alessandro Rubini <rubini@gnudd.com> Acked-by:
Federico Vaga <federico.vaga@gmail.com>
-
- Jan 17, 2013
-
-
Alessandro Rubini authored
Signed-off-by:
Alessandro Rubini <rubini@gnudd.com> Acked-by:
Federico Vaga <federico.vaga@gmail.com>
-
Alessandro Rubini authored
zio_cset_is_self_timed() only returned true for input channels. This is needed, but the name is wrong: use zio_cset_early_arm() instead. An output channel can be self-timed as well, so trigger_data_done check the flag directly, not early_arm(). Every self-timed cset must be rearmed when the trigger fired. Signed-off-by:
Alessandro Rubini <rubini@gnudd.com> Acked-by:
Federico Vaga <federico.vaga@gmail.com>
-
Alessandro Rubini authored
With the new self-timed output devices, the last raw_io() when the buffer is empty would fail, so we need to mark the trigger as not-armed, in order for output to restart when the next push happens. Signed-off-by:
Alessandro Rubini <rubini@gnudd.com> Acked-by:
Federico Vaga <federico.vaga@gmail.com>
-
Alessandro Rubini authored
Signed-off-by:
Alessandro Rubini <rubini@gnudd.com> Acked-by:
Federico Vaga <federico.vaga@gmail.com>
-
Alessandro Rubini authored
The ms-phase attribute pairs with ms-period. In this way you can have a fine control about when the I/O happens. Please note that the epoch of the time base is unphatomable (it is related to boot time). So you can manage offsets between csets, but not absolute stamps. For that please use the HRT trigger. Every trigger instance starts at phase 0 (i.e., the trigger is armed at a multiple of its period). If you later change the period, no phase calculation is performed, so that the new period will be as requested (to allow for slowly-changing periods. If, however, you change the phase, the trigger is re-armed with that absolute phase, to allow for slowly-changing phase. If you change the period and then you change the phase, you'll experience an unexpected period during the transition. Signed-off-by:
Alessandro Rubini <rubini@gnudd.com> Acked-by:
Federico Vaga <federico.vaga@gmail.com>
-
Signed-off-by:
Federico Vaga <federico.vaga@gmail.com> Acked-by:
Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by:
Alessandro Rubini <rubini@gnudd.com> Acked-by:
Federico Vaga <federico.vaga@gmail.com>
-
- Jan 10, 2013
-
-
Alessandro Rubini authored
This merges a series of commits that introduce self-timed devices (exemplified by a tdc driver), zero-size-block for input channels and an overall better and simplified locking policy for csets and triggers.
-
Alessandro Rubini authored
When the current buffer is changed, there should be no users on the channels (otherwise, either a user block is being produced/consumed or there's somebody sleeping on the wq of the buffer instance). This prevents changing the buffer if in use, and prevents users from opening a channel if the buffer is being changed. We use the "disabled" flag for the buffer, not used so far. We noticed this while working on buffer changes (see previous commit). I'm unable to backport this to the proper place in the history because it relies on the new locking introduced by this branch. Signed-off-by:
Alessandro Rubini <rubini@gnudd.com> Acked-by:
Federico Vaga <federico.vaga@gmail.com>
-
Alessandro Rubini authored
I'm unable to backport this commit to the proper place (too many conflicts). Anyways, this fixes an issue related to changing the buffer type (nothing bad happens if you don't change buffer type). The bug is exposed by the self-timed csets: when a buffer type is being changed, the trigger may be armed. This means that a block is being used by the device, but the hosting buffer instance is being destroyed. This commit aborts a trigger and keeps it disabled while the buffer is being changed. Re-enabling later, unless it was already disabled. Even without self-timed support there was a tiny window for the race to appear. Now it's fixed forever. Signed-off-by:
Alessandro Rubini <rubini@gnudd.com> Acked-by:
Federico Vaga <federico.vaga@gmail.com>
-
Alessandro Rubini authored
If the trigger is enabled on creation, it may fire before the cset is ready. This happened to me with "modprobe zio-zero trigger=irq". For this reason it must start disabled. Also, the create method MUST set ti->cset before activating the trigger, because the cset lock is needed to access the enable/disable flag. The commit adds a WARN() if the field is not set after creation, then it leaves it zeroed to ensure the system will crash, instead of having a subtle race. Also, add a pair of FIXME notes about the need to allow changing a trigger type while leaving the new one disabled. Signed-off-by:
Alessandro Rubini <rubini@gnudd.com> Acked-by:
Federico Vaga <federico.vaga@gmail.com>
-
Alessandro Rubini authored
This is a bug fix for overlooks in this same series of commits. I won't fix each lock when it is introduced before proposing for master, because it takes too much time. Signed-off-by:
Alessandro Rubini <rubini@gnudd.com> Acked-by:
Federico Vaga <federico.vaga@gmail.com>
-
Alessandro Rubini authored
Signed-off-by:
Alessandro Rubini <rubini@gnudd.com> Acked-by:
Federico Vaga <federico.vaga@gmail.com>
-
Alessandro Rubini authored
Signed-off-by:
Alessandro Rubini <rubini@gnudd.com> Acked-by:
Federico Vaga <federico.vaga@gmail.com>
-
Alessandro Rubini authored
Now we can have zero-size input blocks, as TDC is real. zio-dump should not complain when reading zero bytes, if zero were expected. Signed-off-by:
Alessandro Rubini <rubini@gnudd.com> Acked-by:
Federico Vaga <federico.vaga@gmail.com>
-
Alessandro Rubini authored
Signed-off-by:
Alessandro Rubini <rubini@gnudd.com> Acked-by:
Federico Vaga <federico.vaga@gmail.com>
-
Alessandro Rubini authored
This has two csets, with one channel each. The first returns timestamps in the data area, the second channel returns zero-sized blocks, with the timestamp in the control. Signed-off-by:
Alessandro Rubini <rubini@gnudd.com> Acked-by:
Federico Vaga <federico.vaga@gmail.com>
-
Alessandro Rubini authored
These changes allow the driver to work with a PCI interrupt, a role that was never used earlier. The commit fixes a warning on removal when if libgpio is not present in the host kernel; it also tries to request the shared interrrupt with various edge-trigger bits, until one succeeds. This allows to use both edges for owned GPIO interrupts and fall back to no specific requirement when used for a PCI interrupt. Signed-off-by:
Alessandro Rubini <rubini@gnudd.com> Acked-by:
Federico Vaga <federico.vaga@gmail.com>
-
Alessandro Rubini authored
This commit allows zero-size channels to exist. The feature is used for TDC and DTC (time to digital converters and the opposite). This simple change in the core allows to implement TDC drivers that only return the control (which includes a time stamp) and no data. For DTC to work we need some modification to chardev.c, which are not there yet. Signed-off-by:
Alessandro Rubini <rubini@gnudd.com> Acked-by:
Federico Vaga <federico.vaga@gmail.com>
-
Alessandro Rubini authored
Signed-off-by:
Alessandro Rubini <rubini@gnudd.com> Acked-by:
Federico Vaga <federico.vaga@gmail.com>
-
Alessandro Rubini authored
This is important now that we have self-timed devices: if any trigger parameter is changed (e.g., nsamples), we need to abort the armed trigger and rearm with new parameters. If the trigger is not armed when changing parameters, nothing happens like before. Signed-off-by:
Alessandro Rubini <rubini@gnudd.com> Acked-by:
Federico Vaga <federico.vaga@gmail.com>
-
Alessandro Rubini authored
Signed-off-by:
Alessandro Rubini <rubini@gnudd.com> Acked-by:
Federico Vaga <federico.vaga@gmail.com>
-
Alessandro Rubini authored
This small patch supports self-timed input csets (for example, a TDC) by ensuring the input trigger is always armed, waiting for the device. Signed-off-by:
Alessandro Rubini <rubini@gnudd.com> Acked-by:
Federico Vaga <federico.vaga@gmail.com>
-
Alessandro Rubini authored
Signed-off-by:
Alessandro Rubini <rubini@gnudd.com> Acked-by:
Federico Vaga <federico.vaga@gmail.com>
-
Alessandro Rubini authored
The flag is need so self-timed devices, like a TDC, can have their trigger continuously armed (see next commit). Signed-off-by:
Alessandro Rubini <rubini@gnudd.com> Acked-by:
Federico Vaga <federico.vaga@gmail.com>
-
Alessandro Rubini authored
The function used to be called __zio_internal_data_done, in heklpers.c. Being used once only, it was expanded inline by the compiler, so nothing changes for previous code. However, if a trigger needs to implement its own data_done method, it will most likely need to replicate this code, so it's better made avaiable directly to everybody. An alternative would be running this code every time, before or after calling t_op->data_done, but we'd better let each trigger choose the order of its own operations. Actually, there is one difference: the input active block is set to NULL after being stored to the current buffer, so the later implementation of stop_io (used in zio-irq-tdc.c) won't expose a bug. Signed-off-by:
Alessandro Rubini <rubini@gnudd.com> Acked-by:
Federico Vaga <federico.vaga@gmail.com>
-
Alessandro Rubini authored
This is the first step of a series of changes aimed at a cleaner and more flexible management of triggers, as well as a really transparent "user" trigger. This commit does the following: - zio_fire_trigger renamed to zio_arm_trigger: the trigger is actually armed by software, and then it fires by hardware. This distinction is especially important for the transparent trigger: when devices have internal timing, the software trigger must arm it immediately (as opposed to the dumb devices, where the software trigger really causes I/O to happen). - ZIO_TI_BUSY renamed to ZIO_TI_ARMED. Also, ZIO_TI_COMPLETING is removed. The new, simplified policy is like this: the trigger is armed by software (the trigger module), but completion is driven by hardware (the device module). There is no need for a COMPLETING flag, because the ARMED flag is only cleared after data_done is over for all channels in the cset. - the cset spinlock is used to protect all changes of the ti flags. - change_current_trigger completely revised and fixed to match new conventions. - trigger->abort now takes "ti" instead of "cset" as argument; it is more natural do do so, and no current trigger implements abort so no harm is done. - the trigger->abort and trigger->change_status methods are now always called while holding the cset spinlock. ZIO core calls abort when changing the current trigger type, to ensure no pending blocks are there. - zio_trigger_abort is renamed to zio_trigger_abort_disable, with an additional argument to state whether the trigger must be atomically disabled after the abort is over. This avoids a race condition on trigger removal. It returns the previous "disabled" bit, to be used when changing a buffer type while preserving trigger status. - minor unrelated improvements in error management in objects.c. - documentation update to match the new locking, and a few typos fixed. Signed-off-by:
Alessandro Rubini <rubini@gnudd.com> Acked-by:
Federico Vaga <federico.vaga@gmail.com>
-
- Jan 08, 2013
-
-
Alessandro Rubini authored
The merge-data attribute tells the buffer to try a merge of a newly-stored block with the previous one. When this is possible, the buffer updates the previous block (nsamples, datalen) and releases the new control immediately. This allows saving some memory without breaking the ZIO data model. The feature only makes sense for input, but there is no policy in place to enforce that. When user space reads this new block, it will get attributes (and timestamp) for the first data items, but all available items are returned in this bigger block. Signed-off-by:
Alessandro Rubini <rubini@gnudd.com> Acked-by:
Federico Vaga <federico.vaga@gmail.com>
-
Signed-off-by:
Federico Vaga <federico.vaga@gmail.com> Acked-by:
Alessandro Rubini <rubini@gnudd.com>
-
On load nsamples is 0 and this is wrong. It must be initialized with the value in ti->nsamples. Otherwise if you read the current_control on sturtup you will read 0 instead of the real value Signed-off-by:
Federico Vaga <federico.vaga@gmail.com> Acked-by:
Alessandro Rubini <rubini@gnudd.com>
-
- Dec 01, 2012
-
-
This patch fixes a few typos in the zio manual. Signed-off-by:
Michael Auchter <michael.auchter@gmail.com>
-
- Nov 30, 2012
-
-
Alessandro Rubini authored
Signed-off-by:
Alessandro Rubini <rubini@gnudd.com> Acked-by:
Federico Vaga <federico.vaga@gmail.com>
-
Alessandro Rubini authored
Signed-off-by:
Alessandro Rubini <rubini@gnudd.com> Acked-by:
Federico Vaga <federico.vaga@gmail.com>
-
Alessandro Rubini authored
Signed-off-by:
Alessandro Rubini <rubini@gnudd.com> Acked-by:
Federico Vaga <federico.vaga@gmail.com>
-
Signed-off-by:
Federico Vaga <federico.vaga@gmail.com> Acked-by:
Alessandro Rubini <rubini@gnudd.com>
-
Signed-off-by:
Federico Vaga <federico.vaga@gmail.com> Acked-by:
Alessandro Rubini <rubini@gnudd.com>
-
- Nov 29, 2012
-
-
Alessandro Rubini authored
Signed-off-by:
Alessandro Rubini <rubini@gnudd.com> Acked-by:
Federico Vaga <federico.vaga@gmail.com>
-
Alessandro Rubini authored
Signed-off-by:
Alessandro Rubini <rubini@gnudd.com> Acked-by:
Federico Vaga <federico.vaga@gmail.com>
-
Alessandro Rubini authored
Signed-off-by:
Alessandro Rubini <rubini@gnudd.com> Acked-by:
Federico Vaga <federico.vaga@gmail.com>
-