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.2 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 6539CC433C1 for ; Mon, 22 Mar 2021 07:46:37 +0000 (UTC) Received: from smtp2.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 AF8E06192E for ; Mon, 22 Mar 2021 07:46:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AF8E06192E 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 smtp2.osuosl.org (Postfix) with ESMTP id 4A7C3402A6; Mon, 22 Mar 2021 07:46:36 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UILvqKbbFAvG; Mon, 22 Mar 2021 07:46:35 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp2.osuosl.org (Postfix) with ESMTP id 4320F40299; Mon, 22 Mar 2021 07:46:35 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 09786C000B; Mon, 22 Mar 2021 07:46:35 +0000 (UTC) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 0EF82C0001 for ; Mon, 22 Mar 2021 07:46:34 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id ECB95402A4 for ; Mon, 22 Mar 2021 07:46:33 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id q3HgQNPKgChJ for ; Mon, 22 Mar 2021 07:46:33 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by smtp4.osuosl.org (Postfix) with ESMTPS id C99A940287 for ; Mon, 22 Mar 2021 07:46:32 +0000 (UTC) Received: by verein.lst.de (Postfix, from userid 2407) id DFD0767373; Mon, 22 Mar 2021 08:46:27 +0100 (CET) Date: Mon, 22 Mar 2021 08:46:27 +0100 From: Christoph Hellwig To: Florian Fainelli Subject: Re: [PATCH v2] swiotlb: Make SWIOTLB_NO_FORCE perform no allocation Message-ID: <20210322074627.GA4252@lst.de> References: <20210319040055.183433-1-f.fainelli@gmail.com> <20210321033740.312500-1-f.fainelli@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210321033740.312500-1-f.fainelli@gmail.com> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: Konrad Rzeszutek Wilk , linux-kernel@vger.kernel.org, "open list:SWIOTLB SUBSYSTEM" , Robin Murphy , Christoph Hellwig 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" On Sat, Mar 20, 2021 at 08:37:40PM -0700, Florian Fainelli wrote: > - if (!strcmp(str, "force")) { > + if (!strcmp(str, "force")) > swiotlb_force = SWIOTLB_FORCE; > - } else if (!strcmp(str, "noforce")) { > + else if (!strcmp(str, "noforce")) > swiotlb_force = SWIOTLB_NO_FORCE; > - default_nslabs = 1; > - } > > return 0; > } > @@ -211,6 +209,9 @@ swiotlb_init(int verbose) > size_t bytes = PAGE_ALIGN(default_nslabs << IO_TLB_SHIFT); > void *tlb; > > + if (swiotlb_force == SWIOTLB_NO_FORCE) > + return; We'll also need this in the other callers of swiotlb_init_with_tbl and swiotlb_late_init_with_tbl. I actually had a plan to mostly kill them, but that can better way until more support for multiple io_tlb structures is merged. _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu