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 X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2E6E0C433E9 for ; Fri, 19 Mar 2021 13:08:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 04F1464F7B for ; Fri, 19 Mar 2021 13:08:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229965AbhCSNIF (ORCPT ); Fri, 19 Mar 2021 09:08:05 -0400 Received: from verein.lst.de ([213.95.11.211]:46113 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229634AbhCSNHf (ORCPT ); Fri, 19 Mar 2021 09:07:35 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id DE0B568BFE; Fri, 19 Mar 2021 14:07:31 +0100 (CET) Date: Fri, 19 Mar 2021 14:07:31 +0100 From: Christoph Hellwig To: Florian Fainelli Cc: linux-arm-kernel@lists.infradead.org, Konrad Rzeszutek Wilk , Christoph Hellwig , Marek Szyprowski , Robin Murphy , "open list:SWIOTLB SUBSYSTEM" , open list , Russell King , Mike Rapoport , Andrew Morton , Ard Biesheuvel , Max Filippov , Catalin Marinas , opendmb@gmail.com Subject: Re: [PATCH] ARM: Qualify enabling of swiotlb_init() Message-ID: <20210319130731.GB2624@lst.de> References: <20210319040333.183827-1-f.fainelli@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210319040333.183827-1-f.fainelli@gmail.com> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 18, 2021 at 09:03:33PM -0700, Florian Fainelli wrote: > #ifdef CONFIG_ARM_LPAE > + if (swiotlb_force == SWIOTLB_FORCE || > + max_pfn > arm_dma_pfn_limit) Does arm_dma_pfn_limit do the right thing even with the weirdest remapping ranges? Maybe a commen here would be useful. > + swiotlb_init(1); > + else > + swiotlb_force = SWIOTLB_NO_FORCE; Konrad: what do you think of setting swiotlb_force to SWIOTLB_NO_FORCE and only switching it to SWIOTLB_NORMAL when swiotlb_init* is called? That kind makes more sense than forcing the callers to do it. While we're at it, I think swiotlb_force should probably be renamed to swiotlb_mode or somethng like that.