From nobody Tue Apr 7 11:17:22 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 211A9C433FE for ; Sun, 16 Oct 2022 15:57:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229819AbiJPP5k (ORCPT ); Sun, 16 Oct 2022 11:57:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229562AbiJPP5i (ORCPT ); Sun, 16 Oct 2022 11:57:38 -0400 Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 762002E9C4; Sun, 16 Oct 2022 08:57:37 -0700 (PDT) Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by gandalf.ozlabs.org (Postfix) with ESMTP id 4Mr4Ww3Gvfz4xGp; Mon, 17 Oct 2022 02:57:32 +1100 (AEDT) Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4Mr4Wq65Brz4xGG; Mon, 17 Oct 2022 02:57:27 +1100 (AEDT) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: linux-spi@vger.kernel.org Cc: Mark Brown , linux-aspeed@lists.ozlabs.org, openbmc@lists.ozlabs.org, Joel Stanley , Andrew Jeffery , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Chin-Ting Kuo Subject: [PATCH] spi: aspeed: Fix window offset of CE1 Date: Sun, 16 Oct 2022 17:57:22 +0200 Message-Id: <20221016155722.3520802-1-clg@kaod.org> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The offset value of the mapping window in the kernel structure is calculated using the value of the previous window offset. This doesn't reflect how the HW is configured and can lead to erroneous setting of the second flash device (CE1). Cc: Chin-Ting Kuo =20 Fixes: e3228ed92893 ("spi: spi-mem: Convert Aspeed SMC driver to spi-mem") Signed-off-by: C=C3=A9dric Le Goater Reviewed-by: Joel Stanley --- drivers/spi/spi-aspeed-smc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi-aspeed-smc.c b/drivers/spi/spi-aspeed-smc.c index 33cefcf18392..b90571396a60 100644 --- a/drivers/spi/spi-aspeed-smc.c +++ b/drivers/spi/spi-aspeed-smc.c @@ -398,7 +398,7 @@ static void aspeed_spi_get_windows(struct aspeed_spi *a= spi, windows[cs].cs =3D cs; windows[cs].size =3D data->segment_end(aspi, reg_val) - data->segment_start(aspi, reg_val); - windows[cs].offset =3D cs ? windows[cs - 1].offset + windows[cs - 1].siz= e : 0; + windows[cs].offset =3D data->segment_start(aspi, reg_val) - aspi->ahb_ba= se_phy; dev_vdbg(aspi->dev, "CE%d offset=3D0x%.8x size=3D0x%x\n", cs, windows[cs].offset, windows[cs].size); } --=20 2.37.3