Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp521069pxj; Fri, 28 May 2021 09:06:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxpEAJa9aCpl6UuLu18ZBtC5Z2HiJ+TGFky0wdQFaybbQaAvBQw9Cs3napnbKpXitJU33vK X-Received: by 2002:a17:906:5a9a:: with SMTP id l26mr1345663ejq.490.1622218015528; Fri, 28 May 2021 09:06:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622218015; cv=none; d=google.com; s=arc-20160816; b=RJwR9sXnqEgLTXgoGgg3dpQBUq7dwz8Hikwa3tZpkY4KZx1GxSq1zDLPtOYkvsYmj3 aCGRN6bhz0PtFlkq3mnlf/SyQBqMUrD3adMVZ0hJl1i3Yazn3X/Nl2dHP1dPgfPf4MlP WRSmxgi9rsUr9Hp5a3hEmnyck15DBva20oFEDBOaXhqSHdl9HBaDOekyHs1BBt2G7w5i 7VYVt4fxNUh519psMAxCKAvCxDh92RzYSRaujrlHH3FsAHZeLRQqq8Wz580uKLD4m53V ev9ZmmzhKeFEIdBpcLLDanXKvoMWnhjrHnzAr8OpFoNWd8hTv+VwNPeyS2bh/jNOH9EJ fxHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=R4ITbO2zQ8+lQSlzYrqLkEM0zhWRWfeQJIIZ5GiIeA8=; b=BSjytYbFmnQBf5U0T2t+8xUEuqkTLvUBtGYLWwq8XMuwsjaqlvt2jEQao83Q3404JX nW1elgjTcINxfC8xPsTJRv8lYysbxF6osbBvTW7nGG4sooZwr9/LvSMvr4G56eYbMrtc dSZQcAZ3EnN3veVa3qNWX0rheiad5dBdbfmWD84GBCc6yRFf2u1TTO9dMZFMgekaY0V7 SCvz2oufbDORsOr6A4FvE9eogkXBn5PXkWP+0dMoGH8V/RejeM4zTVtj7JqkuF86AMwB dYGvjkAmx5xDZlTNHYwa6xUT4zV1JUxJBtHJeyXwptwVn6/GPU8AuSjkLQVTI99BNvSG DnLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b="eo/JmWVl"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mf21si5044474ejb.50.2021.05.28.09.06.27; Fri, 28 May 2021 09:06:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b="eo/JmWVl"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236076AbhE1OhX (ORCPT + 99 others); Fri, 28 May 2021 10:37:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230080AbhE1OhX (ORCPT ); Fri, 28 May 2021 10:37:23 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DC29C061574 for ; Fri, 28 May 2021 07:35:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=R4ITbO2zQ8+lQSlzYrqLkEM0zhWRWfeQJIIZ5GiIeA8=; b=eo/JmWVlEvb6d7ZTxUyMeDveB k4g9KxD+wLtVzPfA8XlBRYVbAQYrXKqpVqeQSmBlOEOwYvIdaejXctscaVFmzPeMhz37UD3KJhVG8 ZbPll31d6s0h19rEC9xTjyEjFxigmG+CbdkzAOF8+bn5WjIrH8KbPfzyohjFNdHyp71u+cnIF09Z9 qLvgDmh0QtNdpIij93/nFNpotFyxnnBV2R8SIqQMO7u/NWCrkxXsQzI0Cv1g+sG083QQ4ihNnA/Io 8irfy1kx20apIZc15THyTauPDvsQXDLvpqyFXe/nW7TYqOxpC5ofI0VgijwM+V4jdS8Bil4QCTlGU 0aB1kHC+Q==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:44444) by pandora.armlinux.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lmdaU-000063-FN; Fri, 28 May 2021 15:35:46 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1lmdaS-0004mG-TV; Fri, 28 May 2021 15:35:44 +0100 Date: Fri, 28 May 2021 15:35:44 +0100 From: "Russell King (Oracle)" To: Krzysztof =?utf-8?Q?Ha=C5=82asa?= Cc: linux-arm-kernel , lkml Subject: Re: Data corruption on i.MX6 IPU in arm_copy_from_user() Message-ID: <20210528143544.GQ30436@shell.armlinux.org.uk> References: <20210526100843.GD30436@shell.armlinux.org.uk> <20210526131853.GE30436@shell.armlinux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: Russell King (Oracle) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 28, 2021 at 12:02:52PM +0200, Krzysztof HaƂasa wrote: > "Russell King (Oracle)" writes: > > > In any case, looking at the architecture reference manual, LDM is > > permitted on device and strongly ordered mappings, and the memory > > subsystem is required to decompose it into a series of 32-bit accesses. > > So, it sounds to me like there could be a hardware bug in the buses/IPU > > causing this. > > It seems so. > > I modified the kernel IPU module a bit, initialized a bunch of IPU > registers to known values (1..0xD). Results (from 1 to 13 IPU > registers) obtained with different instructions: > > readl(13 consecutive registers): CSI = 1 2 3 4 5 6 7 8 9 A B C D > 1 = register #0 and so on - readl() results are obviously correct. > > LDM1: 1 (not corrupted) > LDM2: 1 3 > LDM3: 1 3 4 > LDM4: 2 3 4 4 > LDM5: 1 3 4 5 6 > LDM6: 1 3 4 5 6 7 > LDM7: 1 3 4 5 6 7 8 > LDM8: 2 3 4 5 6 7 8 8 > LDM9: 1 3 4 5 6 7 8 9 A > LDM10: 1 3 4 5 6 7 8 9 A B > LDM11: 1 3 4 5 6 7 8 9 A B C > LDM12: 1 3 4 5 6 7 8 9 A B C D That's rather sad, and does look very much like a hardware bug. The question is what to do about it... there's Linus' "do not break userspace" edict and that's exactly what this change has done. So I suppose we're going to have to revert the change and put up with everything being slightly slower on arm32 than it otherwise would have been. That probably means we'll end up with almost every kernel tree out there carrying a revert of the revert to work around the fact that seemingly NXP broke their hardware - which itself is not a good idea. I guess we're just going to have to put up with that. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!