mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: SeungJu Cheon <suunj1331@gmail.com>
Cc: antoniu.miclaus@analog.com, lars@metafoo.de,
	Michael.Hennerich@analog.com, andriy.shevchenko@intel.com,
	dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] iio:frequency:adf4377: Fix duplicated soft reset mask
Date: Sat, 31 Jan 2026 18:25:58 +0000	[thread overview]
Message-ID: <20260131182558.464e534e@jic23-huawei> (raw)
In-Reply-To: <20260123194758.15445-1-suunj1331@gmail.com>

On Sat, 24 Jan 2026 04:47:58 +0900
SeungJu Cheon <suunj1331@gmail.com> wrote:

> The regmap_read_poll_timeout() uses ADF4377_0000_SOFT_RESET_R_MSK
> twice instead of checking both SOFT_RESET_MSK (bit 0) and
> SOFT_RESET_R_MSK (bit 7). This causes an incomplete reset status check.
> 
> The code first sets both SOFT_RESET and SOFT_RESET_R bits to 1 via
> regmap_update_bits(), then polls for them to be cleared. Since we set
> both bits before polling, we should be waiting for both to clear.
> 
> Fix by using both masks as done in regmap_update_bits() above.
> 
> Fixes: eda549e2e524 ("iio:frequency:adf4377: add support for ADF4377")
> Signed-off-by: SeungJu Cheon <suunj1331@gmail.com>
For now I've applied this to a local branch which I'll push out once
I have a suitable base (release, or rc1 depending on when I do it).

Given Antoniu and Andy's involvement in earlier discussion, still plenty of time
to add tags or indeed suggest I drop it again for a v4!

Thanks,

Jonathan

> ---
> v3:
>  - Summarize discussion about why both bits need to be checked
> 
> v2:
>  - Add Fixes tag
> 
>  drivers/iio/frequency/adf4377.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/frequency/adf4377.c b/drivers/iio/frequency/adf4377.c
> index 08833b7035e4..48aa4b015a14 100644
> --- a/drivers/iio/frequency/adf4377.c
> +++ b/drivers/iio/frequency/adf4377.c
> @@ -501,7 +501,7 @@ static int adf4377_soft_reset(struct adf4377_state *st)
>  		return ret;
>  
>  	return regmap_read_poll_timeout(st->regmap, 0x0, read_val,
> -					!(read_val & (ADF4377_0000_SOFT_RESET_R_MSK |
> +					!(read_val & (ADF4377_0000_SOFT_RESET_MSK |
>  					ADF4377_0000_SOFT_RESET_R_MSK)), 200, 200 * 100);
>  }
>  


      reply	other threads:[~2026-01-31 18:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-23 19:47 SeungJu Cheon
2026-01-31 18:25 ` Jonathan Cameron [this message]

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=20260131182558.464e534e@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Michael.Hennerich@analog.com \
    --cc=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=antoniu.miclaus@analog.com \
    --cc=dlechner@baylibre.com \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=suunj1331@gmail.com \
    /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

all inboxes | Powered by JetHome®