Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp324280pxb; Wed, 13 Jan 2021 04:46:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJzp4v2r2Y4ox2w1bqrIw3ZkcrxZPvAVe5ZLErf+6xhiPlMkX1Kg/tuEGN067d8Oz89fazhd X-Received: by 2002:a50:e845:: with SMTP id k5mr1643801edn.35.1610541985025; Wed, 13 Jan 2021 04:46:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610541985; cv=none; d=google.com; s=arc-20160816; b=o3R/Ud7xTs1etgrYbdSfN+hqBSm5kVK4/GJccWagWiSVnEFa4ONHMA8qEwPc7rgb1g 02qQaKY4RdjkY1QqYnUHSmeVKXbTNgkT0ezytt+geWKWsg3TprsQh78wAbosJKvuXP6G iRDvoHZnQmBfW9kiq0F3xM4MuJuGsiMOkQ5zTZqXsooBOmcsK3G0j5bEks5DJyUiQP4z cNB+rOheKZ7V2X78ItaCRmXmy9A7AmTdY5MQQdS8XrVtJRgpmSdWDYW06xQQCQdZlKd7 8OfICTNFYYUPPotjz/IbUJaiKk8AxzamP4iC8xhTlBJY/GLI3Q7AFOhBPKtgHKrqeIms lDzw== 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=1TrhcYt/iYB3pJJ3wGT6uOpnwVbKapYqrnv+uBukXvs=; b=oobEvVjKCXzWOM1mdSm+0vLxvLPN5Wfv8IciHWFlvLoHoCbJA7/Bg489HEEAzjLbdk nySw+6/S4idA/6uQdEgCoxX3xaPqy9AyhdkGUZAnI9iPE4l1xrcrglXrvNxmrsyLv/l1 pDB8uDKyRngykb0ENFSKzlsTUcYwpWx4/o2o+2i84tEJuHIklJtMrqN89Hx/cqCPMi1j 4g2Epo+awQu2rg2+8xLSBxbRKVnn2vUGrRJbS6hNwsTzdzS+YWo6y2eZngWC7/+iaM/J yHZ+vNCY6mYQuP/AoclecNoO/CyDkANqpeiSMhCFGNG2i0G1AbfVveNyGyFsXa2O73bZ woTw== 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 p14si789782ejf.275.2021.01.13.04.46.01; Wed, 13 Jan 2021 04:46:25 -0800 (PST) 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 S1725857AbhAMMpB (ORCPT + 99 others); Wed, 13 Jan 2021 07:45:01 -0500 Received: from verein.lst.de ([213.95.11.211]:60054 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725773AbhAMMpB (ORCPT ); Wed, 13 Jan 2021 07:45:01 -0500 Received: by verein.lst.de (Postfix, from userid 2407) id 5DAEB68AFE; Wed, 13 Jan 2021 13:44:16 +0100 (CET) Date: Wed, 13 Jan 2021 13:44:16 +0100 From: Christoph Hellwig To: Claire Chang Cc: robh+dt@kernel.org, mpe@ellerman.id.au, benh@kernel.crashing.org, paulus@samba.org, joro@8bytes.org, will@kernel.org, frowand.list@gmail.com, konrad.wilk@oracle.com, boris.ostrovsky@oracle.com, jgross@suse.com, sstabellini@kernel.org, hch@lst.de, m.szyprowski@samsung.com, robin.murphy@arm.com, grant.likely@arm.com, xypron.glpk@gmx.de, treding@nvidia.com, mingo@kernel.org, bauerman@linux.ibm.com, peterz@infradead.org, gregkh@linuxfoundation.org, saravanak@google.com, rafael.j.wysocki@intel.com, heikki.krogerus@linux.intel.com, andriy.shevchenko@linux.intel.com, rdunlap@infradead.org, dan.j.williams@intel.com, bgolaszewski@baylibre.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, iommu@lists.linux-foundation.org, xen-devel@lists.xenproject.org, tfiga@chromium.org, drinkcat@chromium.org Subject: Re: [RFC PATCH v3 3/6] swiotlb: Use restricted DMA pool if available Message-ID: <20210113124416.GB1383@lst.de> References: <20210106034124.30560-1-tientzu@chromium.org> <20210106034124.30560-4-tientzu@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210106034124.30560-4-tientzu@chromium.org> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > +#ifdef CONFIG_SWIOTLB > + if (unlikely(swiotlb_force == SWIOTLB_FORCE) || dev->dma_io_tlb_mem) > return swiotlb_map(dev, phys, size, dir, attrs); > +#endif Please provide a wrapper for the dev->dma_io_tlb_mem check that always returns false if the per-device swiotlb support is not enabled. > index 7fb2ac087d23..1f05af09e61a 100644 > --- a/kernel/dma/swiotlb.c > +++ b/kernel/dma/swiotlb.c > @@ -222,7 +222,6 @@ int __init swiotlb_init_with_tbl(char *tlb, unsigned long nslabs, int verbose) > mem->orig_addr[i] = INVALID_PHYS_ADDR; > } > mem->index = 0; > - no_iotlb_memory = false; How does this fit in here?