From patchwork Fri Feb 16 13:45:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Cassel X-Patchwork-Id: 13560032 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 DBACBC48260 for ; Fri, 16 Feb 2024 13:46:08 +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:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=prkmOas/iOPFXnfvKnCJidvotlHMJwNz0/bKh4Hwmck=; b=FVUgBsDbK5tuzl IzmJ/xfQ4x8/7vY0xru3vRZ7pzHJ8dLGHWPajvdEe+QJqGLFWieDmFwh30WHaRhDkQ9mRcWnf3Y72 Np1HIZWZ9JxkwHPzMMNIxEiWCPLK8Op6BguINW6Ofqsjsn5WK92xNL3kNifxGLyT/Cb2sENRZm3JN 8EMzeJeWFQaWZEebPaQLh1WqJGDIHzWadj8bG/CDXFFT0guJKxESYdXytYh/QlyM7kMSwW49qXIvf 9J1+kKQfGw251ruGK01jt2UYPlu2z1wWNLdaDLXY6edEfevY3fvrF7Zjh8UKpTJ5K7/NAk1/QamDX ND1NgkzHLXTyhdolj/dQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rayXF-00000002Snj-0N0f; Fri, 16 Feb 2024 13:45:49 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rayXA-00000002SlW-2lN3 for linux-arm-kernel@lists.infradead.org; Fri, 16 Feb 2024 13:45:47 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 082B7CE2BA6; Fri, 16 Feb 2024 13:45:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B345DC43390; Fri, 16 Feb 2024 13:45:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708091141; bh=3+uLhQPpkXwAKjU+MV8grUAf3CHFA4l3wtq8PHKqC6U=; h=From:To:Cc:Subject:Date:From; b=auOWFVNcECCiHJDP5ntf+mZ4HtcqIODShCx6lpTdy5HBAsp/avpL9P6wsFYRSigVC tym7z2E3dfs2VpGnZBQJqicT+6Wgi8EmmvCklxbIgA9JeG/zRejrliD4yaUFarTj0j YTnP/nkVz3JsDv7zGy4QO08SHLCt2mpaO9OlMGf2+cNwWcAE9o2n+OyLJagZOzdhxF fmdiirhjrmrPaH+lPn40vxk3oBiWr2imQZdYEttiRADZSPYml9z6Mr/hK4dDzeIe/A ngX+i8P54dQsugqIrf/0+0Xu5A2isII+EePZJ4DPzjbeVphUyDMtUvk6/9aZ6EsuSV lvy/KYHkC7Nrg== From: Niklas Cassel To: Richard Zhu , Lucas Stach , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Rob Herring , Bjorn Helgaas , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Minghuan Lian , Mingkai Hu , Roy Zang , Srikanth Thokala , Marek Vasut , Yoshihiro Shimoda , Thierry Reding , Jonathan Hunter , Kunihiko Hayashi , Masami Hiramatsu , Jon Mason , Dave Jiang , Allen Hubbe , Manivannan Sadhasivam , Kishon Vijay Abraham I Cc: Damien Le Moal , Frank Li , Niklas Cassel , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-renesas-soc@vger.kernel.org, linux-tegra@vger.kernel.org, ntb@lists.linux.dev Subject: [PATCH v2 0/2] PCI endpoint BAR hardware description cleanup Date: Fri, 16 Feb 2024 14:45:13 +0100 Message-ID: <20240216134524.1142149-1-cassel@kernel.org> X-Mailer: git-send-email 2.43.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240216_054545_348266_C0258157 X-CRM114-Status: GOOD ( 14.48 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The series is based on top of: https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git/log/?h=endpoint Hello all, This series cleans up the hardware description for PCI endpoint BARs. The problems with the existing hardware description: -The documentation is lackluster. -Some of the names are confusingly similar, e.g. fixed_64bit and fixed_size, even though these are for completely unrelated things. -The way that the BARs are defined in the endpoint controller drivers is messy, because the left hand side is not a BAR, so you can mark a BAR as e.g. both fixed size and reserved. This series tries to address all the problems above. Personally, I think that the code is more readable, both the endpoint controller drivers, but also pci-epc-core.c. (I will be sending out a patch series that adds BAR_RESIZABLE to enum pci_epc_bar_type in the coming week.) Kind regards, Niklas Changes since V1: -Picked up tags from Kishon and Mani. -Improved commit message for patch 1/2 as suggested by Mani. -Improved kdoc in patch 2/2 as suggested by Mani. Niklas Cassel (2): PCI: endpoint: Clean up hardware description for BARs PCI: endpoint: Drop only_64bit on reserved BARs drivers/pci/controller/dwc/pci-imx6.c | 3 +- drivers/pci/controller/dwc/pci-keystone.c | 12 +++--- .../pci/controller/dwc/pci-layerscape-ep.c | 5 ++- drivers/pci/controller/dwc/pcie-keembay.c | 8 +++- drivers/pci/controller/dwc/pcie-rcar-gen4.c | 4 +- drivers/pci/controller/dwc/pcie-tegra194.c | 10 +++-- drivers/pci/controller/dwc/pcie-uniphier-ep.c | 15 +++++-- drivers/pci/controller/pcie-rcar-ep.c | 14 ++++--- drivers/pci/endpoint/functions/pci-epf-ntb.c | 4 +- drivers/pci/endpoint/functions/pci-epf-test.c | 8 ++-- drivers/pci/endpoint/functions/pci-epf-vntb.c | 2 +- drivers/pci/endpoint/pci-epc-core.c | 25 +++++------- drivers/pci/endpoint/pci-epf-core.c | 15 +++---- include/linux/pci-epc.h | 39 ++++++++++++++++--- 14 files changed, 106 insertions(+), 58 deletions(-)