* FAILED: patch "[PATCH] gpio: pca953x: Fix corruption of other gpios in set_multiple." failed to apply to 4.8-stable tree
@ 2016-11-21 11:32 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2016-11-21 11:32 UTC (permalink / raw)
To: preid, linus.walleij; +Cc: stable
The patch below does not apply to the 4.8-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
>From 53f8d322234649b4d6f1515b20c127a577efd164 Mon Sep 17 00:00:00 2001
From: Phil Reid <preid@electromag.com.au>
Date: Tue, 8 Nov 2016 14:00:45 +0800
Subject: [PATCH] gpio: pca953x: Fix corruption of other gpios in set_multiple.
gpiod_set_array_value_complex does not clear the bits field.
Therefore when the drivers set_multiple funciton is called bits outside
the mask are undefined and can be either set or not. So bank_val needs
to be masked with bank_mask before or with the reg_val cache.
Cc: stable@vger.kernel.org
Fixes: b4818afeacbd ("gpio: pca953x: Add set_multiple to allow multiple")
Signed-off-by: Phil Reid <preid@electromag.com.au>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
index e422568e14ad..4a8d0fe60e0c 100644
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -380,6 +380,7 @@ static void pca953x_gpio_set_multiple(struct gpio_chip *gc,
if (bank_mask) {
bank_val = bits[bank / sizeof(*bits)] >>
((bank % sizeof(*bits)) * 8);
+ bank_val &= bank_mask;
reg_val[bank] = (reg_val[bank] & ~bank_mask) | bank_val;
}
}
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2016-11-21 11:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-21 11:32 FAILED: patch "[PATCH] gpio: pca953x: Fix corruption of other gpios in set_multiple." failed to apply to 4.8-stable tree gregkh
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.