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=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 AE10DC433B4 for ; Tue, 11 May 2021 16:49:56 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (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 4772561432 for ; Tue, 11 May 2021 16:49:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4772561432 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id EDEBF6068A; Tue, 11 May 2021 16:49:55 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kSdvnV_gQ3p2; Tue, 11 May 2021 16:49:55 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp3.osuosl.org (Postfix) with ESMTP id F04EF605CF; Tue, 11 May 2021 16:49:54 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id DB7E6C000E; Tue, 11 May 2021 16:49:54 +0000 (UTC) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 7CB77C0001 for ; Tue, 11 May 2021 16:49:53 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 66D0840417 for ; Tue, 11 May 2021 16:49:53 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp4.osuosl.org (amavisd-new); dkim=pass (1024-bit key) header.d=chromium.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 Jwcj3V8T4sdI for ; Tue, 11 May 2021 16:49:51 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) by smtp4.osuosl.org (Postfix) with ESMTPS id 42C56402FE for ; Tue, 11 May 2021 16:49:51 +0000 (UTC) Received: by mail-io1-xd33.google.com with SMTP id z24so18827955ioj.7 for ; Tue, 11 May 2021 09:49:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=k6jrKLJf+SUK032/zz9tWYcN5Rhay3mFZvhqIWgxNBs=; b=L/Y31OZjVAvXas4gAOFGDpY1O+WckxTleHtLR2a6rScOLannRZ4axVg75JGljNN3EA 40xB287W01zuvyDHYZFS2WLSs1CG9A82KNV8OVT7o92X2FrRRw8J292qbL27/DexCkE7 qg4XvM9gaQyzYYNGyObKTqbnr0WqygwnwiYxc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=k6jrKLJf+SUK032/zz9tWYcN5Rhay3mFZvhqIWgxNBs=; b=E+zmoNQpfD7eGY9Z86Vd7LZBitbT4w0mUl0UAdizFWgEqmn9UrBU/I2IAKj4EdYM5I Wtr1vX83HOwMqFD5lJwawZEbOQB+c8oXyLCTlDUSfQBp3pkEPxgIxiLEuZZVAhgY/1Ah INoiHZgaDkAf6MRWIXK3HZdRwaKZDJr/FZJ1Io5HqPJBeJGAioKuM6ceMXa7b0W0NLtH LWZCmrxczGlm5iPBEbW+itXrY8sn6i/QLAF016jl5839hrY6Vvn/32RiubeHua3x+mqy 6OAKZRnnk6lmlsqSQ+uzeR5UhxZUpYlq3e6blo9bw/zky0YzoYe72SB2ZbqUV1inYDBQ 3iSw== X-Gm-Message-State: AOAM530KsJREYJERAXBhWNxuG3BCvCOLNNHyQGQNbPYzdkk4vMtx9185 aeN82WCpWlxYOcBwIPE6er/q/6TY1UFDpQ== X-Google-Smtp-Source: ABdhPJzmQtleiFCcaKJCmb9TOq/LvN8ekcqvIjYldpl1yO4DMr8ikdHHVKKMK9osHzvK84RipWxvLQ== X-Received: by 2002:a05:6602:14c4:: with SMTP id b4mr1690022iow.82.1620751790115; Tue, 11 May 2021 09:49:50 -0700 (PDT) Received: from mail-il1-f175.google.com (mail-il1-f175.google.com. [209.85.166.175]) by smtp.gmail.com with ESMTPSA id n4sm9756940ilm.39.2021.05.11.09.49.49 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 11 May 2021 09:49:49 -0700 (PDT) Received: by mail-il1-f175.google.com with SMTP id r5so17741286ilb.2 for ; Tue, 11 May 2021 09:49:49 -0700 (PDT) X-Received: by 2002:a6b:7b08:: with SMTP id l8mr22174004iop.50.1620751352978; Tue, 11 May 2021 09:42:32 -0700 (PDT) MIME-Version: 1.0 References: <20210510095026.3477496-1-tientzu@chromium.org> <20210510095026.3477496-6-tientzu@chromium.org> <20210510150342.GD28066@lst.de> In-Reply-To: <20210510150342.GD28066@lst.de> From: Claire Chang Date: Wed, 12 May 2021 00:42:22 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v6 05/15] swiotlb: Add a new get_io_tlb_mem getter To: Christoph Hellwig Cc: heikki.krogerus@linux.intel.com, thomas.hellstrom@linux.intel.com, peterz@infradead.org, benh@kernel.crashing.org, joonas.lahtinen@linux.intel.com, dri-devel@lists.freedesktop.org, chris@chris-wilson.co.uk, grant.likely@arm.com, paulus@samba.org, Frank Rowand , mingo@kernel.org, sstabellini@kernel.org, Saravana Kannan , mpe@ellerman.id.au, "Rafael J . Wysocki" , Bartosz Golaszewski , bskeggs@redhat.com, linux-pci@vger.kernel.org, xen-devel@lists.xenproject.org, Thierry Reding , intel-gfx@lists.freedesktop.org, matthew.auld@intel.com, linux-devicetree , Jianxiong Gao , Daniel Vetter , Will Deacon , Konrad Rzeszutek Wilk , maarten.lankhorst@linux.intel.com, airlied@linux.ie, Dan Williams , linuxppc-dev@lists.ozlabs.org, jani.nikula@linux.intel.com, Rob Herring , rodrigo.vivi@intel.com, Bjorn Helgaas , boris.ostrovsky@oracle.com, Andy Shevchenko , jgross@suse.com, Nicolas Boichat , nouveau@lists.freedesktop.org, Greg KH , Randy Dunlap , lkml , "list@263.net:IOMMU DRIVERS" , Jim Quinlan , xypron.glpk@gmx.de, Robin Murphy , bauerman@linux.ibm.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" On Mon, May 10, 2021 at 11:03 PM Christoph Hellwig wrote: > > > +static inline struct io_tlb_mem *get_io_tlb_mem(struct device *dev) > > +{ > > +#ifdef CONFIG_DMA_RESTRICTED_POOL > > + if (dev && dev->dma_io_tlb_mem) > > + return dev->dma_io_tlb_mem; > > +#endif /* CONFIG_DMA_RESTRICTED_POOL */ > > + > > + return io_tlb_default_mem; > > Given that we're also looking into a not addressing restricted pool > I'd rather always assign the active pool to dev->dma_io_tlb_mem and > do away with this helper. Where do you think is the proper place to do the assignment? First time calling swiotlb_map? or in of_dma_configure_id? _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu