All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mario Limonciello <mario.limonciello@amd.com>
To: <linus.walleij@linaro.org>,
	Basavaraj Natikar <Basavaraj.Natikar@amd.com>,
	Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Cc: <nakato@nakato.io>, <korneld@chromium.org>,
	<richard.gong@amd.com>,
	"Mario Limonciello" <mario.limonciello@amd.com>,
	<stable@vger.kernel.org>, <linux-gpio@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: [PATCH 2/4] pinctrl: amd: Fix mistake in handling clearing pins at startup
Date: Fri, 21 Apr 2023 07:06:22 -0500	[thread overview]
Message-ID: <20230421120625.3366-3-mario.limonciello@amd.com> (raw)
In-Reply-To: <20230421120625.3366-1-mario.limonciello@amd.com>

commit 4e5a04be88fe ("pinctrl: amd: disable and mask interrupts on probe")
had a mistake in loop iteration 63 that it would clear offset 0xFC instead
of 0x100.  Offset 0xFC is actually `WAKE_INT_MASTER_REG`.  This was
clearing bits 13 and 15 from the register which significantly changed the
expected handling for some platforms for GPIO0.

Cc: stable@vger.kernel.org
Link: https://bugzilla.kernel.org/show_bug.cgi?id=217315
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
 drivers/pinctrl/pinctrl-amd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-amd.c b/drivers/pinctrl/pinctrl-amd.c
index 6b9ae92017d4..24465010397b 100644
--- a/drivers/pinctrl/pinctrl-amd.c
+++ b/drivers/pinctrl/pinctrl-amd.c
@@ -897,9 +897,9 @@ static void amd_gpio_irq_init(struct amd_gpio *gpio_dev)
 
 		raw_spin_lock_irqsave(&gpio_dev->lock, flags);
 
-		pin_reg = readl(gpio_dev->base + i * 4);
+		pin_reg = readl(gpio_dev->base + pin * 4);
 		pin_reg &= ~mask;
-		writel(pin_reg, gpio_dev->base + i * 4);
+		writel(pin_reg, gpio_dev->base + pin * 4);
 
 		raw_spin_unlock_irqrestore(&gpio_dev->lock, flags);
 	}
-- 
2.34.1


  parent reply	other threads:[~2023-04-21 12:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-21 12:06 [PATCH 0/4] pinctrl: amd: Adjust handling for firmware misconfigurations Mario Limonciello
2023-04-21 12:06 ` [PATCH 1/4] pinctrl: amd: Detect internal GPIO0 debounce handling Mario Limonciello
2023-04-21 12:06 ` Mario Limonciello [this message]
2023-04-21 12:06 ` [PATCH 3/4] pinctrl: amd: Detect and mask spurious interrupts Mario Limonciello
2023-04-21 12:06 ` [PATCH 4/4] pinctrl: amd: Revert "pinctrl: amd: disable and mask interrupts on probe" Mario Limonciello
2023-04-28 13:54   ` Limonciello, Mario
2023-05-05 11:43 ` [PATCH 0/4] pinctrl: amd: Adjust handling for firmware misconfigurations Linus Walleij
2023-05-05 12:14   ` Limonciello, Mario

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=20230421120625.3366-3-mario.limonciello@amd.com \
    --to=mario.limonciello@amd.com \
    --cc=Basavaraj.Natikar@amd.com \
    --cc=Shyam-sundar.S-k@amd.com \
    --cc=korneld@chromium.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nakato@nakato.io \
    --cc=richard.gong@amd.com \
    --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.