All of lore.kernel.org
 help / color / mirror / Atom feed
From: <gregkh@linuxfoundation.org>
To: preid@electromag.com.au, gregkh@linuxfoundation.org,
	linus.walleij@linaro.org
Cc: <stable@vger.kernel.org>, <stable-commits@vger.kernel.org>
Subject: Patch "gpio: pca953x: Move memcpy into mutex lock for set multiple" has been added to the 4.8-stable tree
Date: Tue, 22 Nov 2016 09:02:36 +0100	[thread overview]
Message-ID: <14798017562825@kroah.com> (raw)


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

    gpio: pca953x: Move memcpy into mutex lock for 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-move-memcpy-into-mutex-lock-for-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 <stable@vger.kernel.org> know about it.


>From 386377b5473043c09b2de40bfe5abfb0fc87e1b4 Mon Sep 17 00:00:00 2001
From: Phil Reid <preid@electromag.com.au>
Date: Tue, 8 Nov 2016 13:18:11 +0800
Subject: gpio: pca953x: Move memcpy into mutex lock for set multiple

From: Phil Reid <preid@electromag.com.au>

commit 386377b5473043c09b2de40bfe5abfb0fc87e1b4 upstream.

Need to ensure that reg_output is not updated while setting multiple
bits. This makes the mutex locking behaviour for the set_multiple call
consistent with that of the set_value call.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/gpio/gpio-pca953x.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -372,8 +372,8 @@ static void pca953x_gpio_set_multiple(st
 		break;
 	}
 
-	memcpy(reg_val, chip->reg_output, NBANK(chip));
 	mutex_lock(&chip->i2c_lock);
+	memcpy(reg_val, chip->reg_output, NBANK(chip));
 	for(bank=0; bank<NBANK(chip); bank++) {
 		unsigned bankmask = mask[bank / sizeof(*mask)] >>
 				    ((bank % sizeof(*mask)) * 8);


Patches currently in stable-queue which might be from preid@electromag.com.au 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

                 reply	other threads:[~2016-11-22  8:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=14798017562825@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=linus.walleij@linaro.org \
    --cc=preid@electromag.com.au \
    --cc=stable-commits@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /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 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.