[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171018170044.2cr57k5jswsrvjlk@earth>
Date: Wed, 18 Oct 2017 19:00:44 +0200
From: Sebastian Reichel <sebastian.reichel@...labora.co.uk>
To: Dmitry Mastykin <mastichi@...il.com>
Cc: preid@...ctromag.com.au, Linus Walleij <linus.walleij@...aro.org>,
linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] pinctrl: mcp23s08: fix interrupt handling regression
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@...ctromag.com.au>
> Signed-off-by: Dmitry Mastykin <mastichi@...il.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@...labora.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
>
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists