linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
To: Dmitry Mastykin <mastichi@gmail.com>
Cc: preid@electromag.com.au, Linus Walleij <linus.walleij@linaro.org>,
	linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] pinctrl: mcp23s08: fix interrupt handling regression
Date: Wed, 18 Oct 2017 19:00:44 +0200	[thread overview]
Message-ID: <20171018170044.2cr57k5jswsrvjlk@earth> (raw)
In-Reply-To: <1508336462-9378-1-git-send-email-mastichi@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1203 bytes --]

Hi,

On Wed, Oct 18, 2017 at 05:21:02PM +0300, Dmitry Mastykin wrote:
> interrupt handling was broken with conversion to using regmap caching.
> cached_gpio value was updated by boolean status instead of gpio reading.
> 
> Fixes: 8f38910ba4f6 ("pinctrl: mcp23s08: switch to regmap caching")
> Tested-by: Phil Reid <preid@electromag.com.au>
> Signed-off-by: Dmitry Mastykin <mastichi@gmail.com>

Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>

-- Sebastian

> ---
>  drivers/pinctrl/pinctrl-mcp23s08.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/pinctrl/pinctrl-mcp23s08.c b/drivers/pinctrl/pinctrl-mcp23s08.c
> index 3e40d42..9c950bbf 100644
> --- a/drivers/pinctrl/pinctrl-mcp23s08.c
> +++ b/drivers/pinctrl/pinctrl-mcp23s08.c
> @@ -407,10 +407,10 @@ static int mcp23s08_get(struct gpio_chip *chip, unsigned offset)
>  	ret = mcp_read(mcp, MCP_GPIO, &status);
>  	if (ret < 0)
>  		status = 0;
> -	else
> +	else {
> +		mcp->cached_gpio = status;
>  		status = !!(status & (1 << offset));
> -
> -	mcp->cached_gpio = status;
> +	}
>  
>  	mutex_unlock(&mcp->lock);
>  	return status;
> -- 
> 2.7.4
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2017-10-18 17:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-18 14:21 [PATCH v2] pinctrl: mcp23s08: fix interrupt handling regression Dmitry Mastykin
2017-10-18 17:00 ` Sebastian Reichel [this message]
2017-10-19  8:20 ` Linus Walleij

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=20171018170044.2cr57k5jswsrvjlk@earth \
    --to=sebastian.reichel@collabora.co.uk \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mastichi@gmail.com \
    --cc=preid@electromag.com.au \
    /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).