FAILED: patch "[PATCH] gpio: pca953x: Fix corruption of other gpios in set_multiple." failed to apply to 4.8-stable tree
Subsystems (2)
[email protected]
maintainerThe 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 <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
Quoted 1 line
From
53f8d322234649b4d6f1515b20c127a577efd164Mon Sep 17 00:00:00 2001
From: Phil Reid <[email protected]>
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.
drivers/gpio/gpio-pca953x.c +1 -0
@@ -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; } }