Commit 138e6c54 authored by Federico Vaga's avatar Federico Vaga

kernel: use ZIO flag insted of driver one

Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent 2768460d
......@@ -78,7 +78,6 @@ enum ft_command {
enum ft_channel_flags {
FT_FLAG_CH_TERMINATED = 0,
FT_FLAG_CH_DO_INPUT,
FT_FLAG_CH_INPUT_READY
};
/* Carrier-specific operations (gateware does not fully decouple carrier specific stuff, such as
......
......@@ -64,7 +64,6 @@ static void ft_reset_channel(struct fmctdc_dev *ft, int channel)
st->cur_seq_id = 0;
st->expected_edge = 1;
clear_bit(FT_FLAG_CH_INPUT_READY, &st->flags);
ft_zio_kill_buffer(ft, channel);
kfifo_reset(&st->fifo);
......
......@@ -316,17 +316,15 @@ static void ft_readout_tasklet(unsigned long arg)
goto out;
for (i = FT_CH_1; i <= FT_NUM_CHANNELS; i++) {
struct ft_channel_state *st = &ft->channels[i - 1];
struct zio_cset *cset = &zdev->cset[i - 1];
/* FIXME: race condition */
if (test_bit(FT_FLAG_CH_INPUT_READY, &st->flags)) {
struct zio_cset *cset = &zdev->cset[i - 1];
if (ZIO_TI_ARMED & cset->ti->flags) {
/* there is an active block, try reading an
accumulated sample */
err = ft_read_sw_fifo(ft, i, cset->chan);
if (!err) {
clear_bit(FT_FLAG_CH_INPUT_READY, &st->flags);
if (!err)
zio_trigger_data_done(cset);
}
}
}
......
......@@ -233,9 +233,6 @@ static int ft_zio_input(struct zio_cset *cset)
if (ft_read_sw_fifo(ft, cset->index + 1, cset->chan) == 0)
return 0; /* don't call data_done, let the caller do it */
/* Mark the active block is valid, and return EAGAIN */
set_bit(FT_FLAG_CH_INPUT_READY, &st->flags);
return -EAGAIN;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment