Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp752580pxj; Fri, 14 May 2021 15:12:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzicnmuE/Dje8+eHaR3+kNxztNX+GMG8Pth112mBzieHo9NPL48HFjpA6gct/rGnYhVikT2 X-Received: by 2002:a5d:88cf:: with SMTP id i15mr36325154iol.45.1621030326794; Fri, 14 May 2021 15:12:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621030326; cv=none; d=google.com; s=arc-20160816; b=pc0jrkWB1LdwCXqsBlpmdb2WoGsUYz6Tk+R3yw8FH7aulaJDXSNHVbpzLBPLjccdXB ef5rIFq9yNJSW0YbloCFMphPpeWBiN/WlmZwoX5Nshzcn60ARZvVyx95DEmuJ4bVSduQ NT4Z1yhU3rPblaIdPFw4XOIktlI0VCdnO+wAO6mwvDSOCjl8eO65xDahavXt5b1LvRQe bgzpqWJu3VWIlsWf5/fAC12z+R9F+GQe3fzlU6Qea77246lqHgBhSgn4hpnYTaMkOEgA 4I8ndsgkpdtWR3SX6Pzyw/7awipudhY1t5VV2OhohsR3JksKrqKa7Hu+JDthcvyQofit w6aw== 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=T04WYniGI4x3hbahY86XzwWHll+OsBZsVxEANmECMRI=; b=U9N4YveMQnpm2y5VSWg/uZlsLhJvQBxYAwqS3Lngn1yFfshaWddSQSqMKcefcxbDt8 D6JQKQKJ5Mwq5kpnEVeGPubaionEJOcKrxzz127EVJMxzxYGvNbXRsjnVWKKg8S1wiU9 fu1oQJRAKE7neB+q3gtcsnCG6+JT+I8PkjnoQRxSDOjard28DsROzViT8lFo8Erg85W9 p0sJ1FeKQaeIgnkZcw4ARdnuKqKsRAuOxR6XU6tutebq0dBdl4YDug9HAxY8DywRxZO3 /ZgqB3kUZF2xI5M1M/JCTS9WDfwPbn13uHbonqb5cCwpfAeFzs3Oun2Kc12yb/tuItil raQQ== 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 u24si8504209iom.67.2021.05.14.15.11.54; Fri, 14 May 2021 15:12:06 -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 S231693AbhENNuj (ORCPT + 99 others); Fri, 14 May 2021 09:50:39 -0400 Received: from verein.lst.de ([213.95.11.211]:50558 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231492AbhENNuS (ORCPT ); Fri, 14 May 2021 09:50:18 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 2A43F6736F; Fri, 14 May 2021 15:49:01 +0200 (CEST) Date: Fri, 14 May 2021 15:49:00 +0200 From: Christoph Hellwig To: Logan Gunthorpe Cc: linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-block@vger.kernel.org, linux-pci@vger.kernel.org, linux-mm@kvack.org, iommu@lists.linux-foundation.org, Stephen Bates , Christoph Hellwig , Dan Williams , Jason Gunthorpe , Christian =?iso-8859-1?Q?K=F6nig?= , John Hubbard , Don Dutile , Matthew Wilcox , Daniel Vetter , Jakowski Andrzej , Minturn Dave B , Jason Ekstrand , Dave Hansen , Xiong Jianxin , Bjorn Helgaas , Ira Weiny , Robin Murphy Subject: Re: [PATCH v2 06/22] PCI/P2PDMA: Attempt to set map_type if it has not been set Message-ID: <20210514134900.GA4715@lst.de> References: <20210513223203.5542-1-logang@deltatee.com> <20210513223203.5542-7-logang@deltatee.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210513223203.5542-7-logang@deltatee.com> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 13, 2021 at 04:31:47PM -0600, Logan Gunthorpe wrote: > Attempt to find the mapping type for P2PDMA pages on the first > DMA map attempt if it has not been done ahead of time. > > Previously, the mapping type was expected to be calculated ahead of > time, but if pages are to come from userspace then there's no > way to ensure the path was checked ahead of time. > > With this change it's no longer invalid to call pci_p2pdma_map_sg() > before the mapping type is calculated so drop the WARN_ON when that > is the case. Why?