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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3CFD7C4332F for ; Tue, 13 Dec 2022 23:45:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237220AbiLMXp1 (ORCPT ); Tue, 13 Dec 2022 18:45:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237209AbiLMXpF (ORCPT ); Tue, 13 Dec 2022 18:45:05 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01D181C909; Tue, 13 Dec 2022 15:44:47 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 0E16EB815FE; Tue, 13 Dec 2022 23:44:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 627B8C433F1; Tue, 13 Dec 2022 23:44:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1670975084; bh=2tvp9NwfkXVkp5bFjHTkmFQ7muXx0ZcIww+kK5zEtVg=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=rs22s+42gOPyj0CUdx6/k27/mWhapSg8QDoyLDf0HLDv1OakEC2dfZBjVPBtaD+PN KX9CSFjEAe0Z15L9UPgyJG1XVfaI/uzPalHBmCeHUUwTY7LefInlrN7kqwidLdET7C iGRNJ+Y06F2m6nM1wdlEQ3AXL1DhP+NgNJO+e/UlBkcHNlqbX9KTC/sxvZKKpQspRp kbhg7V1fhF+DJBHQAZLnZ5kasXYZMbw4WDgswRcdLLQWy8yTPoWeRR603q21ECuYT+ gJthfOJEwBvYAcRC6W0Z6yGjg5UYHku3byLM97SKQqRmiwmK2v4YLTqeFT04Y1NHnc 3FFXLLu/W0Gdg== Date: Tue, 13 Dec 2022 17:44:42 -0600 From: Bjorn Helgaas To: Kishon Vijay Abraham I Cc: Bjorn Helgaas , Joao Pinto , linux-pci@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, hch@infradead.org, nsekhar@ti.com Subject: Re: [PATCH v7 01/23] PCI: endpoint: Add EP core layer to enable EP controller and EP functions Message-ID: <20221213234442.GA219721@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170410135510.30673-1-kishon@ti.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 10, 2017 at 07:25:10PM +0530, Kishon Vijay Abraham I wrote: > Introduce a new EP core layer in order to support endpoint functions in > linux kernel. This comprises the EPC library (Endpoint Controller Library) > and EPF library (Endpoint Function Library). EPC library implements > functions specific to an endpoint controller and EPF library implements > functions specific to an endpoint function. > +void *pci_epf_alloc_space(struct pci_epf *epf, size_t size, enum pci_barno bar) > +{ > + void *space; > + struct device *dev = &epf->dev; > + dma_addr_t phys_addr; > + > + if (size < 128) > + size = 128; > + size = roundup_pow_of_two(size); > + > + space = dma_alloc_coherent(dev, size, &phys_addr, GFP_KERNEL); > + if (!space) { > + dev_err(dev, "failed to allocate mem space\n"); > + return NULL; > + } > + > + epf->bar[bar].phys_addr = phys_addr; > + * struct pci_epf_bar - represents the BAR of EPF device > + * @phys_addr: physical address that should be mapped to the BAR > + * @size: the size of the address space present in BAR > + */ > +struct pci_epf_bar { > + dma_addr_t phys_addr; If this "phys_addr" is an address that can appear on the PCI bus, is "phys_addr" a misnomer? Many drivers use dma, dmabuf, bus_addr, etc. Bjorn 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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 92829C4332F for ; Tue, 13 Dec 2022 23:48:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Owner; bh=P3bGIaDAHTy+X/x/pKA2GnBp3DYhM+tp8nEtFo2hxgc=; b=yapwupu0FCD3nG 3ArYg5noBLGQAZssybgKi1gPre/OrEI4nqEk13QUTxBmQB5GC+GhxfBY51OL8+MsCd/xeYN0827Zj cv12oPnbrkVwjDmJigrOBPR/urvWK/IqUYFNZf+oQ/7KTdtoKCoPUDTOTzzfr9FftBUDxdi42V07H MUZ64MOL2aHS2RpRajXwW2fth2DHz9oqcidHK68luPYGqL3QvoMcGuBZs6/Y945pXR6EvpPFqsPoO DZ39vvpfT3/MPhpbiNSWsQ/GAh4tpGxTm2odsZIKjVjSzS54VhtxA8ib5EAhBBB5w5j7UCTO8nDt/ Z1aR9Xi25JDRKGvvZKHg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p5EzA-008CjU-6G; Tue, 13 Dec 2022 23:46:57 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p5Ex3-008BQ1-Ng for linux-arm-kernel@lists.infradead.org; Tue, 13 Dec 2022 23:44:47 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3C9936177E; Tue, 13 Dec 2022 23:44:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 627B8C433F1; Tue, 13 Dec 2022 23:44:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1670975084; bh=2tvp9NwfkXVkp5bFjHTkmFQ7muXx0ZcIww+kK5zEtVg=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=rs22s+42gOPyj0CUdx6/k27/mWhapSg8QDoyLDf0HLDv1OakEC2dfZBjVPBtaD+PN KX9CSFjEAe0Z15L9UPgyJG1XVfaI/uzPalHBmCeHUUwTY7LefInlrN7kqwidLdET7C iGRNJ+Y06F2m6nM1wdlEQ3AXL1DhP+NgNJO+e/UlBkcHNlqbX9KTC/sxvZKKpQspRp kbhg7V1fhF+DJBHQAZLnZ5kasXYZMbw4WDgswRcdLLQWy8yTPoWeRR603q21ECuYT+ gJthfOJEwBvYAcRC6W0Z6yGjg5UYHku3byLM97SKQqRmiwmK2v4YLTqeFT04Y1NHnc 3FFXLLu/W0Gdg== Date: Tue, 13 Dec 2022 17:44:42 -0600 From: Bjorn Helgaas To: Kishon Vijay Abraham I Cc: Bjorn Helgaas , Joao Pinto , linux-pci@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, hch@infradead.org, nsekhar@ti.com Subject: Re: [PATCH v7 01/23] PCI: endpoint: Add EP core layer to enable EP controller and EP functions Message-ID: <20221213234442.GA219721@bhelgaas> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20170410135510.30673-1-kishon@ti.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221213_154445_843573_80BC9B95 X-CRM114-Status: GOOD ( 16.91 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Apr 10, 2017 at 07:25:10PM +0530, Kishon Vijay Abraham I wrote: > Introduce a new EP core layer in order to support endpoint functions in > linux kernel. This comprises the EPC library (Endpoint Controller Library) > and EPF library (Endpoint Function Library). EPC library implements > functions specific to an endpoint controller and EPF library implements > functions specific to an endpoint function. > +void *pci_epf_alloc_space(struct pci_epf *epf, size_t size, enum pci_barno bar) > +{ > + void *space; > + struct device *dev = &epf->dev; > + dma_addr_t phys_addr; > + > + if (size < 128) > + size = 128; > + size = roundup_pow_of_two(size); > + > + space = dma_alloc_coherent(dev, size, &phys_addr, GFP_KERNEL); > + if (!space) { > + dev_err(dev, "failed to allocate mem space\n"); > + return NULL; > + } > + > + epf->bar[bar].phys_addr = phys_addr; > + * struct pci_epf_bar - represents the BAR of EPF device > + * @phys_addr: physical address that should be mapped to the BAR > + * @size: the size of the address space present in BAR > + */ > +struct pci_epf_bar { > + dma_addr_t phys_addr; If this "phys_addr" is an address that can appear on the PCI bus, is "phys_addr" a misnomer? Many drivers use dma, dmabuf, bus_addr, etc. Bjorn _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel