linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [RFC v6 01/10] PCI: Ignore resource_alignment if PCI_PROBE_ONLY was set
@ 2016-04-18 10:55 Yongji Xie
  2016-04-18 10:55 ` [RFC v6 02/10] PCI: Do not Use IORESOURCE_STARTALIGN to identify bridge resources Yongji Xie
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Yongji Xie @ 2016-04-18 10:55 UTC (permalink / raw)
  To: kvm, linux-kernel, linux-pci, linuxppc-dev, iommu, linux-doc
  Cc: alex.williamson, bhelgaas, aik, benh, paulus, mpe, corbet,
	warrier, zhong, nikunj, gwshan, Yongji Xie

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 <xyjxie@linux.vnet.ibm.com>
---
 drivers/pci/pci.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 602eb42..77b7494 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -4607,6 +4607,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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-04-26  6:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-18 10:55 [RFC v6 01/10] PCI: Ignore resource_alignment if PCI_PROBE_ONLY was set Yongji Xie
2016-04-18 10:55 ` [RFC v6 02/10] PCI: Do not Use IORESOURCE_STARTALIGN to identify bridge resources Yongji Xie
2016-04-18 10:55 ` [RFC v6 03/10] PCI: Add a new option for resource_alignment to reassign alignment Yongji Xie
2016-04-18 10:56 ` [RFC v6 04/10] PCI: Add support for enforcing all MMIO BARs to be page aligned Yongji Xie
2016-04-26  5:41   ` Alexey Kardashevskiy
2016-04-26  6:44     ` Yongji Xie
2016-04-18 10:56 ` [RFC v6 05/10] vfio-pci: Allow to mmap sub-page MMIO BARs if the mmio page is exclusive Yongji Xie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).