From patchwork Wed Jun 8 11:04:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Pieralisi X-Patchwork-Id: 632163 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3rPlvL2ZWZz9t3Z for ; Wed, 8 Jun 2016 21:04:46 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1424884AbcFHLEk (ORCPT ); Wed, 8 Jun 2016 07:04:40 -0400 Received: from foss.arm.com ([217.140.101.70]:52411 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1424888AbcFHLEk (ORCPT ); Wed, 8 Jun 2016 07:04:40 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 09287434; Wed, 8 Jun 2016 04:05:14 -0700 (PDT) Received: from red-moon.cambridge.arm.com (red-moon.cambridge.arm.com [10.1.203.137]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 37D453F253; Wed, 8 Jun 2016 04:04:37 -0700 (PDT) From: Lorenzo Pieralisi To: linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Lorenzo Pieralisi , Arnd Bergmann , Will Deacon , Bjorn Helgaas , Catalin Marinas , David Daney , Yinghai Lu , Russell King Subject: [PATCH v3 3/4] ARM64/PCI: remove arch specific pcibios_enable_device() Date: Wed, 8 Jun 2016 12:04:49 +0100 Message-Id: <1465383890-13538-4-git-send-email-lorenzo.pieralisi@arm.com> X-Mailer: git-send-email 2.6.4 In-Reply-To: <1465383890-13538-1-git-send-email-lorenzo.pieralisi@arm.com> References: <1465383890-13538-1-git-send-email-lorenzo.pieralisi@arm.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org The arm64 pcibios_enable_device() implementation exists solely to prevent enabling PCI resources on PCI_PROBE_ONLY systems, since on those systems the PCI resources are currently not claimed (ie inserted in the PCI resource tree - which means their parent pointer is not correctly set-up) therefore they can not be enabled since this would trigger PCI set-ups failures. By introducing resources claiming in the PCI host controllers set-ups that have PCI_PROBE_ONLY as a probe option, there is no need for arch specific pcibios_enable_device() implementations anymore in that the kernel can rely on the generic pcibios_enable_device() implementation without resorting to arch specific code to work around the missing resources claiming enumeration step. On !PCI_PROBE_ONLY PCI bus set-ups, resources are always assigned in the PCI host controllers drivers; since the PCI resource assignment API takes care of inserting the assigned resources in the resource tree, the resources parent pointer is correctly set-up, which means that this patch leaves behaviour unchanged for all arm64 PCI set-ups that do not set the PCI_PROBE_ONLY flag. Remove the pcibios_enable_device() function from the arm64 arch back-end so that the kernel now uses its generic implementation. Signed-off-by: Lorenzo Pieralisi Acked-by: Will Deacon Cc: Arnd Bergmann Cc: Will Deacon Cc: Bjorn Helgaas Cc: Catalin Marinas --- arch/arm64/kernel/pci.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c index 3c4e308..39cfa03 100644 --- a/arch/arm64/kernel/pci.c +++ b/arch/arm64/kernel/pci.c @@ -36,19 +36,6 @@ resource_size_t pcibios_align_resource(void *data, const struct resource *res, return res->start; } -/** - * pcibios_enable_device - Enable I/O and memory. - * @dev: PCI device to be enabled - * @mask: bitmask of BARs to enable - */ -int pcibios_enable_device(struct pci_dev *dev, int mask) -{ - if (pci_has_flag(PCI_PROBE_ONLY)) - return 0; - - return pci_enable_resources(dev, mask); -} - /* * Try to assign the IRQ number from DT when adding a new device */