Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1379918pxf; Fri, 19 Mar 2021 06:09:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzbOKhBBTW8caSu3ip1RHkW6FFBYaz/TfKtFKrsIEtG43g9W1oxKe13AgrObpQtxi0ktRFa X-Received: by 2002:a17:906:a155:: with SMTP id bu21mr4246755ejb.400.1616159364622; Fri, 19 Mar 2021 06:09:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616159364; cv=none; d=google.com; s=arc-20160816; b=L/4ZZprwy+J6ATnlzRpoaV909q8JH1yPCVYU3ZHavE642RFeoxQ55Y8HbYUK8E5RFO T4L4o8MszLuEXh25VMkjzmyRfnW4Zc+61VP2dGRTqctg6d+Km+JmZd1Gxy7Cue/pH0sr vgp2Gtm2qdA8NHDEApoRL86dRyfw1o/NRQ9CXEGJMy0Ee50y/oUhSMWf5V/Q9xKHat5T ZJJ54MNnWsR/AN+h7xIaZGIc+1bXkIn4YidMBGIqxZWyqtsGhm7MdnxFdJsjKSll9c8z yC6cOPD3dE8c1NoqZyX26wqwJU2Zmvbon9vbzclKs9zOHKFsQrxlPYTmYsBRajJTdJ7x oR0w== 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=uCTSq+vsCfACqFoqhcDPGbA/fxxqsf7oINSpb6qJdJk=; b=XnmvZEwzrLOnvjz7+I58h85ywfAgeTOj8sw9OVjK+TiDjNR9//u1uYB7wJ9Xje20EX BUO+Z+ADUbwRYevaAdwkYq5xu8drfn+Zj8AoEessRBNPu2cJJH5lZcQFJc/1SDPnkRsc 7g6AkBv3+dLBU+vZJvwpCFaqV5+kU8cNxKp6/kYUAAmgQVxCDuRCzeK1iTX8QJ/yZHJd KsyrmOxEwba7p4VdsW8kldBjniYsTPpc4iY88fM4TQDjrzjQtvDhS3pTKu+QZaBOzlIx b2aI5DdjOTT38ok7PmiltC8aRQ+XEZ4qe1fAJGcTszb2RyzJQsKXhHa83QWEkjkagmsv GYCw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s14si3708766edx.521.2021.03.19.06.09.01; Fri, 19 Mar 2021 06:09:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229927AbhCSNIE (ORCPT + 99 others); Fri, 19 Mar 2021 09:08:04 -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.