Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1137369rdb; Sun, 1 Oct 2023 23:18:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGbK3UK0SSVMzXiNpJdOMcAfDfX4Ri9+hbSpB5b92PEorR4GXRpXXd0a6vOc4Nlc0EawFsw X-Received: by 2002:a17:90a:c7d6:b0:274:dd15:87bf with SMTP id gf22-20020a17090ac7d600b00274dd1587bfmr16460290pjb.20.1696227486977; Sun, 01 Oct 2023 23:18:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696227486; cv=none; d=google.com; s=arc-20160816; b=EjHYhZAOX/xM4htxL0ERTIixVRS47gU9ilo6hwj7cHzW1Q0pla8hAVuqwsZfWdNip0 be7PYcOrO1shji5JjArRNDJQrgVax9iHa4Qrl0JP2UEtgFRhlC9YCzMxaorwSSD97cnX Y9UNjNRzb9X8pSuXlpgqabz+nDIWcZrH99aiqIRX7Tkf/gvUbqYKSxt8oHCoHZpQ/18c yvQW7PoRd8o8VsLmEcueiOu9qyk45neBsBCKWp835oEyYEzojysaCiNyelq1hONhYN3U /O2jX58AO+TsKiRJmo55lQ7YWDSxIR5U5QYNSbHNsT6KMoFoL70hs+L8lRm36ACKQ3ke NvsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=KPieyXM0HoPmjo0SUEyWHpTQTB5QXXuHdBcL+GbRRl4=; fh=wK1hz0zAT5JqPECaSeA4RZzfV4DHl7BP2evZlD2YT1E=; b=HAdBNtCmHS/LPG5L11tUYkJAAD+BnLTuYEtoJsINswBwnWVkwXZDpo/3SUWL7lEWZz 6HgW1ylwBexYuqqHcPromYpOAWG0mNllo6+pmv5hCjAQJEx0yLzHD+bUfNSFFZvkGN9m UJ2Fdpu0xIExa2QEh24lxZ8ZVg4RxrGHVt3oYmTksfK8MIQHb5FRfkMcCjh9ijx2DcDZ MCgH3DFve7MiFbY++NhN+ocYeU8gpT15C3DWnq+bSTHID3yrvGki0Puy4iPYsjizygZy 6hi/RYosfXsrWypbzOqre2vPDAsoVfIqC4AkWc+FiXyJM8PhdkNUmDV/ewKAPPaWxK5c lFZw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id i3-20020a17090acf8300b002773af24826si7087893pju.123.2023.10.01.23.18.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Oct 2023 23:18:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id D826E808726A; Sun, 1 Oct 2023 23:16:53 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235443AbjJBGQh (ORCPT + 99 others); Mon, 2 Oct 2023 02:16:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235487AbjJBGQf (ORCPT ); Mon, 2 Oct 2023 02:16:35 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C416A7 for ; Sun, 1 Oct 2023 23:16:33 -0700 (PDT) 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (howler.vger.email [0.0.0.0]); Sun, 01 Oct 2023 23:16:54 -0700 (PDT) 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.