- Jan 21, 2013
-
-
Federico Vaga authored
address is a default ZIO binary attribute which return the channel address structure zio_addr. Signed-off-by:
Federico Vaga <federico.vaga@gmail.com> Acked-by:
Alessandro Rubini <rubini@gnudd.com>
-
This is not really useful for the ZIO framework, but it simplify the work on the user-space side with the libudev library Signed-off-by:
Federico Vaga <federico.vaga@gmail.com> Acked-by:
Alessandro Rubini <rubini@gnudd.com>
-
- Jan 18, 2013
-
-
This patch renames ZIO_CONTROL_SIZE to __ZIO_CONTROL_SIZE and it introduces the function zio_control_size(chan). At a future time, the function will return a channel-dependent value, when we implement TLV to extend the control structure. Signed-off-by:
Federico Vaga <federico.vaga@gmail.com> Acked-by:
Alessandro Rubini <rubini@gnudd.com>
-
This patch introduces ZIO_RW_PERM and ZIO_RO_PERM, which are used in all attributes. Prevoously we had write-all for writeable attributes, now we only allos the owner and the group. Signed-off-by:
Federico Vaga <federico.vaga@gmail.com> Acked-by:
Alessandro Rubini <rubini@gnudd.com>
-
- Jan 17, 2013
-
-
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>
-
Signed-off-by:
Federico Vaga <federico.vaga@gmail.com> Acked-by:
Alessandro Rubini <rubini@gnudd.com>
-
- Jan 10, 2013
-
-
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
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>
-
- Nov 29, 2012
-
-
Alessandro Rubini authored
Signed-off-by:
Alessandro Rubini <rubini@gnudd.com> Acked-by:
Federico Vaga <federico.vaga@gmail.com>
-
- Nov 25, 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>
-
- Nov 24, 2012
-
-
Alessandro Rubini authored
This also removes the ugly __ZIO_INTERNAL__ define we used until now Signed-off-by:
Federico Vaga <federico.vaga@gmail.com> Acked-by:
Alessandro Rubini <rubini@gnudd.com>
-
- Nov 11, 2012
-
-
Alessandro Rubini authored
"more_ctrl" is obsoleted by the TLV approach, and I simply forgot to make this change we agreed about. We have two fields for alarm to avoid endian issues when checking for errors system-wide (i.e., in all ZIO devices, including remote ones). The version remains 1.0 as nobody used the fields in their previous meaning. Signed-off-by:
Alessandro Rubini <rubini@gnudd.com> Acked-by:
Federico Vaga <federico.vaga@gmail.com>
-
- Nov 09, 2012
-
-
Alessandro Rubini authored
This changes the control block to version 1.0. It adds a TLV header at the end and renames sockadd_zio to zio_addr (sockaddr_zio must be defined in user space using the dreaded sa_family_t instead of uint16_t). Signed-off-by:
Alessandro Rubini <rubini@gnudd.com> Acked-by:
Federico Vaga <federico.vaga@gmail.com>
-
Alessandro Rubini authored
This is an incompatible change for buffer authors. We don't think there are any out-of-tree buffers, though. The allocation function must allocate the control by itself, instead of receiving it from outside. The reason why the control was passed doesn't hold any more, and the upcoming PF_ZIO buffer will greatly benefit from this. Also, now alloc_block returns NULL on error, so it can be used directly by the caller (it used to be ERR_PTR). Signed-off-by:
Alessandro Rubini <rubini@gnudd.com> Acked-by:
Federico Vaga <federico.vaga@gmail.com>
-
Alessandro Rubini authored
This replaces the previous allocation bitmask, which only supported small channel-sets, with the first-fit allocator. Minors are always taken from the smallest available slot starting from minor 0. Each cset is allocated separately, but this should not be a problem. With the zio-mini driver, which is not upstream yet, this works: insmod zio-mini.ko nchan=300 ndev=20 And we get all the devices we need. # ls -1 /sys/dev/char/250:* | wc -l 12000 The patch makes also some other renaming of functions (less underscores for functions exported by zio-cdev.c to zio-sys.c) and similar stuff that makes stuff clearer, if I happened to find them during this change. Signed-off-by:
Alessandro Rubini <rubini@gnudd.com> Acked-by:
Federico Vaga <federico.vaga@gmail.com>
-
Alessandro Rubini authored
This is a library-like set of functions, but they are not in the kernel, as far as I know, so let's offer them here. We will use them in the vmalloc buffer, in place of the circular buffer we have now, and for allocating minor device numbers. Signed-off-by:
Alessandro Rubini <rubini@gnudd.com> Acked-by:
Federico Vaga <federico.vaga@gmail.com>
-
- Nov 08, 2012
-
-
Alessandro Rubini authored
The driver itself is allowed to change nsamples, because it may have less samples than requested when the trigger fires. This is done by zio-mini, for example, that will be merged soon. Therefore, the number in current_ctrl must be updated, or the previous shorter value will stick. Also, move seq_num incrementing earlier, so even if allocation fails the sequence number is updated (and we need to do alarms too for that). Signed-off-by:
Alessandro Rubini <rubini@gnudd.com> Acked-by:
Federico Vaga <federico.vaga@gmail.com>
-
- Nov 05, 2012
-
-
Federico Vaga authored
This patch removes the union field priv in the zio_attribute and it introduces the id field. From our experience, the priv.ptr pointer is useless; the priv.addr field can be used for every purpose, also if you have your own private structure. The new field id replaces the role of priv.addr. It can represent a register address, a register offset, an index of a vector of private structure which describe how to gain access to a register, or whatever can describe uniquely a register (or register field) Signed-off-by:
Federico Vaga <federico.vaga@gmail.com> Acked-by:
Alessandro Rubini <rubini@gnudd.com>
-
Federico Vaga authored
Signed-off-by:
Federico Vaga <federico.vaga@gmail.com> Acked-by:
Alessandro Rubini <rubini@gnudd.com>
-
Federico Vaga authored
Signed-off-by:
Federico Vaga <federico.vaga@gmail.com> Acked-by:
Alessandro Rubini <rubini@gnudd.com>
-
Federico Vaga authored
Signed-off-by:
Federico Vaga <federico.vaga@gmail.com> Acked-by:
Alessandro Rubini <rubini@gnudd.com>
-
Federico Vaga authored
Signed-off-by:
Federico Vaga <federico.vaga@gmail.com> Acked-by:
Alessandro Rubini <rubini@gnudd.com>
-
Federico Vaga authored
Signed-off-by:
Federico Vaga <federico.vaga@gmail.com> Acked-by:
Alessandro Rubini <rubini@gnudd.com>
-
Federico Vaga authored
Signed-off-by:
Federico Vaga <federico.vaga@gmail.com> Acked-by:
Alessandro Rubini <rubini@gnudd.com>
-
Federico Vaga authored
Signed-off-by:
Federico Vaga <federico.vaga@gmail.com> Acked-by:
Alessandro Rubini <rubini@gnudd.com>
-
Federico Vaga authored
Signed-off-by:
Federico Vaga <federico.vaga@gmail.com> Acked-by:
Alessandro Rubini <rubini@gnudd.com>
-
Federico Vaga authored
This function can be used outside the ZIO core. At the moment there are not driver which use this function, but it can be useful in the future. Signed-off-by:
Federico Vaga <federico.vaga@gmail.com> Acked-by:
Alessandro Rubini <rubini@gnudd.com>
-
Federico Vaga authored
This function can be used outside the ZIO core (e.g. AD788x driver). A driver can be interested to know how many channel are active during an acquisition to allocate the proper buffer/structure Signed-off-by:
Federico Vaga <federico.vaga@gmail.com> Acked-by:
Alessandro Rubini <rubini@gnudd.com>
-
- Nov 04, 2012
-
-
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>
-
This is more in line with current kernel practices. We do not use zio_ here because the context is always clear when this macro is used. Signed-off-by:
Federico Vaga <federico.vaga@gmail.com> Acked-by:
Alessandro Rubini <rubini@gnudd.com>
-
- Nov 03, 2012
-
-
Federico Vaga authored
Signed-off-by:
Federico Vaga <federico.vaga@gmail.com> Acked-by:
Alessandro Rubini <rubini@gnudd.com>
-
- Nov 01, 2012
-
-
Alessandro Rubini authored
So the inline that followed is in the right place Signed-off-by:
Alessandro Rubini <rubini@gnudd.com> Acked-by:
Federico Vaga <federico.vaga@gmail.com>
-
- Oct 31, 2012
-
-
Alessandro Rubini authored
Signed-off-by:
Alessandro Rubini <rubini@gnudd.com>
-
- Oct 29, 2012
-
-
Alessandro Rubini authored
buffer->store_block calls trigger->push_block when it receives the first block. The trigger user fires directly , and if the device accepts the data immediately, our data_done() will retr_block from the buffer. This happens with zio-zero, cset 1, and leads to a deadlock. To allow immediate success of push_block down to device level, release the lock before calling push_block. The code here also handles pathologic situations like two processes storing at the same time. Signed-off-by:
Alessandro Rubini <rubini@gnudd.com> Acked-by:
Federico Vaga <federico.vaga@gmail.com>
-
- Oct 26, 2012
-
-
Federico Vaga authored
It is difficult to support a board which has pre-samples and post-samples registers and synchronize these value with the nsamples zio_attribute and control field. But, it is really simple for board that hasn't pre and post samples to use these two attributes because they can use only one attribute for their purpose (only pre-sample or only post-sample). Signed-off-by:
Federico Vaga <federico.vaga@gmail.com> Acked-by:
Alessandro Rubini <rubini@gnudd.com>
-