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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 25FCEC433F5 for ; Tue, 4 Oct 2022 07:11:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To: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-Owner; bh=ppqRzKS1l0xtaSqnlokaneT1poYA48krR4ME9d99gSY=; b=ur1crUaTH/C5tl XkppcNLtdob901sd9Qwa1sqNNEZ746jFO6Jr4Fa1jET7iGsmCgC8JQR3+d/Ha9XcGV2An560Sv0NB MD25dbODa75FvA2o2LXkPjxIaZQl7k0TPcLuxh0tpXHq/ir0q/I77owczE7jCv9teFw7n8nwGMmGn 2zRS45ZZYlPh7eQb7A8cyQPO41OsKmu/NrocBjCCFizxup6me/ultzQXlTYZdGA99lCo8oSxyfG1i GOwldse/lTVIkewTsZVZjeMd5eT88aYvAmRhldJEC1gIuB56wrfXLvokqa5eJtySWOwILWDiMIRaH v6pP+EyO7ZYPuoFjQ6zg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ofc4J-008hzC-KB; Tue, 04 Oct 2022 07:10:19 +0000 Received: from verein.lst.de ([213.95.11.211]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ofc4D-008hxj-47 for linux-arm-kernel@lists.infradead.org; Tue, 04 Oct 2022 07:10:17 +0000 Received: by verein.lst.de (Postfix, from userid 2407) id AD16568B05; Tue, 4 Oct 2022 09:10:00 +0200 (CEST) Date: Tue, 4 Oct 2022 09:10:00 +0200 From: Christoph Hellwig To: Marcin Wojtas Cc: Marek =?iso-8859-1?Q?Beh=FAn?= , "Russell King (Oracle)" , pali@kernel.org, Christoph Hellwig , Robin Murphy , Arnd Bergmann , Andre Przywara , Marc Zyngier , Linus Torvalds , Andrew Lunn , Gregory Clement , Greg Kroah-Hartman , iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org Subject: Re: REGRESSION in 6.0-rc7 caused by patch "ARM/dma-mapping: use dma-direct unconditionally" Message-ID: <20221004071000.GA28925@lst.de> References: <20220930151028.0e518421@dellmb> <630be11f-09ef-02d4-69f7-c7880ae5674c@arm.com> <20220930165234.729ad68c@dellmb> <20220930170205.490f1a6b@dellmb> <20221003073037.GB2108@lst.de> <20221003172533.6dc87184@dellmb> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221004_001014_609032_8DC042E5 X-CRM114-Status: GOOD ( 18.26 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Oct 03, 2022 at 11:30:31PM +0200, Marcin Wojtas wrote: > I have one overall concern here. On all kinds of A38x-based boards I > worked on, by default, the firmware set all devices (e.g. network, > AHCI, XHCI) on MBUS as fully IO cache coherent - it should be > reflected in the MVNETA_WIN_BASE(w) registers attribute field. Bits > [15:8] should be set to 0x1D (or 0x1E if there is a second DRAM CS > used). Can you please try adding 'dma-coherent;' property under the > 'internal-regs' node? Robin mentioned something similar earlier. This almost smalls like we somehow manage to mark these device non-coherent by accident now. The interesting part of the bisected commit is the change to mvebu_hwcc_notifier that used to force the DMA OPS to arm_coherent_dma_ops, but now just sets the ->dma_coherent flags, which seems to get overriden somehow again. Maybe the notifier is run before arch_setup_dma_ops, even if that seems odd? As that is the only thing I could think of, maybe try this patch: diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index 089c9c644cce2..76789650e2596 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c @@ -1770,7 +1770,9 @@ void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size, const struct iommu_ops *iommu, bool coherent) { dev->archdata.dma_coherent = coherent; - dev->dma_coherent = coherent; + + if (coherent) + dev->dma_coherent = true; /* * Don't override the dma_ops if they have already been set. Ideally _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel