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=-10.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 2A349C433E0 for ; Wed, 13 Jan 2021 12:44:30 +0000 (UTC) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9F42F2337F for ; Wed, 13 Jan 2021 12:44:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9F42F2337F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 14E6C871B9; Wed, 13 Jan 2021 12:44:29 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HOvrFGkUL3MI; Wed, 13 Jan 2021 12:44:28 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by hemlock.osuosl.org (Postfix) with ESMTP id 854D18715E; Wed, 13 Jan 2021 12:44:28 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 63459C088B; Wed, 13 Jan 2021 12:44:28 +0000 (UTC) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 79782C013A for ; Wed, 13 Jan 2021 12:44:26 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 72F9280B16 for ; Wed, 13 Jan 2021 12:44:26 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8ea+USIMVSh3 for ; Wed, 13 Jan 2021 12:44:21 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by whitealder.osuosl.org (Postfix) with ESMTPS id ED8BB81AD8 for ; Wed, 13 Jan 2021 12:44:20 +0000 (UTC) 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 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-Disposition: inline In-Reply-To: <20210106034124.30560-4-tientzu@chromium.org> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: heikki.krogerus@linux.intel.com, peterz@infradead.org, benh@kernel.crashing.org, grant.likely@arm.com, paulus@samba.org, frowand.list@gmail.com, mingo@kernel.org, sstabellini@kernel.org, saravanak@google.com, mpe@ellerman.id.au, rafael.j.wysocki@intel.com, hch@lst.de, bgolaszewski@baylibre.com, xen-devel@lists.xenproject.org, treding@nvidia.com, devicetree@vger.kernel.org, will@kernel.org, konrad.wilk@oracle.com, dan.j.williams@intel.com, linuxppc-dev@lists.ozlabs.org, robh+dt@kernel.org, boris.ostrovsky@oracle.com, andriy.shevchenko@linux.intel.com, jgross@suse.com, drinkcat@chromium.org, gregkh@linuxfoundation.org, rdunlap@infradead.org, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, xypron.glpk@gmx.de, robin.murphy@arm.com X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" > +#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? _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu