Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3391076rdh; Thu, 28 Sep 2023 10:11:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGmVbQ7a9kZMt3Q5S1q9K4AL5yzvuzCdlNEuFKnXN9hVSGFOfwSElneWFZ9GfafJ0r4iEGj X-Received: by 2002:a05:6870:14d3:b0:1d0:eaa6:82cd with SMTP id l19-20020a05687014d300b001d0eaa682cdmr2044443oab.25.1695921062431; Thu, 28 Sep 2023 10:11:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695921062; cv=none; d=google.com; s=arc-20160816; b=wCJIv9seRTfpF4oqmcd7WvLKn0ZvOryeDVAUfqDNgwK99ETDEWsQCWmYqq3Io1zE/R GTNJL4Zok2vNFwbZIlKGmT717fE4nHQJcbjdALnxhlJkJN/u+1/n830447ZJvapKSmFE YGnkNDkaNqhfZdoFsR74kLTO7uIbCZWkNoidE5SPgMCP4PL44lpNRcrskb6Gn91yKzPJ 1uyOsTqJSnH6GHTxnbPhw+GemS1i/fXNTz6H+8qeHbRr3esqQLDDt5QRtrA/YgGBiOFM 988KP9seiOpykfydq02QJDksZLl6osNeVs4bxdFpKRflgCpBvGUaC2WMGRN8HjGmf6hm CPeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:subject:cc:to:from :date:references:in-reply-to:message-id:mime-version:user-agent :feedback-id:dkim-signature:dkim-signature; bh=p5cefE8C1CwlgpUHYq3dLNNX5/KWHU5zG5bA7CGF3xM=; fh=5xybtjY2xrtrY2piQTURro7pYh4OPNPppyfgfWNuF/c=; b=J0glFcEGt9C4tUQU45lUrjlRWe0NfwUkSt5WKzq6RQ4uKBjd68Ogg++pOBXtZnm6Dc w+urO/8djHv/43gAqtudRsv8KDjzmSdkbeOVtFv5U82hQ4NyYFOQJaMKM2BB/KW+HyMj aSAZFtQc6mM9/Nw7iHr/qznwEROXBAYhCo08Q1wBtOn8/cdvrC7XsKGtCSJ7/EJjM5g/ XrMeAyVOwzbIBuL3LAPmGvFAEkqDGsaeGOvAg/blG1qE9R+v09bC8ENddqlR576xNtVg SH2a5Fsnai8DniOrY2y9aNwfZ3KsawAimDNloAubVRZlbvQ3L3+to6WHV3p8vmIrBAok 5+KQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm1 header.b=iSaF1I3H; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=asKPp9HT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id m9-20020a654389000000b005638355e989si18396532pgp.773.2023.09.28.10.11.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 10:11:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@arndb.de header.s=fm1 header.b=iSaF1I3H; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=asKPp9HT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id C30EF82A2DB8; Thu, 28 Sep 2023 06:33:13 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232050AbjI1NdD (ORCPT + 99 others); Thu, 28 Sep 2023 09:33:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231788AbjI1NdB (ORCPT ); Thu, 28 Sep 2023 09:33:01 -0400 Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF6E7196 for ; Thu, 28 Sep 2023 06:32:59 -0700 (PDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 10A915C0145; Thu, 28 Sep 2023 09:32:59 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute6.internal (MEProxy); Thu, 28 Sep 2023 09:32:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm1; t= 1695907979; x=1695994379; bh=p5cefE8C1CwlgpUHYq3dLNNX5/KWHU5zG5b A7CGF3xM=; b=iSaF1I3Hhe5fqkmDR2jWoX20fTbrJwWAIBOgBmMGJmx3PUcWudF AMLc3+nRa3KUppaUobrWEXRYSZ/D9R+70Z4+3o0c5gTvZ68P9RLcz85HFw21DNAH kl4PxBgextOShnSVVrXjHWQt9gOOsd9dTuQPrUaubgXdqiCSciK9Go9/XwS4f2NX h2kHP4AerkUzY3l8jshN6M0sri2CMYu9ghUCnyFCAJfk5Azyah4zmyJLe9rr/3HH GSfW3xcmE/3aDKvnyz6mFI+J/HQ/g7fQAEJxHcTxEOLDRpVy6PDV2wVc92eVA/zS GDrDqiYm8SQNkcqU71d8er4FTAy/tfpkReg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1695907979; x=1695994379; bh=p5cefE8C1CwlgpUHYq3dLNNX5/KWHU5zG5b A7CGF3xM=; b=asKPp9HT5ko1OK/VCHu79KA2qEvayaMZR/kEysd/FXnTovx9n1R WHnzxtUI1goe4+lAiPkdwNp4b1YwqFiMYJYiK2s3Ek3QBas7Z30nbsqTE5khlcyq XfzDAhxQNQpaJ2DQ++G8kDexygAWYPQVKgvKSCmHgbRRPP3ro8kFIEVpMTxr/mbq Wv6kbKaqIQ+irWTR5JECajXlixj4YpTfzA8Tck50Kq2F+rHPR+fQvEneLl28RMCt U04qDqquokk11mioWyN3a8MTdi0cOGzNR+oChey4A1IiERT7M0S5DViYig3exZ4d CHQT0HC3ccAF6hhhAjOkB08Th8dlvR4B+AQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrtddtgdefiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvvefutgfgsehtqhertderreejnecuhfhrohhmpedftehr nhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrth htvghrnhepgeefjeehvdelvdffieejieejiedvvdfhleeivdelveehjeelteegudektdfg jeevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 06274B6008D; Thu, 28 Sep 2023 09:32:56 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-958-g1b1b911df8-fm-20230927.002-g1b1b911d MIME-Version: 1.0 Message-Id: In-Reply-To: References: <20230926175208.9298-1-james.quinlan@broadcom.com> <20230926175208.9298-2-james.quinlan@broadcom.com> Date: Thu, 28 Sep 2023 09:32:35 -0400 From: "Arnd Bergmann" To: "Jim Quinlan" , "Linus Walleij" Cc: "Christoph Hellwig" , bcm-kernel-feedback-list@broadcom.com, jim2101024@gmail.com, "Russell King" , "Geert Uytterhoeven" , "Russell King" , "Andrew Morton" , "Jonathan Corbet" , "Thomas Gleixner" , "Sebastian Reichel" , "Mike Rapoport" , "Eric DeVolder" , "Nathan Chancellor" , "Kirill A. Shutemov" , "Christophe Leroy" , "moderated list:ARM PORT" , "open list" , "Claire Chang" Subject: Re: [PATCH v1 1/1] ARM: Select DMA_DIRECT_REMAP to fix restricted DMA Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Thu, 28 Sep 2023 06:33:13 -0700 (PDT) On Thu, Sep 28, 2023, at 08:07, Jim Quinlan wrote: > On Wed, Sep 27, 2023 at 7:10=E2=80=AFPM Linus Walleij wrote: >> >> Clearly if you want to do this, surely the ARM-specific >> arch/arm/mm/dma-mapping.c and arch/arm/mm/dma-mapping-nommu.c >> needs to be removed at the same time? > > > Yes, this is the reason I used "RFC" as the fix looked too easy to be = viable :-) > I debugged it enough to see that the host driver's > writes to the dma_alloc_coherent() region were not appearing in > memory, and that > led me to DMA_DIRECT_REMAP. Usually when you see a mismatch between the data observed by the device and the CPU, the problem is an incorrect "dma-coherent" property in the DT: either the device is coherent and accesses the cache but the CPU tries to bypass it because the property is missing, or there is an extraneous property and the CPU goes the through the cache but the devices bypasses it. It could also be a driver bug if the device mixes up the address spaces, e.g. passing virt_to_phys(pointer) rather than the DMA address returned by dma_alloc_coherent(). Arnd