From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AA7851E0493; Wed, 6 Nov 2024 13:11:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730898707; cv=none; b=qUXzLPCRIcsUDkUBK77zyEnDupFHE4XkZvSLbCUXtXwtVaZy8/U86NZgMMZIB0QJ9STEphMcazy9JC7ALXNmAIdS0bUKIqh/HUO2uSKqI/HHipVqNcBQl0UbSYpgZ/uiuZi7IbPKubvPtTWewyYj04YbckELOY7eu73PqnkH7ag= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730898707; c=relaxed/simple; bh=Gbbr6CKxagcQJ2xrpZ8tAwdgN+5NNpRO+lDhWE622tA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cGNIHDE5pduPO6ieigdd5pkyZMTc107Ih3poPSEW2oJhkEfRt1r3RxnRtgfrbFnOEUCP8EGm6GC8VACnzf51ab3nTeJMtLLCRNMIVqXgSwu8brfeTecr7CMayH/WQD2DEdt9c9Uulz5HY9TTXNvXME2Y8T9cnreFJEvJg2gNVSY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=cFsCPZtL; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="cFsCPZtL" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F0C47C4CED4; Wed, 6 Nov 2024 13:11:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1730898707; bh=Gbbr6CKxagcQJ2xrpZ8tAwdgN+5NNpRO+lDhWE622tA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cFsCPZtLjn1eJWaeyKU0DT9hQkScLKczmyT1IKge/bwOqyReJ4lDk8Y9rn2iz18hx 3SbFfQVVvI4ZcT2L3gonIdO73fx0QJHBHEYZhB4rSFIAgNHnL/wOPltx0J4FRZU1hq 8z/1KHCvJYjkOo718JRcl60C5Zs2jmGHN2ptiM3Y= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Andrew Jeffery , Billy Tsai , Bartosz Golaszewski , Sasha Levin Subject: [PATCH 5.4 328/462] gpio: aspeed: Add the flush write to ensure the write complete. Date: Wed, 6 Nov 2024 13:03:41 +0100 Message-ID: <20241106120339.629681297@linuxfoundation.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241106120331.497003148@linuxfoundation.org> References: <20241106120331.497003148@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Billy Tsai [ Upstream commit 1bb5a99e1f3fd27accb804aa0443a789161f843c ] Performing a dummy read ensures that the register write operation is fully completed, mitigating any potential bus delays that could otherwise impact the frequency of bitbang usage. E.g., if the JTAG application uses GPIO to control the JTAG pins (TCK, TMS, TDI, TDO, and TRST), and the application sets the TCK clock to 1 MHz, the GPIO's high/low transitions will rely on a delay function to ensure the clock frequency does not exceed 1 MHz. However, this can lead to rapid toggling of the GPIO because the write operation is POSTed and does not wait for a bus acknowledgment. Fixes: 361b79119a4b ("gpio: Add Aspeed driver") Reviewed-by: Andrew Jeffery Signed-off-by: Billy Tsai Link: https://lore.kernel.org/r/20241008081450.1490955-2-billy_tsai@aspeedtech.com Signed-off-by: Bartosz Golaszewski Signed-off-by: Sasha Levin --- drivers/gpio/gpio-aspeed.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpio/gpio-aspeed.c b/drivers/gpio/gpio-aspeed.c index b7e93d10a6ab6..24bd00a6ae423 100644 --- a/drivers/gpio/gpio-aspeed.c +++ b/drivers/gpio/gpio-aspeed.c @@ -404,6 +404,8 @@ static void __aspeed_gpio_set(struct gpio_chip *gc, unsigned int offset, gpio->dcache[GPIO_BANK(offset)] = reg; iowrite32(reg, addr); + /* Flush write */ + ioread32(addr); } static void aspeed_gpio_set(struct gpio_chip *gc, unsigned int offset, -- 2.43.0