Change multipath routing settings.
[linux-2.6.git] / linux-2.6-710-avoid-64bits-addr-pcmcia.patch
1 diff -Naur linux-source-2.6.29-orig/drivers/pci/bus.c linux-source-2.6.29/drivers/pci/bus.c
2 --- linux-source-2.6.29-orig/drivers/pci/bus.c  2009-03-24 00:12:14.000000000 +0100
3 +++ linux-source-2.6.29/drivers/pci/bus.c       2009-04-06 11:04:41.000000000 +0200
4 @@ -41,6 +41,7 @@
5                 void *alignf_data)
6  {
7         int i, ret = -ENOMEM;
8 +       resource_size_t max = -1;
9  
10         type_mask |= IORESOURCE_IO | IORESOURCE_MEM;
11  
12 @@ -59,10 +60,15 @@
13                     !(res->flags & IORESOURCE_PREFETCH))
14                         continue;
15  
16 +               /* Limit address to 32 bits when requested */
17 +               if ((res->flags & IORESOURCE_MEM) &&
18 +                   (res->flags & IORESOURCE_PCI_32BIT))
19 +                       max = (u32) -1;
20 +
21                 /* Ok, try it out.. */
22                 ret = allocate_resource(r, res, size,
23                                         r->start ? : min,
24 -                                       -1, align,
25 +                                       max, align,
26                                         alignf, alignf_data);
27                 if (ret == 0)
28                         break;
29 diff -Naur linux-source-2.6.29-orig/drivers/pci/setup-bus.c linux-source-2.6.29/drivers/pci/setup-bus.c
30 --- linux-source-2.6.29-orig/drivers/pci/setup-bus.c    2009-03-24 00:12:14.000000000 +0100
31 +++ linux-source-2.6.29/drivers/pci/setup-bus.c 2009-04-06 11:04:41.000000000 +0200
32 *** 430,444 ****
33         if (ctrl & PCI_CB_BRIDGE_CTL_PREFETCH_MEM0) {
34                 b_res[2].start = pci_cardbus_mem_size;
35                 b_res[2].end = b_res[2].start + pci_cardbus_mem_size - 1;
36 !               b_res[2].flags |= IORESOURCE_MEM | IORESOURCE_PREFETCH;
37   
38                 b_res[3].start = pci_cardbus_mem_size;
39                 b_res[3].end = b_res[3].start + pci_cardbus_mem_size - 1;
40 !               b_res[3].flags |= IORESOURCE_MEM;
41         } else {
42                 b_res[3].start = pci_cardbus_mem_size * 2;
43                 b_res[3].end = b_res[3].start + pci_cardbus_mem_size * 2 - 1;
44 !               b_res[3].flags |= IORESOURCE_MEM;
45         }
46   }
47   
48 --- 430,444 ----
49         if (ctrl & PCI_CB_BRIDGE_CTL_PREFETCH_MEM0) {
50                 b_res[2].start = pci_cardbus_mem_size;
51                 b_res[2].end = b_res[2].start + pci_cardbus_mem_size - 1;
52 !               b_res[2].flags |= IORESOURCE_MEM | IORESOURCE_PREFETCH | IORESOURCE_PCI_32BIT;
53   
54                 b_res[3].start = pci_cardbus_mem_size;
55                 b_res[3].end = b_res[3].start + pci_cardbus_mem_size - 1;
56 !               b_res[3].flags |= IORESOURCE_MEM | IORESOURCE_PCI_32BIT;
57         } else {
58                 b_res[3].start = pci_cardbus_mem_size * 2;
59                 b_res[3].end = b_res[3].start + pci_cardbus_mem_size * 2 - 1;
60 !               b_res[3].flags |= IORESOURCE_MEM | IORESOURCE_PCI_32BIT;
61         }
62   }
63   diff -Naur linux-source-2.6.29-orig/include/linux/ioport.h linux-source-2.6.29/include/linux/ioport.h
64 --- linux-source-2.6.29-orig/include/linux/ioport.h     2009-03-24 00:12:14.000000000 +0100
65 +++ linux-source-2.6.29/include/linux/ioport.h  2009-04-06 11:04:41.000000000 +0200
66 @@ -103,6 +103,7 @@
67  
68  /* PCI control bits.  Shares IORESOURCE_BITS with above PCI ROM.  */
69  #define IORESOURCE_PCI_FIXED           (1<<4)  /* Do not move resource */
70 +#define IORESOURCE_PCI_32BIT           (1<<5)  /* Do not use 64bit address space (for cardbus devices) */
71  
72  /* PC/ISA/whatever - the normal PC address spaces: IO and memory */
73  extern struct resource ioport_resource;