aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r--drivers/pci/pci.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 37c00f6fd801..728b3c863d87 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -17,11 +17,16 @@
17#include <linux/module.h> 17#include <linux/module.h>
18#include <linux/spinlock.h> 18#include <linux/spinlock.h>
19#include <linux/string.h> 19#include <linux/string.h>
20#include <linux/log2.h>
20#include <asm/dma.h> /* isa_dma_bridge_buggy */ 21#include <asm/dma.h> /* isa_dma_bridge_buggy */
21#include "pci.h" 22#include "pci.h"
22 23
23unsigned int pci_pm_d3_delay = 10; 24unsigned int pci_pm_d3_delay = 10;
24 25
26#ifdef CONFIG_PCI_DOMAINS
27int pci_domains_supported = 1;
28#endif
29
25#define DEFAULT_CARDBUS_IO_SIZE (256) 30#define DEFAULT_CARDBUS_IO_SIZE (256)
26#define DEFAULT_CARDBUS_MEM_SIZE (64*1024*1024) 31#define DEFAULT_CARDBUS_MEM_SIZE (64*1024*1024)
27/* pci=cbmemsize=nnM,cbiosize=nn can override this */ 32/* pci=cbmemsize=nnM,cbiosize=nn can override this */
@@ -1454,7 +1459,7 @@ int pcix_set_mmrbc(struct pci_dev *dev, int mmrbc)
1454 int cap, err = -EINVAL; 1459 int cap, err = -EINVAL;
1455 u32 stat, cmd, v, o; 1460 u32 stat, cmd, v, o;
1456 1461
1457 if (mmrbc < 512 || mmrbc > 4096 || (mmrbc & (mmrbc-1))) 1462 if (mmrbc < 512 || mmrbc > 4096 || !is_power_of_2(mmrbc))
1458 goto out; 1463 goto out;
1459 1464
1460 v = ffs(mmrbc) - 10; 1465 v = ffs(mmrbc) - 10;
@@ -1526,7 +1531,7 @@ int pcie_set_readrq(struct pci_dev *dev, int rq)
1526 int cap, err = -EINVAL; 1531 int cap, err = -EINVAL;
1527 u16 ctl, v; 1532 u16 ctl, v;
1528 1533
1529 if (rq < 128 || rq > 4096 || (rq & (rq-1))) 1534 if (rq < 128 || rq > 4096 || !is_power_of_2(rq))
1530 goto out; 1535 goto out;
1531 1536
1532 v = (ffs(rq) - 8) << 12; 1537 v = (ffs(rq) - 8) << 12;
@@ -1566,6 +1571,13 @@ int pci_select_bars(struct pci_dev *dev, unsigned long flags)
1566 return bars; 1571 return bars;
1567} 1572}
1568 1573
1574static void __devinit pci_no_domains(void)
1575{
1576#ifdef CONFIG_PCI_DOMAINS
1577 pci_domains_supported = 0;
1578#endif
1579}
1580
1569static int __devinit pci_init(void) 1581static int __devinit pci_init(void)
1570{ 1582{
1571 struct pci_dev *dev = NULL; 1583 struct pci_dev *dev = NULL;
@@ -1585,6 +1597,10 @@ static int __devinit pci_setup(char *str)
1585 if (*str && (str = pcibios_setup(str)) && *str) { 1597 if (*str && (str = pcibios_setup(str)) && *str) {
1586 if (!strcmp(str, "nomsi")) { 1598 if (!strcmp(str, "nomsi")) {
1587 pci_no_msi(); 1599 pci_no_msi();
1600 } else if (!strcmp(str, "noaer")) {
1601 pci_no_aer();
1602 } else if (!strcmp(str, "nodomains")) {
1603 pci_no_domains();
1588 } else if (!strncmp(str, "cbiosize=", 9)) { 1604 } else if (!strncmp(str, "cbiosize=", 9)) {
1589 pci_cardbus_io_size = memparse(str + 9, &str); 1605 pci_cardbus_io_size = memparse(str + 9, &str);
1590 } else if (!strncmp(str, "cbmemsize=", 10)) { 1606 } else if (!strncmp(str, "cbmemsize=", 10)) {