linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: Hartmut Knaack <knaack.h@gmx.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	linux-iio@vger.kernel.org
Subject: Re: [PATCH 2/5] iio: xilinx-xadc: Fix clearing interrupt when enabling trigger
Date: Sun, 5 Apr 2020 13:11:40 +0100	[thread overview]
Message-ID: <20200405131140.0df06963@archlinux> (raw)
In-Reply-To: <20200403132717.24682-2-lars@metafoo.de>

On Fri,  3 Apr 2020 15:27:14 +0200
Lars-Peter Clausen <lars@metafoo.de> wrote:

> When enabling the trigger and unmasking the end-of-sequence (EOS) interrupt
> the EOS interrupt should be cleared from the status register. Otherwise it
> is possible that it was still set from a previous capture. If that is the
> case the interrupt would fire immediately even though no conversion has
> been done yet and stale data is being read from the device.
> 
> The old code only clears the interrupt if the interrupt was previously
> unmasked. Which does not make much sense since the interrupt is always
> masked at this point and in addition masking the interrupt does not clear
> the interrupt from the status register. So the clearing needs to be done
> unconditionally.
> 
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Looks good but were is my fixes tag?  :) I fear we have a theme
here!

Jonathan

> ---
>  drivers/iio/adc/xilinx-xadc-core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/adc/xilinx-xadc-core.c b/drivers/iio/adc/xilinx-xadc-core.c
> index 4fcf1729341f..04a2a609ced4 100644
> --- a/drivers/iio/adc/xilinx-xadc-core.c
> +++ b/drivers/iio/adc/xilinx-xadc-core.c
> @@ -674,7 +674,7 @@ static int xadc_trigger_set_state(struct iio_trigger *trigger, bool state)
>  
>  	spin_lock_irqsave(&xadc->lock, flags);
>  	xadc_read_reg(xadc, XADC_AXI_REG_IPIER, &val);
> -	xadc_write_reg(xadc, XADC_AXI_REG_IPISR, val & XADC_AXI_INT_EOS);
> +	xadc_write_reg(xadc, XADC_AXI_REG_IPISR, XADC_AXI_INT_EOS);
>  	if (state)
>  		val |= XADC_AXI_INT_EOS;
>  	else


  reply	other threads:[~2020-04-05 12:11 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-03 13:27 [PATCH 1/5] iio: xilinx-xadc: Fix ADC-B powerdown Lars-Peter Clausen
2020-04-03 13:27 ` [PATCH 2/5] iio: xilinx-xadc: Fix clearing interrupt when enabling trigger Lars-Peter Clausen
2020-04-05 12:11   ` Jonathan Cameron [this message]
2020-04-03 13:27 ` [PATCH 3/5] iio: xilinx-xadc: Fix sequencer configuration for aux channels in simultaneous mode Lars-Peter Clausen
2020-04-05 12:13   ` Jonathan Cameron
2020-04-03 13:27 ` [PATCH 4/5] iio: xilinx-xadc: Make sure not exceed maximum samplerate Lars-Peter Clausen
2020-04-05 12:15   ` Jonathan Cameron
2020-04-03 13:27 ` [PATCH 5/5] iio: xilinx-xadc: Fix typo Lars-Peter Clausen
2020-04-05 12:17   ` Jonathan Cameron
2020-04-05 12:10 ` [PATCH 1/5] iio: xilinx-xadc: Fix ADC-B powerdown Jonathan Cameron
2020-04-05 12:13   ` Lars-Peter Clausen
2020-04-05 12:26     ` Jonathan Cameron
2020-04-05 12:29       ` Lars-Peter Clausen
2020-04-05 17:20         ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200405131140.0df06963@archlinux \
    --to=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).