Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1737269pxf; Fri, 12 Mar 2021 18:39:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJz/xEUDQ53J+EEuwNZG49oIEJn3lUihLuiCbJchilC3QeST+ZfOtPFOg+OTaQQdCIv2AT06 X-Received: by 2002:a05:6402:220a:: with SMTP id cq10mr17740959edb.345.1615603191989; Fri, 12 Mar 2021 18:39:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615603191; cv=none; d=google.com; s=arc-20160816; b=HVUhL6/IdJpGmbu7ZMaLWGqWqkuqDxYifUwhtfOOrlMOiGfznLHJEu3mAUhM3V7E0z WhqVHcDXS7wCHPKyr+CDja3ewzQQOaOSAJYpmvGEG3aKlZXsruGGQlWpYSY0lBYzZAS6 pt0iU8ea7vfmzD6PdZSZuVw1ndwdJWu8wEKEwiYkRb+f1cjGPhnUq0iAHShs/gZq7pbu c5EsB9flilZIhHNQWkRDrckGsh14MYgIv5jkMmjfTKg2hKQ+qqDQXYL88Ev3yqm5VxJK AQCN3mjAuDzQir2Ulycwgeqb+G7wnrOIan99Hac9+X9AhqwITHw7mloKGSZJ9C3cxm/R E71w== 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 :ironport-sdr:ironport-sdr; bh=hsFDWwx2q7crRkUjHLI/2FXuinTvBfQ/HX57XM2gl0A=; b=O82DRsfWFfzT0OHVT91b6oYh4oU8Qs+QMA8bgtSRnooiBFZSSMC8jx+s1qLGPbcOB8 IX+kg++OkXD2w3+SPohPj0OMhkmdWIoGffM3kUBuy/pGkXL+iEAEEBOdJVa3CxJmDgHd LP+wc1noaQoZTFXoxJ3A4DbNLxT6HPQsYT9aX8hl9IpwOUEO79YUtzUayZem/TgJrtp9 CinxWAi+WjmhwgPpTD4ZHaChU3QWR4vUaBYmyBKkwh3YePRBM8/x++p27siGl5q3lyTl 9O2/V2EgQ0Y3sERxb6x+dPmcmc4oyTNKz6tURv47RZpnQFQnkMlZPnN7PY97sPwvgCAd AEgw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r12si5916936ejz.5.2021.03.12.18.39.29; Fri, 12 Mar 2021 18:39:51 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233105AbhCMCh3 (ORCPT + 99 others); Fri, 12 Mar 2021 21:37:29 -0500 Received: from mga06.intel.com ([134.134.136.31]:47383 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233086AbhCMCg7 (ORCPT ); Fri, 12 Mar 2021 21:36:59 -0500 IronPort-SDR: cJORzfneF+E1h6BVEedk2B31mPGAkpZmaKvhxZLRM+7QZ0kgVQRWom2LxJg/V06Maxa9TM9wrd 522Po48FfejA== X-IronPort-AV: E=McAfee;i="6000,8403,9921"; a="250281130" X-IronPort-AV: E=Sophos;i="5.81,245,1610438400"; d="scan'208";a="250281130" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Mar 2021 18:36:58 -0800 IronPort-SDR: vWH9MrQPUopS4cxXwdJS5su75dKHztdNXjGGlH9ufjynLLu86PmrmvGK6dqQ7nNaiN1giHbb0p Ed7tLl9U/OgQ== X-IronPort-AV: E=Sophos;i="5.81,245,1610438400"; d="scan'208";a="404614708" Received: from iweiny-desk2.sc.intel.com (HELO localhost) ([10.3.52.147]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Mar 2021 18:36:57 -0800 Date: Fri, 12 Mar 2021 18:36:57 -0800 From: Ira Weiny 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?= , Ira Weiny , John Hubbard , Don Dutile , Matthew Wilcox , Daniel Vetter , Jakowski Andrzej , Minturn Dave B , Jason Ekstrand , Dave Hansen , Xiong Jianxin Subject: Re: [RFC PATCH v2 07/11] dma-mapping: Add flags to dma_map_ops to indicate PCI P2PDMA support Message-ID: <20210313023657.GC3402637@iweiny-DESK2.sc.intel.com> References: <20210311233142.7900-1-logang@deltatee.com> <20210311233142.7900-8-logang@deltatee.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210311233142.7900-8-logang@deltatee.com> User-Agent: Mutt/1.11.1 (2018-12-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 11, 2021 at 04:31:37PM -0700, Logan Gunthorpe wrote: > +int dma_pci_p2pdma_supported(struct device *dev) ^^^ bool? > +{ > + const struct dma_map_ops *ops = get_dma_ops(dev); > + > + return !ops || ops->flags & DMA_F_PCI_P2PDMA_SUPPORTED; Is this logic correct? I would have expected. return (ops && ops->flags & DMA_F_PCI_P2PDMA_SUPPORTED); Ira