• Federico Vaga's avatar
    trigger/hrt: fix sysfs value propagation · fe50c546
    Federico Vaga authored
    The HRT trigger has a bug. If you program the fire in the past, the
    trigger fires immediately, so ZIO has not the time to propagate the sysfs
    value to the current_control. The result is that the acquired block has
    the wrong value for attribute exp_{sec|scalar_h}.
    
    The patch introduces a fire delay of 100ms when you program the trigger in the
    past. This allows ZIO to propagate the sysfs values.
    
    I am aware that 100ms can be a long time, but it does not matter because
    the expected fire should be in the past and it is not possible. Moreover,
    the cosistency of the control information will provide information about
    the expected fire which is more important than rapidity of a wrong the fire.
    
    ---------------------------------------------------------------------
    echo 3 > /sys/bus/zio/devices/zzero-0000/zero-input-32/trigger/exp-scalar-h
    echo 4 > /sys/bus/zio/devices/zzero-0000/zero-input-32/trigger/exp-scalar-h
    
    [ 1432.799476] zattr_store
    [ 1432.799762]  trigger: writing value 3 to sysfs attribute exp-scalar-h
    [ 1432.800183] ztt_conf_set:81
    [ 1432.800466] ztt_conf_set:146
    [ 1432.800846] ztt_fn:167
    [ 1432.801162] zio_arm_trigger:131
    [ 1432.801162] __zio_arm_input_trigger:82
    [ 1432.801162] zbk_alloc_block:94
    [ 1432.801162] zio_generic_data_done:135
    [ 1432.801162] zbk_store_block:172 (ffff88000d4ebc00, ffff88000d40dd80)
    [ 1432.803739] __zattr_propagate_value
    [ 1435.736568] zattr_store
    [ 1435.737977]  trigger: writing value 4 to sysfs attribute exp-scalar-h
    [ 1435.739315] ztt_conf_set:81
    [ 1435.740881] ztt_conf_set:146
    [ 1435.742389] ztt_fn:167
    [ 1435.743381] zio_arm_trigger:131
    [ 1435.743381] __zio_arm_input_trigger:82
    [ 1435.743381] zbk_alloc_block:94
    [ 1435.743381] zio_generic_data_done:135
    [ 1435.743381] zbk_store_block:172 (ffff88000d4ebc00, ffff88000d40df40)
    [ 1435.747783] __zattr_propagate_value
    
    From zio-dump
    
    block 1 - "Ctrl: trigger-ext-5   0x00000002         2"
    block 2 - "Ctrl: trigger-ext-5   0x00000003         3"
    ---------------------------------------------------------------------
    Signed-off-by: 's avatarFederico Vaga <federico.vaga@gmail.com>
    fe50c546
Name
Last commit
Last update
Documentation/ABI/stable Loading commit data...
buffers Loading commit data...
doc Loading commit data...
drivers Loading commit data...
include/linux Loading commit data...
tools Loading commit data...
triggers Loading commit data...
.gitignore Loading commit data...
COPYING Loading commit data...
Makefile Loading commit data...
README Loading commit data...
bus.c Loading commit data...
chardev.c Loading commit data...
core.c Loading commit data...
helpers.c Loading commit data...
misc.c Loading commit data...
objects.c Loading commit data...
sysfs.c Loading commit data...
zio-internal.h Loading commit data...