Skip to contentSkip to conversation

Patch "gpio: pca953x: Fix corruption of other gpios in set_multiple." has been added to the 4.8-stable tree

PATCH [email protected] 1 participant 1 message Nov 22, 2016

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

gpio: pca953x: Fix corruption of other gpios in set_multiple.

to the 4.8-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
gpio-pca953x-fix-corruption-of-other-gpios-in-set_multiple.patch
and it can be found in the queue-4.8 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 53f8d322234649b4d6f1515b20c127a577efd164 Mon Sep 17 00:00:00 2001

From: Phil Reid <[email protected]>
Date: Tue, 8 Nov 2016 14:00:45 +0800
Subject: gpio: pca953x: Fix corruption of other gpios in set_multiple.

From: Phil Reid <[email protected]>

commit 53f8d322234649b4d6f1515b20c127a577efd164 upstream.

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.

Fixes b4818afeacbd ("gpio: pca953x: Add set_multiple to allow multiple")
---
 drivers/gpio/gpio-pca953x.c |    1 +
 1 file changed, 1 insertion(+)
drivers/gpio/gpio-pca953x.c +1 -0
@@ -380,6 +380,7 @@ static void pca953x_gpio_set_multiple(st
 		if(bankmask) {
 			unsigned bankval  = bits[bank / sizeof(*bits)] >>
 					    ((bank % sizeof(*bits)) * 8);
+			bankval &= bankmask;
 			reg_val[bank] = (reg_val[bank] & ~bankmask) | bankval;
 		}
 	}

Patches currently in stable-queue which might be from [email protected] are

queue-4.8/gpio-pca953x-move-memcpy-into-mutex-lock-for-set-multiple.patch queue-4.8/gpio-pca953x-fix-corruption-of-other-gpios-in-set_multiple.patch