mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Srinivas Neeli <srinivas.neeli@xilinx.com>
To: linus.walleij@linaro.org, bgolaszewski@baylibre.com,
	michal.simek@xilinx.com, shubhrajyoti.datta@xilinx.com
Cc: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, git@xilinx.com
Subject: [PATCH 1/8] gpio: zynq: Fix for bug in zynq_gpio_restore_context API
Date: Thu, 26 Dec 2019 17:42:11 +0530	[thread overview]
Message-ID: <1577362338-28744-2-git-send-email-srinivas.neeli@xilinx.com> (raw)
In-Reply-To: <1577362338-28744-1-git-send-email-srinivas.neeli@xilinx.com>

From: Swapna Manupati <swapna.manupati@xilinx.com>

This patch writes the inverse value of Interrupt Mask Status
register into the Interrupt Enable register in
zynq_gpio_restore_context API to fix the bug.

Fixes: e11de4de28c0 ("gpio: zynq: Add support for suspend resume")
Signed-off-by: Swapna Manupati <swapna.manupati@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Srinivas Neeli <srinivas.neeli@xilinx.com>
---
 drivers/gpio/gpio-zynq.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/gpio/gpio-zynq.c b/drivers/gpio/gpio-zynq.c
index 4c3f6370eab4..05ba16fffdad 100644
--- a/drivers/gpio/gpio-zynq.c
+++ b/drivers/gpio/gpio-zynq.c
@@ -684,6 +684,8 @@ static void zynq_gpio_restore_context(struct zynq_gpio *gpio)
 	unsigned int bank_num;
 
 	for (bank_num = 0; bank_num < gpio->p_data->max_bank; bank_num++) {
+		writel_relaxed(ZYNQ_GPIO_IXR_DISABLE_ALL, gpio->base_addr +
+				ZYNQ_GPIO_INTDIS_OFFSET(bank_num));
 		writel_relaxed(gpio->context.datalsw[bank_num],
 			       gpio->base_addr +
 			       ZYNQ_GPIO_DATA_LSW_OFFSET(bank_num));
@@ -693,9 +695,6 @@ static void zynq_gpio_restore_context(struct zynq_gpio *gpio)
 		writel_relaxed(gpio->context.dirm[bank_num],
 			       gpio->base_addr +
 			       ZYNQ_GPIO_DIRM_OFFSET(bank_num));
-		writel_relaxed(gpio->context.int_en[bank_num],
-			       gpio->base_addr +
-			       ZYNQ_GPIO_INTEN_OFFSET(bank_num));
 		writel_relaxed(gpio->context.int_type[bank_num],
 			       gpio->base_addr +
 			       ZYNQ_GPIO_INTTYPE_OFFSET(bank_num));
@@ -705,6 +704,9 @@ static void zynq_gpio_restore_context(struct zynq_gpio *gpio)
 		writel_relaxed(gpio->context.int_any[bank_num],
 			       gpio->base_addr +
 			       ZYNQ_GPIO_INTANY_OFFSET(bank_num));
+		writel_relaxed(~(gpio->context.int_en[bank_num]),
+			       gpio->base_addr +
+			       ZYNQ_GPIO_INTEN_OFFSET(bank_num));
 	}
 }
 
-- 
2.7.4


  reply	other threads:[~2019-12-26 12:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-26 12:12 [PATCH 0/8] gpio: zynq: Update on gpio-zynq driver Srinivas Neeli
2019-12-26 12:12 ` Srinivas Neeli [this message]
2020-01-07 10:25   ` [PATCH 1/8] gpio: zynq: Fix for bug in zynq_gpio_restore_context API Linus Walleij
2019-12-26 12:12 ` [PATCH 2/8] gpio: zynq: protect direction in/out with a spinlock Srinivas Neeli
2020-01-02 17:40   ` Bartosz Golaszewski
2019-12-26 12:12 ` [PATCH 3/8] dt-bindings: gpio: Add binding for Versal gpio Srinivas Neeli
2019-12-26 12:12 ` [PATCH 4/8] devicetree-binding: Add pmc gpio node Srinivas Neeli
2019-12-26 12:12 ` [PATCH 5/8] gpio: zynq: Add Versal support Srinivas Neeli
2020-01-02 17:41   ` Bartosz Golaszewski
2019-12-26 12:12 ` [PATCH 6/8] gpio: zynq: Disable the irq if it is not a wakeup source Srinivas Neeli
2019-12-26 12:12 ` [PATCH 7/8] gpio: zynq: Add pmc gpio support Srinivas Neeli
2020-01-02 17:55   ` Bartosz Golaszewski
2019-12-26 12:12 ` [PATCH 8/8] gpio: zynq: Remove error prints in EPROBE_DEFER Srinivas Neeli

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=1577362338-28744-2-git-send-email-srinivas.neeli@xilinx.com \
    --to=srinivas.neeli@xilinx.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=git@xilinx.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.simek@xilinx.com \
    --cc=shubhrajyoti.datta@xilinx.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®