From mboxrd@z Thu Jan 1 00:00:00 1970 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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 30B9EC433EF for ; Wed, 13 Jul 2022 14:02:33 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 613908400F; Wed, 13 Jul 2022 16:02:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=codasip.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=codasip.com header.i=@codasip.com header.b="LGolcJXS"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id EA05383A22; Wed, 13 Jul 2022 15:56:18 +0200 (CEST) Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 18BB8832DA for ; Wed, 13 Jul 2022 15:56:16 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=codasip.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=samuel.obuch@codasip.com Received: by mail-ed1-x536.google.com with SMTP id fd6so14198429edb.5 for ; Wed, 13 Jul 2022 06:56:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codasip.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0gpUBXSOzuCOwcanfrsq0BpoFK1svr1BYoj6Fweoo38=; b=LGolcJXSfV77XYiqTE2iFPcPlIJ3speVa6/awqgqFycPaI5MMaE4uJ4usq35Jq+tj+ 38j5KDkLGR9huOXEj1xvE+MtSlhzvUx5n5pYCVVwpUrdDUXURGUTa3C/SgSHvWXqQO9U wLH7abLkcAufbSIIAEf/tyPNx0SWXo90LSQnkgdE36ejG30db32obn/hYNXctkLiZxy9 DrrNRc38+C8YPl/UHWah77BMIrouJQmg6aaIRKrOiYeEUhfCQWdShZMJgZ9nsGCE/Wgx Wk8A96CJKgdLnk7wQMD4sokGEz2u9kF4RPv1ik67xCwmlewWw1+jglPBG3D0sceGuL2G 0y0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0gpUBXSOzuCOwcanfrsq0BpoFK1svr1BYoj6Fweoo38=; b=3bXh+cKRpeaLH9LbpT3DpzpivNLvNMudagPMLU2aQT/SjT7UGPmmQrNHL5Nk5+gsaa TrwbXKfkOsv6bYSYKMz9JtErHEDnVHmujO7aMwX8nI6sFPdXG85nhgVWQo4YNWSs10cG QWoZ5wxI/zXtodl4rdBLkpBlX6lphlrd4RIKcZ1fL3A9NnCCnEuxjOY41WP0xud0q1jZ M9axcueYoeW4Dr4/AXFl2SRTcUd4WIQSvNIYc76LHBQcYqqR5lfaXunLA6ioTIuIyvkN 1occfR2UnFOioIIGxsmPdIQw7ho++oxCI2PtKjmqtzwBW1s4doEICjb2IvN+3EgzN+Ix tiLw== X-Gm-Message-State: AJIora9aSePkQG5Izbn6DPfcDCjjZYUl+de6X2tR641mnfvkbGLfz99i O9Isuq4EGkatlpJfb0hMt4D/ipAF99mxBQ== X-Google-Smtp-Source: AGRyM1updmVobWBXf+M9VBeXuGrP3S9j0IlfABXGtiI4QGIZZ4F14yyEFjUr3oXMNU1onPQQymHwXQ== X-Received: by 2002:a05:6402:84d:b0:435:a764:9aad with SMTP id b13-20020a056402084d00b00435a7649aadmr5368700edz.332.1657720575395; Wed, 13 Jul 2022 06:56:15 -0700 (PDT) Received: from nb76.codasip.com ([193.85.186.210]) by smtp.gmail.com with ESMTPSA id h4-20020a50ed84000000b0043a85d7d15esm7907531edr.12.2022.07.13.06.56.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Jul 2022 06:56:14 -0700 (PDT) From: Samuel Obuch To: u-boot@lists.denx.de Cc: Samuel Obuch Subject: [PATCH 2/3] net: emaclite: fix xemaclite_alignedread/write functions Date: Wed, 13 Jul 2022 15:52:03 +0200 Message-Id: <20220713135204.233268-3-samuel.obuch@codasip.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220713135204.233268-1-samuel.obuch@codasip.com> References: <20220713135204.233268-1-samuel.obuch@codasip.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Wed, 13 Jul 2022 16:02:04 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Use __raw_read* and __raw_write* functions to ensure read/write is passed to the memory-mapped regions, as non-volatile accesses may get optimised out. Signed-off-by: Samuel Obuch --- drivers/net/xilinx_emaclite.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/net/xilinx_emaclite.c b/drivers/net/xilinx_emaclite.c index 5cd88e04fe..de7a2dee0b 100644 --- a/drivers/net/xilinx_emaclite.c +++ b/drivers/net/xilinx_emaclite.c @@ -113,12 +113,12 @@ static void xemaclite_alignedread(u32 *srcptr, void *destptr, u32 bytecount) /* Word aligned buffer, no correction needed. */ to32ptr = (u32 *) destptr; while (bytecount > 3) { - *to32ptr++ = *from32ptr++; + *to32ptr++ = __raw_readl(from32ptr++); bytecount -= 4; } to8ptr = (u8 *) to32ptr; - alignbuffer = *from32ptr++; + alignbuffer = __raw_readl(from32ptr++); from8ptr = (u8 *) &alignbuffer; for (i = 0; i < bytecount; i++) @@ -136,8 +136,7 @@ static void xemaclite_alignedwrite(void *srcptr, u32 *destptr, u32 bytecount) from32ptr = (u32 *) srcptr; while (bytecount > 3) { - - *to32ptr++ = *from32ptr++; + __raw_writel(*from32ptr++, to32ptr++); bytecount -= 4; } @@ -148,7 +147,7 @@ static void xemaclite_alignedwrite(void *srcptr, u32 *destptr, u32 bytecount) for (i = 0; i < bytecount; i++) *to8ptr++ = *from8ptr++; - *to32ptr++ = alignbuffer; + __raw_writel(alignbuffer, to32ptr++); } static int wait_for_bit(const char *func, u32 *reg, const u32 mask, -- 2.31.1