From: Yinghai Lu <yinghai@kernel.org>
To: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
Ram Pai <linuxram@us.ibm.com>
Subject: Re: [git pull] PCI fixes
Date: Fri, 24 Jun 2011 17:17:53 -0700 [thread overview]
Message-ID: <4E052931.4010806@kernel.org> (raw)
In-Reply-To: <20110624170056.6056425e@jbarnes-desktop>
On 06/24/2011 05:00 PM, Jesse Barnes wrote:
> On Fri, 24 Jun 2011 15:56:42 -0700
> Linus Torvalds <torvalds@linux-foundation.org> wrote:
>
>>
>>
>>
>> Jesse Barnes <jbarnes@virtuousgeek.org> wrote:
>>>
>>> How about a boot param? We've done similar things for _CRS, and it
>>> might give Yinghai and Ram some more flexibility in improving our
>>> dynamic resource allocation before enabling it again (if ever).
>>
>> I'm OK with that, but then I'd suggest against the currently not yet merged series that doesn't seem to work anyway...
>>
>> IOW, just a simple patch that disables the resource re-allocation, and enables it with some command line option.
>
> Ok sounds good, thanks.
please check the draft one, not sure if you like
pci=try=2
or
pci=reallocate_bridge
[PATCH] pci: disable pci trying to reallocate pci bridge by default.
| PCI: update bridge resources to get more big ranges when allocating space (again)
| da7822e5ad71ec9b745b412639f1e5e0ba795a20
still too risky and cause some systems have problem.
Disable reallocating feature, So other user could use command line enable it
to enable it with "pci=try=2"
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
---
Documentation/kernel-parameters.txt | 6 ++++++
drivers/pci/pci.c | 4 ++++
drivers/pci/pci.h | 2 ++
drivers/pci/setup-bus.c | 15 +++++++++------
4 files changed, 21 insertions(+), 6 deletions(-)
Index: linux-2.6/Documentation/kernel-parameters.txt
===================================================================
--- linux-2.6.orig/Documentation/kernel-parameters.txt
+++ linux-2.6/Documentation/kernel-parameters.txt
@@ -1980,6 +1980,12 @@ bytes respectively. Such letter suffixes
for broken drivers that don't call it.
skip_isa_align [X86] do not align io start addr, so can
handle more pci cards
+ try=n set the pci_try_num to reallocate the pci bridge resource
+ 1: default
+ 2: will set the num to max_depth, and try to reallocate res
+ to get big range for the bridge. assume the pci peer root
+ resource is right from _CRS or from hostbridge pci reg
+ reading out.
firmware [ARM] Do not re-enumerate the bus but instead
just use the configuration from the
bootloader. This is currently used on
Index: linux-2.6/drivers/pci/pci.c
===================================================================
--- linux-2.6.orig/drivers/pci/pci.c
+++ linux-2.6/drivers/pci/pci.c
@@ -3485,6 +3485,10 @@ static int __init pci_setup(char *str)
pci_no_aer();
} else if (!strcmp(str, "nodomains")) {
pci_no_domains();
+ } else if (!strncmp(str, "try=", 4)) {
+ int try_num = memparse(str + 4, &str);
+ if (try_num > 0)
+ pci_try_num = try_num;
} else if (!strncmp(str, "cbiosize=", 9)) {
pci_cardbus_io_size = memparse(str + 9, &str);
} else if (!strncmp(str, "cbmemsize=", 10)) {
Index: linux-2.6/drivers/pci/pci.h
===================================================================
--- linux-2.6.orig/drivers/pci/pci.h
+++ linux-2.6/drivers/pci/pci.h
@@ -223,6 +223,8 @@ static inline int pci_ari_enabled(struct
return bus->self && bus->self->ari_enabled;
}
+extern int pci_try_num;
+
#ifdef CONFIG_PCI_QUIRKS
extern int pci_is_reassigndev(struct pci_dev *dev);
resource_size_t pci_specified_resource_alignment(struct pci_dev *dev);
Index: linux-2.6/drivers/pci/setup-bus.c
===================================================================
--- linux-2.6.orig/drivers/pci/setup-bus.c
+++ linux-2.6/drivers/pci/setup-bus.c
@@ -1030,6 +1030,7 @@ static int __init pci_get_max_depth(void
* second and later try will clear small leaf bridge res
* will stop till to the max deepth if can not find good one
*/
+int pci_try_num = 1;
void __init
pci_assign_unassigned_resources(void)
{
@@ -1042,16 +1043,18 @@ pci_assign_unassigned_resources(void)
unsigned long type_mask = IORESOURCE_IO | IORESOURCE_MEM |
IORESOURCE_PREFETCH;
unsigned long failed_type;
- int max_depth = pci_get_max_depth();
- int pci_try_num;
-
head.next = NULL;
add_list.next = NULL;
- pci_try_num = max_depth + 1;
- printk(KERN_DEBUG "PCI: max bus depth: %d pci_try_num: %d\n",
- max_depth, pci_try_num);
+ if (pci_try_num > 1) {
+ int max_depth = pci_get_max_depth();
+
+ if (max_depth + 1 > pci_try_num)
+ pci_try_num = max_depth + 1;
+ printk(KERN_DEBUG "PCI: max bus depth: %d pci_try_num: %d\n",
+ max_depth, pci_try_num);
+ }
again:
/* Depth first, calculate sizes and alignments of all
next prev parent reply other threads:[~2011-06-25 0:18 UTC|newest]
Thread overview: 80+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-23 20:37 Jesse Barnes
2011-06-24 15:38 ` Linus Torvalds
2011-06-24 15:53 ` Jesse Barnes
2011-06-24 16:07 ` Linus Torvalds
2011-06-24 16:11 ` Jesse Barnes
2011-06-24 22:56 ` Linus Torvalds
2011-06-25 0:00 ` Jesse Barnes
2011-06-25 0:17 ` Yinghai Lu [this message]
2011-06-28 17:02 ` Jesse Barnes
2011-06-29 1:04 ` Ram Pai
-- strict thread matches above, loose matches on Subject: below --
2012-03-05 21:49 Jesse Barnes
2012-02-17 17:24 Jesse Barnes
2011-12-17 17:29 Jesse Barnes
2011-12-18 2:33 ` Yinghai Lu
2011-12-18 5:52 ` Jesse Barnes
2011-12-18 22:14 ` Linus Torvalds
2012-01-06 20:46 ` Jesse Barnes
2012-01-07 1:14 ` Yinghai Lu
2011-11-23 22:44 Jesse Barnes
2011-11-23 23:02 ` Linus Torvalds
2011-12-05 19:22 ` Jesse Barnes
2011-12-06 8:08 ` Kenji Kaneshige
2011-12-06 16:14 ` Linus Torvalds
2011-12-06 22:36 ` Yinghai Lu
2011-12-07 8:18 ` Kenji Kaneshige
2011-12-07 19:20 ` Yinghai Lu
2011-12-07 7:58 ` Kenji Kaneshige
2011-08-19 16:17 Jesse Barnes
2011-08-19 16:46 ` Greg KH
2011-08-19 17:12 ` Jesse Barnes
2011-08-19 17:19 ` Jesse Barnes
2011-03-25 17:22 Jesse Barnes
2010-12-17 23:29 Jesse Barnes
2010-11-15 17:45 Jesse Barnes
2010-11-16 11:16 ` Andreas Schwab
2010-11-16 11:23 ` Wolfram Sang
2010-11-16 17:00 ` Jesse Barnes
2010-08-31 15:49 Jesse Barnes
2010-06-09 22:53 Jesse Barnes
2010-06-09 23:14 ` Linus Torvalds
2010-06-10 0:20 ` Jesse Barnes
2010-06-11 21:02 ` Jesse Barnes
2010-04-29 3:14 Jesse Barnes
2010-04-23 20:37 Jesse Barnes
2010-03-26 23:33 Jesse Barnes
2010-01-29 0:25 Jesse Barnes
2010-01-07 22:34 Jesse Barnes
2009-12-28 16:10 Jesse Barnes
2009-11-11 8:12 Jesse Barnes
2009-10-12 17:32 Jesse Barnes
2009-08-10 17:30 Jesse Barnes
2009-07-06 18:00 Jesse Barnes
2009-06-06 20:32 Jesse Barnes
2009-05-15 22:09 Jesse Barnes
2009-04-27 18:54 Jesse Barnes
2009-04-07 18:00 Jesse Barnes
2009-02-26 22:24 Jesse Barnes
2009-02-26 22:36 ` Matthew Wilcox
2009-02-26 22:39 ` Jesse Barnes
2009-02-27 0:45 ` Jesse Barnes
2009-02-13 22:07 Jesse Barnes
2009-02-03 2:19 Jesse Barnes
2009-01-21 22:00 Jesse Barnes
2008-12-19 1:30 Jesse Barnes
2008-11-13 20:50 Jesse Barnes
2008-11-07 17:00 Jesse Barnes
2008-09-23 19:14 Jesse Barnes
2008-09-13 0:02 Jesse Barnes
2008-08-25 17:07 Jesse Barnes
2008-08-19 17:03 Jesse Barnes
2008-08-11 17:27 Jesse Barnes
2008-07-07 22:34 Jesse Barnes
2008-06-14 20:23 Jesse Barnes
2008-06-14 20:29 ` Rafael J. Wysocki
2008-06-06 18:26 Jesse Barnes
2008-06-06 22:04 ` Jeff Garzik
2008-06-06 22:16 ` Jesse Barnes
2008-05-27 22:55 Jesse Barnes
2008-05-20 17:51 Jesse Barnes
2008-05-13 17:42 Jesse Barnes
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=4E052931.4010806@kernel.org \
--to=yinghai@kernel.org \
--cc=jbarnes@virtuousgeek.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linuxram@us.ibm.com \
--cc=torvalds@linux-foundation.org \
/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
Powered by JetHome