Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4447891pxf; Tue, 16 Mar 2021 13:49:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyhC5QHSrf1PeVin0KBetk0f6Iu2E9IPsP6J0dM3KZqOZRk7lpOsEfWP8rO+9nMi4FVtoUd X-Received: by 2002:a17:906:5607:: with SMTP id f7mr30988081ejq.262.1615927789402; Tue, 16 Mar 2021 13:49:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615927789; cv=none; d=google.com; s=arc-20160816; b=IF5g+ksm6YvB3aAnVUuaAZZzSjwUQoxL0tv+77IXalxP+ndz8SAO+M4sa2FQC4GPTa MUm35iLZ8cFp14hUpHV9rCCwQdPDSrBgz2FPxvCr4ur2L1rop6f3D9U89+P8Bmv6Ihjn ReliA/n2RW+7uS4AuXQHtJYyC0qDnj2HQhXww0hNMi018LWbBDuuAQjuc3XPSrp6X8Wv ivampFh/eLHS2LEq6DCVgTG/v6TXpyDwM67ZYRHPbfNQ0lGcnetknkxHaWcvqW2Sz6hL X11YGjZGx4IAr9hWR1redoe+R/MTXA/hQz2+yg/RMrKmBCI7G4COjVsR7g3+LEwEFv9h PXYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:dkim-signature; bh=oFF8o/RVegrG3G5YG5dTK44WOWDv57bdoGVgR2ktNWc=; b=iaAShkyeYw/M7nQ8gym5oS/05ocPAJBKJV3lxsO+FmjgG9aaaej2f8dDLFX5keU2Kf cv7VYT+Evrp9WcCAGhyLWZf3hQFz+Y4fn4+xWRzqzo0Kng2koGnHWWNTFvNhVgQwglRZ 81neATSEqxRxAu7XDLr/vFrzUgjKVJ81tP3mDkku3zVSx7HD3fuaTIYszsYPjVNO1wWu ItNpPLFhfYAz75/aM++hUP5qNIbS6iPsX3PRhXvEcZoYQKvvbcBID82GtqojnFwbgaj2 7BlEZGqV+X+V/W2Mi93dWUo09GM/OEhUK4ZjYJXHFNcNV+z7veElGCnwIHxfg1ViphIc F3Pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@deltatee.com header.s=20200525 header.b=dsqiw2Uq; 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 a7si16888924edb.607.2021.03.16.13.49.27; Tue, 16 Mar 2021 13:49:49 -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; dkim=pass header.i=@deltatee.com header.s=20200525 header.b=dsqiw2Uq; 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 S238237AbhCPPzi (ORCPT + 99 others); Tue, 16 Mar 2021 11:55:38 -0400 Received: from ale.deltatee.com ([204.191.154.188]:36728 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238235AbhCPPzV (ORCPT ); Tue, 16 Mar 2021 11:55:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:In-Reply-To:MIME-Version:Date: Message-ID:From:References:Cc:To:content-disposition; bh=oFF8o/RVegrG3G5YG5dTK44WOWDv57bdoGVgR2ktNWc=; b=dsqiw2UqRHpc2m6czITifyPazC l3KC3T9j57KTF3XoWiyV+LPgw4lbLtgOWKdd598bgRLfvrtkF2yuQDTcMKhGG9vB+KiBIJHVKMqOo mz5L+MEsdNsRbgo0gzz/8XPLL0CEathKtt+ZC61Qu6pAMYwbwCzqpb34Hfj+pEJnqN+lbJ6lzm9Ih wMlXJ7CnBmVPIFSao3qYHQjM/uSXXdMUZqbGyOWB+ccwh0ZmHoBC+XWjsMT4ETu8VxhHGEnyC4uu8 9v/yv+i4wmpSzCRFdT+0I+6inCilQdZbbQP3yiENwxiLiBsWDTPHNXrs7QPi+fZVB9gawHTLngfEt /Q9Irqsg==; Received: from guinness.priv.deltatee.com ([172.16.1.162]) by ale.deltatee.com with esmtp (Exim 4.92) (envelope-from ) id 1lMC27-00012D-3W; Tue, 16 Mar 2021 09:54:59 -0600 To: Christoph Hellwig Cc: Robin Murphy , 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, Minturn Dave B , John Hubbard , Dave Hansen , Matthew Wilcox , =?UTF-8?Q?Christian_K=c3=b6nig?= , Jason Gunthorpe , Jason Ekstrand , Daniel Vetter , Dan Williams , Stephen Bates , Jakowski Andrzej , Xiong Jianxin References: <20210311233142.7900-1-logang@deltatee.com> <20210311233142.7900-7-logang@deltatee.com> <215e1472-5294-d20a-a43a-ff6dfe8cd66e@arm.com> <367fa81e-588d-5734-c69c-8cdc800dcb7e@deltatee.com> <20210316075821.GB15949@lst.de> From: Logan Gunthorpe Message-ID: <093b77cb-e8b1-c8a8-620b-ab36cdb7f3cc@deltatee.com> Date: Tue, 16 Mar 2021 09:54:53 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <20210316075821.GB15949@lst.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-CA Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 172.16.1.162 X-SA-Exim-Rcpt-To: jianxin.xiong@intel.com, andrzej.jakowski@intel.com, sbates@raithlin.com, dan.j.williams@intel.com, daniel.vetter@ffwll.ch, jason@jlekstrand.net, jgg@ziepe.ca, christian.koenig@amd.com, willy@infradead.org, dave.hansen@linux.intel.com, jhubbard@nvidia.com, dave.b.minturn@intel.com, iommu@lists.linux-foundation.org, linux-mm@kvack.org, linux-pci@vger.kernel.org, linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, robin.murphy@arm.com, hch@lst.de X-SA-Exim-Mail-From: logang@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on ale.deltatee.com X-Spam-Level: X-Spam-Status: No, score=-8.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, GREYLIST_ISWHITE,NICE_REPLY_A autolearn=ham autolearn_force=no version=3.4.2 Subject: Re: [RFC PATCH v2 06/11] dma-direct: Support PCI P2PDMA pages in dma-direct map_sg X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021-03-16 1:58 a.m., Christoph Hellwig wrote: > On Fri, Mar 12, 2021 at 11:27:46AM -0700, Logan Gunthorpe wrote: >> So then we reject the patches that make that change. Seems like an odd >> argument to say that we can't do something that won't cause problems >> because someone might use it as an example and do something that will >> cause problems. Reject the change that causes the problem. > > No, the problem is a mess of calling conventions. A calling convention > returning 0 for error, positive values for success is fine. One returning > a negative errno for error and positive values for success is fine a well. > One returning 0 for the usual errors and negativ errnos for an unusual > corner case is just a complete mess. Fair enough. I can try implementing a dma_map_sg_p2p() roughly as Robin suggested that has a more reasonable calling convention. Most of your other feedback seems easy enough so I'll address it in a future series. Thanks, Logan