Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752633AbcD0MTA (ORCPT ); Wed, 27 Apr 2016 08:19:00 -0400 Received: from e28smtp09.in.ibm.com ([125.16.236.9]:48643 "EHLO e28smtp09.in.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752447AbcD0MS7 (ORCPT ); Wed, 27 Apr 2016 08:18:59 -0400 X-IBM-Helo: d28relay01.in.ibm.com X-IBM-MailFrom: xyjxie@linux.vnet.ibm.com X-IBM-RcptTo: linux-doc@vger.kernel.org;kvm@vger.kernel.org;linux-pci@vger.kernel.org;linux-kernel@vger.kernel.org From: Yongji Xie To: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kvm@vger.kernel.org, linux-doc@vger.kernel.org Cc: alex.williamson@redhat.com, bhelgaas@google.com, aik@ozlabs.ru, benh@kernel.crashing.org, paulus@samba.org, mpe@ellerman.id.au, corbet@lwn.net, warrier@linux.vnet.ibm.com, zhong@linux.vnet.ibm.com, nikunj@linux.vnet.ibm.com, gwshan@linux.vnet.ibm.com, Yongji Xie Subject: [PATCH 1/4] PCI: Ignore resource_alignment if PCI_PROBE_ONLY was set Date: Wed, 27 Apr 2016 20:17:08 +0800 Message-Id: <1461759432-5030-2-git-send-email-xyjxie@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1461759432-5030-1-git-send-email-xyjxie@linux.vnet.ibm.com> References: <1461759432-5030-1-git-send-email-xyjxie@linux.vnet.ibm.com> X-TM-AS-MML: disable x-cbid: 16042712-0041-0000-0000-00000C652E84 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1159 Lines: 34 The resource_alignment will releases memory resources allocated by firmware so that kernel can reassign new resources later on. But this will cause the problem that no resources can be allocated by kernel if PCI_PROBE_ONLY was set, e.g. on pSeries platform because PCI_PROBE_ONLY force kernel to use firmware setup and not to reassign any resources. To solve this problem, this patch ignores resource_alignment if PCI_PROBE_ONLY was set. Signed-off-by: Yongji Xie --- drivers/pci/pci.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 25e0327..19b9560 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -4617,6 +4617,12 @@ static resource_size_t pci_specified_resource_alignment(struct pci_dev *dev) spin_lock(&resource_alignment_lock); p = resource_alignment_param; while (*p) { + if (pci_has_flag(PCI_PROBE_ONLY)) { + printk(KERN_ERR "PCI: Ignore resource_alignment parameter: %s with PCI_PROBE_ONLY set\n", + p); + *p = 0; + break; + } count = 0; if (sscanf(p, "%d%n", &align_order, &count) == 1 && p[count] == '@') { -- 1.7.9.5