From patchwork Wed Mar 28 11:50:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Cassel X-Patchwork-Id: 892088 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=axis.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40B5mP2sr3z9s0b for ; Wed, 28 Mar 2018 22:50:29 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751341AbeC1Lu1 (ORCPT ); Wed, 28 Mar 2018 07:50:27 -0400 Received: from bastet.se.axis.com ([195.60.68.11]:53840 "EHLO bastet.se.axis.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751207AbeC1Lu0 (ORCPT ); Wed, 28 Mar 2018 07:50:26 -0400 Received: from localhost (localhost [127.0.0.1]) by bastet.se.axis.com (Postfix) with ESMTP id 91EDC1832D; Wed, 28 Mar 2018 13:50:25 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at bastet.se.axis.com Received: from bastet.se.axis.com ([IPv6:::ffff:127.0.0.1]) by localhost (bastet.se.axis.com [::ffff:127.0.0.1]) (amavisd-new, port 10024) with LMTP id MCq7hTHBFGFv; Wed, 28 Mar 2018 13:50:25 +0200 (CEST) Received: from boulder03.se.axis.com (boulder03.se.axis.com [10.0.8.17]) by bastet.se.axis.com (Postfix) with ESMTPS id 68C241806E; Wed, 28 Mar 2018 13:50:24 +0200 (CEST) Received: from boulder03.se.axis.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 458C31E072; Wed, 28 Mar 2018 13:50:24 +0200 (CEST) Received: from boulder03.se.axis.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 365BD1E06C; Wed, 28 Mar 2018 13:50:24 +0200 (CEST) Received: from thoth.se.axis.com (unknown [10.0.2.173]) by boulder03.se.axis.com (Postfix) with ESMTP; Wed, 28 Mar 2018 13:50:24 +0200 (CEST) Received: from lnxartpec1.se.axis.com (lnxartpec1.se.axis.com [10.88.4.10]) by thoth.se.axis.com (Postfix) with ESMTP id 2813E3085; Wed, 28 Mar 2018 13:50:24 +0200 (CEST) Received: by lnxartpec1.se.axis.com (Postfix, from userid 20283) id 20FAE40197; Wed, 28 Mar 2018 13:50:24 +0200 (CEST) From: Niklas Cassel To: kishon@ti.com, cyrille.pitchen@free-electrons.com, Lorenzo Pieralisi , Arnd Bergmann , Greg Kroah-Hartman , Alan Douglas , Bjorn Helgaas , Jingoo Han , Joao Pinto Cc: Niklas Cassel , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 00/12] PCI endpoint 64-bit BAR fixes Date: Wed, 28 Mar 2018 13:50:05 +0200 Message-Id: <20180328115018.31921-1-niklas.cassel@axis.com> X-Mailer: git-send-email 2.14.2 X-TM-AS-GCONF: 00 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org PCI endpoint fixes to improve the way 64-bit BARs are handled. There are still future improvements that could be made: pci-epf-test.c always allocates space for 6 BARs, even when using 64-bit BARs (which really only requires us to allocate 3 BARs). pcitest.sh will print "NOT OKAY" for BAR1, BAR3, and BAR5 when using 64-bit BARs. This could probably be improved to say something like "N/A (64-bit BAR)". Niklas Cassel (12): PCI: endpoint: BAR width should not depend on sizeof dma_addr_t PCI: endpoint: Simplify epc->ops->set_bar()/pci_epc_set_bar() PCI: endpoint: Setting BAR_5 to 64-bits wide is invalid PCI: endpoint: Setting 64-bit/prefetch bit is invalid when IO is set PCI: endpoint: Setting a BAR size > 4 GB is invalid if 64-bit flag is not set PCI: designware-ep: Make dw_pcie_ep_set_bar() handle 64-bit BARs properly PCI: cadence: Set PCI_BASE_ADDRESS_MEM_TYPE_64 if a 64-bit BAR was set-up PCI: endpoint: Handle 64-bit BARs properly PCI: endpoint: Make epc->ops->clear_bar()/pci_epc_clear_bar() take struct *epf_bar PCI: endpoint: Make sure that BAR_5 does not have 64-bit flag set when clearing PCI: designware-ep: Make dw_pcie_ep_reset_bar() handle 64-bit BARs properly misc: pci_endpoint_test: Handle 64-bit BARs properly drivers/misc/pci_endpoint_test.c | 12 +++++---- drivers/pci/cadence/pcie-cadence-ep.c | 15 ++++++++--- drivers/pci/dwc/pcie-designware-ep.c | 36 +++++++++++++++++++++------ drivers/pci/endpoint/functions/pci-epf-test.c | 28 +++++++++++++-------- drivers/pci/endpoint/pci-epc-core.c | 32 +++++++++++++++--------- drivers/pci/endpoint/pci-epf-core.c | 4 +++ include/linux/pci-epc.h | 11 ++++---- include/linux/pci-epf.h | 2 ++ 8 files changed, 95 insertions(+), 45 deletions(-) Tested-by: Gustavo Pimentel