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 38AB31798C; Mon, 14 Oct 2024 14:30:15 +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=1728916216; cv=none; b=fKfVCEZX3YV/Wcn15U2fNrb/M+tiVw6MrqNcUqV04s8D0Z+ktY0YJqM4ePUjkNXG1WfPLwqz6LaY9XZYK8kYq4CVUnLTj686vHL2cFcGJfxL4XF3KGD84DilRu++mSmw/KZY9zVreQfDqX9eGuXvgHXYB5Fe9qJKUasMEDRHAxE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728916216; c=relaxed/simple; bh=dhVyug9Rq78i1LGjpfxMaZVgfBdq1HjmP2GZutTv1EI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fas1Z5hVleao++mTH1YGOm1wa8GJDkdC+tMv1Z9awx0Y2a6z7AWFX+lpV7wU5cXef6UILL60nzOrDOxKoTS2GS2AzdvtMq7jLBUDK8hl4z8bcg4b+Pi7FPnMbaCcld4icGLdEyfyYR1cdBxmWT3PCjeu7QRtwIcHg7DOCVcgJAk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=WFUsiook; 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="WFUsiook" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5D683C4CEC3; Mon, 14 Oct 2024 14:30:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1728916215; bh=dhVyug9Rq78i1LGjpfxMaZVgfBdq1HjmP2GZutTv1EI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WFUsiookRPdj102DnJayCiHEcJz2LDnG1uNKOXuss8kKdXXUM+VNqy9t/txsSdVfB 1vZ4n0G7fwO2H00ULgh5W2ZgkNjD/MORjsEQEhelzXHt6tobPDsBWKzyJylG9rZAFt qsBH3wiI/E5XwdalqAtLJEuMZfnCu3lfQHGRomSA= 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 6.11 116/214] gpio: aspeed: Add the flush write to ensure the write complete. Date: Mon, 14 Oct 2024 16:19:39 +0200 Message-ID: <20241014141049.519836847@linuxfoundation.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241014141044.974962104@linuxfoundation.org> References: <20241014141044.974962104@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.11-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 04c03402db6dd..98551b7f6de2e 100644 --- a/drivers/gpio/gpio-aspeed.c +++ b/drivers/gpio/gpio-aspeed.c @@ -406,6 +406,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