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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8E843E732D1 for ; Thu, 28 Sep 2023 13:33:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232069AbjI1NdD (ORCPT ); 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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