From: Ram Pai <linuxram@us.ibm.com>
To: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>,
linux-next@vger.kernel.org, linux-kernel@vger.kernel.org,
Ram Pai <linuxram@us.ibm.com>
Subject: Re: linux-next: build failure after merge of the pci-current tree
Date: Thu, 7 Jul 2011 11:19:10 -0700 [thread overview]
Message-ID: <20110707181910.GD3543@ram-ThinkPad-T61> (raw)
In-Reply-To: <20110707085205.7524a5a7@jbarnes-desktop>
On Thu, Jul 07, 2011 at 08:52:05AM -0700, Jesse Barnes wrote:
> On Thu, 7 Jul 2011 10:58:23 +1000
> Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> > Hi Jesse,
> >
> > After merging the pci-current tree, today's linux-next build (powerpc
> > ppc64_defconfig) failed like this:
> >
> > drivers/built-in.o:(.toc1+0xb98): undefined reference to `pci_realloc'
> >
> > Caused by commit 72007d2b4797 ("PCI: conditional resource-reallocation
> > through kernel parameter pci=realloc").
> >
> > I have used the pci-current tree from next-20110706 for today.
>
> Oops, x86 bits used in common code. I've pushed a fix that just moves
> the variable into setup-bus.c rather than x86/pci/common.c.
Jesse,
I have fixed the problem and have a better patch. See if it is acceptable for you.
>
> Ram, did you see the microblaze patch I forwarded you? It moves some
> re-alloc control flags into common code; for -next it might be cleaner
> to use them in a few places. Any comments?
Yes I have seen that forwarded mail. I will look through it.
Here is the patch.
commit 213e491e64a6c77f2e52abcb563a592964dd1074
Author: Ram Pai <linuxram@us.ibm.com>
Date: Thu Jun 30 00:45:39 2011 -0700
PCI: conditional resource-reallocation through kernel parameter pci=realloc
Multiple attempts to dynamically reallocate pci resources have unfortunately
lead to regressions. Though we continue to fix the regressions and fine tune the
dynamic-reallocation behavior, we have not reached a acceptable state yet.
This patch provides a interim solution. It disables dynamic-reallocation; by
default, with the ability to enable it through pci=realloc kernel command line
parameter.
Signed-off-by: Ram Pai <linuxram@us.ibm.com>
Documentation/kernel-parameters.txt | 2 ++
drivers/pci/pci.c | 2 ++
drivers/pci/pci.h | 2 ++
drivers/pci/setup-bus.c | 15 +++++++++++++++
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index fd248a31..aa47be7 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -2015,6 +2015,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
the default.
off: Turn ECRC off
on: Turn ECRC on.
+ realloc reallocate PCI resources if allocations done by BIOS
+ are erroneous.
pcie_aspm= [PCIE] Forcibly enable or disable PCIe Active State Power
Management.
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 5f10c23..7df8e3c 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -3483,6 +3483,8 @@ static int __init pci_setup(char *str)
pci_no_msi();
} else if (!strcmp(str, "noaer")) {
pci_no_aer();
+ } else if (!strncmp(str, "realloc", 7)) {
+ pci_realloc();
} else if (!strcmp(str, "nodomains")) {
pci_no_domains();
} else if (!strncmp(str, "cbiosize=", 9)) {
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index ebaf0ed..2b3f60b 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -146,6 +146,8 @@ static inline void pci_no_msi(void) { }
static inline void pci_msi_init_pci_dev(struct pci_dev *dev) { }
#endif
+extern void pci_realloc(void);
+
static inline int pci_no_d1d2(struct pci_dev *dev)
{
unsigned int parent_dstates = 0;
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index 68b4fce..f6616cb 100644
--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@ -48,6 +48,13 @@ struct resource_list_x {
(head)->next = NULL; \
} while (0)
+int pci_realloc_enable = 0;
+#define pci_realloc_enabled() pci_realloc_enable
+void pci_realloc(void)
+{
+ pci_realloc_enable = 1;
+}
+
/**
* add_to_list() - add a new resource tracker to the list
* @head: Head of the list
@@ -1091,6 +1098,7 @@ static int __init pci_get_max_depth(void)
return depth;
}
+
/*
* first try will not touch pci bridge res
* second and later try will clear small leaf bridge res
@@ -1134,6 +1142,13 @@ again:
/* any device complain? */
if (!head.next)
goto enable_and_dump;
+
+ /* don't realloc if asked to do so */
+ if (!pci_realloc_enabled()) {
+ free_list(resource_list_x, &head);
+ goto enable_and_dump;
+ }
+
failed_type = 0;
for (list = head.next; list;) {
failed_type |= list->flags;
next prev parent reply other threads:[~2011-07-07 18:19 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-07 0:58 linux-next: build failure after merge of the pci-current tree Stephen Rothwell
2011-07-07 15:52 ` Jesse Barnes
2011-07-07 18:19 ` Ram Pai [this message]
2011-07-08 22:49 ` Jesse Barnes
-- strict thread matches above, loose matches on Subject: below --
2011-08-02 0:48 Stephen Rothwell
2011-08-02 1:23 ` Stephen Rothwell
2011-08-02 15:53 ` Jesse Barnes
2011-11-03 1:53 Stephen Rothwell
2011-11-03 2:04 ` Jesse Barnes
2011-11-03 2:37 ` Stephen Rothwell
2011-11-03 3:22 ` Stephen Rothwell
2011-11-03 3:32 ` Stephen Rothwell
2011-11-03 5:19 ` Stephen Rothwell
2011-11-03 15:02 ` Jesse Barnes
2012-01-05 0:07 Stephen Rothwell
2012-01-05 0:11 ` Jesse Barnes
2012-01-05 0:19 ` Stephen Rothwell
2012-01-05 0:27 ` Dave Jones
2012-01-05 2:16 ` Stephen Rothwell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110707181910.GD3543@ram-ThinkPad-T61 \
--to=linuxram@us.ibm.com \
--cc=jbarnes@virtuousgeek.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=sfr@canb.auug.org.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).