- 11 Jun, 2014 3 commits
-
-
Federico Vaga authored
src point to the source code. Obj point to the object. Sometimes they live toghether but users can decide to build the object outside the source tree. Signed-off-by: Federico Vaga <federico.vaga@cern.ch> Acked-by: Alessandro Rubini <rubini@gnudd.com>
-
Federico Vaga authored
Because their are not part of the module building but simple user space application. To avoid confusion, do not use kbuild environment style Signed-off-by: Federico Vaga <federico.vaga@cern.ch> Acked-by: Alessandro Rubini <rubini@gnudd.com>
-
Federico Vaga authored
TAGS files are typically generated by etags and ctags. Their aim is to indexing files content Signed-off-by: Federico Vaga <federico.vaga@cern.ch> Acked-by: Alessandro Rubini <rubini@gnudd.com>
-
- 25 Apr, 2014 3 commits
-
-
Federico Vaga authored
Signed-off-by: Federico Vaga <federico.vaga@cern.ch> Acked-by: Alessandro Rubini <rubini@gnudd.com>
-
Federico Vaga authored
Signed-off-by: Federico Vaga <federico.vaga@cern.ch> Acked-by: Alessandro Rubini <rubini@gnudd.com>
-
Federico Vaga authored
This patch doesn't provide any technical change. The patch just simplify the next patch. Signed-off-by: Federico Vaga <federico.vaga@cern.ch> Acked-by: Alessandro Rubini <rubini@gnudd.com>
-
- 24 Apr, 2014 3 commits
-
-
Alessandro Rubini authored
Previously, the enable/disable sysfs store had to complete atomically, as zio takes a spinlock to serialize the various concurrent enable and disable that may happen. Unfortunately, this is a problem when the hardware is keeping data structures busy, and commit b77ca7f0 is not enough to solve the problem: That commit uses udelay(10) in a loop, but in one installation of ours the hardware operation runs in a work queue, whereas the driving application has real-time priority. So we really need to schedule (or change the priorities, which is denied to us). But we cannot schedule while holding a spinlock. This patch, thus, make the following changes: * zio_trigger_abort_disable() is renamed to __zio_trigger_abort_disable() and does not sleep, but it returns -EAGAIN if HW_BUSY. * a new zio_trigger_abort_disable() is offered, that retries while scheduling. This covers all sysfs users, but one, so this keeps the patch smaller than I initially wrote it. * __zobj_enable() return int, not void: 0 or -EAGAIN (without sleeping, as it calls the new __zio_trigger_abort_disable()). It's an internal function in ./sysfs.c, so this is not a problem. * zobj_store_enable() accepts -AGAIN, and loops over if so. This is more difficult than expected (I loved b77ca7f0), but I see no easier solution to the weird RT priorities our users deploy. Signed-off-by: Alessandro Rubini <rubini@gnudd.com> Acked-by: Federico Vaga <federico.vaga@gmail.com>
-
Alessandro Rubini authored
This flag has one user no more, but I already found the name confusing while working on that only user -- a driver. So this renames the flag, to make clear to readers (and myself) that only hardware can set and clear the flag, obviously under cset lock. Signed-off-by: Alessandro Rubini <rubini@gnudd.com> Acked-by: Federico Vaga <federico.vaga@gmail.com>
-
Federico Vaga authored
The Linux kernel patch b4e46138f946442608647be58e78e3ad4d15534e removes bus_type.bus_attrs Signed-off-by: Federico Vaga <federico.vaga@cern.ch> Acked-by: Alessandro Rubini <rubini@gnudd.com>
-
- 02 Apr, 2014 1 commit
-
-
Federico Vaga authored
CONFIG_HOTPLUG is going away as an option so __devinit, __devexit and __devexit_p are no longer needed. Signed-off-by: Federico Vaga <federico.vaga@gmail.com> Acked-by: Alessandro Rubini <rubini@gnudd.com>
-
- 07 Mar, 2014 4 commits
-
-
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>
-
- 04 Mar, 2014 1 commit
-
-
Federico Vaga authored
Signed-off-by: Federico Vaga <federico.vaga@gmail.com> Acked-by: Alessandro Rubini <rubini@gnudd.com>
-
- 26 Feb, 2014 3 commits
-
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com> Acked-by: Federico Vaga <federico.vaga@gmail.com>
-
Alessandro Rubini authored
The hardware may be in uninterruptible operations, like writing in DMA to the buffers. So we can't release stuff until the hardware is done. We are in atomic context for sure, and the hardare is mandated to be fast, so busy-wait for it. The CSET_BUSY flag is set and cleared by the hardware driver, with the cset lock taken. Signed-off-by: Alessandro Rubini <rubini@gnudd.com> Acked-by: Federico Vaga <federico.vaga@gmail.com>
-
Alessandro Rubini authored
There are some hardware operations that cannot be stopped, like ongoing DMA, and we must prevent abort from freeing stuff while in use. This commit only adds the flag. Signed-off-by: Alessandro Rubini <rubini@gnudd.com> Acked-by: Federico Vaga <federico.vaga@gmail.com>
-
- 24 Feb, 2014 6 commits
-
-
Federico Vaga authored
These prints are still present in drivers, triggers and buffer 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
BUG: when user read a single channel but all the other channel are enable, then it occurs a buffer overflow on all the other chennels. When the buffer is full ZIO does not assign chan->active_block. So, the index in the local buffer are wrong. If there is no active_block, the driver must not acquire data from the correspondent channel. 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>
-
- 30 Jan, 2014 3 commits
-
-
Federico Vaga authored
Signed-off-by: Federico Vaga <federico.vaga@gmail.com> Acked-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Very fast self-timed input channels triggerd a recursion, with kernel stack overflow: zio_arm_trigger was calling zio_trigger_data_done, which in turn called zio_arm_trigger again. We can't change the semantics of zio_trigger_data_done(), since that's what most drivers call (they simply ignore the existence of zio_arm_trigger, which is good). So this commit introduces iteration in zio_arm_trigger itself, relying on an internal version of zio_trigger_data_done that doesn't call zio_arm_trigger. Signed-off-by: Alessandro Rubini <rubini@gnudd.com> Acked-by: Federico Vaga <federico.vaga@gmail.com>
-
Alessandro Rubini authored
When a process is writing and another process is changing the configuration, it may happen that the trigger-related store calling abort_disable() zeroes the active_block that is already being pushed by the other process. This fixes the interaction by keeping the cset spinlock during the whole configuration of a sysfs attribute, thus preventing a write to sneak in. After changing parameters, if the trigger was armed, the code re-arms it, and this covers self-timed devices. The choice helps simple tests from the shell, but serious users will likely want to manually disable the trigger before reconfiguring it. Signed-off-by: Alessandro Rubini <rubini@gnudd.com> Acked-by: Federico Vaga <federico.vaga@gmail.com>
-
- 24 Jan, 2014 4 commits
-
-
Alessandro Rubini authored
This typo was zeroing all unrelated flags in ti->falgs when zio_trigger_abort_disable, but it had no effect at this point since we have only one other flag, which is zeroed by this function anyways. Signed-off-by: Alessandro Rubini <rubini@gnudd.com> Acked-by: Federico Vaga <federico.vaga@gmail.com>
-
Alessandro Rubini authored
[This commit originated in zio-v1.0-fixed, and I then adapted to the current master] With trigger user and output channels, a block may be referenced after being released. This affects both kmalloc and vmalloc buffers. This bug was introduced by commit 2300e624, partly reversed by this. However, we only noticed when running under CONFIG_DEBUG_SLAB. Bug description: When store_block is called for output the first time, it pushes to the trigger, but as of commit 2300e624 it adds the block to the list first (to keep ordering if another push happens very soon). If push succeeds *and* cset->raw_io succeeds immediately, the block is freed. Store_block will thus remove it from the list of enqueued blocks, accessing the data structure. Bug solution: The store_block method runs calls trigger->push in locked context, like it used to before 2300e624. Thus, the block doesn't need to be enqueued (as other store processes are waiting for the spinlock) and is not dequeued if push succeeds. The ZIO_BI_PUSHING flag remains, to prevent the deadlock when store succeeds and data_done() tries to retrieve the next block. However, it is checked by retr_block before taking the lock. Update for master branch: the commit also removes the locking in the new helpers zio_buffer_retr_block() and zio_buffer_store_block(), because the functions are now called in locking context; suck a lock is not needed anyways, because the critical section is just reading the DISABLED flag, which is atomic by definition. Signed-off-by: Alessandro Rubini <rubini@gnudd.com> Acked-by: Federico Vaga <federico.vaga@gmail.com>
-
Alessandro Rubini authored
this commit a90aba09 chardev: return POLLERR if user disables the trigger removed in error the mutex_unlock() from zio_can_w_ctrl(). This results in an immediate deadlock when anybody writes a control structure. The fix is trivial. Signed-off-by: Alessandro Rubini <rubini@gnudd.com> Acked-by: Federico Vaga <federico.vaga@gmail.com>
-
Alessandro Rubini authored
Registration of devices is done with a mutex held. as device_attach() calls device_lock() (in the upstream kernel). Thus, allocation of minor numbers must use GFP_ATOMIC. Similarly, the default buffer and the default trigger for a new device being registered are allocated within the critical section. The problem also applies when changing a buffer or trigger type at runtime, because sysfs_write_file() takes a mutex on the file. Thus, all triggers and buffers are affected. Signed-off-by: Alessandro Rubini <rubini@gnudd.com> Acked-by: Federico Vaga <federico.vaga@gmail.com>
-
- 22 Jan, 2014 3 commits
-
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com> Acked-by: Federico Vaga <federico.vaga@gmail.com>
-
Federico Vaga authored
Signed-off-by: Federico Vaga <federico.vaga@gmail.com> Acked-by: Alessandro Rubini <rubini@gnudd.com>
-
Federico Vaga authored
This patch add two new attributes: "allocated-buffer-len" and "allocated-buffer-kb". Buffers are expected to use one of them, or both. The purpose of these attribute is to export to user space information about the number of blocks stored in a buffer. This information can be used to monitor buffer status, and see how the data flow behaves. We report the allocated buffer size, which includes active blocks, instead of the size currently stored, because it reflects actual use of the available data space (the max-buffer-* attributes). Knowing how many blocks, or kilobytes, are currently stored is much less important. Signed-off-by: Federico Vaga <federico.vaga@gmail.com> Acked-by: Alessandro Rubini <rubini@gnudd.com>
-
- 20 Jan, 2014 2 commits
-
-
Federico Vaga authored
bug: on re-enable it automatically fires even if no timer was programmed or it was already expired. Here the most simple procedure to reproduce the bug: insmod zio-zero.ko cd /sys/bus/zio/devices/zzero-0000/zero-input-8 echo hrt > current_trigger echo 0 > trigger/enable echo 1 > trigger/enable the trigger fired and you will find a block in all buffers. Signed-off-by: Federico Vaga <federico.vaga@gmail.com> Acked-by: Alessandro Rubini <rubini@gnudd.com>
-
Federico Vaga authored
The trigger operation push_block() is mandatory in order to use a trigger on output csets Signed-off-by: Federico Vaga <federico.vaga@gmail.com> Acked-by: Alessandro Rubini <rubini@gnudd.com>
-
- 18 Jan, 2014 4 commits
-
-
Federico Vaga authored
Signed-off-by: Federico Vaga <federico.vaga@gmail.com> Acked-by: Alessandro Rubini <rubini@gnudd.com>
-
Federico Vaga authored
This is used by the test suite, to verify attribute management. Signed-off-by: Federico Vaga <federico.vaga@gmail.com> Acked-by: Alessandro Rubini <rubini@gnudd.com>
-
Federico Vaga authored
The in-kenrel hrt uses absolute times, and so does the zio trigger based on it. However, for testing in shell scripts, relative times are easier to handle. We accepted any "absolute" time less than 1 hour to be considered relative, but then we realized some embedded systems have no real-world time notion, so they start at Jan 1st 1970. This decreases relative times to 10s, assuming it's enough for shell scripts during testing and short enough to allow the rare embedded system to be later than tat by the time zio runs. 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>
-