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 0BC1FE784A5 for ; Mon, 2 Oct 2023 06:17:05 +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=L3/oUiroy7+QIVBB/9U1hl3BonUVLIUwF3leuVg9X0U=; b=biypHa/Y/g9k+n jxwk8GpXvxafNCj6jfMcrONlejbOmqjQGX6u3x9l7coJ2BDXRcQiRY+3NfYju2fN+T0+ENHnB+Rzh ZStGf/uxyw1OLFzjKy4QPCRaOC/Z1+NvtunCf7ocGnmjIsPa02a/Wej2dN6GjuhqIxNKxRy0yBX/q lX319p6rz4U9UesvWTiBIpvBLF9hBL6fIJDQrzCk3Ls4Eg5dHymOJ+zsEoujshKIrb2G0nBDCkU/4 WOshPLC0GGEerAJptPT8ZeG6TF88WHU5zSkXUweQ3p9+OmqkITQdsQwGJTrsoYHQxBsFGNql9fxUw VJQOP9+TU1/CXPjb8GTA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qnCEU-00C17c-0y; Mon, 02 Oct 2023 06:16:42 +0000 Received: from verein.lst.de ([213.95.11.211]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qnCER-00C161-2k for linux-arm-kernel@lists.infradead.org; Mon, 02 Oct 2023 06:16:41 +0000 Received: by verein.lst.de (Postfix, from userid 2407) id 6614368D07; Mon, 2 Oct 2023 08:16:28 +0200 (CEST) Date: Mon, 2 Oct 2023 08:16:28 +0200 From: Christoph Hellwig To: Linus Walleij Cc: Jim Quinlan , Christoph Hellwig , bcm-kernel-feedback-list@broadcom.com, jim2101024@gmail.com, Russell King , Arnd Bergmann , Geert Uytterhoeven , "Russell King (Oracle)" , Andrew Morton , Jonathan Corbet , Thomas Gleixner , Sebastian Reichel , "Mike Rapoport (IBM)" , Eric DeVolder , Nathan Chancellor , "Kirill A. Shutemov" , Christophe Leroy , "moderated list:ARM PORT" , open list Subject: Re: [PATCH v1 1/1] ARM: Select DMA_DIRECT_REMAP to fix restricted DMA Message-ID: <20231002061628.GC911@lst.de> References: <20230926175208.9298-1-james.quinlan@broadcom.com> <20230926175208.9298-2-james.quinlan@broadcom.com> 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-20231001_231640_058468_424E482D X-CRM114-Status: GOOD ( 24.77 ) 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 Thu, Sep 28, 2023 at 01:10:27AM +0200, Linus Walleij wrote: > (...) > > + select DMA_DIRECT_REMAP > > Christoph invented that symbol so he can certainly > explain what is missing to use this on ARM. > > This looks weird to me, because: > > git grep atomic_pool_init > arch/arm/mm/dma-mapping.c:static int __init atomic_pool_init(void) > kernel/dma/pool.c:static int __init dma_atomic_pool_init(void) > > Now you have two atomic DMA pools in the kernel, > and a lot more than that is duplicated. I'm amazed that it > compiles at all. > > 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? > > However I don't think it's that simple, because Christoph would surely > had done this a long time ago if it was that simple. Yes, DMA_DIRECT_REMAP should only be used for platforms using the generic generic remap that plus straight into dma-direct and bypasses arch_dma_alloc. ARM first needs support to directly set the uncached/wc bits on the direct mapping for CMA, which should be fairly simple but require wide spread testing. I'd be happy to work with anyone who wants to look into this. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel