diff options
96 files changed, 1356 insertions, 468 deletions
diff --git a/Documentation/nfsroot.txt b/Documentation/nfsroot.txt index 16a7cae2721d..9b956a969362 100644 --- a/Documentation/nfsroot.txt +++ b/Documentation/nfsroot.txt | |||
@@ -92,8 +92,14 @@ ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf> | |||
92 | autoconfiguration. | 92 | autoconfiguration. |
93 | 93 | ||
94 | The <autoconf> parameter can appear alone as the value to the `ip' | 94 | The <autoconf> parameter can appear alone as the value to the `ip' |
95 | parameter (without all the ':' characters before) in which case auto- | 95 | parameter (without all the ':' characters before). If the value is |
96 | configuration is used. | 96 | "ip=off" or "ip=none", no autoconfiguration will take place, otherwise |
97 | autoconfiguration will take place. The most common way to use this | ||
98 | is "ip=dhcp". | ||
99 | |||
100 | Note that "ip=off" is not the same thing as "ip=::::::off", because in | ||
101 | the latter autoconfiguration will take place if any of DHCP, BOOTP or RARP | ||
102 | are compiled in the kernel. | ||
97 | 103 | ||
98 | <client-ip> IP address of the client. | 104 | <client-ip> IP address of the client. |
99 | 105 | ||
@@ -142,7 +148,7 @@ ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf> | |||
142 | into the kernel will be used, regardless of the value of | 148 | into the kernel will be used, regardless of the value of |
143 | this option. | 149 | this option. |
144 | 150 | ||
145 | off or none: don't use autoconfiguration (default) | 151 | off or none: don't use autoconfiguration |
146 | on or any: use any protocol available in the kernel | 152 | on or any: use any protocol available in the kernel |
147 | dhcp: use DHCP | 153 | dhcp: use DHCP |
148 | bootp: use BOOTP | 154 | bootp: use BOOTP |
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index a7e9fea978a6..c4de2d4664d7 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -537,7 +537,7 @@ config ISA_DMA_API | |||
537 | bool | 537 | bool |
538 | 538 | ||
539 | config PCI | 539 | config PCI |
540 | bool "PCI support" if ARCH_INTEGRATOR_AP || ARCH_VERSATILE_PB || ARCH_IXP4XX || ARCH_KS8695 | 540 | bool "PCI support" if ARCH_INTEGRATOR_AP || ARCH_VERSATILE_PB || ARCH_IXP4XX || ARCH_KS8695 || MACH_ARMCORE |
541 | help | 541 | help |
542 | Find out whether you have a PCI motherboard. PCI is the name of a | 542 | Find out whether you have a PCI motherboard. PCI is the name of a |
543 | bus system, i.e. the way the CPU talks to the other stuff inside | 543 | bus system, i.e. the way the CPU talks to the other stuff inside |
@@ -558,6 +558,12 @@ config PCI_HOST_VIA82C505 | |||
558 | depends on PCI && ARCH_SHARK | 558 | depends on PCI && ARCH_SHARK |
559 | default y | 559 | default y |
560 | 560 | ||
561 | config PCI_HOST_ITE8152 | ||
562 | bool | ||
563 | depends on PCI && MACH_ARMCORE | ||
564 | default y | ||
565 | select DMABOUNCE | ||
566 | |||
561 | source "drivers/pci/Kconfig" | 567 | source "drivers/pci/Kconfig" |
562 | 568 | ||
563 | source "drivers/pcmcia/Kconfig" | 569 | source "drivers/pcmcia/Kconfig" |
diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S index b9b03eda70e5..5cac46a19bb7 100644 --- a/arch/arm/boot/compressed/head.S +++ b/arch/arm/boot/compressed/head.S | |||
@@ -31,7 +31,7 @@ | |||
31 | .macro loadsp, rb | 31 | .macro loadsp, rb |
32 | .endm | 32 | .endm |
33 | .macro writeb, ch, rb | 33 | .macro writeb, ch, rb |
34 | mcr p14, 0, \ch, c0, c1, 0 | 34 | mcr p14, 0, \ch, c1, c0, 0 |
35 | .endm | 35 | .endm |
36 | #endif | 36 | #endif |
37 | 37 | ||
diff --git a/arch/arm/common/it8152.c b/arch/arm/common/it8152.c index c03de9bfd76b..97b7dc13d9aa 100644 --- a/arch/arm/common/it8152.c +++ b/arch/arm/common/it8152.c | |||
@@ -70,8 +70,6 @@ static inline void it8152_irq(int irq) | |||
70 | { | 70 | { |
71 | struct irq_desc *desc; | 71 | struct irq_desc *desc; |
72 | 72 | ||
73 | printk(KERN_DEBUG "===> %s: irq=%d\n", __FUNCTION__, irq); | ||
74 | |||
75 | desc = irq_desc + irq; | 73 | desc = irq_desc + irq; |
76 | desc_handle_irq(irq, desc); | 74 | desc_handle_irq(irq, desc); |
77 | } | 75 | } |
@@ -106,8 +104,6 @@ void it8152_irq_demux(unsigned int irq, struct irq_desc *desc) | |||
106 | int bits_pd, bits_lp, bits_ld; | 104 | int bits_pd, bits_lp, bits_ld; |
107 | int i; | 105 | int i; |
108 | 106 | ||
109 | printk(KERN_DEBUG "=> %s: irq = %d\n", __FUNCTION__, irq); | ||
110 | |||
111 | while (1) { | 107 | while (1) { |
112 | /* Read all */ | 108 | /* Read all */ |
113 | bits_pd = __raw_readl(IT8152_INTC_PDCNIRR); | 109 | bits_pd = __raw_readl(IT8152_INTC_PDCNIRR); |
@@ -293,8 +289,7 @@ int dma_needs_bounce(struct device *dev, dma_addr_t dma_addr, size_t size) | |||
293 | */ | 289 | */ |
294 | int pci_set_dma_mask(struct pci_dev *dev, u64 mask) | 290 | int pci_set_dma_mask(struct pci_dev *dev, u64 mask) |
295 | { | 291 | { |
296 | printk(KERN_DEBUG "%s: %s %llx\n", | 292 | dev_dbg(&dev->dev, "%s: %llx\n", __FUNCTION__, mask); |
297 | __FUNCTION__, dev->dev.bus_id, mask); | ||
298 | if (mask >= PHYS_OFFSET + SZ_64M - 1) | 293 | if (mask >= PHYS_OFFSET + SZ_64M - 1) |
299 | return 0; | 294 | return 0; |
300 | 295 | ||
@@ -304,8 +299,7 @@ int pci_set_dma_mask(struct pci_dev *dev, u64 mask) | |||
304 | int | 299 | int |
305 | pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask) | 300 | pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask) |
306 | { | 301 | { |
307 | printk(KERN_DEBUG "%s: %s %llx\n", | 302 | dev_dbg(&dev->dev, "%s: %llx\n", __FUNCTION__, mask); |
308 | __FUNCTION__, dev->dev.bus_id, mask); | ||
309 | if (mask >= PHYS_OFFSET + SZ_64M - 1) | 303 | if (mask >= PHYS_OFFSET + SZ_64M - 1) |
310 | return 0; | 304 | return 0; |
311 | 305 | ||
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c index c1271c449246..f6d66dce6852 100644 --- a/arch/arm/mach-ixp4xx/common.c +++ b/arch/arm/mach-ixp4xx/common.c | |||
@@ -442,7 +442,8 @@ static int ixp4xx_set_next_event(unsigned long evt, | |||
442 | static void ixp4xx_set_mode(enum clock_event_mode mode, | 442 | static void ixp4xx_set_mode(enum clock_event_mode mode, |
443 | struct clock_event_device *evt) | 443 | struct clock_event_device *evt) |
444 | { | 444 | { |
445 | unsigned long opts, osrt = *IXP4XX_OSRT1 & ~IXP4XX_OST_RELOAD_MASK; | 445 | unsigned long opts = *IXP4XX_OSRT1 & IXP4XX_OST_RELOAD_MASK; |
446 | unsigned long osrt = *IXP4XX_OSRT1 & ~IXP4XX_OST_RELOAD_MASK; | ||
446 | 447 | ||
447 | switch (mode) { | 448 | switch (mode) { |
448 | case CLOCK_EVT_MODE_PERIODIC: | 449 | case CLOCK_EVT_MODE_PERIODIC: |
@@ -455,12 +456,15 @@ static void ixp4xx_set_mode(enum clock_event_mode mode, | |||
455 | opts = IXP4XX_OST_ENABLE | IXP4XX_OST_ONE_SHOT; | 456 | opts = IXP4XX_OST_ENABLE | IXP4XX_OST_ONE_SHOT; |
456 | break; | 457 | break; |
457 | case CLOCK_EVT_MODE_SHUTDOWN: | 458 | case CLOCK_EVT_MODE_SHUTDOWN: |
459 | opts &= ~IXP4XX_OST_ENABLE; | ||
460 | break; | ||
461 | case CLOCK_EVT_MODE_RESUME: | ||
462 | opts |= IXP4XX_OST_ENABLE; | ||
463 | break; | ||
458 | case CLOCK_EVT_MODE_UNUSED: | 464 | case CLOCK_EVT_MODE_UNUSED: |
459 | default: | 465 | default: |
460 | osrt = opts = 0; | 466 | osrt = opts = 0; |
461 | break; | 467 | break; |
462 | case CLOCK_EVT_MODE_RESUME: | ||
463 | break; | ||
464 | } | 468 | } |
465 | 469 | ||
466 | *IXP4XX_OSRT1 = osrt | opts; | 470 | *IXP4XX_OSRT1 = osrt | opts; |
diff --git a/arch/arm/mach-pxa/cm-x270-pci.c b/arch/arm/mach-pxa/cm-x270-pci.c index 878d3b9b8633..15c4e0df3e10 100644 --- a/arch/arm/mach-pxa/cm-x270-pci.c +++ b/arch/arm/mach-pxa/cm-x270-pci.c | |||
@@ -40,7 +40,7 @@ void __init cmx270_pci_adjust_zones(int node, unsigned long *zone_size, | |||
40 | { | 40 | { |
41 | unsigned int sz = SZ_64M >> PAGE_SHIFT; | 41 | unsigned int sz = SZ_64M >> PAGE_SHIFT; |
42 | 42 | ||
43 | printk(KERN_INFO "Adjusting zones for CM-x270\n"); | 43 | pr_info("Adjusting zones for CM-x270\n"); |
44 | 44 | ||
45 | /* | 45 | /* |
46 | * Only adjust if > 64M on current system | 46 | * Only adjust if > 64M on current system |
@@ -104,8 +104,7 @@ static int __init cmx270_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin) | |||
104 | { | 104 | { |
105 | int irq; | 105 | int irq; |
106 | 106 | ||
107 | printk(KERN_DEBUG "===> %s: %s slot=%x, pin=%x\n", __FUNCTION__, | 107 | dev_dbg(&dev->dev, "%s: slot=%x, pin=%x\n", __FUNCTION__, slot, pin); |
108 | pci_name(dev), slot, pin); | ||
109 | 108 | ||
110 | irq = it8152_pci_map_irq(dev, slot, pin); | 109 | irq = it8152_pci_map_irq(dev, slot, pin); |
111 | if (irq) | 110 | if (irq) |
@@ -141,14 +140,13 @@ static int __init cmx270_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin) | |||
141 | return(0); | 140 | return(0); |
142 | } | 141 | } |
143 | 142 | ||
144 | static struct pci_bus * __init | 143 | static void cmx270_pci_preinit(void) |
145 | cmx270_pci_scan_bus(int nr, struct pci_sys_data *sys) | ||
146 | { | 144 | { |
147 | printk(KERN_INFO "Initializing CM-X270 PCI subsystem\n"); | 145 | pr_info("Initializing CM-X270 PCI subsystem\n"); |
148 | 146 | ||
149 | __raw_writel(0x800, IT8152_PCI_CFG_ADDR); | 147 | __raw_writel(0x800, IT8152_PCI_CFG_ADDR); |
150 | if (__raw_readl(IT8152_PCI_CFG_DATA) == 0x81521283) { | 148 | if (__raw_readl(IT8152_PCI_CFG_DATA) == 0x81521283) { |
151 | printk(KERN_INFO "PCI Bridge found.\n"); | 149 | pr_info("PCI Bridge found.\n"); |
152 | 150 | ||
153 | /* set PCI I/O base at 0 */ | 151 | /* set PCI I/O base at 0 */ |
154 | writel(0x848, IT8152_PCI_CFG_ADDR); | 152 | writel(0x848, IT8152_PCI_CFG_ADDR); |
@@ -163,7 +161,7 @@ cmx270_pci_scan_bus(int nr, struct pci_sys_data *sys) | |||
163 | /* CardBus Controller on ATXbase baseboard */ | 161 | /* CardBus Controller on ATXbase baseboard */ |
164 | writel(0x4000, IT8152_PCI_CFG_ADDR); | 162 | writel(0x4000, IT8152_PCI_CFG_ADDR); |
165 | if (readl(IT8152_PCI_CFG_DATA) == 0xAC51104C) { | 163 | if (readl(IT8152_PCI_CFG_DATA) == 0xAC51104C) { |
166 | printk(KERN_INFO "CardBus Bridge found.\n"); | 164 | pr_info("CardBus Bridge found.\n"); |
167 | 165 | ||
168 | /* Configure socket 0 */ | 166 | /* Configure socket 0 */ |
169 | writel(0x408C, IT8152_PCI_CFG_ADDR); | 167 | writel(0x408C, IT8152_PCI_CFG_ADDR); |
@@ -196,7 +194,6 @@ cmx270_pci_scan_bus(int nr, struct pci_sys_data *sys) | |||
196 | writel(0xb0000000, IT8152_PCI_CFG_DATA); | 194 | writel(0xb0000000, IT8152_PCI_CFG_DATA); |
197 | } | 195 | } |
198 | } | 196 | } |
199 | return it8152_pci_scan_bus(nr, sys); | ||
200 | } | 197 | } |
201 | 198 | ||
202 | static struct hw_pci cmx270_pci __initdata = { | 199 | static struct hw_pci cmx270_pci __initdata = { |
@@ -204,7 +201,8 @@ static struct hw_pci cmx270_pci __initdata = { | |||
204 | .map_irq = cmx270_pci_map_irq, | 201 | .map_irq = cmx270_pci_map_irq, |
205 | .nr_controllers = 1, | 202 | .nr_controllers = 1, |
206 | .setup = it8152_pci_setup, | 203 | .setup = it8152_pci_setup, |
207 | .scan = cmx270_pci_scan_bus, | 204 | .scan = it8152_pci_scan_bus, |
205 | .preinit = cmx270_pci_preinit, | ||
208 | }; | 206 | }; |
209 | 207 | ||
210 | static int __init cmx270_init_pci(void) | 208 | static int __init cmx270_init_pci(void) |
diff --git a/arch/mips/au1000/Kconfig b/arch/mips/au1000/Kconfig index 05d1354aad3a..1fe97cccead1 100644 --- a/arch/mips/au1000/Kconfig +++ b/arch/mips/au1000/Kconfig | |||
@@ -7,7 +7,6 @@ config MIPS_MTX1 | |||
7 | bool "4G Systems MTX-1 board" | 7 | bool "4G Systems MTX-1 board" |
8 | select DMA_NONCOHERENT | 8 | select DMA_NONCOHERENT |
9 | select HW_HAS_PCI | 9 | select HW_HAS_PCI |
10 | select RESOURCES_64BIT if PCI | ||
11 | select SOC_AU1500 | 10 | select SOC_AU1500 |
12 | select SYS_SUPPORTS_LITTLE_ENDIAN | 11 | select SYS_SUPPORTS_LITTLE_ENDIAN |
13 | 12 | ||
@@ -22,7 +21,6 @@ config MIPS_DB1000 | |||
22 | select SOC_AU1000 | 21 | select SOC_AU1000 |
23 | select DMA_NONCOHERENT | 22 | select DMA_NONCOHERENT |
24 | select HW_HAS_PCI | 23 | select HW_HAS_PCI |
25 | select RESOURCES_64BIT if PCI | ||
26 | select SYS_SUPPORTS_LITTLE_ENDIAN | 24 | select SYS_SUPPORTS_LITTLE_ENDIAN |
27 | 25 | ||
28 | config MIPS_DB1100 | 26 | config MIPS_DB1100 |
@@ -44,7 +42,6 @@ config MIPS_DB1500 | |||
44 | select DMA_NONCOHERENT | 42 | select DMA_NONCOHERENT |
45 | select HW_HAS_PCI | 43 | select HW_HAS_PCI |
46 | select MIPS_DISABLE_OBSOLETE_IDE | 44 | select MIPS_DISABLE_OBSOLETE_IDE |
47 | select RESOURCES_64BIT if PCI | ||
48 | select SYS_SUPPORTS_BIG_ENDIAN | 45 | select SYS_SUPPORTS_BIG_ENDIAN |
49 | select SYS_SUPPORTS_LITTLE_ENDIAN | 46 | select SYS_SUPPORTS_LITTLE_ENDIAN |
50 | 47 | ||
@@ -54,7 +51,6 @@ config MIPS_DB1550 | |||
54 | select HW_HAS_PCI | 51 | select HW_HAS_PCI |
55 | select DMA_NONCOHERENT | 52 | select DMA_NONCOHERENT |
56 | select MIPS_DISABLE_OBSOLETE_IDE | 53 | select MIPS_DISABLE_OBSOLETE_IDE |
57 | select RESOURCES_64BIT if PCI | ||
58 | select SYS_SUPPORTS_LITTLE_ENDIAN | 54 | select SYS_SUPPORTS_LITTLE_ENDIAN |
59 | 55 | ||
60 | config MIPS_MIRAGE | 56 | config MIPS_MIRAGE |
@@ -68,7 +64,6 @@ config MIPS_PB1000 | |||
68 | select SOC_AU1000 | 64 | select SOC_AU1000 |
69 | select DMA_NONCOHERENT | 65 | select DMA_NONCOHERENT |
70 | select HW_HAS_PCI | 66 | select HW_HAS_PCI |
71 | select RESOURCES_64BIT if PCI | ||
72 | select SWAP_IO_SPACE | 67 | select SWAP_IO_SPACE |
73 | select SYS_SUPPORTS_LITTLE_ENDIAN | 68 | select SYS_SUPPORTS_LITTLE_ENDIAN |
74 | 69 | ||
@@ -77,7 +72,6 @@ config MIPS_PB1100 | |||
77 | select SOC_AU1100 | 72 | select SOC_AU1100 |
78 | select DMA_NONCOHERENT | 73 | select DMA_NONCOHERENT |
79 | select HW_HAS_PCI | 74 | select HW_HAS_PCI |
80 | select RESOURCES_64BIT if PCI | ||
81 | select SWAP_IO_SPACE | 75 | select SWAP_IO_SPACE |
82 | select SYS_SUPPORTS_LITTLE_ENDIAN | 76 | select SYS_SUPPORTS_LITTLE_ENDIAN |
83 | 77 | ||
@@ -86,7 +80,6 @@ config MIPS_PB1200 | |||
86 | select SOC_AU1200 | 80 | select SOC_AU1200 |
87 | select DMA_NONCOHERENT | 81 | select DMA_NONCOHERENT |
88 | select MIPS_DISABLE_OBSOLETE_IDE | 82 | select MIPS_DISABLE_OBSOLETE_IDE |
89 | select RESOURCES_64BIT if PCI | ||
90 | select SYS_SUPPORTS_LITTLE_ENDIAN | 83 | select SYS_SUPPORTS_LITTLE_ENDIAN |
91 | 84 | ||
92 | config MIPS_PB1500 | 85 | config MIPS_PB1500 |
@@ -94,7 +87,6 @@ config MIPS_PB1500 | |||
94 | select SOC_AU1500 | 87 | select SOC_AU1500 |
95 | select DMA_NONCOHERENT | 88 | select DMA_NONCOHERENT |
96 | select HW_HAS_PCI | 89 | select HW_HAS_PCI |
97 | select RESOURCES_64BIT if PCI | ||
98 | select SYS_SUPPORTS_LITTLE_ENDIAN | 90 | select SYS_SUPPORTS_LITTLE_ENDIAN |
99 | 91 | ||
100 | config MIPS_PB1550 | 92 | config MIPS_PB1550 |
@@ -103,7 +95,6 @@ config MIPS_PB1550 | |||
103 | select DMA_NONCOHERENT | 95 | select DMA_NONCOHERENT |
104 | select HW_HAS_PCI | 96 | select HW_HAS_PCI |
105 | select MIPS_DISABLE_OBSOLETE_IDE | 97 | select MIPS_DISABLE_OBSOLETE_IDE |
106 | select RESOURCES_64BIT if PCI | ||
107 | select SYS_SUPPORTS_LITTLE_ENDIAN | 98 | select SYS_SUPPORTS_LITTLE_ENDIAN |
108 | 99 | ||
109 | config MIPS_XXS1500 | 100 | config MIPS_XXS1500 |
diff --git a/arch/mips/au1000/common/pci.c b/arch/mips/au1000/common/pci.c index 9be99a68932a..6fa70a36a250 100644 --- a/arch/mips/au1000/common/pci.c +++ b/arch/mips/au1000/common/pci.c | |||
@@ -39,15 +39,15 @@ | |||
39 | 39 | ||
40 | /* TBD */ | 40 | /* TBD */ |
41 | static struct resource pci_io_resource = { | 41 | static struct resource pci_io_resource = { |
42 | .start = (resource_size_t)PCI_IO_START, | 42 | .start = PCI_IO_START, |
43 | .end = (resource_size_t)PCI_IO_END, | 43 | .end = PCI_IO_END, |
44 | .name = "PCI IO space", | 44 | .name = "PCI IO space", |
45 | .flags = IORESOURCE_IO | 45 | .flags = IORESOURCE_IO |
46 | }; | 46 | }; |
47 | 47 | ||
48 | static struct resource pci_mem_resource = { | 48 | static struct resource pci_mem_resource = { |
49 | .start = (resource_size_t)PCI_MEM_START, | 49 | .start = PCI_MEM_START, |
50 | .end = (resource_size_t)PCI_MEM_END, | 50 | .end = PCI_MEM_END, |
51 | .name = "PCI memory space", | 51 | .name = "PCI memory space", |
52 | .flags = IORESOURCE_MEM | 52 | .flags = IORESOURCE_MEM |
53 | }; | 53 | }; |
diff --git a/arch/mips/au1000/common/setup.c b/arch/mips/au1000/common/setup.c index a90d425d4651..d885e3848ec6 100644 --- a/arch/mips/au1000/common/setup.c +++ b/arch/mips/au1000/common/setup.c | |||
@@ -137,12 +137,11 @@ phys_t __fixup_bigphys_addr(phys_t phys_addr, phys_t size) | |||
137 | 137 | ||
138 | #ifdef CONFIG_PCI | 138 | #ifdef CONFIG_PCI |
139 | { | 139 | { |
140 | u32 start, end; | 140 | u32 start = (u32)Au1500_PCI_MEM_START; |
141 | u32 end = (u32)Au1500_PCI_MEM_END; | ||
141 | 142 | ||
142 | start = (u32)Au1500_PCI_MEM_START; | 143 | /* Check for PCI memory window */ |
143 | end = (u32)Au1500_PCI_MEM_END; | 144 | if (phys_addr >= start && (phys_addr + size - 1) <= end) |
144 | /* check for pci memory window */ | ||
145 | if ((phys_addr >= start) && ((phys_addr + size) < end)) | ||
146 | return (phys_t) | 145 | return (phys_t) |
147 | ((phys_addr - start) + Au1500_PCI_MEM_START); | 146 | ((phys_addr - start) + Au1500_PCI_MEM_START); |
148 | } | 147 | } |
diff --git a/arch/mips/cobalt/time.c b/arch/mips/cobalt/time.c index fa819fccd5db..4a570e7145fe 100644 --- a/arch/mips/cobalt/time.c +++ b/arch/mips/cobalt/time.c | |||
@@ -27,9 +27,28 @@ | |||
27 | 27 | ||
28 | void __init plat_time_init(void) | 28 | void __init plat_time_init(void) |
29 | { | 29 | { |
30 | u32 start, end; | ||
31 | int i = HZ / 10; | ||
32 | |||
30 | setup_pit_timer(); | 33 | setup_pit_timer(); |
31 | 34 | ||
32 | gt641xx_set_base_clock(GT641XX_BASE_CLOCK); | 35 | gt641xx_set_base_clock(GT641XX_BASE_CLOCK); |
33 | 36 | ||
34 | mips_timer_state = gt641xx_timer0_state; | 37 | /* |
38 | * MIPS counter frequency is measured during a 100msec interval | ||
39 | * using GT64111 timer0. | ||
40 | */ | ||
41 | while (!gt641xx_timer0_state()) | ||
42 | ; | ||
43 | |||
44 | start = read_c0_count(); | ||
45 | |||
46 | while (i--) | ||
47 | while (!gt641xx_timer0_state()) | ||
48 | ; | ||
49 | |||
50 | end = read_c0_count(); | ||
51 | |||
52 | mips_hpt_frequency = (end - start) * 10; | ||
53 | printk(KERN_INFO "MIPS counter frequency %dHz\n", mips_hpt_frequency); | ||
35 | } | 54 | } |
diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c index 11cb264f59ce..2c09a442e5e5 100644 --- a/arch/mips/kernel/process.c +++ b/arch/mips/kernel/process.c | |||
@@ -77,9 +77,8 @@ void start_thread(struct pt_regs * regs, unsigned long pc, unsigned long sp) | |||
77 | unsigned long status; | 77 | unsigned long status; |
78 | 78 | ||
79 | /* New thread loses kernel privileges. */ | 79 | /* New thread loses kernel privileges. */ |
80 | status = regs->cp0_status & ~(ST0_CU0|ST0_CU1|KU_MASK); | 80 | status = regs->cp0_status & ~(ST0_CU0|ST0_CU1|ST0_FR|KU_MASK); |
81 | #ifdef CONFIG_64BIT | 81 | #ifdef CONFIG_64BIT |
82 | status &= ~ST0_FR; | ||
83 | status |= test_thread_flag(TIF_32BIT_REGS) ? 0 : ST0_FR; | 82 | status |= test_thread_flag(TIF_32BIT_REGS) ? 0 : ST0_FR; |
84 | #endif | 83 | #endif |
85 | status |= KU_USER; | 84 | status |= KU_USER; |
diff --git a/arch/mips/kernel/time.c b/arch/mips/kernel/time.c index 52075426c373..1ecfbb7eba6c 100644 --- a/arch/mips/kernel/time.c +++ b/arch/mips/kernel/time.c | |||
@@ -109,10 +109,6 @@ void __cpuinit clockevent_set_clock(struct clock_event_device *cd, | |||
109 | cd->mult = (u32) temp; | 109 | cd->mult = (u32) temp; |
110 | } | 110 | } |
111 | 111 | ||
112 | void __init __weak plat_time_init(void) | ||
113 | { | ||
114 | } | ||
115 | |||
116 | /* | 112 | /* |
117 | * This function exists in order to cause an error due to a duplicate | 113 | * This function exists in order to cause an error due to a duplicate |
118 | * definition if platform code should have its own implementation. The hook | 114 | * definition if platform code should have its own implementation. The hook |
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index 23e73d0650a3..fcae66752972 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c | |||
@@ -1317,12 +1317,12 @@ void __init per_cpu_trap_init(void) | |||
1317 | #endif | 1317 | #endif |
1318 | if (current_cpu_data.isa_level == MIPS_CPU_ISA_IV) | 1318 | if (current_cpu_data.isa_level == MIPS_CPU_ISA_IV) |
1319 | status_set |= ST0_XX; | 1319 | status_set |= ST0_XX; |
1320 | if (cpu_has_dsp) | ||
1321 | status_set |= ST0_MX; | ||
1322 | |||
1320 | change_c0_status(ST0_CU|ST0_MX|ST0_RE|ST0_FR|ST0_BEV|ST0_TS|ST0_KX|ST0_SX|ST0_UX, | 1323 | change_c0_status(ST0_CU|ST0_MX|ST0_RE|ST0_FR|ST0_BEV|ST0_TS|ST0_KX|ST0_SX|ST0_UX, |
1321 | status_set); | 1324 | status_set); |
1322 | 1325 | ||
1323 | if (cpu_has_dsp) | ||
1324 | set_c0_status(ST0_MX); | ||
1325 | |||
1326 | #ifdef CONFIG_CPU_MIPSR2 | 1326 | #ifdef CONFIG_CPU_MIPSR2 |
1327 | if (cpu_has_mips_r2) { | 1327 | if (cpu_has_mips_r2) { |
1328 | unsigned int enable = 0x0000000f; | 1328 | unsigned int enable = 0x0000000f; |
diff --git a/arch/mips/mips-boards/generic/memory.c b/arch/mips/mips-boards/generic/memory.c index dc272c188233..2c5c27c8e86d 100644 --- a/arch/mips/mips-boards/generic/memory.c +++ b/arch/mips/mips-boards/generic/memory.c | |||
@@ -169,6 +169,7 @@ void __init prom_meminit(void) | |||
169 | 169 | ||
170 | void __init prom_free_prom_memory(void) | 170 | void __init prom_free_prom_memory(void) |
171 | { | 171 | { |
172 | #if 0 /* for now ... */ | ||
172 | unsigned long addr; | 173 | unsigned long addr; |
173 | int i; | 174 | int i; |
174 | 175 | ||
@@ -180,4 +181,5 @@ void __init prom_free_prom_memory(void) | |||
180 | free_init_pages("prom memory", | 181 | free_init_pages("prom memory", |
181 | addr, addr + boot_mem_map.map[i].size); | 182 | addr, addr + boot_mem_map.map[i].size); |
182 | } | 183 | } |
184 | #endif | ||
183 | } | 185 | } |
diff --git a/arch/mips/pci/pci.c b/arch/mips/pci/pci.c index 589b745d822a..6e6981fd7934 100644 --- a/arch/mips/pci/pci.c +++ b/arch/mips/pci/pci.c | |||
@@ -242,6 +242,8 @@ static void pcibios_fixup_device_resources(struct pci_dev *dev, | |||
242 | for (i = 0; i < PCI_NUM_RESOURCES; i++) { | 242 | for (i = 0; i < PCI_NUM_RESOURCES; i++) { |
243 | if (!dev->resource[i].start) | 243 | if (!dev->resource[i].start) |
244 | continue; | 244 | continue; |
245 | if (dev->resource[i].flags & IORESOURCE_PCI_FIXED) | ||
246 | continue; | ||
245 | if (dev->resource[i].flags & IORESOURCE_IO) | 247 | if (dev->resource[i].flags & IORESOURCE_IO) |
246 | offset = hose->io_offset; | 248 | offset = hose->io_offset; |
247 | else if (dev->resource[i].flags & IORESOURCE_MEM) | 249 | else if (dev->resource[i].flags & IORESOURCE_MEM) |
diff --git a/arch/powerpc/configs/mpc8272_ads_defconfig b/arch/powerpc/configs/mpc8272_ads_defconfig index a31b7a030a6b..5eae305215dc 100644 --- a/arch/powerpc/configs/mpc8272_ads_defconfig +++ b/arch/powerpc/configs/mpc8272_ads_defconfig | |||
@@ -1,7 +1,7 @@ | |||
1 | # | 1 | # |
2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
3 | # Linux kernel version: 2.6.24-rc4 | 3 | # Linux kernel version: 2.6.24-rc5 |
4 | # Thu Dec 6 16:48:30 2007 | 4 | # Thu Dec 13 22:40:57 2007 |
5 | # | 5 | # |
6 | # CONFIG_PPC64 is not set | 6 | # CONFIG_PPC64 is not set |
7 | 7 | ||
@@ -491,7 +491,7 @@ CONFIG_MII=y | |||
491 | CONFIG_FS_ENET=y | 491 | CONFIG_FS_ENET=y |
492 | # CONFIG_FS_ENET_HAS_SCC is not set | 492 | # CONFIG_FS_ENET_HAS_SCC is not set |
493 | CONFIG_FS_ENET_HAS_FCC=y | 493 | CONFIG_FS_ENET_HAS_FCC=y |
494 | # CONFIG_FS_ENET_MDIO_FCC is not set | 494 | CONFIG_FS_ENET_MDIO_FCC=y |
495 | CONFIG_NETDEV_1000=y | 495 | CONFIG_NETDEV_1000=y |
496 | # CONFIG_ACENIC is not set | 496 | # CONFIG_ACENIC is not set |
497 | # CONFIG_DL2K is not set | 497 | # CONFIG_DL2K is not set |
diff --git a/arch/powerpc/configs/pq2fads_defconfig b/arch/powerpc/configs/pq2fads_defconfig index 142d206d6870..a3bfbb65a933 100644 --- a/arch/powerpc/configs/pq2fads_defconfig +++ b/arch/powerpc/configs/pq2fads_defconfig | |||
@@ -1,7 +1,7 @@ | |||
1 | # | 1 | # |
2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
3 | # Linux kernel version: 2.6.24-rc4 | 3 | # Linux kernel version: 2.6.24-rc5 |
4 | # Thu Dec 6 16:49:09 2007 | 4 | # Thu Dec 13 22:39:18 2007 |
5 | # | 5 | # |
6 | # CONFIG_PPC64 is not set | 6 | # CONFIG_PPC64 is not set |
7 | 7 | ||
@@ -548,7 +548,7 @@ CONFIG_MII=y | |||
548 | CONFIG_FS_ENET=y | 548 | CONFIG_FS_ENET=y |
549 | # CONFIG_FS_ENET_HAS_SCC is not set | 549 | # CONFIG_FS_ENET_HAS_SCC is not set |
550 | CONFIG_FS_ENET_HAS_FCC=y | 550 | CONFIG_FS_ENET_HAS_FCC=y |
551 | # CONFIG_FS_ENET_MDIO_FCC is not set | 551 | CONFIG_FS_ENET_MDIO_FCC=y |
552 | CONFIG_NETDEV_1000=y | 552 | CONFIG_NETDEV_1000=y |
553 | # CONFIG_ACENIC is not set | 553 | # CONFIG_ACENIC is not set |
554 | # CONFIG_DL2K is not set | 554 | # CONFIG_DL2K is not set |
diff --git a/arch/powerpc/configs/ps3_defconfig b/arch/powerpc/configs/ps3_defconfig index 5bd547ecd60a..0b5469fb6e0f 100644 --- a/arch/powerpc/configs/ps3_defconfig +++ b/arch/powerpc/configs/ps3_defconfig | |||
@@ -157,7 +157,7 @@ CONFIG_PS3_HTAB_SIZE=20 | |||
157 | CONFIG_PS3_USE_LPAR_ADDR=y | 157 | CONFIG_PS3_USE_LPAR_ADDR=y |
158 | CONFIG_PS3_VUART=y | 158 | CONFIG_PS3_VUART=y |
159 | CONFIG_PS3_PS3AV=y | 159 | CONFIG_PS3_PS3AV=y |
160 | CONFIG_PS3_SYS_MANAGER=m | 160 | CONFIG_PS3_SYS_MANAGER=y |
161 | CONFIG_PS3_STORAGE=y | 161 | CONFIG_PS3_STORAGE=y |
162 | CONFIG_PS3_DISK=y | 162 | CONFIG_PS3_DISK=y |
163 | CONFIG_PS3_ROM=y | 163 | CONFIG_PS3_ROM=y |
diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c index c6b1aa3efbb9..13ebeb2d71e6 100644 --- a/arch/powerpc/kernel/ppc_ksyms.c +++ b/arch/powerpc/kernel/ppc_ksyms.c | |||
@@ -45,10 +45,6 @@ | |||
45 | #include <asm/signal.h> | 45 | #include <asm/signal.h> |
46 | #include <asm/dcr.h> | 46 | #include <asm/dcr.h> |
47 | 47 | ||
48 | #ifdef CONFIG_8xx | ||
49 | #include <asm/commproc.h> | ||
50 | #endif | ||
51 | |||
52 | #ifdef CONFIG_PPC64 | 48 | #ifdef CONFIG_PPC64 |
53 | EXPORT_SYMBOL(local_irq_restore); | 49 | EXPORT_SYMBOL(local_irq_restore); |
54 | #endif | 50 | #endif |
@@ -172,14 +168,6 @@ EXPORT_SYMBOL(console_drivers); | |||
172 | EXPORT_SYMBOL(cacheable_memcpy); | 168 | EXPORT_SYMBOL(cacheable_memcpy); |
173 | #endif | 169 | #endif |
174 | 170 | ||
175 | #ifdef CONFIG_8xx | ||
176 | EXPORT_SYMBOL(cpm_install_handler); | ||
177 | EXPORT_SYMBOL(cpm_free_handler); | ||
178 | #endif /* CONFIG_8xx */ | ||
179 | #if defined(CONFIG_8xx) | ||
180 | EXPORT_SYMBOL(__res); | ||
181 | #endif | ||
182 | |||
183 | #ifdef CONFIG_PPC32 | 171 | #ifdef CONFIG_PPC32 |
184 | EXPORT_SYMBOL(next_mmu_context); | 172 | EXPORT_SYMBOL(next_mmu_context); |
185 | EXPORT_SYMBOL(set_context); | 173 | EXPORT_SYMBOL(set_context); |
diff --git a/arch/powerpc/math-emu/op-2.h b/arch/powerpc/math-emu/op-2.h index b9b06b4c6ea1..7d6f17cc2929 100644 --- a/arch/powerpc/math-emu/op-2.h +++ b/arch/powerpc/math-emu/op-2.h | |||
@@ -59,7 +59,8 @@ | |||
59 | else \ | 59 | else \ |
60 | { \ | 60 | { \ |
61 | X##_f0 = (X##_f1 >> ((N) - _FP_W_TYPE_SIZE) | \ | 61 | X##_f0 = (X##_f1 >> ((N) - _FP_W_TYPE_SIZE) | \ |
62 | (((X##_f1 << (sz - (N))) | X##_f0) != 0)); \ | 62 | (((X##_f1 << (2 * _FP_W_TYPE_SIZE - (N))) | \ |
63 | X##_f0) != 0)); \ | ||
63 | X##_f1 = 0; \ | 64 | X##_f1 = 0; \ |
64 | } \ | 65 | } \ |
65 | } while (0) | 66 | } while (0) |
diff --git a/arch/powerpc/platforms/iseries/lpevents.c b/arch/powerpc/platforms/iseries/lpevents.c index 34bdbbe3ce59..275f49449839 100644 --- a/arch/powerpc/platforms/iseries/lpevents.c +++ b/arch/powerpc/platforms/iseries/lpevents.c | |||
@@ -121,6 +121,7 @@ void process_hvlpevents(void) | |||
121 | { | 121 | { |
122 | struct HvLpEvent * event; | 122 | struct HvLpEvent * event; |
123 | 123 | ||
124 | restart: | ||
124 | /* If we have recursed, just return */ | 125 | /* If we have recursed, just return */ |
125 | if (!spin_trylock(&hvlpevent_queue.hq_lock)) | 126 | if (!spin_trylock(&hvlpevent_queue.hq_lock)) |
126 | return; | 127 | return; |
@@ -146,8 +147,20 @@ void process_hvlpevents(void) | |||
146 | if (event->xType < HvLpEvent_Type_NumTypes && | 147 | if (event->xType < HvLpEvent_Type_NumTypes && |
147 | lpEventHandler[event->xType]) | 148 | lpEventHandler[event->xType]) |
148 | lpEventHandler[event->xType](event); | 149 | lpEventHandler[event->xType](event); |
149 | else | 150 | else { |
150 | printk(KERN_INFO "Unexpected Lp Event type=%d\n", event->xType ); | 151 | u8 type = event->xType; |
152 | |||
153 | /* | ||
154 | * Don't printk in the spinlock as printk | ||
155 | * may require ack events form the HV to send | ||
156 | * any characters there. | ||
157 | */ | ||
158 | hvlpevent_clear_valid(event); | ||
159 | spin_unlock(&hvlpevent_queue.hq_lock); | ||
160 | printk(KERN_INFO | ||
161 | "Unexpected Lp Event type=%d\n", type); | ||
162 | goto restart; | ||
163 | } | ||
151 | 164 | ||
152 | hvlpevent_clear_valid(event); | 165 | hvlpevent_clear_valid(event); |
153 | } else if (hvlpevent_queue.hq_overflow_pending) | 166 | } else if (hvlpevent_queue.hq_overflow_pending) |
diff --git a/arch/powerpc/platforms/ps3/Kconfig b/arch/powerpc/platforms/ps3/Kconfig index 67144d1d1405..298f1c9679fb 100644 --- a/arch/powerpc/platforms/ps3/Kconfig +++ b/arch/powerpc/platforms/ps3/Kconfig | |||
@@ -91,7 +91,7 @@ config PS3_SYS_MANAGER | |||
91 | depends on PPC_PS3 | 91 | depends on PPC_PS3 |
92 | tristate "PS3 System Manager driver" if PS3_ADVANCED | 92 | tristate "PS3 System Manager driver" if PS3_ADVANCED |
93 | select PS3_VUART | 93 | select PS3_VUART |
94 | default m | 94 | default y |
95 | help | 95 | help |
96 | Include support for the PS3 System Manager. | 96 | Include support for the PS3 System Manager. |
97 | 97 | ||
diff --git a/arch/powerpc/sysdev/cpm2_common.c b/arch/powerpc/sysdev/cpm2_common.c index 859362fecb7c..c1d824032020 100644 --- a/arch/powerpc/sysdev/cpm2_common.c +++ b/arch/powerpc/sysdev/cpm2_common.c | |||
@@ -61,8 +61,7 @@ cpm2_map_t __iomem *cpm2_immr; | |||
61 | of space for CPM as it is larger | 61 | of space for CPM as it is larger |
62 | than on PQ2 */ | 62 | than on PQ2 */ |
63 | 63 | ||
64 | void | 64 | void __init cpm2_reset(void) |
65 | cpm2_reset(void) | ||
66 | { | 65 | { |
67 | #ifdef CONFIG_PPC_85xx | 66 | #ifdef CONFIG_PPC_85xx |
68 | cpm2_immr = ioremap(CPM_MAP_ADDR, CPM_MAP_SIZE); | 67 | cpm2_immr = ioremap(CPM_MAP_ADDR, CPM_MAP_SIZE); |
diff --git a/arch/sparc64/kernel/entry.S b/arch/sparc64/kernel/entry.S index c9b0d7af64ae..ea257e828364 100644 --- a/arch/sparc64/kernel/entry.S +++ b/arch/sparc64/kernel/entry.S | |||
@@ -2593,3 +2593,15 @@ sun4v_mmustat_info: | |||
2593 | retl | 2593 | retl |
2594 | nop | 2594 | nop |
2595 | .size sun4v_mmustat_info, .-sun4v_mmustat_info | 2595 | .size sun4v_mmustat_info, .-sun4v_mmustat_info |
2596 | |||
2597 | .globl sun4v_mmu_demap_all | ||
2598 | .type sun4v_mmu_demap_all,#function | ||
2599 | sun4v_mmu_demap_all: | ||
2600 | clr %o0 | ||
2601 | clr %o1 | ||
2602 | mov HV_MMU_ALL, %o2 | ||
2603 | mov HV_FAST_MMU_DEMAP_ALL, %o5 | ||
2604 | ta HV_FAST_TRAP | ||
2605 | retl | ||
2606 | nop | ||
2607 | .size sun4v_mmu_demap_all, .-sun4v_mmu_demap_all | ||
diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c index e18ccf85224f..fbeb55d71e76 100644 --- a/arch/sparc64/mm/init.c +++ b/arch/sparc64/mm/init.c | |||
@@ -1133,14 +1133,9 @@ static void __init mark_kpte_bitmap(unsigned long start, unsigned long end) | |||
1133 | } | 1133 | } |
1134 | } | 1134 | } |
1135 | 1135 | ||
1136 | static void __init kernel_physical_mapping_init(void) | 1136 | static void __init init_kpte_bitmap(void) |
1137 | { | 1137 | { |
1138 | unsigned long i; | 1138 | unsigned long i; |
1139 | #ifdef CONFIG_DEBUG_PAGEALLOC | ||
1140 | unsigned long mem_alloced = 0UL; | ||
1141 | #endif | ||
1142 | |||
1143 | read_obp_memory("reg", &pall[0], &pall_ents); | ||
1144 | 1139 | ||
1145 | for (i = 0; i < pall_ents; i++) { | 1140 | for (i = 0; i < pall_ents; i++) { |
1146 | unsigned long phys_start, phys_end; | 1141 | unsigned long phys_start, phys_end; |
@@ -1149,14 +1144,24 @@ static void __init kernel_physical_mapping_init(void) | |||
1149 | phys_end = phys_start + pall[i].reg_size; | 1144 | phys_end = phys_start + pall[i].reg_size; |
1150 | 1145 | ||
1151 | mark_kpte_bitmap(phys_start, phys_end); | 1146 | mark_kpte_bitmap(phys_start, phys_end); |
1147 | } | ||
1148 | } | ||
1152 | 1149 | ||
1150 | static void __init kernel_physical_mapping_init(void) | ||
1151 | { | ||
1153 | #ifdef CONFIG_DEBUG_PAGEALLOC | 1152 | #ifdef CONFIG_DEBUG_PAGEALLOC |
1153 | unsigned long i, mem_alloced = 0UL; | ||
1154 | |||
1155 | for (i = 0; i < pall_ents; i++) { | ||
1156 | unsigned long phys_start, phys_end; | ||
1157 | |||
1158 | phys_start = pall[i].phys_addr; | ||
1159 | phys_end = phys_start + pall[i].reg_size; | ||
1160 | |||
1154 | mem_alloced += kernel_map_range(phys_start, phys_end, | 1161 | mem_alloced += kernel_map_range(phys_start, phys_end, |
1155 | PAGE_KERNEL); | 1162 | PAGE_KERNEL); |
1156 | #endif | ||
1157 | } | 1163 | } |
1158 | 1164 | ||
1159 | #ifdef CONFIG_DEBUG_PAGEALLOC | ||
1160 | printk("Allocated %ld bytes for kernel page tables.\n", | 1165 | printk("Allocated %ld bytes for kernel page tables.\n", |
1161 | mem_alloced); | 1166 | mem_alloced); |
1162 | 1167 | ||
@@ -1398,6 +1403,10 @@ void __init paging_init(void) | |||
1398 | 1403 | ||
1399 | inherit_prom_mappings(); | 1404 | inherit_prom_mappings(); |
1400 | 1405 | ||
1406 | read_obp_memory("reg", &pall[0], &pall_ents); | ||
1407 | |||
1408 | init_kpte_bitmap(); | ||
1409 | |||
1401 | /* Ok, we can use our TLB miss and window trap handlers safely. */ | 1410 | /* Ok, we can use our TLB miss and window trap handlers safely. */ |
1402 | setup_tba(); | 1411 | setup_tba(); |
1403 | 1412 | ||
@@ -1904,7 +1913,9 @@ void __flush_tlb_all(void) | |||
1904 | "wrpr %0, %1, %%pstate" | 1913 | "wrpr %0, %1, %%pstate" |
1905 | : "=r" (pstate) | 1914 | : "=r" (pstate) |
1906 | : "i" (PSTATE_IE)); | 1915 | : "i" (PSTATE_IE)); |
1907 | if (tlb_type == spitfire) { | 1916 | if (tlb_type == hypervisor) { |
1917 | sun4v_mmu_demap_all(); | ||
1918 | } else if (tlb_type == spitfire) { | ||
1908 | for (i = 0; i < 64; i++) { | 1919 | for (i = 0; i < 64; i++) { |
1909 | /* Spitfire Errata #32 workaround */ | 1920 | /* Spitfire Errata #32 workaround */ |
1910 | /* NOTE: Always runs on spitfire, so no | 1921 | /* NOTE: Always runs on spitfire, so no |
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index 7d6be23eff89..8f7505d304b5 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c | |||
@@ -125,7 +125,7 @@ static int acpi_battery_technology(struct acpi_battery *battery) | |||
125 | return POWER_SUPPLY_TECHNOLOGY_NiMH; | 125 | return POWER_SUPPLY_TECHNOLOGY_NiMH; |
126 | if (!strcasecmp("LION", battery->type)) | 126 | if (!strcasecmp("LION", battery->type)) |
127 | return POWER_SUPPLY_TECHNOLOGY_LION; | 127 | return POWER_SUPPLY_TECHNOLOGY_LION; |
128 | if (!strcasecmp("LI-ION", battery->type)) | 128 | if (!strncasecmp("LI-ION", battery->type, 6)) |
129 | return POWER_SUPPLY_TECHNOLOGY_LION; | 129 | return POWER_SUPPLY_TECHNOLOGY_LION; |
130 | if (!strcasecmp("LiP", battery->type)) | 130 | if (!strcasecmp("LiP", battery->type)) |
131 | return POWER_SUPPLY_TECHNOLOGY_LIPO; | 131 | return POWER_SUPPLY_TECHNOLOGY_LIPO; |
diff --git a/drivers/acpi/numa.c b/drivers/acpi/numa.c index ab04d848b19d..0822d9fc1cb4 100644 --- a/drivers/acpi/numa.c +++ b/drivers/acpi/numa.c | |||
@@ -38,9 +38,9 @@ ACPI_MODULE_NAME("numa"); | |||
38 | static nodemask_t nodes_found_map = NODE_MASK_NONE; | 38 | static nodemask_t nodes_found_map = NODE_MASK_NONE; |
39 | 39 | ||
40 | /* maps to convert between proximity domain and logical node ID */ | 40 | /* maps to convert between proximity domain and logical node ID */ |
41 | static int __cpuinitdata pxm_to_node_map[MAX_PXM_DOMAINS] | 41 | static int pxm_to_node_map[MAX_PXM_DOMAINS] |
42 | = { [0 ... MAX_PXM_DOMAINS - 1] = NID_INVAL }; | 42 | = { [0 ... MAX_PXM_DOMAINS - 1] = NID_INVAL }; |
43 | static int __cpuinitdata node_to_pxm_map[MAX_NUMNODES] | 43 | static int node_to_pxm_map[MAX_NUMNODES] |
44 | = { [0 ... MAX_NUMNODES - 1] = PXM_INVAL }; | 44 | = { [0 ... MAX_NUMNODES - 1] = PXM_INVAL }; |
45 | 45 | ||
46 | int pxm_to_node(int pxm) | 46 | int pxm_to_node(int pxm) |
diff --git a/drivers/acpi/pci_bind.c b/drivers/acpi/pci_bind.c index 028969370bbf..388300de005d 100644 --- a/drivers/acpi/pci_bind.c +++ b/drivers/acpi/pci_bind.c | |||
@@ -294,9 +294,6 @@ int acpi_pci_unbind(struct acpi_device *device) | |||
294 | acpi_get_data(device->handle, acpi_pci_data_handler, | 294 | acpi_get_data(device->handle, acpi_pci_data_handler, |
295 | (void **)&data); | 295 | (void **)&data); |
296 | if (ACPI_FAILURE(status)) { | 296 | if (ACPI_FAILURE(status)) { |
297 | ACPI_EXCEPTION((AE_INFO, status, | ||
298 | "Unable to get data from device %s", | ||
299 | acpi_device_bid(device))); | ||
300 | result = -ENODEV; | 297 | result = -ENODEV; |
301 | goto end; | 298 | goto end; |
302 | } | 299 | } |
diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c index 6045cdbe176b..22cb95b349e4 100644 --- a/drivers/acpi/sbs.c +++ b/drivers/acpi/sbs.c | |||
@@ -54,12 +54,6 @@ | |||
54 | #define ACPI_BATTERY_DIR_NAME "BAT%i" | 54 | #define ACPI_BATTERY_DIR_NAME "BAT%i" |
55 | #define ACPI_AC_DIR_NAME "AC0" | 55 | #define ACPI_AC_DIR_NAME "AC0" |
56 | 56 | ||
57 | enum acpi_sbs_device_addr { | ||
58 | ACPI_SBS_CHARGER = 0x9, | ||
59 | ACPI_SBS_MANAGER = 0xa, | ||
60 | ACPI_SBS_BATTERY = 0xb, | ||
61 | }; | ||
62 | |||
63 | #define ACPI_SBS_NOTIFY_STATUS 0x80 | 57 | #define ACPI_SBS_NOTIFY_STATUS 0x80 |
64 | #define ACPI_SBS_NOTIFY_INFO 0x81 | 58 | #define ACPI_SBS_NOTIFY_INFO 0x81 |
65 | 59 | ||
@@ -539,7 +533,7 @@ static struct proc_dir_entry *acpi_battery_dir = NULL; | |||
539 | 533 | ||
540 | static inline char *acpi_battery_units(struct acpi_battery *battery) | 534 | static inline char *acpi_battery_units(struct acpi_battery *battery) |
541 | { | 535 | { |
542 | return acpi_battery_mode(battery) ? " mWh" : " mAh"; | 536 | return acpi_battery_mode(battery) ? " mW" : " mA"; |
543 | } | 537 | } |
544 | 538 | ||
545 | 539 | ||
@@ -556,10 +550,10 @@ static int acpi_battery_read_info(struct seq_file *seq, void *offset) | |||
556 | if (!battery->present) | 550 | if (!battery->present) |
557 | goto end; | 551 | goto end; |
558 | 552 | ||
559 | seq_printf(seq, "design capacity: %i%s\n", | 553 | seq_printf(seq, "design capacity: %i%sh\n", |
560 | battery->design_capacity * acpi_battery_scale(battery), | 554 | battery->design_capacity * acpi_battery_scale(battery), |
561 | acpi_battery_units(battery)); | 555 | acpi_battery_units(battery)); |
562 | seq_printf(seq, "last full capacity: %i%s\n", | 556 | seq_printf(seq, "last full capacity: %i%sh\n", |
563 | battery->full_charge_capacity * acpi_battery_scale(battery), | 557 | battery->full_charge_capacity * acpi_battery_scale(battery), |
564 | acpi_battery_units(battery)); | 558 | acpi_battery_units(battery)); |
565 | seq_printf(seq, "battery technology: rechargeable\n"); | 559 | seq_printf(seq, "battery technology: rechargeable\n"); |
@@ -590,7 +584,7 @@ static int acpi_battery_read_state(struct seq_file *seq, void *offset) | |||
590 | { | 584 | { |
591 | struct acpi_battery *battery = seq->private; | 585 | struct acpi_battery *battery = seq->private; |
592 | struct acpi_sbs *sbs = battery->sbs; | 586 | struct acpi_sbs *sbs = battery->sbs; |
593 | int result = 0; | 587 | int rate; |
594 | 588 | ||
595 | mutex_lock(&sbs->lock); | 589 | mutex_lock(&sbs->lock); |
596 | seq_printf(seq, "present: %s\n", | 590 | seq_printf(seq, "present: %s\n", |
@@ -604,9 +598,12 @@ static int acpi_battery_read_state(struct seq_file *seq, void *offset) | |||
604 | seq_printf(seq, "charging state: %s\n", | 598 | seq_printf(seq, "charging state: %s\n", |
605 | (battery->current_now < 0) ? "discharging" : | 599 | (battery->current_now < 0) ? "discharging" : |
606 | ((battery->current_now > 0) ? "charging" : "charged")); | 600 | ((battery->current_now > 0) ? "charging" : "charged")); |
607 | seq_printf(seq, "present rate: %d mA\n", | 601 | rate = abs(battery->current_now) * acpi_battery_ipscale(battery); |
608 | abs(battery->current_now) * acpi_battery_ipscale(battery)); | 602 | rate *= (acpi_battery_mode(battery))?(battery->voltage_now * |
609 | seq_printf(seq, "remaining capacity: %i%s\n", | 603 | acpi_battery_vscale(battery)/1000):1; |
604 | seq_printf(seq, "present rate: %d%s\n", rate, | ||
605 | acpi_battery_units(battery)); | ||
606 | seq_printf(seq, "remaining capacity: %i%sh\n", | ||
610 | battery->capacity_now * acpi_battery_scale(battery), | 607 | battery->capacity_now * acpi_battery_scale(battery), |
611 | acpi_battery_units(battery)); | 608 | acpi_battery_units(battery)); |
612 | seq_printf(seq, "present voltage: %i mV\n", | 609 | seq_printf(seq, "present voltage: %i mV\n", |
@@ -614,7 +611,7 @@ static int acpi_battery_read_state(struct seq_file *seq, void *offset) | |||
614 | 611 | ||
615 | end: | 612 | end: |
616 | mutex_unlock(&sbs->lock); | 613 | mutex_unlock(&sbs->lock); |
617 | return result; | 614 | return 0; |
618 | } | 615 | } |
619 | 616 | ||
620 | static int acpi_battery_state_open_fs(struct inode *inode, struct file *file) | 617 | static int acpi_battery_state_open_fs(struct inode *inode, struct file *file) |
@@ -638,7 +635,7 @@ static int acpi_battery_read_alarm(struct seq_file *seq, void *offset) | |||
638 | acpi_battery_get_alarm(battery); | 635 | acpi_battery_get_alarm(battery); |
639 | seq_printf(seq, "alarm: "); | 636 | seq_printf(seq, "alarm: "); |
640 | if (battery->alarm_capacity) | 637 | if (battery->alarm_capacity) |
641 | seq_printf(seq, "%i%s\n", | 638 | seq_printf(seq, "%i%sh\n", |
642 | battery->alarm_capacity * | 639 | battery->alarm_capacity * |
643 | acpi_battery_scale(battery), | 640 | acpi_battery_scale(battery), |
644 | acpi_battery_units(battery)); | 641 | acpi_battery_units(battery)); |
diff --git a/drivers/acpi/sbshc.c b/drivers/acpi/sbshc.c index 046d7c3ed356..fd40b6a1d639 100644 --- a/drivers/acpi/sbshc.c +++ b/drivers/acpi/sbshc.c | |||
@@ -202,10 +202,9 @@ int acpi_smbus_unregister_callback(struct acpi_smb_hc *hc) | |||
202 | 202 | ||
203 | EXPORT_SYMBOL_GPL(acpi_smbus_unregister_callback); | 203 | EXPORT_SYMBOL_GPL(acpi_smbus_unregister_callback); |
204 | 204 | ||
205 | static void acpi_smbus_callback(void *context) | 205 | static inline void acpi_smbus_callback(void *context) |
206 | { | 206 | { |
207 | struct acpi_smb_hc *hc = context; | 207 | struct acpi_smb_hc *hc = context; |
208 | |||
209 | if (hc->callback) | 208 | if (hc->callback) |
210 | hc->callback(hc->context); | 209 | hc->callback(hc->context); |
211 | } | 210 | } |
@@ -214,6 +213,7 @@ static int smbus_alarm(void *context) | |||
214 | { | 213 | { |
215 | struct acpi_smb_hc *hc = context; | 214 | struct acpi_smb_hc *hc = context; |
216 | union acpi_smb_status status; | 215 | union acpi_smb_status status; |
216 | u8 address; | ||
217 | if (smb_hc_read(hc, ACPI_SMB_STATUS, &status.raw)) | 217 | if (smb_hc_read(hc, ACPI_SMB_STATUS, &status.raw)) |
218 | return 0; | 218 | return 0; |
219 | /* Check if it is only a completion notify */ | 219 | /* Check if it is only a completion notify */ |
@@ -222,9 +222,18 @@ static int smbus_alarm(void *context) | |||
222 | if (!status.fields.alarm) | 222 | if (!status.fields.alarm) |
223 | return 0; | 223 | return 0; |
224 | mutex_lock(&hc->lock); | 224 | mutex_lock(&hc->lock); |
225 | smb_hc_read(hc, ACPI_SMB_ALARM_ADDRESS, &address); | ||
226 | status.fields.alarm = 0; | ||
225 | smb_hc_write(hc, ACPI_SMB_STATUS, status.raw); | 227 | smb_hc_write(hc, ACPI_SMB_STATUS, status.raw); |
226 | if (hc->callback) | 228 | /* We are only interested in events coming from known devices */ |
227 | acpi_os_execute(OSL_GPE_HANDLER, acpi_smbus_callback, hc); | 229 | switch (address >> 1) { |
230 | case ACPI_SBS_CHARGER: | ||
231 | case ACPI_SBS_MANAGER: | ||
232 | case ACPI_SBS_BATTERY: | ||
233 | acpi_os_execute(OSL_GPE_HANDLER, | ||
234 | acpi_smbus_callback, hc); | ||
235 | default:; | ||
236 | } | ||
228 | mutex_unlock(&hc->lock); | 237 | mutex_unlock(&hc->lock); |
229 | return 0; | 238 | return 0; |
230 | } | 239 | } |
diff --git a/drivers/acpi/sbshc.h b/drivers/acpi/sbshc.h index 3bda3491a97b..a57b0762dd7f 100644 --- a/drivers/acpi/sbshc.h +++ b/drivers/acpi/sbshc.h | |||
@@ -16,6 +16,12 @@ enum acpi_smb_protocol { | |||
16 | 16 | ||
17 | static const u8 SMBUS_PEC = 0x80; | 17 | static const u8 SMBUS_PEC = 0x80; |
18 | 18 | ||
19 | enum acpi_sbs_device_addr { | ||
20 | ACPI_SBS_CHARGER = 0x9, | ||
21 | ACPI_SBS_MANAGER = 0xa, | ||
22 | ACPI_SBS_BATTERY = 0xb, | ||
23 | }; | ||
24 | |||
19 | typedef void (*smbus_alarm_callback)(void *context); | 25 | typedef void (*smbus_alarm_callback)(void *context); |
20 | 26 | ||
21 | extern int acpi_smbus_read(struct acpi_smb_hc *hc, u8 protocol, u8 address, | 27 | extern int acpi_smbus_read(struct acpi_smb_hc *hc, u8 protocol, u8 address, |
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index 44a0d9ba9bd6..bd77e81e81c1 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c | |||
@@ -577,7 +577,7 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device) | |||
577 | struct acpi_video_device_brightness *br = NULL; | 577 | struct acpi_video_device_brightness *br = NULL; |
578 | 578 | ||
579 | 579 | ||
580 | memset(&device->cap, 0, 4); | 580 | memset(&device->cap, 0, sizeof(device->cap)); |
581 | 581 | ||
582 | if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle, "_ADR", &h_dummy1))) { | 582 | if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle, "_ADR", &h_dummy1))) { |
583 | device->cap._ADR = 1; | 583 | device->cap._ADR = 1; |
@@ -697,7 +697,7 @@ static void acpi_video_bus_find_cap(struct acpi_video_bus *video) | |||
697 | { | 697 | { |
698 | acpi_handle h_dummy1; | 698 | acpi_handle h_dummy1; |
699 | 699 | ||
700 | memset(&video->cap, 0, 4); | 700 | memset(&video->cap, 0, sizeof(video->cap)); |
701 | if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_DOS", &h_dummy1))) { | 701 | if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_DOS", &h_dummy1))) { |
702 | video->cap._DOS = 1; | 702 | video->cap._DOS = 1; |
703 | } | 703 | } |
diff --git a/drivers/atm/fore200e.c b/drivers/atm/fore200e.c index 8b12925fe7a4..f97e050338f0 100644 --- a/drivers/atm/fore200e.c +++ b/drivers/atm/fore200e.c | |||
@@ -2689,7 +2689,7 @@ fore200e_init(struct fore200e* fore200e) | |||
2689 | return 0; | 2689 | return 0; |
2690 | } | 2690 | } |
2691 | 2691 | ||
2692 | 2692 | #ifdef CONFIG_ATM_FORE200E_PCA | |
2693 | static int __devinit | 2693 | static int __devinit |
2694 | fore200e_pca_detect(struct pci_dev *pci_dev, const struct pci_device_id *pci_ent) | 2694 | fore200e_pca_detect(struct pci_dev *pci_dev, const struct pci_device_id *pci_ent) |
2695 | { | 2695 | { |
@@ -2756,7 +2756,6 @@ static void __devexit fore200e_pca_remove_one(struct pci_dev *pci_dev) | |||
2756 | } | 2756 | } |
2757 | 2757 | ||
2758 | 2758 | ||
2759 | #ifdef CONFIG_ATM_FORE200E_PCA | ||
2760 | static struct pci_device_id fore200e_pca_tbl[] = { | 2759 | static struct pci_device_id fore200e_pca_tbl[] = { |
2761 | { PCI_VENDOR_ID_FORE, PCI_DEVICE_ID_FORE_PCA200E, PCI_ANY_ID, PCI_ANY_ID, | 2760 | { PCI_VENDOR_ID_FORE, PCI_DEVICE_ID_FORE_PCA200E, PCI_ANY_ID, PCI_ANY_ID, |
2762 | 0, 0, (unsigned long) &fore200e_bus[0] }, | 2761 | 0, 0, (unsigned long) &fore200e_bus[0] }, |
diff --git a/drivers/char/ipmi/ipmi_watchdog.c b/drivers/char/ipmi/ipmi_watchdog.c index e686fc925168..8f45ca9235ad 100644 --- a/drivers/char/ipmi/ipmi_watchdog.c +++ b/drivers/char/ipmi/ipmi_watchdog.c | |||
@@ -669,6 +669,7 @@ static int ipmi_ioctl(struct inode *inode, struct file *file, | |||
669 | return 0; | 669 | return 0; |
670 | 670 | ||
671 | case WDIOC_SET_PRETIMEOUT: | 671 | case WDIOC_SET_PRETIMEOUT: |
672 | case WDIOC_SETPRETIMEOUT: | ||
672 | i = copy_from_user(&val, argp, sizeof(int)); | 673 | i = copy_from_user(&val, argp, sizeof(int)); |
673 | if (i) | 674 | if (i) |
674 | return -EFAULT; | 675 | return -EFAULT; |
@@ -676,6 +677,7 @@ static int ipmi_ioctl(struct inode *inode, struct file *file, | |||
676 | return ipmi_set_timeout(IPMI_SET_TIMEOUT_HB_IF_NECESSARY); | 677 | return ipmi_set_timeout(IPMI_SET_TIMEOUT_HB_IF_NECESSARY); |
677 | 678 | ||
678 | case WDIOC_GET_PRETIMEOUT: | 679 | case WDIOC_GET_PRETIMEOUT: |
680 | case WDIOC_GETPRETIMEOUT: | ||
679 | i = copy_to_user(argp, &pretimeout, sizeof(pretimeout)); | 681 | i = copy_to_user(argp, &pretimeout, sizeof(pretimeout)); |
680 | if (i) | 682 | if (i) |
681 | return -EFAULT; | 683 | return -EFAULT; |
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig index 45b22282f149..fb06555708a8 100644 --- a/drivers/ide/Kconfig +++ b/drivers/ide/Kconfig | |||
@@ -390,7 +390,7 @@ config IDEPCI_PCIBUS_ORDER | |||
390 | 390 | ||
391 | # TODO: split it on per host driver config options (or module parameters) | 391 | # TODO: split it on per host driver config options (or module parameters) |
392 | config BLK_DEV_OFFBOARD | 392 | config BLK_DEV_OFFBOARD |
393 | bool "Boot off-board chipsets first support" | 393 | bool "Boot off-board chipsets first support (DEPRECATED)" |
394 | depends on BLK_DEV_IDEPCI && (BLK_DEV_AEC62XX || BLK_DEV_GENERIC || BLK_DEV_HPT34X || BLK_DEV_HPT366 || BLK_DEV_PDC202XX_NEW || BLK_DEV_PDC202XX_OLD || BLK_DEV_TC86C001) | 394 | depends on BLK_DEV_IDEPCI && (BLK_DEV_AEC62XX || BLK_DEV_GENERIC || BLK_DEV_HPT34X || BLK_DEV_HPT366 || BLK_DEV_PDC202XX_NEW || BLK_DEV_PDC202XX_OLD || BLK_DEV_TC86C001) |
395 | help | 395 | help |
396 | Normally, IDE controllers built into the motherboard (on-board | 396 | Normally, IDE controllers built into the motherboard (on-board |
@@ -410,6 +410,10 @@ config BLK_DEV_OFFBOARD | |||
410 | Note that, if you do this, the order of the hd* devices will be | 410 | Note that, if you do this, the order of the hd* devices will be |
411 | rearranged which may require modification of fstab and other files. | 411 | rearranged which may require modification of fstab and other files. |
412 | 412 | ||
413 | Please also note that this method of assuring stable naming of | ||
414 | IDE devices is unreliable and use other means for achieving it | ||
415 | (i.e. udev). | ||
416 | |||
413 | If in doubt, say N. | 417 | If in doubt, say N. |
414 | 418 | ||
415 | config BLK_DEV_GENERIC | 419 | config BLK_DEV_GENERIC |
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index 57a5f63d6ae3..92ac658dac33 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c | |||
@@ -1650,31 +1650,6 @@ static int cdrom_write_check_ireason(ide_drive_t *drive, int len, int ireason) | |||
1650 | return 1; | 1650 | return 1; |
1651 | } | 1651 | } |
1652 | 1652 | ||
1653 | static void post_transform_command(struct request *req) | ||
1654 | { | ||
1655 | u8 *c = req->cmd; | ||
1656 | char *ibuf; | ||
1657 | |||
1658 | if (!blk_pc_request(req)) | ||
1659 | return; | ||
1660 | |||
1661 | if (req->bio) | ||
1662 | ibuf = bio_data(req->bio); | ||
1663 | else | ||
1664 | ibuf = req->data; | ||
1665 | |||
1666 | if (!ibuf) | ||
1667 | return; | ||
1668 | |||
1669 | /* | ||
1670 | * set ansi-revision and response data as atapi | ||
1671 | */ | ||
1672 | if (c[0] == GPCMD_INQUIRY) { | ||
1673 | ibuf[2] |= 2; | ||
1674 | ibuf[3] = (ibuf[3] & 0xf0) | 2; | ||
1675 | } | ||
1676 | } | ||
1677 | |||
1678 | typedef void (xfer_func_t)(ide_drive_t *, void *, u32); | 1653 | typedef void (xfer_func_t)(ide_drive_t *, void *, u32); |
1679 | 1654 | ||
1680 | /* | 1655 | /* |
@@ -1810,9 +1785,6 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive) | |||
1810 | return ide_started; | 1785 | return ide_started; |
1811 | 1786 | ||
1812 | end_request: | 1787 | end_request: |
1813 | if (!rq->data_len) | ||
1814 | post_transform_command(rq); | ||
1815 | |||
1816 | spin_lock_irqsave(&ide_lock, flags); | 1788 | spin_lock_irqsave(&ide_lock, flags); |
1817 | blkdev_dequeue_request(rq); | 1789 | blkdev_dequeue_request(rq); |
1818 | end_that_request_last(rq, 1); | 1790 | end_that_request_last(rq, 1); |
@@ -3049,12 +3021,7 @@ int ide_cdrom_probe_capabilities (ide_drive_t *drive) | |||
3049 | else | 3021 | else |
3050 | printk(" drive"); | 3022 | printk(" drive"); |
3051 | 3023 | ||
3052 | printk(", %dkB Cache", be16_to_cpu(cap.buffer_size)); | 3024 | printk(KERN_CONT ", %dkB Cache\n", be16_to_cpu(cap.buffer_size)); |
3053 | |||
3054 | if (drive->using_dma) | ||
3055 | ide_dma_verbose(drive); | ||
3056 | |||
3057 | printk("\n"); | ||
3058 | 3025 | ||
3059 | return nslots; | 3026 | return nslots; |
3060 | } | 3027 | } |
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c index 00123d99527a..b1781908e1f2 100644 --- a/drivers/ide/ide-disk.c +++ b/drivers/ide/ide-disk.c | |||
@@ -13,32 +13,6 @@ | |||
13 | * and Andre Hedrick <andre@linux-ide.org> | 13 | * and Andre Hedrick <andre@linux-ide.org> |
14 | * | 14 | * |
15 | * This is the IDE/ATA disk driver, as evolved from hd.c and ide.c. | 15 | * This is the IDE/ATA disk driver, as evolved from hd.c and ide.c. |
16 | * | ||
17 | * Version 1.00 move disk only code from ide.c to ide-disk.c | ||
18 | * support optional byte-swapping of all data | ||
19 | * Version 1.01 fix previous byte-swapping code | ||
20 | * Version 1.02 remove ", LBA" from drive identification msgs | ||
21 | * Version 1.03 fix display of id->buf_size for big-endian | ||
22 | * Version 1.04 add /proc configurable settings and S.M.A.R.T support | ||
23 | * Version 1.05 add capacity support for ATA3 >= 8GB | ||
24 | * Version 1.06 get boot-up messages to show full cyl count | ||
25 | * Version 1.07 disable door-locking if it fails | ||
26 | * Version 1.08 fixed CHS/LBA translations for ATA4 > 8GB, | ||
27 | * process of adding new ATA4 compliance. | ||
28 | * fixed problems in allowing fdisk to see | ||
29 | * the entire disk. | ||
30 | * Version 1.09 added increment of rq->sector in ide_multwrite | ||
31 | * added UDMA 3/4 reporting | ||
32 | * Version 1.10 request queue changes, Ultra DMA 100 | ||
33 | * Version 1.11 added 48-bit lba | ||
34 | * Version 1.12 adding taskfile io access method | ||
35 | * Version 1.13 added standby and flush-cache for notifier | ||
36 | * Version 1.14 added acoustic-wcache | ||
37 | * Version 1.15 convert all calls to ide_raw_taskfile | ||
38 | * since args will return register content. | ||
39 | * Version 1.16 added suspend-resume-checkpower | ||
40 | * Version 1.17 do flush on standby, do flush on ATA < ATA6 | ||
41 | * fix wcache setup. | ||
42 | */ | 16 | */ |
43 | 17 | ||
44 | #define IDEDISK_VERSION "1.18" | 18 | #define IDEDISK_VERSION "1.18" |
@@ -961,11 +935,8 @@ static void idedisk_setup (ide_drive_t *drive) | |||
961 | if (id->buf_size) | 935 | if (id->buf_size) |
962 | printk (" w/%dKiB Cache", id->buf_size/2); | 936 | printk (" w/%dKiB Cache", id->buf_size/2); |
963 | 937 | ||
964 | printk(", CHS=%d/%d/%d", | 938 | printk(KERN_CONT ", CHS=%d/%d/%d\n", |
965 | drive->bios_cyl, drive->bios_head, drive->bios_sect); | 939 | drive->bios_cyl, drive->bios_head, drive->bios_sect); |
966 | if (drive->using_dma) | ||
967 | ide_dma_verbose(drive); | ||
968 | printk("\n"); | ||
969 | 940 | ||
970 | /* write cache enabled? */ | 941 | /* write cache enabled? */ |
971 | if ((id->csfo & 1) || (id->cfs_enable_1 & (1 << 5))) | 942 | if ((id->csfo & 1) || (id->cfs_enable_1 & (1 << 5))) |
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c index 0d795a1678c7..4703837bf1fc 100644 --- a/drivers/ide/ide-dma.c +++ b/drivers/ide/ide-dma.c | |||
@@ -611,12 +611,6 @@ static int __ide_dma_test_irq(ide_drive_t *drive) | |||
611 | ide_hwif_t *hwif = HWIF(drive); | 611 | ide_hwif_t *hwif = HWIF(drive); |
612 | u8 dma_stat = hwif->INB(hwif->dma_status); | 612 | u8 dma_stat = hwif->INB(hwif->dma_status); |
613 | 613 | ||
614 | #if 0 /* do not set unless you know what you are doing */ | ||
615 | if (dma_stat & 4) { | ||
616 | u8 stat = hwif->INB(IDE_STATUS_REG); | ||
617 | hwif->OUTB(hwif->dma_status, dma_stat & 0xE4); | ||
618 | } | ||
619 | #endif | ||
620 | /* return 1 if INTR asserted */ | 614 | /* return 1 if INTR asserted */ |
621 | if ((dma_stat & 4) == 4) | 615 | if ((dma_stat & 4) == 4) |
622 | return 1; | 616 | return 1; |
@@ -753,10 +747,12 @@ u8 ide_find_dma_mode(ide_drive_t *drive, u8 req_mode) | |||
753 | mode = XFER_MW_DMA_1; | 747 | mode = XFER_MW_DMA_1; |
754 | } | 748 | } |
755 | 749 | ||
756 | printk(KERN_DEBUG "%s: %s mode selected\n", drive->name, | 750 | mode = min(mode, req_mode); |
751 | |||
752 | printk(KERN_INFO "%s: %s mode selected\n", drive->name, | ||
757 | mode ? ide_xfer_verbose(mode) : "no DMA"); | 753 | mode ? ide_xfer_verbose(mode) : "no DMA"); |
758 | 754 | ||
759 | return min(mode, req_mode); | 755 | return mode; |
760 | } | 756 | } |
761 | 757 | ||
762 | EXPORT_SYMBOL_GPL(ide_find_dma_mode); | 758 | EXPORT_SYMBOL_GPL(ide_find_dma_mode); |
@@ -772,6 +768,9 @@ static int ide_tune_dma(ide_drive_t *drive) | |||
772 | if (__ide_dma_bad_drive(drive)) | 768 | if (__ide_dma_bad_drive(drive)) |
773 | return 0; | 769 | return 0; |
774 | 770 | ||
771 | if (ide_id_dma_bug(drive)) | ||
772 | return 0; | ||
773 | |||
775 | if (drive->hwif->host_flags & IDE_HFLAG_TRUST_BIOS_FOR_DMA) | 774 | if (drive->hwif->host_flags & IDE_HFLAG_TRUST_BIOS_FOR_DMA) |
776 | return config_drive_for_dma(drive); | 775 | return config_drive_for_dma(drive); |
777 | 776 | ||
@@ -806,58 +805,23 @@ static int ide_dma_check(ide_drive_t *drive) | |||
806 | return vdma ? 0 : -1; | 805 | return vdma ? 0 : -1; |
807 | } | 806 | } |
808 | 807 | ||
809 | void ide_dma_verbose(ide_drive_t *drive) | 808 | int ide_id_dma_bug(ide_drive_t *drive) |
810 | { | 809 | { |
811 | struct hd_driveid *id = drive->id; | 810 | struct hd_driveid *id = drive->id; |
812 | ide_hwif_t *hwif = HWIF(drive); | ||
813 | 811 | ||
814 | if (id->field_valid & 4) { | 812 | if (id->field_valid & 4) { |
815 | if ((id->dma_ultra >> 8) && (id->dma_mword >> 8)) | 813 | if ((id->dma_ultra >> 8) && (id->dma_mword >> 8)) |
816 | goto bug_dma_off; | 814 | goto err_out; |
817 | if (id->dma_ultra & ((id->dma_ultra >> 8) & hwif->ultra_mask)) { | ||
818 | if (((id->dma_ultra >> 11) & 0x1F) && | ||
819 | eighty_ninty_three(drive)) { | ||
820 | if ((id->dma_ultra >> 15) & 1) { | ||
821 | printk(", UDMA(mode 7)"); | ||
822 | } else if ((id->dma_ultra >> 14) & 1) { | ||
823 | printk(", UDMA(133)"); | ||
824 | } else if ((id->dma_ultra >> 13) & 1) { | ||
825 | printk(", UDMA(100)"); | ||
826 | } else if ((id->dma_ultra >> 12) & 1) { | ||
827 | printk(", UDMA(66)"); | ||
828 | } else if ((id->dma_ultra >> 11) & 1) { | ||
829 | printk(", UDMA(44)"); | ||
830 | } else | ||
831 | goto mode_two; | ||
832 | } else { | ||
833 | mode_two: | ||
834 | if ((id->dma_ultra >> 10) & 1) { | ||
835 | printk(", UDMA(33)"); | ||
836 | } else if ((id->dma_ultra >> 9) & 1) { | ||
837 | printk(", UDMA(25)"); | ||
838 | } else if ((id->dma_ultra >> 8) & 1) { | ||
839 | printk(", UDMA(16)"); | ||
840 | } | ||
841 | } | ||
842 | } else { | ||
843 | printk(", (U)DMA"); /* Can be BIOS-enabled! */ | ||
844 | } | ||
845 | } else if (id->field_valid & 2) { | 815 | } else if (id->field_valid & 2) { |
846 | if ((id->dma_mword >> 8) && (id->dma_1word >> 8)) | 816 | if ((id->dma_mword >> 8) && (id->dma_1word >> 8)) |
847 | goto bug_dma_off; | 817 | goto err_out; |
848 | printk(", DMA"); | ||
849 | } else if (id->field_valid & 1) { | ||
850 | goto bug_dma_off; | ||
851 | } | 818 | } |
852 | return; | 819 | return 0; |
853 | bug_dma_off: | 820 | err_out: |
854 | printk(", BUG DMA OFF"); | 821 | printk(KERN_ERR "%s: bad DMA info in identify block\n", drive->name); |
855 | hwif->dma_off_quietly(drive); | 822 | return 1; |
856 | return; | ||
857 | } | 823 | } |
858 | 824 | ||
859 | EXPORT_SYMBOL(ide_dma_verbose); | ||
860 | |||
861 | int ide_set_dma(ide_drive_t *drive) | 825 | int ide_set_dma(ide_drive_t *drive) |
862 | { | 826 | { |
863 | ide_hwif_t *hwif = drive->hwif; | 827 | ide_hwif_t *hwif = drive->hwif; |
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c index db22d1ff4e55..bef781fec500 100644 --- a/drivers/ide/ide-io.c +++ b/drivers/ide/ide-io.c | |||
@@ -970,7 +970,8 @@ static void ide_check_pm_state(ide_drive_t *drive, struct request *rq) | |||
970 | if (rc) | 970 | if (rc) |
971 | printk(KERN_WARNING "%s: bus not ready on wakeup\n", drive->name); | 971 | printk(KERN_WARNING "%s: bus not ready on wakeup\n", drive->name); |
972 | SELECT_DRIVE(drive); | 972 | SELECT_DRIVE(drive); |
973 | HWIF(drive)->OUTB(8, HWIF(drive)->io_ports[IDE_CONTROL_OFFSET]); | 973 | if (IDE_CONTROL_REG) |
974 | HWIF(drive)->OUTB(drive->ctl, IDE_CONTROL_REG); | ||
974 | rc = ide_wait_not_busy(HWIF(drive), 100000); | 975 | rc = ide_wait_not_busy(HWIF(drive), 100000); |
975 | if (rc) | 976 | if (rc) |
976 | printk(KERN_WARNING "%s: drive not ready on wakeup\n", drive->name); | 977 | printk(KERN_WARNING "%s: drive not ready on wakeup\n", drive->name); |
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c index 5c3256180ae5..cef405ddaf0e 100644 --- a/drivers/ide/ide-iops.c +++ b/drivers/ide/ide-iops.c | |||
@@ -748,6 +748,9 @@ int ide_driveid_update(ide_drive_t *drive) | |||
748 | drive->id->dma_1word = id->dma_1word; | 748 | drive->id->dma_1word = id->dma_1word; |
749 | /* anything more ? */ | 749 | /* anything more ? */ |
750 | kfree(id); | 750 | kfree(id); |
751 | |||
752 | if (drive->using_dma && ide_id_dma_bug(drive)) | ||
753 | ide_dma_off(drive); | ||
751 | } | 754 | } |
752 | 755 | ||
753 | return 1; | 756 | return 1; |
diff --git a/drivers/ide/ide-lib.c b/drivers/ide/ide-lib.c index 1609b8604f56..062d3bcb2471 100644 --- a/drivers/ide/ide-lib.c +++ b/drivers/ide/ide-lib.c | |||
@@ -29,41 +29,44 @@ | |||
29 | * Add common non I/O op stuff here. Make sure it has proper | 29 | * Add common non I/O op stuff here. Make sure it has proper |
30 | * kernel-doc function headers or your patch will be rejected | 30 | * kernel-doc function headers or your patch will be rejected |
31 | */ | 31 | */ |
32 | 32 | ||
33 | static const char *udma_str[] = | ||
34 | { "UDMA/16", "UDMA/25", "UDMA/33", "UDMA/44", | ||
35 | "UDMA/66", "UDMA/100", "UDMA/133", "UDMA7" }; | ||
36 | static const char *mwdma_str[] = | ||
37 | { "MWDMA0", "MWDMA1", "MWDMA2" }; | ||
38 | static const char *swdma_str[] = | ||
39 | { "SWDMA0", "SWDMA1", "SWDMA2" }; | ||
40 | static const char *pio_str[] = | ||
41 | { "PIO0", "PIO1", "PIO2", "PIO3", "PIO4", "PIO5" }; | ||
33 | 42 | ||
34 | /** | 43 | /** |
35 | * ide_xfer_verbose - return IDE mode names | 44 | * ide_xfer_verbose - return IDE mode names |
36 | * @xfer_rate: rate to name | 45 | * @mode: transfer mode |
37 | * | 46 | * |
38 | * Returns a constant string giving the name of the mode | 47 | * Returns a constant string giving the name of the mode |
39 | * requested. | 48 | * requested. |
40 | */ | 49 | */ |
41 | 50 | ||
42 | char *ide_xfer_verbose (u8 xfer_rate) | 51 | const char *ide_xfer_verbose(u8 mode) |
43 | { | 52 | { |
44 | switch(xfer_rate) { | 53 | const char *s; |
45 | case XFER_UDMA_7: return("UDMA 7"); | 54 | u8 i = mode & 0xf; |
46 | case XFER_UDMA_6: return("UDMA 6"); | 55 | |
47 | case XFER_UDMA_5: return("UDMA 5"); | 56 | if (mode >= XFER_UDMA_0 && mode <= XFER_UDMA_7) |
48 | case XFER_UDMA_4: return("UDMA 4"); | 57 | s = udma_str[i]; |
49 | case XFER_UDMA_3: return("UDMA 3"); | 58 | else if (mode >= XFER_MW_DMA_0 && mode <= XFER_MW_DMA_2) |
50 | case XFER_UDMA_2: return("UDMA 2"); | 59 | s = mwdma_str[i]; |
51 | case XFER_UDMA_1: return("UDMA 1"); | 60 | else if (mode >= XFER_SW_DMA_0 && mode <= XFER_SW_DMA_2) |
52 | case XFER_UDMA_0: return("UDMA 0"); | 61 | s = swdma_str[i]; |
53 | case XFER_MW_DMA_2: return("MW DMA 2"); | 62 | else if (mode >= XFER_PIO_0 && mode <= XFER_PIO_5) |
54 | case XFER_MW_DMA_1: return("MW DMA 1"); | 63 | s = pio_str[i & 0x7]; |
55 | case XFER_MW_DMA_0: return("MW DMA 0"); | 64 | else if (mode == XFER_PIO_SLOW) |
56 | case XFER_SW_DMA_2: return("SW DMA 2"); | 65 | s = "PIO SLOW"; |
57 | case XFER_SW_DMA_1: return("SW DMA 1"); | 66 | else |
58 | case XFER_SW_DMA_0: return("SW DMA 0"); | 67 | s = "XFER ERROR"; |
59 | case XFER_PIO_4: return("PIO 4"); | 68 | |
60 | case XFER_PIO_3: return("PIO 3"); | 69 | return s; |
61 | case XFER_PIO_2: return("PIO 2"); | ||
62 | case XFER_PIO_1: return("PIO 1"); | ||
63 | case XFER_PIO_0: return("PIO 0"); | ||
64 | case XFER_PIO_SLOW: return("PIO SLOW"); | ||
65 | default: return("XFER ERROR"); | ||
66 | } | ||
67 | } | 70 | } |
68 | 71 | ||
69 | EXPORT_SYMBOL(ide_xfer_verbose); | 72 | EXPORT_SYMBOL(ide_xfer_verbose); |
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index ee848c705995..2994523be7bf 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c | |||
@@ -13,22 +13,8 @@ | |||
13 | * | 13 | * |
14 | * This is the IDE probe module, as evolved from hd.c and ide.c. | 14 | * This is the IDE probe module, as evolved from hd.c and ide.c. |
15 | * | 15 | * |
16 | * Version 1.00 move drive probing code from ide.c to ide-probe.c | 16 | * -- increase WAIT_PIDENTIFY to avoid CD-ROM locking at boot |
17 | * Version 1.01 fix compilation problem for m68k | 17 | * by Andrea Arcangeli |
18 | * Version 1.02 increase WAIT_PIDENTIFY to avoid CD-ROM locking at boot | ||
19 | * by Andrea Arcangeli | ||
20 | * Version 1.03 fix for (hwif->chipset == ide_4drives) | ||
21 | * Version 1.04 fixed buggy treatments of known flash memory cards | ||
22 | * | ||
23 | * Version 1.05 fix for (hwif->chipset == ide_pdc4030) | ||
24 | * added ide6/7/8/9 | ||
25 | * allowed for secondary flash card to be detectable | ||
26 | * with new flag : drive->ata_flash : 1; | ||
27 | * Version 1.06 stream line request queue and prep for cascade project. | ||
28 | * Version 1.07 max_sect <= 255; slower disks would get behind and | ||
29 | * then fall over when they get to 256. Paul G. | ||
30 | * Version 1.10 Update set for new IDE. drive->id is now always | ||
31 | * valid after probe time even with noprobe | ||
32 | */ | 18 | */ |
33 | 19 | ||
34 | #include <linux/module.h> | 20 | #include <linux/module.h> |
@@ -667,7 +653,8 @@ static int wait_hwif_ready(ide_hwif_t *hwif) | |||
667 | /* Ignore disks that we will not probe for later. */ | 653 | /* Ignore disks that we will not probe for later. */ |
668 | if (!drive->noprobe || drive->present) { | 654 | if (!drive->noprobe || drive->present) { |
669 | SELECT_DRIVE(drive); | 655 | SELECT_DRIVE(drive); |
670 | hwif->OUTB(8, hwif->io_ports[IDE_CONTROL_OFFSET]); | 656 | if (IDE_CONTROL_REG) |
657 | hwif->OUTB(drive->ctl, IDE_CONTROL_REG); | ||
671 | mdelay(2); | 658 | mdelay(2); |
672 | rc = ide_wait_not_busy(hwif, 35000); | 659 | rc = ide_wait_not_busy(hwif, 35000); |
673 | if (rc) | 660 | if (rc) |
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index 674a65c1a130..54943da6e4e5 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c | |||
@@ -800,11 +800,17 @@ int set_io_32bit(ide_drive_t *drive, int arg) | |||
800 | if (arg < 0 || arg > 1 + (SUPPORT_VLB_SYNC << 1)) | 800 | if (arg < 0 || arg > 1 + (SUPPORT_VLB_SYNC << 1)) |
801 | return -EINVAL; | 801 | return -EINVAL; |
802 | 802 | ||
803 | if (ide_spin_wait_hwgroup(drive)) | ||
804 | return -EBUSY; | ||
805 | |||
803 | drive->io_32bit = arg; | 806 | drive->io_32bit = arg; |
804 | #ifdef CONFIG_BLK_DEV_DTC2278 | 807 | #ifdef CONFIG_BLK_DEV_DTC2278 |
805 | if (HWIF(drive)->chipset == ide_dtc2278) | 808 | if (HWIF(drive)->chipset == ide_dtc2278) |
806 | HWIF(drive)->drives[!drive->select.b.unit].io_32bit = arg; | 809 | HWIF(drive)->drives[!drive->select.b.unit].io_32bit = arg; |
807 | #endif /* CONFIG_BLK_DEV_DTC2278 */ | 810 | #endif /* CONFIG_BLK_DEV_DTC2278 */ |
811 | |||
812 | spin_unlock_irq(&ide_lock); | ||
813 | |||
808 | return 0; | 814 | return 0; |
809 | } | 815 | } |
810 | 816 | ||
@@ -1670,10 +1676,34 @@ static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, | |||
1670 | return sprintf(buf, "ide:m-%s\n", media_string(drive)); | 1676 | return sprintf(buf, "ide:m-%s\n", media_string(drive)); |
1671 | } | 1677 | } |
1672 | 1678 | ||
1679 | static ssize_t model_show(struct device *dev, struct device_attribute *attr, | ||
1680 | char *buf) | ||
1681 | { | ||
1682 | ide_drive_t *drive = to_ide_device(dev); | ||
1683 | return sprintf(buf, "%s\n", drive->id->model); | ||
1684 | } | ||
1685 | |||
1686 | static ssize_t firmware_show(struct device *dev, struct device_attribute *attr, | ||
1687 | char *buf) | ||
1688 | { | ||
1689 | ide_drive_t *drive = to_ide_device(dev); | ||
1690 | return sprintf(buf, "%s\n", drive->id->fw_rev); | ||
1691 | } | ||
1692 | |||
1693 | static ssize_t serial_show(struct device *dev, struct device_attribute *attr, | ||
1694 | char *buf) | ||
1695 | { | ||
1696 | ide_drive_t *drive = to_ide_device(dev); | ||
1697 | return sprintf(buf, "%s\n", drive->id->serial_no); | ||
1698 | } | ||
1699 | |||
1673 | static struct device_attribute ide_dev_attrs[] = { | 1700 | static struct device_attribute ide_dev_attrs[] = { |
1674 | __ATTR_RO(media), | 1701 | __ATTR_RO(media), |
1675 | __ATTR_RO(drivename), | 1702 | __ATTR_RO(drivename), |
1676 | __ATTR_RO(modalias), | 1703 | __ATTR_RO(modalias), |
1704 | __ATTR_RO(model), | ||
1705 | __ATTR_RO(firmware), | ||
1706 | __ATTR(serial, 0400, serial_show, NULL), | ||
1677 | __ATTR_NULL | 1707 | __ATTR_NULL |
1678 | }; | 1708 | }; |
1679 | 1709 | ||
diff --git a/drivers/ide/pci/hpt366.c b/drivers/ide/pci/hpt366.c index 5682895d36d9..9fce25bdec8a 100644 --- a/drivers/ide/pci/hpt366.c +++ b/drivers/ide/pci/hpt366.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * linux/drivers/ide/pci/hpt366.c Version 1.21 Oct 23, 2007 | 2 | * linux/drivers/ide/pci/hpt366.c Version 1.22 Dec 4, 2007 |
3 | * | 3 | * |
4 | * Copyright (C) 1999-2003 Andre Hedrick <andre@linux-ide.org> | 4 | * Copyright (C) 1999-2003 Andre Hedrick <andre@linux-ide.org> |
5 | * Portions Copyright (C) 2001 Sun Microsystems, Inc. | 5 | * Portions Copyright (C) 2001 Sun Microsystems, Inc. |
@@ -310,6 +310,8 @@ static u32 twenty_five_base_hpt36x[] = { | |||
310 | /* XFER_PIO_0 */ 0xc0d08585 | 310 | /* XFER_PIO_0 */ 0xc0d08585 |
311 | }; | 311 | }; |
312 | 312 | ||
313 | #if 0 | ||
314 | /* These are the timing tables from the HighPoint open source drivers... */ | ||
313 | static u32 thirty_three_base_hpt37x[] = { | 315 | static u32 thirty_three_base_hpt37x[] = { |
314 | /* XFER_UDMA_6 */ 0x12446231, /* 0x12646231 ?? */ | 316 | /* XFER_UDMA_6 */ 0x12446231, /* 0x12646231 ?? */ |
315 | /* XFER_UDMA_5 */ 0x12446231, | 317 | /* XFER_UDMA_5 */ 0x12446231, |
@@ -369,6 +371,73 @@ static u32 sixty_six_base_hpt37x[] = { | |||
369 | /* XFER_PIO_1 */ 0x0d029d26, | 371 | /* XFER_PIO_1 */ 0x0d029d26, |
370 | /* XFER_PIO_0 */ 0x0d029d5e | 372 | /* XFER_PIO_0 */ 0x0d029d5e |
371 | }; | 373 | }; |
374 | #else | ||
375 | /* | ||
376 | * The following are the new timing tables with PIO mode data/taskfile transfer | ||
377 | * overclocking fixed... | ||
378 | */ | ||
379 | |||
380 | /* This table is taken from the HPT370 data manual rev. 1.02 */ | ||
381 | static u32 thirty_three_base_hpt37x[] = { | ||
382 | /* XFER_UDMA_6 */ 0x16455031, /* 0x16655031 ?? */ | ||
383 | /* XFER_UDMA_5 */ 0x16455031, | ||
384 | /* XFER_UDMA_4 */ 0x16455031, | ||
385 | /* XFER_UDMA_3 */ 0x166d5031, | ||
386 | /* XFER_UDMA_2 */ 0x16495031, | ||
387 | /* XFER_UDMA_1 */ 0x164d5033, | ||
388 | /* XFER_UDMA_0 */ 0x16515097, | ||
389 | |||
390 | /* XFER_MW_DMA_2 */ 0x26515031, | ||
391 | /* XFER_MW_DMA_1 */ 0x26515033, | ||
392 | /* XFER_MW_DMA_0 */ 0x26515097, | ||
393 | |||
394 | /* XFER_PIO_4 */ 0x06515021, | ||
395 | /* XFER_PIO_3 */ 0x06515022, | ||
396 | /* XFER_PIO_2 */ 0x06515033, | ||
397 | /* XFER_PIO_1 */ 0x06915065, | ||
398 | /* XFER_PIO_0 */ 0x06d1508a | ||
399 | }; | ||
400 | |||
401 | static u32 fifty_base_hpt37x[] = { | ||
402 | /* XFER_UDMA_6 */ 0x1a861842, | ||
403 | /* XFER_UDMA_5 */ 0x1a861842, | ||
404 | /* XFER_UDMA_4 */ 0x1aae1842, | ||
405 | /* XFER_UDMA_3 */ 0x1a8e1842, | ||
406 | /* XFER_UDMA_2 */ 0x1a0e1842, | ||
407 | /* XFER_UDMA_1 */ 0x1a161854, | ||
408 | /* XFER_UDMA_0 */ 0x1a1a18ea, | ||
409 | |||
410 | /* XFER_MW_DMA_2 */ 0x2a821842, | ||
411 | /* XFER_MW_DMA_1 */ 0x2a821854, | ||
412 | /* XFER_MW_DMA_0 */ 0x2a8218ea, | ||
413 | |||
414 | /* XFER_PIO_4 */ 0x0a821842, | ||
415 | /* XFER_PIO_3 */ 0x0a821843, | ||
416 | /* XFER_PIO_2 */ 0x0a821855, | ||
417 | /* XFER_PIO_1 */ 0x0ac218a8, | ||
418 | /* XFER_PIO_0 */ 0x0b02190c | ||
419 | }; | ||
420 | |||
421 | static u32 sixty_six_base_hpt37x[] = { | ||
422 | /* XFER_UDMA_6 */ 0x1c86fe62, | ||
423 | /* XFER_UDMA_5 */ 0x1caefe62, /* 0x1c8afe62 */ | ||
424 | /* XFER_UDMA_4 */ 0x1c8afe62, | ||
425 | /* XFER_UDMA_3 */ 0x1c8efe62, | ||
426 | /* XFER_UDMA_2 */ 0x1c92fe62, | ||
427 | /* XFER_UDMA_1 */ 0x1c9afe62, | ||
428 | /* XFER_UDMA_0 */ 0x1c82fe62, | ||
429 | |||
430 | /* XFER_MW_DMA_2 */ 0x2c82fe62, | ||
431 | /* XFER_MW_DMA_1 */ 0x2c82fe66, | ||
432 | /* XFER_MW_DMA_0 */ 0x2c82ff2e, | ||
433 | |||
434 | /* XFER_PIO_4 */ 0x0c82fe62, | ||
435 | /* XFER_PIO_3 */ 0x0c82fe84, | ||
436 | /* XFER_PIO_2 */ 0x0c82fea6, | ||
437 | /* XFER_PIO_1 */ 0x0d02ff26, | ||
438 | /* XFER_PIO_0 */ 0x0d42ff7f | ||
439 | }; | ||
440 | #endif | ||
372 | 441 | ||
373 | #define HPT366_DEBUG_DRIVE_INFO 0 | 442 | #define HPT366_DEBUG_DRIVE_INFO 0 |
374 | #define HPT371_ALLOW_ATA133_6 1 | 443 | #define HPT371_ALLOW_ATA133_6 1 |
diff --git a/drivers/ide/pci/pdc202xx_new.c b/drivers/ide/pci/pdc202xx_new.c index 4234efeba606..2b4f44e45a1a 100644 --- a/drivers/ide/pci/pdc202xx_new.c +++ b/drivers/ide/pci/pdc202xx_new.c | |||
@@ -482,8 +482,9 @@ static struct pci_dev * __devinit pdc20270_get_dev2(struct pci_dev *dev) | |||
482 | { | 482 | { |
483 | struct pci_dev *dev2; | 483 | struct pci_dev *dev2; |
484 | 484 | ||
485 | dev2 = pci_get_slot(dev->bus, PCI_DEVFN(PCI_SLOT(dev->devfn) + 2, | 485 | dev2 = pci_get_slot(dev->bus, PCI_DEVFN(PCI_SLOT(dev->devfn) + 1, |
486 | PCI_FUNC(dev->devfn))); | 486 | PCI_FUNC(dev->devfn))); |
487 | |||
487 | if (dev2 && | 488 | if (dev2 && |
488 | dev2->vendor == dev->vendor && | 489 | dev2->vendor == dev->vendor && |
489 | dev2->device == dev->device) { | 490 | dev2->device == dev->device) { |
diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c index 25fd09053220..d2cd5a3d38f8 100644 --- a/drivers/ide/setup-pci.c +++ b/drivers/ide/setup-pci.c | |||
@@ -704,7 +704,7 @@ EXPORT_SYMBOL_GPL(ide_setup_pci_devices); | |||
704 | /* | 704 | /* |
705 | * Module interfaces | 705 | * Module interfaces |
706 | */ | 706 | */ |
707 | 707 | ||
708 | static int pre_init = 1; /* Before first ordered IDE scan */ | 708 | static int pre_init = 1; /* Before first ordered IDE scan */ |
709 | static LIST_HEAD(ide_pci_drivers); | 709 | static LIST_HEAD(ide_pci_drivers); |
710 | 710 | ||
@@ -714,7 +714,7 @@ static LIST_HEAD(ide_pci_drivers); | |||
714 | * @module: owner module of the driver | 714 | * @module: owner module of the driver |
715 | * | 715 | * |
716 | * Registers a driver with the IDE layer. The IDE layer arranges that | 716 | * Registers a driver with the IDE layer. The IDE layer arranges that |
717 | * boot time setup is done in the expected device order and then | 717 | * boot time setup is done in the expected device order and then |
718 | * hands the controllers off to the core PCI code to do the rest of | 718 | * hands the controllers off to the core PCI code to do the rest of |
719 | * the work. | 719 | * the work. |
720 | * | 720 | * |
@@ -724,13 +724,12 @@ static LIST_HEAD(ide_pci_drivers); | |||
724 | int __ide_pci_register_driver(struct pci_driver *driver, struct module *module, | 724 | int __ide_pci_register_driver(struct pci_driver *driver, struct module *module, |
725 | const char *mod_name) | 725 | const char *mod_name) |
726 | { | 726 | { |
727 | if(!pre_init) | 727 | if (!pre_init) |
728 | return __pci_register_driver(driver, module, mod_name); | 728 | return __pci_register_driver(driver, module, mod_name); |
729 | driver->driver.owner = module; | 729 | driver->driver.owner = module; |
730 | list_add_tail(&driver->node, &ide_pci_drivers); | 730 | list_add_tail(&driver->node, &ide_pci_drivers); |
731 | return 0; | 731 | return 0; |
732 | } | 732 | } |
733 | |||
734 | EXPORT_SYMBOL_GPL(__ide_pci_register_driver); | 733 | EXPORT_SYMBOL_GPL(__ide_pci_register_driver); |
735 | 734 | ||
736 | /** | 735 | /** |
@@ -741,17 +740,18 @@ EXPORT_SYMBOL_GPL(__ide_pci_register_driver); | |||
741 | * This is only used during boot up to get the ordering correct. After | 740 | * This is only used during boot up to get the ordering correct. After |
742 | * boot up the pci layer takes over the job. | 741 | * boot up the pci layer takes over the job. |
743 | */ | 742 | */ |
744 | 743 | ||
745 | static int __init ide_scan_pcidev(struct pci_dev *dev) | 744 | static int __init ide_scan_pcidev(struct pci_dev *dev) |
746 | { | 745 | { |
747 | struct list_head *l; | 746 | struct list_head *l; |
748 | struct pci_driver *d; | 747 | struct pci_driver *d; |
749 | 748 | ||
750 | list_for_each(l, &ide_pci_drivers) { | 749 | list_for_each(l, &ide_pci_drivers) { |
751 | d = list_entry(l, struct pci_driver, node); | 750 | d = list_entry(l, struct pci_driver, node); |
752 | if (d->id_table) { | 751 | if (d->id_table) { |
753 | const struct pci_device_id *id = pci_match_id(d->id_table, | 752 | const struct pci_device_id *id = |
754 | dev); | 753 | pci_match_id(d->id_table, dev); |
754 | |||
755 | if (id != NULL && d->probe(dev, id) >= 0) { | 755 | if (id != NULL && d->probe(dev, id) >= 0) { |
756 | dev->driver = d; | 756 | dev->driver = d; |
757 | pci_dev_get(dev); | 757 | pci_dev_get(dev); |
@@ -779,13 +779,13 @@ void __init ide_scan_pcibus (int scan_direction) | |||
779 | 779 | ||
780 | pre_init = 0; | 780 | pre_init = 0; |
781 | if (!scan_direction) | 781 | if (!scan_direction) |
782 | while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) | 782 | while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev))) |
783 | ide_scan_pcidev(dev); | 783 | ide_scan_pcidev(dev); |
784 | else | 784 | else |
785 | while ((dev = pci_get_device_reverse(PCI_ANY_ID, PCI_ANY_ID, dev)) | 785 | while ((dev = pci_get_device_reverse(PCI_ANY_ID, PCI_ANY_ID, |
786 | != NULL) | 786 | dev))) |
787 | ide_scan_pcidev(dev); | 787 | ide_scan_pcidev(dev); |
788 | 788 | ||
789 | /* | 789 | /* |
790 | * Hand the drivers over to the PCI layer now we | 790 | * Hand the drivers over to the PCI layer now we |
791 | * are post init. | 791 | * are post init. |
@@ -794,9 +794,10 @@ void __init ide_scan_pcibus (int scan_direction) | |||
794 | list_for_each_safe(l, n, &ide_pci_drivers) { | 794 | list_for_each_safe(l, n, &ide_pci_drivers) { |
795 | list_del(l); | 795 | list_del(l); |
796 | d = list_entry(l, struct pci_driver, node); | 796 | d = list_entry(l, struct pci_driver, node); |
797 | if (__pci_register_driver(d, d->driver.owner, d->driver.mod_name)) | 797 | if (__pci_register_driver(d, d->driver.owner, |
798 | printk(KERN_ERR "%s: failed to register driver for %s\n", | 798 | d->driver.mod_name)) |
799 | __FUNCTION__, d->driver.mod_name); | 799 | printk(KERN_ERR "%s: failed to register %s driver\n", |
800 | __FUNCTION__, d->driver.mod_name); | ||
800 | } | 801 | } |
801 | } | 802 | } |
802 | #endif | 803 | #endif |
diff --git a/drivers/infiniband/hw/ehca/ehca_classes.h b/drivers/infiniband/hw/ehca/ehca_classes.h index 87f12d4312a7..74d2b72a11d8 100644 --- a/drivers/infiniband/hw/ehca/ehca_classes.h +++ b/drivers/infiniband/hw/ehca/ehca_classes.h | |||
@@ -322,6 +322,7 @@ extern int ehca_static_rate; | |||
322 | extern int ehca_port_act_time; | 322 | extern int ehca_port_act_time; |
323 | extern int ehca_use_hp_mr; | 323 | extern int ehca_use_hp_mr; |
324 | extern int ehca_scaling_code; | 324 | extern int ehca_scaling_code; |
325 | extern int ehca_lock_hcalls; | ||
325 | 326 | ||
326 | struct ipzu_queue_resp { | 327 | struct ipzu_queue_resp { |
327 | u32 qe_size; /* queue entry size */ | 328 | u32 qe_size; /* queue entry size */ |
diff --git a/drivers/infiniband/hw/ehca/ehca_main.c b/drivers/infiniband/hw/ehca/ehca_main.c index 90d4334179bf..6a56d86a2951 100644 --- a/drivers/infiniband/hw/ehca/ehca_main.c +++ b/drivers/infiniband/hw/ehca/ehca_main.c | |||
@@ -43,13 +43,14 @@ | |||
43 | #ifdef CONFIG_PPC_64K_PAGES | 43 | #ifdef CONFIG_PPC_64K_PAGES |
44 | #include <linux/slab.h> | 44 | #include <linux/slab.h> |
45 | #endif | 45 | #endif |
46 | |||
46 | #include "ehca_classes.h" | 47 | #include "ehca_classes.h" |
47 | #include "ehca_iverbs.h" | 48 | #include "ehca_iverbs.h" |
48 | #include "ehca_mrmw.h" | 49 | #include "ehca_mrmw.h" |
49 | #include "ehca_tools.h" | 50 | #include "ehca_tools.h" |
50 | #include "hcp_if.h" | 51 | #include "hcp_if.h" |
51 | 52 | ||
52 | #define HCAD_VERSION "0024" | 53 | #define HCAD_VERSION "0025" |
53 | 54 | ||
54 | MODULE_LICENSE("Dual BSD/GPL"); | 55 | MODULE_LICENSE("Dual BSD/GPL"); |
55 | MODULE_AUTHOR("Christoph Raisch <raisch@de.ibm.com>"); | 56 | MODULE_AUTHOR("Christoph Raisch <raisch@de.ibm.com>"); |
@@ -66,6 +67,7 @@ int ehca_poll_all_eqs = 1; | |||
66 | int ehca_static_rate = -1; | 67 | int ehca_static_rate = -1; |
67 | int ehca_scaling_code = 0; | 68 | int ehca_scaling_code = 0; |
68 | int ehca_mr_largepage = 1; | 69 | int ehca_mr_largepage = 1; |
70 | int ehca_lock_hcalls = -1; | ||
69 | 71 | ||
70 | module_param_named(open_aqp1, ehca_open_aqp1, int, S_IRUGO); | 72 | module_param_named(open_aqp1, ehca_open_aqp1, int, S_IRUGO); |
71 | module_param_named(debug_level, ehca_debug_level, int, S_IRUGO); | 73 | module_param_named(debug_level, ehca_debug_level, int, S_IRUGO); |
@@ -77,6 +79,7 @@ module_param_named(poll_all_eqs, ehca_poll_all_eqs, int, S_IRUGO); | |||
77 | module_param_named(static_rate, ehca_static_rate, int, S_IRUGO); | 79 | module_param_named(static_rate, ehca_static_rate, int, S_IRUGO); |
78 | module_param_named(scaling_code, ehca_scaling_code, int, S_IRUGO); | 80 | module_param_named(scaling_code, ehca_scaling_code, int, S_IRUGO); |
79 | module_param_named(mr_largepage, ehca_mr_largepage, int, S_IRUGO); | 81 | module_param_named(mr_largepage, ehca_mr_largepage, int, S_IRUGO); |
82 | module_param_named(lock_hcalls, ehca_lock_hcalls, bool, S_IRUGO); | ||
80 | 83 | ||
81 | MODULE_PARM_DESC(open_aqp1, | 84 | MODULE_PARM_DESC(open_aqp1, |
82 | "AQP1 on startup (0: no (default), 1: yes)"); | 85 | "AQP1 on startup (0: no (default), 1: yes)"); |
@@ -102,6 +105,9 @@ MODULE_PARM_DESC(scaling_code, | |||
102 | MODULE_PARM_DESC(mr_largepage, | 105 | MODULE_PARM_DESC(mr_largepage, |
103 | "use large page for MR (0: use PAGE_SIZE (default), " | 106 | "use large page for MR (0: use PAGE_SIZE (default), " |
104 | "1: use large page depending on MR size"); | 107 | "1: use large page depending on MR size"); |
108 | MODULE_PARM_DESC(lock_hcalls, | ||
109 | "serialize all hCalls made by the driver " | ||
110 | "(default: autodetect)"); | ||
105 | 111 | ||
106 | DEFINE_RWLOCK(ehca_qp_idr_lock); | 112 | DEFINE_RWLOCK(ehca_qp_idr_lock); |
107 | DEFINE_RWLOCK(ehca_cq_idr_lock); | 113 | DEFINE_RWLOCK(ehca_cq_idr_lock); |
@@ -258,6 +264,7 @@ static struct cap_descr { | |||
258 | { HCA_CAP_UD_LL_QP, "HCA_CAP_UD_LL_QP" }, | 264 | { HCA_CAP_UD_LL_QP, "HCA_CAP_UD_LL_QP" }, |
259 | { HCA_CAP_RESIZE_MR, "HCA_CAP_RESIZE_MR" }, | 265 | { HCA_CAP_RESIZE_MR, "HCA_CAP_RESIZE_MR" }, |
260 | { HCA_CAP_MINI_QP, "HCA_CAP_MINI_QP" }, | 266 | { HCA_CAP_MINI_QP, "HCA_CAP_MINI_QP" }, |
267 | { HCA_CAP_H_ALLOC_RES_SYNC, "HCA_CAP_H_ALLOC_RES_SYNC" }, | ||
261 | }; | 268 | }; |
262 | 269 | ||
263 | static int ehca_sense_attributes(struct ehca_shca *shca) | 270 | static int ehca_sense_attributes(struct ehca_shca *shca) |
@@ -333,6 +340,12 @@ static int ehca_sense_attributes(struct ehca_shca *shca) | |||
333 | if (EHCA_BMASK_GET(hca_cap_descr[i].mask, shca->hca_cap)) | 340 | if (EHCA_BMASK_GET(hca_cap_descr[i].mask, shca->hca_cap)) |
334 | ehca_gen_dbg(" %s", hca_cap_descr[i].descr); | 341 | ehca_gen_dbg(" %s", hca_cap_descr[i].descr); |
335 | 342 | ||
343 | /* Autodetect hCall locking -- the "H_ALLOC_RESOURCE synced" flag is | ||
344 | * a firmware property, so it's valid across all adapters | ||
345 | */ | ||
346 | if (ehca_lock_hcalls == -1) | ||
347 | ehca_lock_hcalls = !(shca->hca_cap & HCA_CAP_H_ALLOC_RES_SYNC); | ||
348 | |||
336 | /* translate supported MR page sizes; always support 4K */ | 349 | /* translate supported MR page sizes; always support 4K */ |
337 | shca->hca_cap_mr_pgsize = EHCA_PAGESIZE; | 350 | shca->hca_cap_mr_pgsize = EHCA_PAGESIZE; |
338 | if (ehca_mr_largepage) { /* support extra sizes only if enabled */ | 351 | if (ehca_mr_largepage) { /* support extra sizes only if enabled */ |
diff --git a/drivers/infiniband/hw/ehca/ehca_qp.c b/drivers/infiniband/hw/ehca/ehca_qp.c index dd126681fed0..eff5fb55604b 100644 --- a/drivers/infiniband/hw/ehca/ehca_qp.c +++ b/drivers/infiniband/hw/ehca/ehca_qp.c | |||
@@ -838,7 +838,7 @@ struct ib_srq *ehca_create_srq(struct ib_pd *pd, | |||
838 | 838 | ||
839 | /* copy back return values */ | 839 | /* copy back return values */ |
840 | srq_init_attr->attr.max_wr = qp_init_attr.cap.max_recv_wr; | 840 | srq_init_attr->attr.max_wr = qp_init_attr.cap.max_recv_wr; |
841 | srq_init_attr->attr.max_sge = qp_init_attr.cap.max_recv_sge; | 841 | srq_init_attr->attr.max_sge = 3; |
842 | 842 | ||
843 | /* drive SRQ into RTR state */ | 843 | /* drive SRQ into RTR state */ |
844 | mqpcb = ehca_alloc_fw_ctrlblock(GFP_KERNEL); | 844 | mqpcb = ehca_alloc_fw_ctrlblock(GFP_KERNEL); |
@@ -1750,7 +1750,7 @@ int ehca_query_srq(struct ib_srq *srq, struct ib_srq_attr *srq_attr) | |||
1750 | } | 1750 | } |
1751 | 1751 | ||
1752 | srq_attr->max_wr = qpcb->max_nr_outst_recv_wr - 1; | 1752 | srq_attr->max_wr = qpcb->max_nr_outst_recv_wr - 1; |
1753 | srq_attr->max_sge = qpcb->actual_nr_sges_in_rq_wqe; | 1753 | srq_attr->max_sge = 3; |
1754 | srq_attr->srq_limit = EHCA_BMASK_GET( | 1754 | srq_attr->srq_limit = EHCA_BMASK_GET( |
1755 | MQPCB_CURR_SRQ_LIMIT, qpcb->curr_srq_limit); | 1755 | MQPCB_CURR_SRQ_LIMIT, qpcb->curr_srq_limit); |
1756 | 1756 | ||
diff --git a/drivers/infiniband/hw/ehca/hcp_if.c b/drivers/infiniband/hw/ehca/hcp_if.c index c16a21374bb5..7029aa653751 100644 --- a/drivers/infiniband/hw/ehca/hcp_if.c +++ b/drivers/infiniband/hw/ehca/hcp_if.c | |||
@@ -120,26 +120,21 @@ static long ehca_plpar_hcall_norets(unsigned long opcode, | |||
120 | unsigned long arg7) | 120 | unsigned long arg7) |
121 | { | 121 | { |
122 | long ret; | 122 | long ret; |
123 | int i, sleep_msecs, do_lock; | 123 | int i, sleep_msecs; |
124 | unsigned long flags; | 124 | unsigned long flags = 0; |
125 | 125 | ||
126 | ehca_gen_dbg("opcode=%lx " HCALL7_REGS_FORMAT, | 126 | ehca_gen_dbg("opcode=%lx " HCALL7_REGS_FORMAT, |
127 | opcode, arg1, arg2, arg3, arg4, arg5, arg6, arg7); | 127 | opcode, arg1, arg2, arg3, arg4, arg5, arg6, arg7); |
128 | 128 | ||
129 | /* lock H_FREE_RESOURCE(MR) against itself and H_ALLOC_RESOURCE(MR) */ | ||
130 | if ((opcode == H_FREE_RESOURCE) && (arg7 == 5)) { | ||
131 | arg7 = 0; /* better not upset firmware */ | ||
132 | do_lock = 1; | ||
133 | } | ||
134 | |||
135 | for (i = 0; i < 5; i++) { | 129 | for (i = 0; i < 5; i++) { |
136 | if (do_lock) | 130 | /* serialize hCalls to work around firmware issue */ |
131 | if (ehca_lock_hcalls) | ||
137 | spin_lock_irqsave(&hcall_lock, flags); | 132 | spin_lock_irqsave(&hcall_lock, flags); |
138 | 133 | ||
139 | ret = plpar_hcall_norets(opcode, arg1, arg2, arg3, arg4, | 134 | ret = plpar_hcall_norets(opcode, arg1, arg2, arg3, arg4, |
140 | arg5, arg6, arg7); | 135 | arg5, arg6, arg7); |
141 | 136 | ||
142 | if (do_lock) | 137 | if (ehca_lock_hcalls) |
143 | spin_unlock_irqrestore(&hcall_lock, flags); | 138 | spin_unlock_irqrestore(&hcall_lock, flags); |
144 | 139 | ||
145 | if (H_IS_LONG_BUSY(ret)) { | 140 | if (H_IS_LONG_BUSY(ret)) { |
@@ -174,24 +169,22 @@ static long ehca_plpar_hcall9(unsigned long opcode, | |||
174 | unsigned long arg9) | 169 | unsigned long arg9) |
175 | { | 170 | { |
176 | long ret; | 171 | long ret; |
177 | int i, sleep_msecs, do_lock; | 172 | int i, sleep_msecs; |
178 | unsigned long flags = 0; | 173 | unsigned long flags = 0; |
179 | 174 | ||
180 | ehca_gen_dbg("INPUT -- opcode=%lx " HCALL9_REGS_FORMAT, opcode, | 175 | ehca_gen_dbg("INPUT -- opcode=%lx " HCALL9_REGS_FORMAT, opcode, |
181 | arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9); | 176 | arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9); |
182 | 177 | ||
183 | /* lock H_ALLOC_RESOURCE(MR) against itself and H_FREE_RESOURCE(MR) */ | ||
184 | do_lock = ((opcode == H_ALLOC_RESOURCE) && (arg2 == 5)); | ||
185 | |||
186 | for (i = 0; i < 5; i++) { | 178 | for (i = 0; i < 5; i++) { |
187 | if (do_lock) | 179 | /* serialize hCalls to work around firmware issue */ |
180 | if (ehca_lock_hcalls) | ||
188 | spin_lock_irqsave(&hcall_lock, flags); | 181 | spin_lock_irqsave(&hcall_lock, flags); |
189 | 182 | ||
190 | ret = plpar_hcall9(opcode, outs, | 183 | ret = plpar_hcall9(opcode, outs, |
191 | arg1, arg2, arg3, arg4, arg5, | 184 | arg1, arg2, arg3, arg4, arg5, |
192 | arg6, arg7, arg8, arg9); | 185 | arg6, arg7, arg8, arg9); |
193 | 186 | ||
194 | if (do_lock) | 187 | if (ehca_lock_hcalls) |
195 | spin_unlock_irqrestore(&hcall_lock, flags); | 188 | spin_unlock_irqrestore(&hcall_lock, flags); |
196 | 189 | ||
197 | if (H_IS_LONG_BUSY(ret)) { | 190 | if (H_IS_LONG_BUSY(ret)) { |
@@ -821,7 +814,7 @@ u64 hipz_h_free_resource_mr(const struct ipz_adapter_handle adapter_handle, | |||
821 | return ehca_plpar_hcall_norets(H_FREE_RESOURCE, | 814 | return ehca_plpar_hcall_norets(H_FREE_RESOURCE, |
822 | adapter_handle.handle, /* r4 */ | 815 | adapter_handle.handle, /* r4 */ |
823 | mr->ipz_mr_handle.handle, /* r5 */ | 816 | mr->ipz_mr_handle.handle, /* r5 */ |
824 | 0, 0, 0, 0, 5); | 817 | 0, 0, 0, 0, 0); |
825 | } | 818 | } |
826 | 819 | ||
827 | u64 hipz_h_reregister_pmr(const struct ipz_adapter_handle adapter_handle, | 820 | u64 hipz_h_reregister_pmr(const struct ipz_adapter_handle adapter_handle, |
diff --git a/drivers/infiniband/hw/ehca/hipz_hw.h b/drivers/infiniband/hw/ehca/hipz_hw.h index 485b8400359e..bf996c7acc42 100644 --- a/drivers/infiniband/hw/ehca/hipz_hw.h +++ b/drivers/infiniband/hw/ehca/hipz_hw.h | |||
@@ -378,6 +378,7 @@ struct hipz_query_hca { | |||
378 | #define HCA_CAP_UD_LL_QP EHCA_BMASK_IBM(16, 16) | 378 | #define HCA_CAP_UD_LL_QP EHCA_BMASK_IBM(16, 16) |
379 | #define HCA_CAP_RESIZE_MR EHCA_BMASK_IBM(17, 17) | 379 | #define HCA_CAP_RESIZE_MR EHCA_BMASK_IBM(17, 17) |
380 | #define HCA_CAP_MINI_QP EHCA_BMASK_IBM(18, 18) | 380 | #define HCA_CAP_MINI_QP EHCA_BMASK_IBM(18, 18) |
381 | #define HCA_CAP_H_ALLOC_RES_SYNC EHCA_BMASK_IBM(19, 19) | ||
381 | 382 | ||
382 | /* query port response block */ | 383 | /* query port response block */ |
383 | struct hipz_query_port { | 384 | struct hipz_query_port { |
diff --git a/drivers/media/Makefile b/drivers/media/Makefile index 8fa19939c2b6..8cf91353b56a 100644 --- a/drivers/media/Makefile +++ b/drivers/media/Makefile | |||
@@ -3,6 +3,6 @@ | |||
3 | # | 3 | # |
4 | 4 | ||
5 | obj-y := common/ | 5 | obj-y := common/ |
6 | obj-$(CONFIG_VIDEO_DEV) += video/ | 6 | obj-y += video/ |
7 | obj-$(CONFIG_VIDEO_DEV) += radio/ | 7 | obj-$(CONFIG_VIDEO_DEV) += radio/ |
8 | obj-$(CONFIG_DVB_CORE) += dvb/ | 8 | obj-$(CONFIG_DVB_CORE) += dvb/ |
diff --git a/drivers/media/dvb/frontends/s5h1409.c b/drivers/media/dvb/frontends/s5h1409.c index 8dee7ec9456a..562d9208857a 100644 --- a/drivers/media/dvb/frontends/s5h1409.c +++ b/drivers/media/dvb/frontends/s5h1409.c | |||
@@ -107,7 +107,7 @@ static struct vsb_snr_tab { | |||
107 | u16 val; | 107 | u16 val; |
108 | u16 data; | 108 | u16 data; |
109 | } vsb_snr_tab[] = { | 109 | } vsb_snr_tab[] = { |
110 | { 1023, 770, }, | 110 | { 924, 300, }, |
111 | { 923, 300, }, | 111 | { 923, 300, }, |
112 | { 918, 295, }, | 112 | { 918, 295, }, |
113 | { 915, 290, }, | 113 | { 915, 290, }, |
@@ -154,6 +154,7 @@ static struct qam64_snr_tab { | |||
154 | u16 val; | 154 | u16 val; |
155 | u16 data; | 155 | u16 data; |
156 | } qam64_snr_tab[] = { | 156 | } qam64_snr_tab[] = { |
157 | { 1, 0, }, | ||
157 | { 12, 300, }, | 158 | { 12, 300, }, |
158 | { 15, 290, }, | 159 | { 15, 290, }, |
159 | { 18, 280, }, | 160 | { 18, 280, }, |
@@ -217,6 +218,7 @@ static struct qam64_snr_tab { | |||
217 | { 95, 202, }, | 218 | { 95, 202, }, |
218 | { 96, 201, }, | 219 | { 96, 201, }, |
219 | { 104, 200, }, | 220 | { 104, 200, }, |
221 | { 255, 0, }, | ||
220 | }; | 222 | }; |
221 | 223 | ||
222 | /* QAM256 SNR lookup table */ | 224 | /* QAM256 SNR lookup table */ |
@@ -224,6 +226,7 @@ static struct qam256_snr_tab { | |||
224 | u16 val; | 226 | u16 val; |
225 | u16 data; | 227 | u16 data; |
226 | } qam256_snr_tab[] = { | 228 | } qam256_snr_tab[] = { |
229 | { 1, 0, }, | ||
227 | { 12, 400, }, | 230 | { 12, 400, }, |
228 | { 13, 390, }, | 231 | { 13, 390, }, |
229 | { 15, 380, }, | 232 | { 15, 380, }, |
@@ -292,6 +295,7 @@ static struct qam256_snr_tab { | |||
292 | { 105, 262, }, | 295 | { 105, 262, }, |
293 | { 106, 261, }, | 296 | { 106, 261, }, |
294 | { 110, 260, }, | 297 | { 110, 260, }, |
298 | { 255, 0, }, | ||
295 | }; | 299 | }; |
296 | 300 | ||
297 | /* 8 bit registers, 16 bit values */ | 301 | /* 8 bit registers, 16 bit values */ |
@@ -670,14 +674,15 @@ static int s5h1409_read_snr(struct dvb_frontend* fe, u16* snr) | |||
670 | u16 reg; | 674 | u16 reg; |
671 | dprintk("%s()\n", __FUNCTION__); | 675 | dprintk("%s()\n", __FUNCTION__); |
672 | 676 | ||
673 | reg = s5h1409_readreg(state, 0xf1) & 0x1ff; | ||
674 | |||
675 | switch(state->current_modulation) { | 677 | switch(state->current_modulation) { |
676 | case QAM_64: | 678 | case QAM_64: |
679 | reg = s5h1409_readreg(state, 0xf0) & 0xff; | ||
677 | return s5h1409_qam64_lookup_snr(fe, snr, reg); | 680 | return s5h1409_qam64_lookup_snr(fe, snr, reg); |
678 | case QAM_256: | 681 | case QAM_256: |
682 | reg = s5h1409_readreg(state, 0xf0) & 0xff; | ||
679 | return s5h1409_qam256_lookup_snr(fe, snr, reg); | 683 | return s5h1409_qam256_lookup_snr(fe, snr, reg); |
680 | case VSB_8: | 684 | case VSB_8: |
685 | reg = s5h1409_readreg(state, 0xf1) & 0x3ff; | ||
681 | return s5h1409_vsb_lookup_snr(fe, snr, reg); | 686 | return s5h1409_vsb_lookup_snr(fe, snr, reg); |
682 | default: | 687 | default: |
683 | break; | 688 | break; |
diff --git a/drivers/media/video/bt866.c b/drivers/media/video/bt866.c index b767b098d14b..96b415576f0d 100644 --- a/drivers/media/video/bt866.c +++ b/drivers/media/video/bt866.c | |||
@@ -300,7 +300,6 @@ static struct i2c_client bt866_client_tmpl = | |||
300 | .addr = 0, | 300 | .addr = 0, |
301 | .adapter = NULL, | 301 | .adapter = NULL, |
302 | .driver = &i2c_driver_bt866, | 302 | .driver = &i2c_driver_bt866, |
303 | .usage_count = 0 | ||
304 | }; | 303 | }; |
305 | 304 | ||
306 | static int bt866_found_proc(struct i2c_adapter *adapter, | 305 | static int bt866_found_proc(struct i2c_adapter *adapter, |
diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c index c6eb1e37a46e..98c1b084a716 100644 --- a/drivers/media/video/saa7134/saa7134-cards.c +++ b/drivers/media/video/saa7134/saa7134-cards.c | |||
@@ -3221,6 +3221,7 @@ struct saa7134_board saa7134_boards[] = { | |||
3221 | .radio_type = UNSET, | 3221 | .radio_type = UNSET, |
3222 | .tuner_addr = ADDR_UNSET, | 3222 | .tuner_addr = ADDR_UNSET, |
3223 | .radio_addr = ADDR_UNSET, | 3223 | .radio_addr = ADDR_UNSET, |
3224 | .tuner_config = 1, | ||
3224 | .mpeg = SAA7134_MPEG_DVB, | 3225 | .mpeg = SAA7134_MPEG_DVB, |
3225 | .inputs = {{ | 3226 | .inputs = {{ |
3226 | .name = name_tv, | 3227 | .name = name_tv, |
diff --git a/drivers/media/video/videobuf-core.c b/drivers/media/video/videobuf-core.c index 81f77d2b4bd3..c8a5cb57963b 100644 --- a/drivers/media/video/videobuf-core.c +++ b/drivers/media/video/videobuf-core.c | |||
@@ -909,7 +909,7 @@ ssize_t videobuf_read_stream(struct videobuf_queue *q, | |||
909 | if (q->streaming) | 909 | if (q->streaming) |
910 | goto done; | 910 | goto done; |
911 | if (!q->reading) { | 911 | if (!q->reading) { |
912 | retval = videobuf_read_start(q); | 912 | retval = __videobuf_read_start(q); |
913 | if (retval < 0) | 913 | if (retval < 0) |
914 | goto done; | 914 | goto done; |
915 | } | 915 | } |
@@ -982,7 +982,7 @@ unsigned int videobuf_poll_stream(struct file *file, | |||
982 | struct videobuf_buffer, stream); | 982 | struct videobuf_buffer, stream); |
983 | } else { | 983 | } else { |
984 | if (!q->reading) | 984 | if (!q->reading) |
985 | videobuf_read_start(q); | 985 | __videobuf_read_start(q); |
986 | if (!q->reading) { | 986 | if (!q->reading) { |
987 | rc = POLLERR; | 987 | rc = POLLERR; |
988 | } else if (NULL == q->read_buf) { | 988 | } else if (NULL == q->read_buf) { |
diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c index ab23a3221585..cf56647a6ca4 100644 --- a/drivers/misc/thinkpad_acpi.c +++ b/drivers/misc/thinkpad_acpi.c | |||
@@ -987,9 +987,9 @@ static int __init hotkey_init(struct ibm_init_struct *iibm) | |||
987 | KEY_UNKNOWN, /* 0x0C: FN+BACKSPACE */ | 987 | KEY_UNKNOWN, /* 0x0C: FN+BACKSPACE */ |
988 | KEY_UNKNOWN, /* 0x0D: FN+INSERT */ | 988 | KEY_UNKNOWN, /* 0x0D: FN+INSERT */ |
989 | KEY_UNKNOWN, /* 0x0E: FN+DELETE */ | 989 | KEY_UNKNOWN, /* 0x0E: FN+DELETE */ |
990 | KEY_BRIGHTNESSUP, /* 0x0F: FN+HOME (brightness up) */ | 990 | KEY_RESERVED, /* 0x0F: FN+HOME (brightness up) */ |
991 | /* Scan codes 0x10 to 0x1F: Extended ACPI HKEY hot keys */ | 991 | /* Scan codes 0x10 to 0x1F: Extended ACPI HKEY hot keys */ |
992 | KEY_BRIGHTNESSDOWN, /* 0x10: FN+END (brightness down) */ | 992 | KEY_RESERVED, /* 0x10: FN+END (brightness down) */ |
993 | KEY_RESERVED, /* 0x11: FN+PGUP (thinklight toggle) */ | 993 | KEY_RESERVED, /* 0x11: FN+PGUP (thinklight toggle) */ |
994 | KEY_UNKNOWN, /* 0x12: FN+PGDOWN */ | 994 | KEY_UNKNOWN, /* 0x12: FN+PGDOWN */ |
995 | KEY_ZOOM, /* 0x13: FN+SPACE (zoom) */ | 995 | KEY_ZOOM, /* 0x13: FN+SPACE (zoom) */ |
diff --git a/drivers/net/fs_enet/mac-scc.c b/drivers/net/fs_enet/mac-scc.c index 03134f47a4eb..48f2f3005935 100644 --- a/drivers/net/fs_enet/mac-scc.c +++ b/drivers/net/fs_enet/mac-scc.c | |||
@@ -158,7 +158,7 @@ static int setup_data(struct net_device *dev) | |||
158 | { | 158 | { |
159 | struct fs_enet_private *fep = netdev_priv(dev); | 159 | struct fs_enet_private *fep = netdev_priv(dev); |
160 | 160 | ||
161 | #ifdef CONFIG_PPC_CPM_NEW_BINDING | 161 | #ifndef CONFIG_PPC_CPM_NEW_BINDING |
162 | struct fs_platform_info *fpi = fep->fpi; | 162 | struct fs_platform_info *fpi = fep->fpi; |
163 | 163 | ||
164 | fep->scc.idx = fs_get_scc_index(fpi->fs_no); | 164 | fep->scc.idx = fs_get_scc_index(fpi->fs_no); |
diff --git a/drivers/net/irda/irda-usb.c b/drivers/net/irda/irda-usb.c index c6355c00fd7a..9081234ab458 100644 --- a/drivers/net/irda/irda-usb.c +++ b/drivers/net/irda/irda-usb.c | |||
@@ -1168,6 +1168,7 @@ static int stir421x_patch_device(struct irda_usb_cb *self) | |||
1168 | static int irda_usb_net_open(struct net_device *netdev) | 1168 | static int irda_usb_net_open(struct net_device *netdev) |
1169 | { | 1169 | { |
1170 | struct irda_usb_cb *self; | 1170 | struct irda_usb_cb *self; |
1171 | unsigned long flags; | ||
1171 | char hwname[16]; | 1172 | char hwname[16]; |
1172 | int i; | 1173 | int i; |
1173 | 1174 | ||
@@ -1177,13 +1178,16 @@ static int irda_usb_net_open(struct net_device *netdev) | |||
1177 | self = (struct irda_usb_cb *) netdev->priv; | 1178 | self = (struct irda_usb_cb *) netdev->priv; |
1178 | IRDA_ASSERT(self != NULL, return -1;); | 1179 | IRDA_ASSERT(self != NULL, return -1;); |
1179 | 1180 | ||
1181 | spin_lock_irqsave(&self->lock, flags); | ||
1180 | /* Can only open the device if it's there */ | 1182 | /* Can only open the device if it's there */ |
1181 | if(!self->present) { | 1183 | if(!self->present) { |
1184 | spin_unlock_irqrestore(&self->lock, flags); | ||
1182 | IRDA_WARNING("%s(), device not present!\n", __FUNCTION__); | 1185 | IRDA_WARNING("%s(), device not present!\n", __FUNCTION__); |
1183 | return -1; | 1186 | return -1; |
1184 | } | 1187 | } |
1185 | 1188 | ||
1186 | if(self->needspatch) { | 1189 | if(self->needspatch) { |
1190 | spin_unlock_irqrestore(&self->lock, flags); | ||
1187 | IRDA_WARNING("%s(), device needs patch\n", __FUNCTION__) ; | 1191 | IRDA_WARNING("%s(), device needs patch\n", __FUNCTION__) ; |
1188 | return -EIO ; | 1192 | return -EIO ; |
1189 | } | 1193 | } |
@@ -1198,6 +1202,7 @@ static int irda_usb_net_open(struct net_device *netdev) | |||
1198 | /* To do *before* submitting Rx urbs and starting net Tx queue | 1202 | /* To do *before* submitting Rx urbs and starting net Tx queue |
1199 | * Jean II */ | 1203 | * Jean II */ |
1200 | self->netopen = 1; | 1204 | self->netopen = 1; |
1205 | spin_unlock_irqrestore(&self->lock, flags); | ||
1201 | 1206 | ||
1202 | /* | 1207 | /* |
1203 | * Now that everything should be initialized properly, | 1208 | * Now that everything should be initialized properly, |
diff --git a/drivers/net/irda/mcs7780.c b/drivers/net/irda/mcs7780.c index 0b769192d4ce..93916cf33f29 100644 --- a/drivers/net/irda/mcs7780.c +++ b/drivers/net/irda/mcs7780.c | |||
@@ -677,6 +677,8 @@ static int mcs_net_close(struct net_device *netdev) | |||
677 | /* Stop transmit processing */ | 677 | /* Stop transmit processing */ |
678 | netif_stop_queue(netdev); | 678 | netif_stop_queue(netdev); |
679 | 679 | ||
680 | kfree_skb(mcs->rx_buff.skb); | ||
681 | |||
680 | /* kill and free the receive and transmit URBs */ | 682 | /* kill and free the receive and transmit URBs */ |
681 | usb_kill_urb(mcs->rx_urb); | 683 | usb_kill_urb(mcs->rx_urb); |
682 | usb_free_urb(mcs->rx_urb); | 684 | usb_free_urb(mcs->rx_urb); |
diff --git a/drivers/net/irda/stir4200.c b/drivers/net/irda/stir4200.c index 042bc2f0417d..e59c485bc497 100644 --- a/drivers/net/irda/stir4200.c +++ b/drivers/net/irda/stir4200.c | |||
@@ -142,9 +142,6 @@ enum StirCtrl2Mask { | |||
142 | }; | 142 | }; |
143 | 143 | ||
144 | enum StirFifoCtlMask { | 144 | enum StirFifoCtlMask { |
145 | FIFOCTL_EOF = 0x80, | ||
146 | FIFOCTL_UNDER = 0x40, | ||
147 | FIFOCTL_OVER = 0x20, | ||
148 | FIFOCTL_DIR = 0x10, | 145 | FIFOCTL_DIR = 0x10, |
149 | FIFOCTL_CLR = 0x08, | 146 | FIFOCTL_CLR = 0x08, |
150 | FIFOCTL_EMPTY = 0x04, | 147 | FIFOCTL_EMPTY = 0x04, |
@@ -594,9 +591,10 @@ static int fifo_txwait(struct stir_cb *stir, int space) | |||
594 | { | 591 | { |
595 | int err; | 592 | int err; |
596 | unsigned long count, status; | 593 | unsigned long count, status; |
594 | unsigned long prev_count = 0x1fff; | ||
597 | 595 | ||
598 | /* Read FIFO status and count */ | 596 | /* Read FIFO status and count */ |
599 | for(;;) { | 597 | for (;; prev_count = count) { |
600 | err = read_reg(stir, REG_FIFOCTL, stir->fifo_status, | 598 | err = read_reg(stir, REG_FIFOCTL, stir->fifo_status, |
601 | FIFO_REGS_SIZE); | 599 | FIFO_REGS_SIZE); |
602 | if (unlikely(err != FIFO_REGS_SIZE)) { | 600 | if (unlikely(err != FIFO_REGS_SIZE)) { |
@@ -629,6 +627,10 @@ static int fifo_txwait(struct stir_cb *stir, int space) | |||
629 | if (space >= 0 && STIR_FIFO_SIZE - 4 > space + count) | 627 | if (space >= 0 && STIR_FIFO_SIZE - 4 > space + count) |
630 | return 0; | 628 | return 0; |
631 | 629 | ||
630 | /* queue confused */ | ||
631 | if (prev_count < count) | ||
632 | break; | ||
633 | |||
632 | /* estimate transfer time for remaining chars */ | 634 | /* estimate transfer time for remaining chars */ |
633 | msleep((count * 8000) / stir->speed); | 635 | msleep((count * 8000) / stir->speed); |
634 | } | 636 | } |
diff --git a/drivers/net/wan/syncppp.c b/drivers/net/wan/syncppp.c index 232ecba5340f..61e24b7a45a3 100644 --- a/drivers/net/wan/syncppp.c +++ b/drivers/net/wan/syncppp.c | |||
@@ -107,24 +107,24 @@ | |||
107 | struct ppp_header { | 107 | struct ppp_header { |
108 | u8 address; | 108 | u8 address; |
109 | u8 control; | 109 | u8 control; |
110 | u16 protocol; | 110 | __be16 protocol; |
111 | }; | 111 | }; |
112 | #define PPP_HEADER_LEN sizeof (struct ppp_header) | 112 | #define PPP_HEADER_LEN sizeof (struct ppp_header) |
113 | 113 | ||
114 | struct lcp_header { | 114 | struct lcp_header { |
115 | u8 type; | 115 | u8 type; |
116 | u8 ident; | 116 | u8 ident; |
117 | u16 len; | 117 | __be16 len; |
118 | }; | 118 | }; |
119 | #define LCP_HEADER_LEN sizeof (struct lcp_header) | 119 | #define LCP_HEADER_LEN sizeof (struct lcp_header) |
120 | 120 | ||
121 | struct cisco_packet { | 121 | struct cisco_packet { |
122 | u32 type; | 122 | __be32 type; |
123 | u32 par1; | 123 | __be32 par1; |
124 | u32 par2; | 124 | __be32 par2; |
125 | u16 rel; | 125 | __be16 rel; |
126 | u16 time0; | 126 | __be16 time0; |
127 | u16 time1; | 127 | __be16 time1; |
128 | }; | 128 | }; |
129 | #define CISCO_PACKET_LEN 18 | 129 | #define CISCO_PACKET_LEN 18 |
130 | #define CISCO_BIG_PACKET_LEN 20 | 130 | #define CISCO_BIG_PACKET_LEN 20 |
@@ -139,7 +139,7 @@ static struct sk_buff_head tx_queue; | |||
139 | static void sppp_keepalive (unsigned long dummy); | 139 | static void sppp_keepalive (unsigned long dummy); |
140 | static void sppp_cp_send (struct sppp *sp, u16 proto, u8 type, | 140 | static void sppp_cp_send (struct sppp *sp, u16 proto, u8 type, |
141 | u8 ident, u16 len, void *data); | 141 | u8 ident, u16 len, void *data); |
142 | static void sppp_cisco_send (struct sppp *sp, int type, long par1, long par2); | 142 | static void sppp_cisco_send (struct sppp *sp, int type, u32 par1, u32 par2); |
143 | static void sppp_lcp_input (struct sppp *sp, struct sk_buff *m); | 143 | static void sppp_lcp_input (struct sppp *sp, struct sk_buff *m); |
144 | static void sppp_cisco_input (struct sppp *sp, struct sk_buff *m); | 144 | static void sppp_cisco_input (struct sppp *sp, struct sk_buff *m); |
145 | static void sppp_ipcp_input (struct sppp *sp, struct sk_buff *m); | 145 | static void sppp_ipcp_input (struct sppp *sp, struct sk_buff *m); |
@@ -447,7 +447,7 @@ static void sppp_keepalive (unsigned long dummy) | |||
447 | sppp_cisco_send (sp, CISCO_KEEPALIVE_REQ, ++sp->pp_seq, | 447 | sppp_cisco_send (sp, CISCO_KEEPALIVE_REQ, ++sp->pp_seq, |
448 | sp->pp_rseq); | 448 | sp->pp_rseq); |
449 | else if (sp->lcp.state == LCP_STATE_OPENED) { | 449 | else if (sp->lcp.state == LCP_STATE_OPENED) { |
450 | long nmagic = htonl (sp->lcp.magic); | 450 | __be32 nmagic = htonl (sp->lcp.magic); |
451 | sp->lcp.echoid = ++sp->pp_seq; | 451 | sp->lcp.echoid = ++sp->pp_seq; |
452 | sppp_cp_send (sp, PPP_LCP, LCP_ECHO_REQ, | 452 | sppp_cp_send (sp, PPP_LCP, LCP_ECHO_REQ, |
453 | sp->lcp.echoid, 4, &nmagic); | 453 | sp->lcp.echoid, 4, &nmagic); |
@@ -667,7 +667,7 @@ badreq: | |||
667 | dev->name, len); | 667 | dev->name, len); |
668 | break; | 668 | break; |
669 | } | 669 | } |
670 | if (ntohl (*(long*)(h+1)) == sp->lcp.magic) { | 670 | if (ntohl (*(__be32*)(h+1)) == sp->lcp.magic) { |
671 | /* Line loopback mode detected. */ | 671 | /* Line loopback mode detected. */ |
672 | printk (KERN_WARNING "%s: loopback\n", dev->name); | 672 | printk (KERN_WARNING "%s: loopback\n", dev->name); |
673 | if_down (dev); | 673 | if_down (dev); |
@@ -680,7 +680,7 @@ badreq: | |||
680 | sppp_lcp_open (sp); | 680 | sppp_lcp_open (sp); |
681 | break; | 681 | break; |
682 | } | 682 | } |
683 | *(long*)(h+1) = htonl (sp->lcp.magic); | 683 | *(__be32 *)(h+1) = htonl (sp->lcp.magic); |
684 | sppp_cp_send (sp, PPP_LCP, LCP_ECHO_REPLY, h->ident, len-4, h+1); | 684 | sppp_cp_send (sp, PPP_LCP, LCP_ECHO_REPLY, h->ident, len-4, h+1); |
685 | break; | 685 | break; |
686 | case LCP_ECHO_REPLY: | 686 | case LCP_ECHO_REPLY: |
@@ -692,7 +692,7 @@ badreq: | |||
692 | dev->name, len); | 692 | dev->name, len); |
693 | break; | 693 | break; |
694 | } | 694 | } |
695 | if (ntohl (*(long*)(h+1)) != sp->lcp.magic) | 695 | if (ntohl(*(__be32 *)(h+1)) != sp->lcp.magic) |
696 | sp->pp_alivecnt = 0; | 696 | sp->pp_alivecnt = 0; |
697 | break; | 697 | break; |
698 | } | 698 | } |
@@ -765,7 +765,7 @@ static void sppp_cisco_input (struct sppp *sp, struct sk_buff *skb) | |||
765 | { | 765 | { |
766 | struct in_device *in_dev; | 766 | struct in_device *in_dev; |
767 | struct in_ifaddr *ifa; | 767 | struct in_ifaddr *ifa; |
768 | __be32 addr = 0, mask = ~0; /* FIXME: is the mask correct? */ | 768 | __be32 addr = 0, mask = htonl(~0U); /* FIXME: is the mask correct? */ |
769 | #ifdef CONFIG_INET | 769 | #ifdef CONFIG_INET |
770 | rcu_read_lock(); | 770 | rcu_read_lock(); |
771 | if ((in_dev = __in_dev_get_rcu(dev)) != NULL) | 771 | if ((in_dev = __in_dev_get_rcu(dev)) != NULL) |
@@ -782,8 +782,7 @@ static void sppp_cisco_input (struct sppp *sp, struct sk_buff *skb) | |||
782 | } | 782 | } |
783 | rcu_read_unlock(); | 783 | rcu_read_unlock(); |
784 | #endif | 784 | #endif |
785 | /* I hope both addr and mask are in the net order */ | 785 | sppp_cisco_send (sp, CISCO_ADDR_REPLY, ntohl(addr), ntohl(mask)); |
786 | sppp_cisco_send (sp, CISCO_ADDR_REPLY, addr, mask); | ||
787 | break; | 786 | break; |
788 | } | 787 | } |
789 | } | 788 | } |
@@ -844,7 +843,7 @@ static void sppp_cp_send (struct sppp *sp, u16 proto, u8 type, | |||
844 | * Send Cisco keepalive packet. | 843 | * Send Cisco keepalive packet. |
845 | */ | 844 | */ |
846 | 845 | ||
847 | static void sppp_cisco_send (struct sppp *sp, int type, long par1, long par2) | 846 | static void sppp_cisco_send (struct sppp *sp, int type, u32 par1, u32 par2) |
848 | { | 847 | { |
849 | struct ppp_header *h; | 848 | struct ppp_header *h; |
850 | struct cisco_packet *ch; | 849 | struct cisco_packet *ch; |
@@ -868,7 +867,7 @@ static void sppp_cisco_send (struct sppp *sp, int type, long par1, long par2) | |||
868 | ch->type = htonl (type); | 867 | ch->type = htonl (type); |
869 | ch->par1 = htonl (par1); | 868 | ch->par1 = htonl (par1); |
870 | ch->par2 = htonl (par2); | 869 | ch->par2 = htonl (par2); |
871 | ch->rel = -1; | 870 | ch->rel = htons(0xffff); |
872 | ch->time0 = htons ((u16) (t >> 16)); | 871 | ch->time0 = htons ((u16) (t >> 16)); |
873 | ch->time1 = htons ((u16) t); | 872 | ch->time1 = htons ((u16) t); |
874 | 873 | ||
diff --git a/drivers/sbus/char/cpwatchdog.c b/drivers/sbus/char/cpwatchdog.c index 7b5773d88212..a4e758143665 100644 --- a/drivers/sbus/char/cpwatchdog.c +++ b/drivers/sbus/char/cpwatchdog.c | |||
@@ -154,7 +154,7 @@ struct wd_device { | |||
154 | }; | 154 | }; |
155 | 155 | ||
156 | static struct wd_device wd_dev = { | 156 | static struct wd_device wd_dev = { |
157 | 0, SPIN_LOCK_UNLOCKED, 0, 0, 0, 0, | 157 | 0, __SPIN_LOCK_UNLOCKED(wd_dev.lock), 0, 0, 0, 0, |
158 | }; | 158 | }; |
159 | 159 | ||
160 | static struct timer_list wd_timer; | 160 | static struct timer_list wd_timer; |
diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c index 7a835a35f21d..9706de9d98d5 100644 --- a/drivers/scsi/ide-scsi.c +++ b/drivers/scsi/ide-scsi.c | |||
@@ -242,6 +242,11 @@ static void idescsi_output_buffers (ide_drive_t *drive, idescsi_pc_t *pc, unsign | |||
242 | } | 242 | } |
243 | } | 243 | } |
244 | 244 | ||
245 | static void ide_scsi_hex_dump(u8 *data, int len) | ||
246 | { | ||
247 | print_hex_dump(KERN_CONT, "", DUMP_PREFIX_NONE, 16, 1, data, len, 0); | ||
248 | } | ||
249 | |||
245 | static int idescsi_check_condition(ide_drive_t *drive, struct request *failed_command) | 250 | static int idescsi_check_condition(ide_drive_t *drive, struct request *failed_command) |
246 | { | 251 | { |
247 | idescsi_scsi_t *scsi = drive_to_idescsi(drive); | 252 | idescsi_scsi_t *scsi = drive_to_idescsi(drive); |
@@ -272,8 +277,7 @@ static int idescsi_check_condition(ide_drive_t *drive, struct request *failed_co | |||
272 | pc->scsi_cmd = ((idescsi_pc_t *) failed_command->special)->scsi_cmd; | 277 | pc->scsi_cmd = ((idescsi_pc_t *) failed_command->special)->scsi_cmd; |
273 | if (test_bit(IDESCSI_LOG_CMD, &scsi->log)) { | 278 | if (test_bit(IDESCSI_LOG_CMD, &scsi->log)) { |
274 | printk ("ide-scsi: %s: queue cmd = ", drive->name); | 279 | printk ("ide-scsi: %s: queue cmd = ", drive->name); |
275 | print_hex_dump(KERN_CONT, "", DUMP_PREFIX_NONE, 16, 1, pc->c, | 280 | ide_scsi_hex_dump(pc->c, 6); |
276 | 6, 0); | ||
277 | } | 281 | } |
278 | rq->rq_disk = scsi->disk; | 282 | rq->rq_disk = scsi->disk; |
279 | return ide_do_drive_cmd(drive, rq, ide_preempt); | 283 | return ide_do_drive_cmd(drive, rq, ide_preempt); |
@@ -328,8 +332,7 @@ static int idescsi_end_request (ide_drive_t *drive, int uptodate, int nrsecs) | |||
328 | idescsi_pc_t *opc = (idescsi_pc_t *) rq->buffer; | 332 | idescsi_pc_t *opc = (idescsi_pc_t *) rq->buffer; |
329 | if (log) { | 333 | if (log) { |
330 | printk ("ide-scsi: %s: wrap up check %lu, rst = ", drive->name, opc->scsi_cmd->serial_number); | 334 | printk ("ide-scsi: %s: wrap up check %lu, rst = ", drive->name, opc->scsi_cmd->serial_number); |
331 | print_hex_dump(KERN_CONT, "", DUMP_PREFIX_NONE, 16, 1, | 335 | ide_scsi_hex_dump(pc->buffer, 16); |
332 | pc->buffer, 16, 0); | ||
333 | } | 336 | } |
334 | memcpy((void *) opc->scsi_cmd->sense_buffer, pc->buffer, SCSI_SENSE_BUFFERSIZE); | 337 | memcpy((void *) opc->scsi_cmd->sense_buffer, pc->buffer, SCSI_SENSE_BUFFERSIZE); |
335 | kfree(pc->buffer); | 338 | kfree(pc->buffer); |
@@ -808,12 +811,10 @@ static int idescsi_queue (struct scsi_cmnd *cmd, | |||
808 | 811 | ||
809 | if (test_bit(IDESCSI_LOG_CMD, &scsi->log)) { | 812 | if (test_bit(IDESCSI_LOG_CMD, &scsi->log)) { |
810 | printk ("ide-scsi: %s: que %lu, cmd = ", drive->name, cmd->serial_number); | 813 | printk ("ide-scsi: %s: que %lu, cmd = ", drive->name, cmd->serial_number); |
811 | print_hex_dump(KERN_CONT, "", DUMP_PREFIX_NONE, 16, 1, | 814 | ide_scsi_hex_dump(cmd->cmnd, cmd->cmd_len); |
812 | cmd->cmnd, cmd->cmd_len, 0); | ||
813 | if (memcmp(pc->c, cmd->cmnd, cmd->cmd_len)) { | 815 | if (memcmp(pc->c, cmd->cmnd, cmd->cmd_len)) { |
814 | printk ("ide-scsi: %s: que %lu, tsl = ", drive->name, cmd->serial_number); | 816 | printk ("ide-scsi: %s: que %lu, tsl = ", drive->name, cmd->serial_number); |
815 | print_hex_dump(KERN_CONT, "", DUMP_PREFIX_NONE, 16, 1, | 817 | ide_scsi_hex_dump(pc->c, 12); |
816 | pc->c, 12, 0); | ||
817 | } | 818 | } |
818 | } | 819 | } |
819 | 820 | ||
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig index 2792bc1a7269..52dff40ec192 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig | |||
@@ -392,6 +392,16 @@ config ITCO_VENDOR_SUPPORT | |||
392 | devices. At this moment we only have additional support for some | 392 | devices. At this moment we only have additional support for some |
393 | SuperMicro Inc. motherboards. | 393 | SuperMicro Inc. motherboards. |
394 | 394 | ||
395 | config IT8712F_WDT | ||
396 | tristate "IT8712F (Smart Guardian) Watchdog Timer" | ||
397 | depends on X86 | ||
398 | ---help--- | ||
399 | This is the driver for the built-in watchdog timer on the IT8712F | ||
400 | Super I/0 chipset used on many motherboards. | ||
401 | |||
402 | To compile this driver as a module, choose M here: the | ||
403 | module will be called it8712f_wdt. | ||
404 | |||
395 | config SC1200_WDT | 405 | config SC1200_WDT |
396 | tristate "National Semiconductor PC87307/PC97307 (ala SC1200) Watchdog" | 406 | tristate "National Semiconductor PC87307/PC97307 (ala SC1200) Watchdog" |
397 | depends on X86 | 407 | depends on X86 |
@@ -456,6 +466,19 @@ config SBC8360_WDT | |||
456 | 466 | ||
457 | Most people will say N. | 467 | Most people will say N. |
458 | 468 | ||
469 | config SBC7240_WDT | ||
470 | tristate "SBC Nano 7240 Watchdog Timer" | ||
471 | depends on X86_32 | ||
472 | ---help--- | ||
473 | This is the driver for the hardware watchdog found on the IEI | ||
474 | single board computers EPIC Nano 7240 (and likely others). This | ||
475 | watchdog simply watches your kernel to make sure it doesn't freeze, | ||
476 | and if it does, it reboots your computer after a certain amount of | ||
477 | time. | ||
478 | |||
479 | To compile this driver as a module, choose M here: the | ||
480 | module will be called sbc7240_wdt. | ||
481 | |||
459 | config CPU5_WDT | 482 | config CPU5_WDT |
460 | tristate "SMA CPU5 Watchdog" | 483 | tristate "SMA CPU5 Watchdog" |
461 | depends on X86 | 484 | depends on X86 |
diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile index 7d9e5734f8bb..87483cc63252 100644 --- a/drivers/watchdog/Makefile +++ b/drivers/watchdog/Makefile | |||
@@ -66,11 +66,13 @@ obj-$(CONFIG_IBMASR) += ibmasr.o | |||
66 | obj-$(CONFIG_WAFER_WDT) += wafer5823wdt.o | 66 | obj-$(CONFIG_WAFER_WDT) += wafer5823wdt.o |
67 | obj-$(CONFIG_I6300ESB_WDT) += i6300esb.o | 67 | obj-$(CONFIG_I6300ESB_WDT) += i6300esb.o |
68 | obj-$(CONFIG_ITCO_WDT) += iTCO_wdt.o iTCO_vendor_support.o | 68 | obj-$(CONFIG_ITCO_WDT) += iTCO_wdt.o iTCO_vendor_support.o |
69 | obj-$(CONFIG_IT8712F_WDT) += it8712f_wdt.o | ||
69 | obj-$(CONFIG_SC1200_WDT) += sc1200wdt.o | 70 | obj-$(CONFIG_SC1200_WDT) += sc1200wdt.o |
70 | obj-$(CONFIG_SCx200_WDT) += scx200_wdt.o | 71 | obj-$(CONFIG_SCx200_WDT) += scx200_wdt.o |
71 | obj-$(CONFIG_PC87413_WDT) += pc87413_wdt.o | 72 | obj-$(CONFIG_PC87413_WDT) += pc87413_wdt.o |
72 | obj-$(CONFIG_60XX_WDT) += sbc60xxwdt.o | 73 | obj-$(CONFIG_60XX_WDT) += sbc60xxwdt.o |
73 | obj-$(CONFIG_SBC8360_WDT) += sbc8360.o | 74 | obj-$(CONFIG_SBC8360_WDT) += sbc8360.o |
75 | obj-$(CONFIG_SBC7240_WDT) += sbc7240_wdt.o | ||
74 | obj-$(CONFIG_CPU5_WDT) += cpu5wdt.o | 76 | obj-$(CONFIG_CPU5_WDT) += cpu5wdt.o |
75 | obj-$(CONFIG_SMSC37B787_WDT) += smsc37b787_wdt.o | 77 | obj-$(CONFIG_SMSC37B787_WDT) += smsc37b787_wdt.o |
76 | obj-$(CONFIG_W83627HF_WDT) += w83627hf_wdt.o | 78 | obj-$(CONFIG_W83627HF_WDT) += w83627hf_wdt.o |
diff --git a/drivers/watchdog/at32ap700x_wdt.c b/drivers/watchdog/at32ap700x_wdt.c index 54a516169d07..fb5ed6478f78 100644 --- a/drivers/watchdog/at32ap700x_wdt.c +++ b/drivers/watchdog/at32ap700x_wdt.c | |||
@@ -6,6 +6,19 @@ | |||
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License version 2 as | 7 | * it under the terms of the GNU General Public License version 2 as |
8 | * published by the Free Software Foundation. | 8 | * published by the Free Software Foundation. |
9 | * | ||
10 | * | ||
11 | * Errata: WDT Clear is blocked after WDT Reset | ||
12 | * | ||
13 | * A watchdog timer event will, after reset, block writes to the WDT_CLEAR | ||
14 | * register, preventing the program to clear the next Watchdog Timer Reset. | ||
15 | * | ||
16 | * If you still want to use the WDT after a WDT reset a small code can be | ||
17 | * insterted at the startup checking the AVR32_PM.rcause register for WDT reset | ||
18 | * and use a GPIO pin to reset the system. This method requires that one of the | ||
19 | * GPIO pins are available and connected externally to the RESET_N pin. After | ||
20 | * the GPIO pin has pulled down the reset line the GPIO will be reset and leave | ||
21 | * the pin tristated with pullup. | ||
9 | */ | 22 | */ |
10 | 23 | ||
11 | #include <linux/init.h> | 24 | #include <linux/init.h> |
@@ -44,6 +57,13 @@ MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" | |||
44 | 57 | ||
45 | #define WDT_CLR 0x04 | 58 | #define WDT_CLR 0x04 |
46 | 59 | ||
60 | #define WDT_RCAUSE 0x10 | ||
61 | #define WDT_RCAUSE_POR 0 | ||
62 | #define WDT_RCAUSE_EXT 2 | ||
63 | #define WDT_RCAUSE_WDT 3 | ||
64 | #define WDT_RCAUSE_JTAG 4 | ||
65 | #define WDT_RCAUSE_SERP 5 | ||
66 | |||
47 | #define WDT_BIT(name) (1 << WDT_##name) | 67 | #define WDT_BIT(name) (1 << WDT_##name) |
48 | #define WDT_BF(name, value) ((value) << WDT_##name) | 68 | #define WDT_BF(name, value) ((value) << WDT_##name) |
49 | 69 | ||
@@ -56,6 +76,7 @@ struct wdt_at32ap700x { | |||
56 | void __iomem *regs; | 76 | void __iomem *regs; |
57 | spinlock_t io_lock; | 77 | spinlock_t io_lock; |
58 | int timeout; | 78 | int timeout; |
79 | int boot_status; | ||
59 | unsigned long users; | 80 | unsigned long users; |
60 | struct miscdevice miscdev; | 81 | struct miscdevice miscdev; |
61 | }; | 82 | }; |
@@ -126,7 +147,7 @@ static int at32_wdt_close(struct inode *inode, struct file *file) | |||
126 | at32_wdt_stop(); | 147 | at32_wdt_stop(); |
127 | } else { | 148 | } else { |
128 | dev_dbg(wdt->miscdev.parent, | 149 | dev_dbg(wdt->miscdev.parent, |
129 | "Unexpected close, not stopping watchdog!\n"); | 150 | "unexpected close, not stopping watchdog!\n"); |
130 | at32_wdt_pat(); | 151 | at32_wdt_pat(); |
131 | } | 152 | } |
132 | clear_bit(1, &wdt->users); | 153 | clear_bit(1, &wdt->users); |
@@ -154,6 +175,33 @@ static int at32_wdt_settimeout(int time) | |||
154 | return 0; | 175 | return 0; |
155 | } | 176 | } |
156 | 177 | ||
178 | /* | ||
179 | * Get the watchdog status. | ||
180 | */ | ||
181 | static int at32_wdt_get_status(void) | ||
182 | { | ||
183 | int rcause; | ||
184 | int status = 0; | ||
185 | |||
186 | rcause = wdt_readl(wdt, RCAUSE); | ||
187 | |||
188 | switch (rcause) { | ||
189 | case WDT_BIT(RCAUSE_EXT): | ||
190 | status = WDIOF_EXTERN1; | ||
191 | break; | ||
192 | case WDT_BIT(RCAUSE_WDT): | ||
193 | status = WDIOF_CARDRESET; | ||
194 | break; | ||
195 | case WDT_BIT(RCAUSE_POR): /* fall through */ | ||
196 | case WDT_BIT(RCAUSE_JTAG): /* fall through */ | ||
197 | case WDT_BIT(RCAUSE_SERP): /* fall through */ | ||
198 | default: | ||
199 | break; | ||
200 | } | ||
201 | |||
202 | return status; | ||
203 | } | ||
204 | |||
157 | static struct watchdog_info at32_wdt_info = { | 205 | static struct watchdog_info at32_wdt_info = { |
158 | .identity = "at32ap700x watchdog", | 206 | .identity = "at32ap700x watchdog", |
159 | .options = WDIOF_SETTIMEOUT | | 207 | .options = WDIOF_SETTIMEOUT | |
@@ -194,10 +242,12 @@ static int at32_wdt_ioctl(struct inode *inode, struct file *file, | |||
194 | case WDIOC_GETTIMEOUT: | 242 | case WDIOC_GETTIMEOUT: |
195 | ret = put_user(wdt->timeout, p); | 243 | ret = put_user(wdt->timeout, p); |
196 | break; | 244 | break; |
197 | case WDIOC_GETSTATUS: /* fall through */ | 245 | case WDIOC_GETSTATUS: |
198 | case WDIOC_GETBOOTSTATUS: | ||
199 | ret = put_user(0, p); | 246 | ret = put_user(0, p); |
200 | break; | 247 | break; |
248 | case WDIOC_GETBOOTSTATUS: | ||
249 | ret = put_user(wdt->boot_status, p); | ||
250 | break; | ||
201 | case WDIOC_SETOPTIONS: | 251 | case WDIOC_SETOPTIONS: |
202 | ret = get_user(time, p); | 252 | ret = get_user(time, p); |
203 | if (ret) | 253 | if (ret) |
@@ -282,8 +332,19 @@ static int __init at32_wdt_probe(struct platform_device *pdev) | |||
282 | dev_dbg(&pdev->dev, "could not map I/O memory\n"); | 332 | dev_dbg(&pdev->dev, "could not map I/O memory\n"); |
283 | goto err_free; | 333 | goto err_free; |
284 | } | 334 | } |
335 | |||
285 | spin_lock_init(&wdt->io_lock); | 336 | spin_lock_init(&wdt->io_lock); |
286 | wdt->users = 0; | 337 | wdt->boot_status = at32_wdt_get_status(); |
338 | |||
339 | /* Work-around for watchdog silicon errata. */ | ||
340 | if (wdt->boot_status & WDIOF_CARDRESET) { | ||
341 | dev_info(&pdev->dev, "CPU must be reset with external " | ||
342 | "reset or POR due to silicon errata.\n"); | ||
343 | ret = -EIO; | ||
344 | goto err_iounmap; | ||
345 | } else { | ||
346 | wdt->users = 0; | ||
347 | } | ||
287 | wdt->miscdev.minor = WATCHDOG_MINOR; | 348 | wdt->miscdev.minor = WATCHDOG_MINOR; |
288 | wdt->miscdev.name = "watchdog"; | 349 | wdt->miscdev.name = "watchdog"; |
289 | wdt->miscdev.fops = &at32_wdt_fops; | 350 | wdt->miscdev.fops = &at32_wdt_fops; |
diff --git a/drivers/watchdog/bfin_wdt.c b/drivers/watchdog/bfin_wdt.c index 309d27913fc1..31dc7a69e90c 100644 --- a/drivers/watchdog/bfin_wdt.c +++ b/drivers/watchdog/bfin_wdt.c | |||
@@ -71,7 +71,7 @@ static int nowayout = WATCHDOG_NOWAYOUT; | |||
71 | static struct watchdog_info bfin_wdt_info; | 71 | static struct watchdog_info bfin_wdt_info; |
72 | static unsigned long open_check; | 72 | static unsigned long open_check; |
73 | static char expect_close; | 73 | static char expect_close; |
74 | static spinlock_t bfin_wdt_spinlock = SPIN_LOCK_UNLOCKED; | 74 | static DEFINE_SPINLOCK(bfin_wdt_spinlock); |
75 | 75 | ||
76 | /** | 76 | /** |
77 | * bfin_wdt_keepalive - Keep the Userspace Watchdog Alive | 77 | * bfin_wdt_keepalive - Keep the Userspace Watchdog Alive |
diff --git a/drivers/watchdog/it8712f_wdt.c b/drivers/watchdog/it8712f_wdt.c new file mode 100644 index 000000000000..6330fc02464e --- /dev/null +++ b/drivers/watchdog/it8712f_wdt.c | |||
@@ -0,0 +1,400 @@ | |||
1 | /* | ||
2 | * IT8712F "Smart Guardian" Watchdog support | ||
3 | * | ||
4 | * Copyright (c) 2006-2007 Jorge Boncompte - DTI2 <jorge@dti2.net> | ||
5 | * | ||
6 | * Based on info and code taken from: | ||
7 | * | ||
8 | * drivers/char/watchdog/scx200_wdt.c | ||
9 | * drivers/hwmon/it87.c | ||
10 | * IT8712F EC-LPC I/O Preliminary Specification 0.9.2.pdf | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License as | ||
14 | * published by the Free Software Foundation; either version 2 of the | ||
15 | * License, or (at your option) any later version. | ||
16 | * | ||
17 | * The author(s) of this software shall not be held liable for damages | ||
18 | * of any nature resulting due to the use of this software. This | ||
19 | * software is provided AS-IS with no warranties. | ||
20 | */ | ||
21 | |||
22 | #include <linux/module.h> | ||
23 | #include <linux/moduleparam.h> | ||
24 | #include <linux/init.h> | ||
25 | #include <linux/miscdevice.h> | ||
26 | #include <linux/watchdog.h> | ||
27 | #include <linux/notifier.h> | ||
28 | #include <linux/reboot.h> | ||
29 | #include <linux/fs.h> | ||
30 | #include <linux/pci.h> | ||
31 | #include <linux/spinlock.h> | ||
32 | |||
33 | #include <asm/uaccess.h> | ||
34 | #include <asm/io.h> | ||
35 | |||
36 | #define NAME "it8712f_wdt" | ||
37 | |||
38 | MODULE_AUTHOR("Jorge Boncompte - DTI2 <jorge@dti2.net>"); | ||
39 | MODULE_DESCRIPTION("IT8712F Watchdog Driver"); | ||
40 | MODULE_LICENSE("GPL"); | ||
41 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
42 | |||
43 | static int margin = 60; /* in seconds */ | ||
44 | module_param(margin, int, 0); | ||
45 | MODULE_PARM_DESC(margin, "Watchdog margin in seconds"); | ||
46 | |||
47 | static int nowayout = WATCHDOG_NOWAYOUT; | ||
48 | module_param(nowayout, int, 0); | ||
49 | MODULE_PARM_DESC(nowayout, "Disable watchdog shutdown on close"); | ||
50 | |||
51 | static struct semaphore it8712f_wdt_sem; | ||
52 | static unsigned expect_close; | ||
53 | static spinlock_t io_lock; | ||
54 | |||
55 | /* Dog Food address - We use the game port address */ | ||
56 | static unsigned short address; | ||
57 | |||
58 | #define REG 0x2e /* The register to read/write */ | ||
59 | #define VAL 0x2f /* The value to read/write */ | ||
60 | |||
61 | #define LDN 0x07 /* Register: Logical device select */ | ||
62 | #define DEVID 0x20 /* Register: Device ID */ | ||
63 | #define DEVREV 0x22 /* Register: Device Revision */ | ||
64 | #define ACT_REG 0x30 /* LDN Register: Activation */ | ||
65 | #define BASE_REG 0x60 /* LDN Register: Base address */ | ||
66 | |||
67 | #define IT8712F_DEVID 0x8712 | ||
68 | |||
69 | #define LDN_GPIO 0x07 /* GPIO and Watch Dog Timer */ | ||
70 | #define LDN_GAME 0x09 /* Game Port */ | ||
71 | |||
72 | #define WDT_CONTROL 0x71 /* WDT Register: Control */ | ||
73 | #define WDT_CONFIG 0x72 /* WDT Register: Configuration */ | ||
74 | #define WDT_TIMEOUT 0x73 /* WDT Register: Timeout Value */ | ||
75 | |||
76 | #define WDT_RESET_GAME 0x10 | ||
77 | #define WDT_RESET_KBD 0x20 | ||
78 | #define WDT_RESET_MOUSE 0x40 | ||
79 | #define WDT_RESET_CIR 0x80 | ||
80 | |||
81 | #define WDT_UNIT_SEC 0x80 /* If 0 in MINUTES */ | ||
82 | |||
83 | #define WDT_OUT_PWROK 0x10 | ||
84 | #define WDT_OUT_KRST 0x40 | ||
85 | |||
86 | static int | ||
87 | superio_inb(int reg) | ||
88 | { | ||
89 | outb(reg, REG); | ||
90 | return inb(VAL); | ||
91 | } | ||
92 | |||
93 | static void | ||
94 | superio_outb(int val, int reg) | ||
95 | { | ||
96 | outb(reg, REG); | ||
97 | outb(val, VAL); | ||
98 | } | ||
99 | |||
100 | static int | ||
101 | superio_inw(int reg) | ||
102 | { | ||
103 | int val; | ||
104 | outb(reg++, REG); | ||
105 | val = inb(VAL) << 8; | ||
106 | outb(reg, REG); | ||
107 | val |= inb(VAL); | ||
108 | return val; | ||
109 | } | ||
110 | |||
111 | static inline void | ||
112 | superio_select(int ldn) | ||
113 | { | ||
114 | outb(LDN, REG); | ||
115 | outb(ldn, VAL); | ||
116 | } | ||
117 | |||
118 | static inline void | ||
119 | superio_enter(void) | ||
120 | { | ||
121 | spin_lock(&io_lock); | ||
122 | outb(0x87, REG); | ||
123 | outb(0x01, REG); | ||
124 | outb(0x55, REG); | ||
125 | outb(0x55, REG); | ||
126 | } | ||
127 | |||
128 | static inline void | ||
129 | superio_exit(void) | ||
130 | { | ||
131 | outb(0x02, REG); | ||
132 | outb(0x02, VAL); | ||
133 | spin_unlock(&io_lock); | ||
134 | } | ||
135 | |||
136 | static inline void | ||
137 | it8712f_wdt_ping(void) | ||
138 | { | ||
139 | inb(address); | ||
140 | } | ||
141 | |||
142 | static void | ||
143 | it8712f_wdt_update_margin(void) | ||
144 | { | ||
145 | int config = WDT_OUT_KRST | WDT_OUT_PWROK; | ||
146 | |||
147 | printk(KERN_INFO NAME ": timer margin %d seconds\n", margin); | ||
148 | |||
149 | /* The timeout register only has 8bits wide */ | ||
150 | if (margin < 256) | ||
151 | config |= WDT_UNIT_SEC; /* else UNIT are MINUTES */ | ||
152 | superio_outb(config, WDT_CONFIG); | ||
153 | |||
154 | superio_outb((margin > 255) ? (margin / 60) : margin, WDT_TIMEOUT); | ||
155 | } | ||
156 | |||
157 | static void | ||
158 | it8712f_wdt_enable(void) | ||
159 | { | ||
160 | printk(KERN_DEBUG NAME ": enabling watchdog timer\n"); | ||
161 | superio_enter(); | ||
162 | superio_select(LDN_GPIO); | ||
163 | |||
164 | superio_outb(WDT_RESET_GAME, WDT_CONTROL); | ||
165 | |||
166 | it8712f_wdt_update_margin(); | ||
167 | |||
168 | superio_exit(); | ||
169 | |||
170 | it8712f_wdt_ping(); | ||
171 | } | ||
172 | |||
173 | static void | ||
174 | it8712f_wdt_disable(void) | ||
175 | { | ||
176 | printk(KERN_DEBUG NAME ": disabling watchdog timer\n"); | ||
177 | |||
178 | superio_enter(); | ||
179 | superio_select(LDN_GPIO); | ||
180 | |||
181 | superio_outb(0, WDT_CONFIG); | ||
182 | superio_outb(0, WDT_CONTROL); | ||
183 | superio_outb(0, WDT_TIMEOUT); | ||
184 | |||
185 | superio_exit(); | ||
186 | } | ||
187 | |||
188 | static int | ||
189 | it8712f_wdt_notify(struct notifier_block *this, | ||
190 | unsigned long code, void *unused) | ||
191 | { | ||
192 | if (code == SYS_HALT || code == SYS_POWER_OFF) | ||
193 | if (!nowayout) | ||
194 | it8712f_wdt_disable(); | ||
195 | |||
196 | return NOTIFY_DONE; | ||
197 | } | ||
198 | |||
199 | static struct notifier_block it8712f_wdt_notifier = { | ||
200 | .notifier_call = it8712f_wdt_notify, | ||
201 | }; | ||
202 | |||
203 | static ssize_t | ||
204 | it8712f_wdt_write(struct file *file, const char __user *data, | ||
205 | size_t len, loff_t *ppos) | ||
206 | { | ||
207 | /* check for a magic close character */ | ||
208 | if (len) { | ||
209 | size_t i; | ||
210 | |||
211 | it8712f_wdt_ping(); | ||
212 | |||
213 | expect_close = 0; | ||
214 | for (i = 0; i < len; ++i) { | ||
215 | char c; | ||
216 | if (get_user(c, data+i)) | ||
217 | return -EFAULT; | ||
218 | if (c == 'V') | ||
219 | expect_close = 42; | ||
220 | } | ||
221 | } | ||
222 | |||
223 | return len; | ||
224 | } | ||
225 | |||
226 | static int | ||
227 | it8712f_wdt_ioctl(struct inode *inode, struct file *file, | ||
228 | unsigned int cmd, unsigned long arg) | ||
229 | { | ||
230 | void __user *argp = (void __user *)arg; | ||
231 | int __user *p = argp; | ||
232 | static struct watchdog_info ident = { | ||
233 | .identity = "IT8712F Watchdog", | ||
234 | .firmware_version = 1, | ||
235 | .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING, | ||
236 | }; | ||
237 | int new_margin; | ||
238 | |||
239 | switch (cmd) { | ||
240 | default: | ||
241 | return -ENOTTY; | ||
242 | case WDIOC_GETSUPPORT: | ||
243 | if (copy_to_user(argp, &ident, sizeof(ident))) | ||
244 | return -EFAULT; | ||
245 | return 0; | ||
246 | case WDIOC_GETSTATUS: | ||
247 | case WDIOC_GETBOOTSTATUS: | ||
248 | return put_user(0, p); | ||
249 | case WDIOC_KEEPALIVE: | ||
250 | it8712f_wdt_ping(); | ||
251 | return 0; | ||
252 | case WDIOC_SETTIMEOUT: | ||
253 | if (get_user(new_margin, p)) | ||
254 | return -EFAULT; | ||
255 | if (new_margin < 1) | ||
256 | return -EINVAL; | ||
257 | margin = new_margin; | ||
258 | superio_enter(); | ||
259 | superio_select(LDN_GPIO); | ||
260 | |||
261 | it8712f_wdt_update_margin(); | ||
262 | |||
263 | superio_exit(); | ||
264 | it8712f_wdt_ping(); | ||
265 | case WDIOC_GETTIMEOUT: | ||
266 | if (put_user(margin, p)) | ||
267 | return -EFAULT; | ||
268 | return 0; | ||
269 | } | ||
270 | } | ||
271 | |||
272 | static int | ||
273 | it8712f_wdt_open(struct inode *inode, struct file *file) | ||
274 | { | ||
275 | /* only allow one at a time */ | ||
276 | if (down_trylock(&it8712f_wdt_sem)) | ||
277 | return -EBUSY; | ||
278 | it8712f_wdt_enable(); | ||
279 | |||
280 | return nonseekable_open(inode, file); | ||
281 | } | ||
282 | |||
283 | static int | ||
284 | it8712f_wdt_release(struct inode *inode, struct file *file) | ||
285 | { | ||
286 | if (expect_close != 42) { | ||
287 | printk(KERN_WARNING NAME | ||
288 | ": watchdog device closed unexpectedly, will not" | ||
289 | " disable the watchdog timer\n"); | ||
290 | } else if (!nowayout) { | ||
291 | it8712f_wdt_disable(); | ||
292 | } | ||
293 | expect_close = 0; | ||
294 | up(&it8712f_wdt_sem); | ||
295 | |||
296 | return 0; | ||
297 | } | ||
298 | |||
299 | static struct file_operations it8712f_wdt_fops = { | ||
300 | .owner = THIS_MODULE, | ||
301 | .llseek = no_llseek, | ||
302 | .write = it8712f_wdt_write, | ||
303 | .ioctl = it8712f_wdt_ioctl, | ||
304 | .open = it8712f_wdt_open, | ||
305 | .release = it8712f_wdt_release, | ||
306 | }; | ||
307 | |||
308 | static struct miscdevice it8712f_wdt_miscdev = { | ||
309 | .minor = WATCHDOG_MINOR, | ||
310 | .name = "watchdog", | ||
311 | .fops = &it8712f_wdt_fops, | ||
312 | }; | ||
313 | |||
314 | static int __init | ||
315 | it8712f_wdt_find(unsigned short *address) | ||
316 | { | ||
317 | int err = -ENODEV; | ||
318 | int chip_type; | ||
319 | |||
320 | superio_enter(); | ||
321 | chip_type = superio_inw(DEVID); | ||
322 | if (chip_type != IT8712F_DEVID) | ||
323 | goto exit; | ||
324 | |||
325 | superio_select(LDN_GAME); | ||
326 | superio_outb(1, ACT_REG); | ||
327 | if (!(superio_inb(ACT_REG) & 0x01)) { | ||
328 | printk(KERN_ERR NAME ": Device not activated, skipping\n"); | ||
329 | goto exit; | ||
330 | } | ||
331 | |||
332 | *address = superio_inw(BASE_REG); | ||
333 | if (*address == 0) { | ||
334 | printk(KERN_ERR NAME ": Base address not set, skipping\n"); | ||
335 | goto exit; | ||
336 | } | ||
337 | |||
338 | err = 0; | ||
339 | printk(KERN_DEBUG NAME ": Found IT%04xF chip revision %d - " | ||
340 | "using DogFood address 0x%x\n", | ||
341 | chip_type, superio_inb(DEVREV) & 0x0f, *address); | ||
342 | |||
343 | exit: | ||
344 | superio_exit(); | ||
345 | return err; | ||
346 | } | ||
347 | |||
348 | static int __init | ||
349 | it8712f_wdt_init(void) | ||
350 | { | ||
351 | int err = 0; | ||
352 | |||
353 | spin_lock_init(&io_lock); | ||
354 | |||
355 | if (it8712f_wdt_find(&address)) | ||
356 | return -ENODEV; | ||
357 | |||
358 | if (!request_region(address, 1, "IT8712F Watchdog")) { | ||
359 | printk(KERN_WARNING NAME ": watchdog I/O region busy\n"); | ||
360 | return -EBUSY; | ||
361 | } | ||
362 | |||
363 | it8712f_wdt_disable(); | ||
364 | |||
365 | sema_init(&it8712f_wdt_sem, 1); | ||
366 | |||
367 | err = register_reboot_notifier(&it8712f_wdt_notifier); | ||
368 | if (err) { | ||
369 | printk(KERN_ERR NAME ": unable to register reboot notifier\n"); | ||
370 | goto out; | ||
371 | } | ||
372 | |||
373 | err = misc_register(&it8712f_wdt_miscdev); | ||
374 | if (err) { | ||
375 | printk(KERN_ERR NAME | ||
376 | ": cannot register miscdev on minor=%d (err=%d)\n", | ||
377 | WATCHDOG_MINOR, err); | ||
378 | goto reboot_out; | ||
379 | } | ||
380 | |||
381 | return 0; | ||
382 | |||
383 | |||
384 | reboot_out: | ||
385 | unregister_reboot_notifier(&it8712f_wdt_notifier); | ||
386 | out: | ||
387 | release_region(address, 1); | ||
388 | return err; | ||
389 | } | ||
390 | |||
391 | static void __exit | ||
392 | it8712f_wdt_exit(void) | ||
393 | { | ||
394 | misc_deregister(&it8712f_wdt_miscdev); | ||
395 | unregister_reboot_notifier(&it8712f_wdt_notifier); | ||
396 | release_region(address, 1); | ||
397 | } | ||
398 | |||
399 | module_init(it8712f_wdt_init); | ||
400 | module_exit(it8712f_wdt_exit); | ||
diff --git a/drivers/watchdog/sbc7240_wdt.c b/drivers/watchdog/sbc7240_wdt.c new file mode 100644 index 000000000000..4c8cefbd8627 --- /dev/null +++ b/drivers/watchdog/sbc7240_wdt.c | |||
@@ -0,0 +1,324 @@ | |||
1 | /* | ||
2 | * NANO7240 SBC Watchdog device driver | ||
3 | * | ||
4 | * Based on w83877f.c by Scott Jennings, | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation; | ||
9 | * | ||
10 | * Software distributed under the License is distributed on an "AS IS" | ||
11 | * basis, WITHOUT WARRANTY OF ANY KIND, either express or | ||
12 | * implied. See the License for the specific language governing | ||
13 | * rights and limitations under the License. | ||
14 | * | ||
15 | * (c) Copyright 2007 Gilles GIGAN <gilles.gigan@jcu.edu.au> | ||
16 | * | ||
17 | */ | ||
18 | |||
19 | #include <linux/fs.h> | ||
20 | #include <linux/init.h> | ||
21 | #include <linux/ioport.h> | ||
22 | #include <linux/jiffies.h> | ||
23 | #include <linux/module.h> | ||
24 | #include <linux/moduleparam.h> | ||
25 | #include <linux/miscdevice.h> | ||
26 | #include <linux/notifier.h> | ||
27 | #include <linux/reboot.h> | ||
28 | #include <linux/types.h> | ||
29 | #include <linux/watchdog.h> | ||
30 | #include <asm/atomic.h> | ||
31 | #include <asm/io.h> | ||
32 | #include <asm/system.h> | ||
33 | #include <asm/uaccess.h> | ||
34 | |||
35 | #define SBC7240_PREFIX "sbc7240_wdt: " | ||
36 | |||
37 | #define SBC7240_ENABLE_PORT 0x443 | ||
38 | #define SBC7240_DISABLE_PORT 0x043 | ||
39 | #define SBC7240_SET_TIMEOUT_PORT SBC7240_ENABLE_PORT | ||
40 | #define SBC7240_MAGIC_CHAR 'V' | ||
41 | |||
42 | #define SBC7240_TIMEOUT 30 | ||
43 | #define SBC7240_MAX_TIMEOUT 255 | ||
44 | static int timeout = SBC7240_TIMEOUT; /* in seconds */ | ||
45 | module_param(timeout, int, 0); | ||
46 | MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. (1<=timeout<=" | ||
47 | __MODULE_STRING(SBC7240_MAX_TIMEOUT) ", default=" | ||
48 | __MODULE_STRING(SBC7240_TIMEOUT) ")"); | ||
49 | |||
50 | static int nowayout = WATCHDOG_NOWAYOUT; | ||
51 | module_param(nowayout, int, 0); | ||
52 | MODULE_PARM_DESC(nowayout, "Disable watchdog when closing device file"); | ||
53 | |||
54 | #define SBC7240_OPEN_STATUS_BIT 0 | ||
55 | #define SBC7240_ENABLED_STATUS_BIT 1 | ||
56 | #define SBC7240_EXPECT_CLOSE_STATUS_BIT 2 | ||
57 | static unsigned long wdt_status; | ||
58 | |||
59 | /* | ||
60 | * Utility routines | ||
61 | */ | ||
62 | |||
63 | static void wdt_disable(void) | ||
64 | { | ||
65 | /* disable the watchdog */ | ||
66 | if (test_and_clear_bit(SBC7240_ENABLED_STATUS_BIT, &wdt_status)) { | ||
67 | inb_p(SBC7240_DISABLE_PORT); | ||
68 | printk(KERN_INFO SBC7240_PREFIX | ||
69 | "Watchdog timer is now disabled.\n"); | ||
70 | } | ||
71 | } | ||
72 | |||
73 | static void wdt_enable(void) | ||
74 | { | ||
75 | /* enable the watchdog */ | ||
76 | if (!test_and_set_bit(SBC7240_ENABLED_STATUS_BIT, &wdt_status)) { | ||
77 | inb_p(SBC7240_ENABLE_PORT); | ||
78 | printk(KERN_INFO SBC7240_PREFIX | ||
79 | "Watchdog timer is now enabled.\n"); | ||
80 | } | ||
81 | } | ||
82 | |||
83 | static int wdt_set_timeout(int t) | ||
84 | { | ||
85 | if (t < 1 || t > SBC7240_MAX_TIMEOUT) { | ||
86 | printk(KERN_ERR SBC7240_PREFIX | ||
87 | "timeout value must be 1<=x<=%d\n", | ||
88 | SBC7240_MAX_TIMEOUT); | ||
89 | return -1; | ||
90 | } | ||
91 | /* set the timeout */ | ||
92 | outb_p((unsigned)t, SBC7240_SET_TIMEOUT_PORT); | ||
93 | timeout = t; | ||
94 | printk(KERN_INFO SBC7240_PREFIX "timeout set to %d seconds\n", t); | ||
95 | return 0; | ||
96 | } | ||
97 | |||
98 | /* Whack the dog */ | ||
99 | static inline void wdt_keepalive(void) | ||
100 | { | ||
101 | if (test_bit(SBC7240_ENABLED_STATUS_BIT, &wdt_status)) | ||
102 | inb_p(SBC7240_ENABLE_PORT); | ||
103 | } | ||
104 | |||
105 | /* | ||
106 | * /dev/watchdog handling | ||
107 | */ | ||
108 | static ssize_t fop_write(struct file *file, const char __user *buf, | ||
109 | size_t count, loff_t *ppos) | ||
110 | { | ||
111 | size_t i; | ||
112 | char c; | ||
113 | |||
114 | if (count) { | ||
115 | if (!nowayout) { | ||
116 | clear_bit(SBC7240_EXPECT_CLOSE_STATUS_BIT, | ||
117 | &wdt_status); | ||
118 | |||
119 | /* is there a magic char ? */ | ||
120 | for (i = 0; i != count; i++) { | ||
121 | if (get_user(c, buf + i)) | ||
122 | return -EFAULT; | ||
123 | if (c == SBC7240_MAGIC_CHAR) { | ||
124 | set_bit(SBC7240_EXPECT_CLOSE_STATUS_BIT, | ||
125 | &wdt_status); | ||
126 | break; | ||
127 | } | ||
128 | } | ||
129 | } | ||
130 | |||
131 | wdt_keepalive(); | ||
132 | } | ||
133 | |||
134 | return count; | ||
135 | } | ||
136 | |||
137 | static int fop_open(struct inode *inode, struct file *file) | ||
138 | { | ||
139 | if (test_and_set_bit(SBC7240_OPEN_STATUS_BIT, &wdt_status)) | ||
140 | return -EBUSY; | ||
141 | |||
142 | wdt_enable(); | ||
143 | |||
144 | return nonseekable_open(inode, file); | ||
145 | } | ||
146 | |||
147 | static int fop_close(struct inode *inode, struct file *file) | ||
148 | { | ||
149 | if (test_and_clear_bit(SBC7240_EXPECT_CLOSE_STATUS_BIT, &wdt_status) | ||
150 | || !nowayout) { | ||
151 | wdt_disable(); | ||
152 | } else { | ||
153 | printk(KERN_CRIT SBC7240_PREFIX | ||
154 | "Unexpected close, not stopping watchdog!\n"); | ||
155 | wdt_keepalive(); | ||
156 | } | ||
157 | |||
158 | clear_bit(SBC7240_OPEN_STATUS_BIT, &wdt_status); | ||
159 | return 0; | ||
160 | } | ||
161 | |||
162 | static struct watchdog_info ident = { | ||
163 | .options = WDIOF_KEEPALIVEPING| | ||
164 | WDIOF_SETTIMEOUT| | ||
165 | WDIOF_MAGICCLOSE, | ||
166 | .firmware_version = 1, | ||
167 | .identity = "SBC7240", | ||
168 | }; | ||
169 | |||
170 | |||
171 | static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd, | ||
172 | unsigned long arg) | ||
173 | { | ||
174 | switch (cmd) { | ||
175 | case WDIOC_GETSUPPORT: | ||
176 | return copy_to_user | ||
177 | ((void __user *)arg, &ident, sizeof(ident)) | ||
178 | ? -EFAULT : 0; | ||
179 | case WDIOC_GETSTATUS: | ||
180 | case WDIOC_GETBOOTSTATUS: | ||
181 | return put_user(0, (int __user *)arg); | ||
182 | case WDIOC_KEEPALIVE: | ||
183 | wdt_keepalive(); | ||
184 | return 0; | ||
185 | case WDIOC_SETOPTIONS:{ | ||
186 | int options; | ||
187 | int retval = -EINVAL; | ||
188 | |||
189 | if (get_user(options, (int __user *)arg)) | ||
190 | return -EFAULT; | ||
191 | |||
192 | if (options & WDIOS_DISABLECARD) { | ||
193 | wdt_disable(); | ||
194 | retval = 0; | ||
195 | } | ||
196 | |||
197 | if (options & WDIOS_ENABLECARD) { | ||
198 | wdt_enable(); | ||
199 | retval = 0; | ||
200 | } | ||
201 | |||
202 | return retval; | ||
203 | } | ||
204 | case WDIOC_SETTIMEOUT:{ | ||
205 | int new_timeout; | ||
206 | |||
207 | if (get_user(new_timeout, (int __user *)arg)) | ||
208 | return -EFAULT; | ||
209 | |||
210 | if (wdt_set_timeout(new_timeout)) | ||
211 | return -EINVAL; | ||
212 | |||
213 | /* Fall through */ | ||
214 | } | ||
215 | case WDIOC_GETTIMEOUT: | ||
216 | return put_user(timeout, (int __user *)arg); | ||
217 | default: | ||
218 | return -ENOTTY; | ||
219 | } | ||
220 | } | ||
221 | |||
222 | static const struct file_operations wdt_fops = { | ||
223 | .owner = THIS_MODULE, | ||
224 | .llseek = no_llseek, | ||
225 | .write = fop_write, | ||
226 | .open = fop_open, | ||
227 | .release = fop_close, | ||
228 | .ioctl = fop_ioctl, | ||
229 | }; | ||
230 | |||
231 | static struct miscdevice wdt_miscdev = { | ||
232 | .minor = WATCHDOG_MINOR, | ||
233 | .name = "watchdog", | ||
234 | .fops = &wdt_fops, | ||
235 | }; | ||
236 | |||
237 | /* | ||
238 | * Notifier for system down | ||
239 | */ | ||
240 | |||
241 | static int wdt_notify_sys(struct notifier_block *this, unsigned long code, | ||
242 | void *unused) | ||
243 | { | ||
244 | if (code == SYS_DOWN || code == SYS_HALT) | ||
245 | wdt_disable(); | ||
246 | return NOTIFY_DONE; | ||
247 | } | ||
248 | |||
249 | static struct notifier_block wdt_notifier = { | ||
250 | .notifier_call = wdt_notify_sys, | ||
251 | }; | ||
252 | |||
253 | static void __exit sbc7240_wdt_unload(void) | ||
254 | { | ||
255 | printk(KERN_INFO SBC7240_PREFIX "Removing watchdog\n"); | ||
256 | misc_deregister(&wdt_miscdev); | ||
257 | |||
258 | unregister_reboot_notifier(&wdt_notifier); | ||
259 | release_region(SBC7240_ENABLE_PORT, 1); | ||
260 | } | ||
261 | |||
262 | static int __init sbc7240_wdt_init(void) | ||
263 | { | ||
264 | int rc = -EBUSY; | ||
265 | |||
266 | if (!request_region(SBC7240_ENABLE_PORT, 1, "SBC7240 WDT")) { | ||
267 | printk(KERN_ERR SBC7240_PREFIX | ||
268 | "I/O address 0x%04x already in use\n", | ||
269 | SBC7240_ENABLE_PORT); | ||
270 | rc = -EIO; | ||
271 | goto err_out; | ||
272 | } | ||
273 | |||
274 | /* The IO port 0x043 used to disable the watchdog | ||
275 | * is already claimed by the system timer, so we | ||
276 | * cant request_region() it ...*/ | ||
277 | |||
278 | if (timeout < 1 || timeout > SBC7240_MAX_TIMEOUT) { | ||
279 | timeout = SBC7240_TIMEOUT; | ||
280 | printk(KERN_INFO SBC7240_PREFIX | ||
281 | "timeout value must be 1<=x<=%d, using %d\n", | ||
282 | SBC7240_MAX_TIMEOUT, timeout); | ||
283 | } | ||
284 | wdt_set_timeout(timeout); | ||
285 | wdt_disable(); | ||
286 | |||
287 | rc = register_reboot_notifier(&wdt_notifier); | ||
288 | if (rc) { | ||
289 | printk(KERN_ERR SBC7240_PREFIX | ||
290 | "cannot register reboot notifier (err=%d)\n", rc); | ||
291 | goto err_out_region; | ||
292 | } | ||
293 | |||
294 | rc = misc_register(&wdt_miscdev); | ||
295 | if (rc) { | ||
296 | printk(KERN_ERR SBC7240_PREFIX | ||
297 | "cannot register miscdev on minor=%d (err=%d)\n", | ||
298 | wdt_miscdev.minor, rc); | ||
299 | goto err_out_reboot_notifier; | ||
300 | } | ||
301 | |||
302 | printk(KERN_INFO SBC7240_PREFIX | ||
303 | "Watchdog driver for SBC7240 initialised (nowayout=%d)\n", | ||
304 | nowayout); | ||
305 | |||
306 | return 0; | ||
307 | |||
308 | err_out_reboot_notifier: | ||
309 | unregister_reboot_notifier(&wdt_notifier); | ||
310 | err_out_region: | ||
311 | release_region(SBC7240_ENABLE_PORT, 1); | ||
312 | err_out: | ||
313 | return rc; | ||
314 | } | ||
315 | |||
316 | module_init(sbc7240_wdt_init); | ||
317 | module_exit(sbc7240_wdt_unload); | ||
318 | |||
319 | MODULE_AUTHOR("Gilles Gigan"); | ||
320 | MODULE_DESCRIPTION("Watchdog device driver for single board" | ||
321 | " computers EPIC Nano 7240 from iEi"); | ||
322 | MODULE_LICENSE("GPL"); | ||
323 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
324 | |||
diff --git a/drivers/watchdog/w83697hf_wdt.c b/drivers/watchdog/w83697hf_wdt.c index c622a0e6c9ae..6ea125eabeaa 100644 --- a/drivers/watchdog/w83697hf_wdt.c +++ b/drivers/watchdog/w83697hf_wdt.c | |||
@@ -382,8 +382,10 @@ wdt_init(void) | |||
382 | /* we will autodetect the W83697HF/HG watchdog */ | 382 | /* we will autodetect the W83697HF/HG watchdog */ |
383 | for (i = 0; ((!found) && (w83697hf_ioports[i] != 0)); i++) { | 383 | for (i = 0; ((!found) && (w83697hf_ioports[i] != 0)); i++) { |
384 | wdt_io = w83697hf_ioports[i]; | 384 | wdt_io = w83697hf_ioports[i]; |
385 | if (!w83697hf_check_wdt()) | 385 | if (!w83697hf_check_wdt()) { |
386 | found++; | 386 | found++; |
387 | break; | ||
388 | } | ||
387 | } | 389 | } |
388 | } else { | 390 | } else { |
389 | if (!w83697hf_check_wdt()) | 391 | if (!w83697hf_check_wdt()) |
diff --git a/include/asm-arm/arch-pxa/pxa-regs.h b/include/asm-arm/arch-pxa/pxa-regs.h index 6b33df6f1995..1bd398da07da 100644 --- a/include/asm-arm/arch-pxa/pxa-regs.h +++ b/include/asm-arm/arch-pxa/pxa-regs.h | |||
@@ -1784,6 +1784,7 @@ | |||
1784 | #define CCCR_M_MASK 0x0060 /* Memory Frequency to Run Mode Frequency Multiplier */ | 1784 | #define CCCR_M_MASK 0x0060 /* Memory Frequency to Run Mode Frequency Multiplier */ |
1785 | #define CCCR_L_MASK 0x001f /* Crystal Frequency to Memory Frequency Multiplier */ | 1785 | #define CCCR_L_MASK 0x001f /* Crystal Frequency to Memory Frequency Multiplier */ |
1786 | 1786 | ||
1787 | #define CKEN_AC97CONF (31) /* AC97 Controller Configuration */ | ||
1787 | #define CKEN_CAMERA (24) /* Camera Interface Clock Enable */ | 1788 | #define CKEN_CAMERA (24) /* Camera Interface Clock Enable */ |
1788 | #define CKEN_SSP1 (23) /* SSP1 Unit Clock Enable */ | 1789 | #define CKEN_SSP1 (23) /* SSP1 Unit Clock Enable */ |
1789 | #define CKEN_MEMC (22) /* Memory Controller Clock Enable */ | 1790 | #define CKEN_MEMC (22) /* Memory Controller Clock Enable */ |
diff --git a/include/asm-mips/mach-au1x00/au1000.h b/include/asm-mips/mach-au1x00/au1000.h index bf7701243d71..cb18af989645 100644 --- a/include/asm-mips/mach-au1x00/au1000.h +++ b/include/asm-mips/mach-au1x00/au1000.h | |||
@@ -1680,10 +1680,11 @@ enum soc_au1200_ints { | |||
1680 | #define Au1500_PCI_MEM_START 0x440000000ULL | 1680 | #define Au1500_PCI_MEM_START 0x440000000ULL |
1681 | #define Au1500_PCI_MEM_END 0x44FFFFFFFULL | 1681 | #define Au1500_PCI_MEM_END 0x44FFFFFFFULL |
1682 | 1682 | ||
1683 | #define PCI_IO_START (Au1500_PCI_IO_START + 0x1000) | 1683 | #define PCI_IO_START 0x00001000 |
1684 | #define PCI_IO_END (Au1500_PCI_IO_END) | 1684 | #define PCI_IO_END 0x000FFFFF |
1685 | #define PCI_MEM_START (Au1500_PCI_MEM_START) | 1685 | #define PCI_MEM_START 0x40000000 |
1686 | #define PCI_MEM_END (Au1500_PCI_MEM_END) | 1686 | #define PCI_MEM_END 0x4FFFFFFF |
1687 | |||
1687 | #define PCI_FIRST_DEVFN (0<<3) | 1688 | #define PCI_FIRST_DEVFN (0<<3) |
1688 | #define PCI_LAST_DEVFN (19<<3) | 1689 | #define PCI_LAST_DEVFN (19<<3) |
1689 | 1690 | ||
diff --git a/include/asm-powerpc/commproc.h b/include/asm-powerpc/commproc.h index a2328b8addd8..2ee59d7b335c 100644 --- a/include/asm-powerpc/commproc.h +++ b/include/asm-powerpc/commproc.h | |||
@@ -698,9 +698,6 @@ typedef struct risc_timer_pram { | |||
698 | #define CICR_IEN ((uint)0x00000080) /* Int. enable */ | 698 | #define CICR_IEN ((uint)0x00000080) /* Int. enable */ |
699 | #define CICR_SPS ((uint)0x00000001) /* SCC Spread */ | 699 | #define CICR_SPS ((uint)0x00000001) /* SCC Spread */ |
700 | 700 | ||
701 | extern void cpm_install_handler(int vec, void (*handler)(void *), void *dev_id); | ||
702 | extern void cpm_free_handler(int vec); | ||
703 | |||
704 | #define IMAP_ADDR (get_immrbase()) | 701 | #define IMAP_ADDR (get_immrbase()) |
705 | 702 | ||
706 | #define CPM_PIN_INPUT 0 | 703 | #define CPM_PIN_INPUT 0 |
diff --git a/include/asm-s390/pgtable.h b/include/asm-s390/pgtable.h index f2cc25b74adf..1f530f8a6280 100644 --- a/include/asm-s390/pgtable.h +++ b/include/asm-s390/pgtable.h | |||
@@ -453,12 +453,12 @@ static inline int pgd_bad(pgd_t pgd) { return 0; } | |||
453 | 453 | ||
454 | static inline int pud_present(pud_t pud) | 454 | static inline int pud_present(pud_t pud) |
455 | { | 455 | { |
456 | return pud_val(pud) & _REGION_ENTRY_ORIGIN; | 456 | return (pud_val(pud) & _REGION_ENTRY_ORIGIN) != 0UL; |
457 | } | 457 | } |
458 | 458 | ||
459 | static inline int pud_none(pud_t pud) | 459 | static inline int pud_none(pud_t pud) |
460 | { | 460 | { |
461 | return pud_val(pud) & _REGION_ENTRY_INV; | 461 | return (pud_val(pud) & _REGION_ENTRY_INV) != 0UL; |
462 | } | 462 | } |
463 | 463 | ||
464 | static inline int pud_bad(pud_t pud) | 464 | static inline int pud_bad(pud_t pud) |
@@ -471,12 +471,12 @@ static inline int pud_bad(pud_t pud) | |||
471 | 471 | ||
472 | static inline int pmd_present(pmd_t pmd) | 472 | static inline int pmd_present(pmd_t pmd) |
473 | { | 473 | { |
474 | return pmd_val(pmd) & _SEGMENT_ENTRY_ORIGIN; | 474 | return (pmd_val(pmd) & _SEGMENT_ENTRY_ORIGIN) != 0UL; |
475 | } | 475 | } |
476 | 476 | ||
477 | static inline int pmd_none(pmd_t pmd) | 477 | static inline int pmd_none(pmd_t pmd) |
478 | { | 478 | { |
479 | return pmd_val(pmd) & _SEGMENT_ENTRY_INV; | 479 | return (pmd_val(pmd) & _SEGMENT_ENTRY_INV) != 0UL; |
480 | } | 480 | } |
481 | 481 | ||
482 | static inline int pmd_bad(pmd_t pmd) | 482 | static inline int pmd_bad(pmd_t pmd) |
diff --git a/include/asm-sparc/unistd.h b/include/asm-sparc/unistd.h index 029b3e0d5e4c..0decdf763716 100644 --- a/include/asm-sparc/unistd.h +++ b/include/asm-sparc/unistd.h | |||
@@ -333,6 +333,15 @@ | |||
333 | 333 | ||
334 | #define NR_SYSCALLS 315 | 334 | #define NR_SYSCALLS 315 |
335 | 335 | ||
336 | /* Sparc 32-bit only has the "setresuid32", "getresuid32" variants, | ||
337 | * it never had the plain ones and there is no value to adding those | ||
338 | * old versions into the syscall table. | ||
339 | */ | ||
340 | #define __IGNORE_setresuid | ||
341 | #define __IGNORE_getresuid | ||
342 | #define __IGNORE_setresgid | ||
343 | #define __IGNORE_getresgid | ||
344 | |||
336 | #ifdef __KERNEL__ | 345 | #ifdef __KERNEL__ |
337 | #define __ARCH_WANT_IPC_PARSE_VERSION | 346 | #define __ARCH_WANT_IPC_PARSE_VERSION |
338 | #define __ARCH_WANT_OLD_READDIR | 347 | #define __ARCH_WANT_OLD_READDIR |
diff --git a/include/asm-sparc64/hypervisor.h b/include/asm-sparc64/hypervisor.h index 524d49835dfd..3ad45dff52f8 100644 --- a/include/asm-sparc64/hypervisor.h +++ b/include/asm-sparc64/hypervisor.h | |||
@@ -709,6 +709,10 @@ extern unsigned long sun4v_mmu_tsb_ctx0(unsigned long num_descriptions, | |||
709 | */ | 709 | */ |
710 | #define HV_FAST_MMU_DEMAP_ALL 0x24 | 710 | #define HV_FAST_MMU_DEMAP_ALL 0x24 |
711 | 711 | ||
712 | #ifndef __ASSEMBLY__ | ||
713 | extern void sun4v_mmu_demap_all(void); | ||
714 | #endif | ||
715 | |||
712 | /* mmu_map_perm_addr() | 716 | /* mmu_map_perm_addr() |
713 | * TRAP: HV_FAST_TRAP | 717 | * TRAP: HV_FAST_TRAP |
714 | * FUNCTION: HV_FAST_MMU_MAP_PERM_ADDR | 718 | * FUNCTION: HV_FAST_MMU_MAP_PERM_ADDR |
diff --git a/include/linux/ide.h b/include/linux/ide.h index dc75ccbcf991..9a6a41e7079f 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -1255,6 +1255,7 @@ int ide_in_drive_list(struct hd_driveid *, const struct drive_list_entry *); | |||
1255 | 1255 | ||
1256 | #ifdef CONFIG_BLK_DEV_IDEDMA | 1256 | #ifdef CONFIG_BLK_DEV_IDEDMA |
1257 | int __ide_dma_bad_drive(ide_drive_t *); | 1257 | int __ide_dma_bad_drive(ide_drive_t *); |
1258 | int ide_id_dma_bug(ide_drive_t *); | ||
1258 | 1259 | ||
1259 | u8 ide_find_dma_mode(ide_drive_t *, u8); | 1260 | u8 ide_find_dma_mode(ide_drive_t *, u8); |
1260 | 1261 | ||
@@ -1264,7 +1265,6 @@ static inline u8 ide_max_dma_mode(ide_drive_t *drive) | |||
1264 | } | 1265 | } |
1265 | 1266 | ||
1266 | void ide_dma_off(ide_drive_t *); | 1267 | void ide_dma_off(ide_drive_t *); |
1267 | void ide_dma_verbose(ide_drive_t *); | ||
1268 | int ide_set_dma(ide_drive_t *); | 1268 | int ide_set_dma(ide_drive_t *); |
1269 | ide_startstop_t ide_dma_intr(ide_drive_t *); | 1269 | ide_startstop_t ide_dma_intr(ide_drive_t *); |
1270 | 1270 | ||
@@ -1287,6 +1287,7 @@ extern void ide_dma_timeout(ide_drive_t *); | |||
1287 | #endif /* CONFIG_BLK_DEV_IDEDMA_PCI */ | 1287 | #endif /* CONFIG_BLK_DEV_IDEDMA_PCI */ |
1288 | 1288 | ||
1289 | #else | 1289 | #else |
1290 | static inline int ide_id_dma_bug(ide_drive_t *drive) { return 0; } | ||
1290 | static inline u8 ide_find_dma_mode(ide_drive_t *drive, u8 speed) { return 0; } | 1291 | static inline u8 ide_find_dma_mode(ide_drive_t *drive, u8 speed) { return 0; } |
1291 | static inline u8 ide_max_dma_mode(ide_drive_t *drive) { return 0; } | 1292 | static inline u8 ide_max_dma_mode(ide_drive_t *drive) { return 0; } |
1292 | static inline void ide_dma_off(ide_drive_t *drive) { ; } | 1293 | static inline void ide_dma_off(ide_drive_t *drive) { ; } |
@@ -1333,8 +1334,7 @@ static inline void ide_set_hwifdata (ide_hwif_t * hwif, void *data) | |||
1333 | hwif->hwif_data = data; | 1334 | hwif->hwif_data = data; |
1334 | } | 1335 | } |
1335 | 1336 | ||
1336 | /* ide-lib.c */ | 1337 | const char *ide_xfer_verbose(u8 mode); |
1337 | extern char *ide_xfer_verbose(u8 xfer_rate); | ||
1338 | extern void ide_toggle_bounce(ide_drive_t *drive, int on); | 1338 | extern void ide_toggle_bounce(ide_drive_t *drive, int on); |
1339 | extern int ide_set_xfer_rate(ide_drive_t *drive, u8 rate); | 1339 | extern int ide_set_xfer_rate(ide_drive_t *drive, u8 rate); |
1340 | 1340 | ||
diff --git a/include/linux/netfilter_bridge.h b/include/linux/netfilter_bridge.h index 533ee351a273..499aa9375901 100644 --- a/include/linux/netfilter_bridge.h +++ b/include/linux/netfilter_bridge.h | |||
@@ -50,7 +50,8 @@ enum nf_br_hook_priorities { | |||
50 | extern int nf_bridge_copy_header(struct sk_buff *skb); | 50 | extern int nf_bridge_copy_header(struct sk_buff *skb); |
51 | static inline int nf_bridge_maybe_copy_header(struct sk_buff *skb) | 51 | static inline int nf_bridge_maybe_copy_header(struct sk_buff *skb) |
52 | { | 52 | { |
53 | if (skb->nf_bridge) | 53 | if (skb->nf_bridge && |
54 | skb->nf_bridge->mask & (BRNF_BRIDGED | BRNF_BRIDGED_DNAT)) | ||
54 | return nf_bridge_copy_header(skb); | 55 | return nf_bridge_copy_header(skb); |
55 | return 0; | 56 | return 0; |
56 | } | 57 | } |
diff --git a/net/ax25/ax25_subr.c b/net/ax25/ax25_subr.c index 5fe9b2a6697d..d8f215733175 100644 --- a/net/ax25/ax25_subr.c +++ b/net/ax25/ax25_subr.c | |||
@@ -279,6 +279,7 @@ void ax25_disconnect(ax25_cb *ax25, int reason) | |||
279 | ax25_link_failed(ax25, reason); | 279 | ax25_link_failed(ax25, reason); |
280 | 280 | ||
281 | if (ax25->sk != NULL) { | 281 | if (ax25->sk != NULL) { |
282 | local_bh_disable(); | ||
282 | bh_lock_sock(ax25->sk); | 283 | bh_lock_sock(ax25->sk); |
283 | ax25->sk->sk_state = TCP_CLOSE; | 284 | ax25->sk->sk_state = TCP_CLOSE; |
284 | ax25->sk->sk_err = reason; | 285 | ax25->sk->sk_err = reason; |
@@ -288,5 +289,6 @@ void ax25_disconnect(ax25_cb *ax25, int reason) | |||
288 | sock_set_flag(ax25->sk, SOCK_DEAD); | 289 | sock_set_flag(ax25->sk, SOCK_DEAD); |
289 | } | 290 | } |
290 | bh_unlock_sock(ax25->sk); | 291 | bh_unlock_sock(ax25->sk); |
292 | local_bh_enable(); | ||
291 | } | 293 | } |
292 | } | 294 | } |
diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c index c07bac5e3e10..bf7787395fe0 100644 --- a/net/bridge/br_device.c +++ b/net/bridge/br_device.c | |||
@@ -157,8 +157,7 @@ static struct ethtool_ops br_ethtool_ops = { | |||
157 | 157 | ||
158 | void br_dev_setup(struct net_device *dev) | 158 | void br_dev_setup(struct net_device *dev) |
159 | { | 159 | { |
160 | memset(dev->dev_addr, 0, ETH_ALEN); | 160 | random_ether_addr(dev->dev_addr); |
161 | |||
162 | ether_setup(dev); | 161 | ether_setup(dev); |
163 | 162 | ||
164 | dev->do_ioctl = br_dev_ioctl; | 163 | dev->do_ioctl = br_dev_ioctl; |
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c index c5c107a01823..96400b0bd08a 100644 --- a/net/ipv4/ipconfig.c +++ b/net/ipv4/ipconfig.c | |||
@@ -1396,25 +1396,7 @@ late_initcall(ip_auto_config); | |||
1396 | 1396 | ||
1397 | /* | 1397 | /* |
1398 | * Decode any IP configuration options in the "ip=" or "nfsaddrs=" kernel | 1398 | * Decode any IP configuration options in the "ip=" or "nfsaddrs=" kernel |
1399 | * command line parameter. It consists of option fields separated by colons in | 1399 | * command line parameter. See Documentation/nfsroot.txt. |
1400 | * the following order: | ||
1401 | * | ||
1402 | * <client-ip>:<server-ip>:<gw-ip>:<netmask>:<host name>:<device>:<PROTO> | ||
1403 | * | ||
1404 | * Any of the fields can be empty which means to use a default value: | ||
1405 | * <client-ip> - address given by BOOTP or RARP | ||
1406 | * <server-ip> - address of host returning BOOTP or RARP packet | ||
1407 | * <gw-ip> - none, or the address returned by BOOTP | ||
1408 | * <netmask> - automatically determined from <client-ip>, or the | ||
1409 | * one returned by BOOTP | ||
1410 | * <host name> - <client-ip> in ASCII notation, or the name returned | ||
1411 | * by BOOTP | ||
1412 | * <device> - use all available devices | ||
1413 | * <PROTO>: | ||
1414 | * off|none - don't do autoconfig at all (DEFAULT) | ||
1415 | * on|any - use any configured protocol | ||
1416 | * dhcp|bootp|rarp - use only the specified protocol | ||
1417 | * both - use both BOOTP and RARP (not DHCP) | ||
1418 | */ | 1400 | */ |
1419 | static int __init ic_proto_name(char *name) | 1401 | static int __init ic_proto_name(char *name) |
1420 | { | 1402 | { |
diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c index 4b10b98640ac..b9b189c26208 100644 --- a/net/ipv4/netfilter/ip_tables.c +++ b/net/ipv4/netfilter/ip_tables.c | |||
@@ -1492,8 +1492,10 @@ static inline int compat_copy_match_to_user(struct ipt_entry_match *m, | |||
1492 | return xt_compat_match_to_user(m, dstptr, size); | 1492 | return xt_compat_match_to_user(m, dstptr, size); |
1493 | } | 1493 | } |
1494 | 1494 | ||
1495 | static int compat_copy_entry_to_user(struct ipt_entry *e, | 1495 | static int |
1496 | void __user **dstptr, compat_uint_t *size) | 1496 | compat_copy_entry_to_user(struct ipt_entry *e, void __user **dstptr, |
1497 | compat_uint_t *size, struct xt_counters *counters, | ||
1498 | unsigned int *i) | ||
1497 | { | 1499 | { |
1498 | struct ipt_entry_target *t; | 1500 | struct ipt_entry_target *t; |
1499 | struct compat_ipt_entry __user *ce; | 1501 | struct compat_ipt_entry __user *ce; |
@@ -1507,6 +1509,9 @@ static int compat_copy_entry_to_user(struct ipt_entry *e, | |||
1507 | if (copy_to_user(ce, e, sizeof(struct ipt_entry))) | 1509 | if (copy_to_user(ce, e, sizeof(struct ipt_entry))) |
1508 | goto out; | 1510 | goto out; |
1509 | 1511 | ||
1512 | if (copy_to_user(&ce->counters, &counters[*i], sizeof(counters[*i]))) | ||
1513 | goto out; | ||
1514 | |||
1510 | *dstptr += sizeof(struct compat_ipt_entry); | 1515 | *dstptr += sizeof(struct compat_ipt_entry); |
1511 | ret = IPT_MATCH_ITERATE(e, compat_copy_match_to_user, dstptr, size); | 1516 | ret = IPT_MATCH_ITERATE(e, compat_copy_match_to_user, dstptr, size); |
1512 | target_offset = e->target_offset - (origsize - *size); | 1517 | target_offset = e->target_offset - (origsize - *size); |
@@ -1522,6 +1527,8 @@ static int compat_copy_entry_to_user(struct ipt_entry *e, | |||
1522 | goto out; | 1527 | goto out; |
1523 | if (put_user(next_offset, &ce->next_offset)) | 1528 | if (put_user(next_offset, &ce->next_offset)) |
1524 | goto out; | 1529 | goto out; |
1530 | |||
1531 | (*i)++; | ||
1525 | return 0; | 1532 | return 0; |
1526 | out: | 1533 | out: |
1527 | return ret; | 1534 | return ret; |
@@ -1937,14 +1944,13 @@ struct compat_ipt_get_entries | |||
1937 | static int compat_copy_entries_to_user(unsigned int total_size, | 1944 | static int compat_copy_entries_to_user(unsigned int total_size, |
1938 | struct xt_table *table, void __user *userptr) | 1945 | struct xt_table *table, void __user *userptr) |
1939 | { | 1946 | { |
1940 | unsigned int off, num; | ||
1941 | struct compat_ipt_entry e; | ||
1942 | struct xt_counters *counters; | 1947 | struct xt_counters *counters; |
1943 | struct xt_table_info *private = table->private; | 1948 | struct xt_table_info *private = table->private; |
1944 | void __user *pos; | 1949 | void __user *pos; |
1945 | unsigned int size; | 1950 | unsigned int size; |
1946 | int ret = 0; | 1951 | int ret = 0; |
1947 | void *loc_cpu_entry; | 1952 | void *loc_cpu_entry; |
1953 | unsigned int i = 0; | ||
1948 | 1954 | ||
1949 | counters = alloc_counters(table); | 1955 | counters = alloc_counters(table); |
1950 | if (IS_ERR(counters)) | 1956 | if (IS_ERR(counters)) |
@@ -1958,48 +1964,9 @@ static int compat_copy_entries_to_user(unsigned int total_size, | |||
1958 | pos = userptr; | 1964 | pos = userptr; |
1959 | size = total_size; | 1965 | size = total_size; |
1960 | ret = IPT_ENTRY_ITERATE(loc_cpu_entry, total_size, | 1966 | ret = IPT_ENTRY_ITERATE(loc_cpu_entry, total_size, |
1961 | compat_copy_entry_to_user, &pos, &size); | 1967 | compat_copy_entry_to_user, |
1962 | if (ret) | 1968 | &pos, &size, counters, &i); |
1963 | goto free_counters; | ||
1964 | |||
1965 | /* ... then go back and fix counters and names */ | ||
1966 | for (off = 0, num = 0; off < size; off += e.next_offset, num++) { | ||
1967 | unsigned int i; | ||
1968 | struct ipt_entry_match m; | ||
1969 | struct ipt_entry_target t; | ||
1970 | 1969 | ||
1971 | ret = -EFAULT; | ||
1972 | if (copy_from_user(&e, userptr + off, | ||
1973 | sizeof(struct compat_ipt_entry))) | ||
1974 | goto free_counters; | ||
1975 | if (copy_to_user(userptr + off + | ||
1976 | offsetof(struct compat_ipt_entry, counters), | ||
1977 | &counters[num], sizeof(counters[num]))) | ||
1978 | goto free_counters; | ||
1979 | |||
1980 | for (i = sizeof(struct compat_ipt_entry); | ||
1981 | i < e.target_offset; i += m.u.match_size) { | ||
1982 | if (copy_from_user(&m, userptr + off + i, | ||
1983 | sizeof(struct ipt_entry_match))) | ||
1984 | goto free_counters; | ||
1985 | if (copy_to_user(userptr + off + i + | ||
1986 | offsetof(struct ipt_entry_match, u.user.name), | ||
1987 | m.u.kernel.match->name, | ||
1988 | strlen(m.u.kernel.match->name) + 1)) | ||
1989 | goto free_counters; | ||
1990 | } | ||
1991 | |||
1992 | if (copy_from_user(&t, userptr + off + e.target_offset, | ||
1993 | sizeof(struct ipt_entry_target))) | ||
1994 | goto free_counters; | ||
1995 | if (copy_to_user(userptr + off + e.target_offset + | ||
1996 | offsetof(struct ipt_entry_target, u.user.name), | ||
1997 | t.u.kernel.target->name, | ||
1998 | strlen(t.u.kernel.target->name) + 1)) | ||
1999 | goto free_counters; | ||
2000 | } | ||
2001 | ret = 0; | ||
2002 | free_counters: | ||
2003 | vfree(counters); | 1970 | vfree(counters); |
2004 | return ret; | 1971 | return ret; |
2005 | } | 1972 | } |
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index b9e429d2d1de..889c89362bfc 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -923,7 +923,7 @@ static void tcp_init_metrics(struct sock *sk) | |||
923 | } | 923 | } |
924 | if (dst_metric(dst, RTAX_RTTVAR) > tp->mdev) { | 924 | if (dst_metric(dst, RTAX_RTTVAR) > tp->mdev) { |
925 | tp->mdev = dst_metric(dst, RTAX_RTTVAR); | 925 | tp->mdev = dst_metric(dst, RTAX_RTTVAR); |
926 | tp->mdev_max = tp->rttvar = max(tp->mdev, TCP_RTO_MIN); | 926 | tp->mdev_max = tp->rttvar = max(tp->mdev, tcp_rto_min(sk)); |
927 | } | 927 | } |
928 | tcp_set_rto(sk); | 928 | tcp_set_rto(sk); |
929 | tcp_bound_rto(sk); | 929 | tcp_bound_rto(sk); |
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c index 1334fc174bcf..8c5f80fd03ad 100644 --- a/net/ipv6/ipv6_sockglue.c +++ b/net/ipv6/ipv6_sockglue.c | |||
@@ -1046,7 +1046,7 @@ static int do_ipv6_getsockopt(struct sock *sk, int level, int optname, | |||
1046 | break; | 1046 | break; |
1047 | 1047 | ||
1048 | default: | 1048 | default: |
1049 | return -EINVAL; | 1049 | return -ENOPROTOOPT; |
1050 | } | 1050 | } |
1051 | len = min_t(unsigned int, sizeof(int), len); | 1051 | len = min_t(unsigned int, sizeof(int), len); |
1052 | if(put_user(len, optlen)) | 1052 | if(put_user(len, optlen)) |
@@ -1069,9 +1069,8 @@ int ipv6_getsockopt(struct sock *sk, int level, int optname, | |||
1069 | 1069 | ||
1070 | err = do_ipv6_getsockopt(sk, level, optname, optval, optlen); | 1070 | err = do_ipv6_getsockopt(sk, level, optname, optval, optlen); |
1071 | #ifdef CONFIG_NETFILTER | 1071 | #ifdef CONFIG_NETFILTER |
1072 | /* we need to exclude all possible EINVALs except default case */ | 1072 | /* we need to exclude all possible ENOPROTOOPTs except default case */ |
1073 | if (err == -EINVAL && optname != IPV6_ADDRFORM && | 1073 | if (err == -ENOPROTOOPT && optname != IPV6_2292PKTOPTIONS) { |
1074 | optname != MCAST_MSFILTER) { | ||
1075 | int len; | 1074 | int len; |
1076 | 1075 | ||
1077 | if (get_user(len, optlen)) | 1076 | if (get_user(len, optlen)) |
@@ -1108,9 +1107,8 @@ int compat_ipv6_getsockopt(struct sock *sk, int level, int optname, | |||
1108 | 1107 | ||
1109 | err = do_ipv6_getsockopt(sk, level, optname, optval, optlen); | 1108 | err = do_ipv6_getsockopt(sk, level, optname, optval, optlen); |
1110 | #ifdef CONFIG_NETFILTER | 1109 | #ifdef CONFIG_NETFILTER |
1111 | /* we need to exclude all possible EINVALs except default case */ | 1110 | /* we need to exclude all possible ENOPROTOOPTs except default case */ |
1112 | if (err == -EINVAL && optname != IPV6_ADDRFORM && | 1111 | if (err == -ENOPROTOOPT && optname != IPV6_2292PKTOPTIONS) { |
1113 | optname != MCAST_MSFILTER) { | ||
1114 | int len; | 1112 | int len; |
1115 | 1113 | ||
1116 | if (get_user(len, optlen)) | 1114 | if (get_user(len, optlen)) |
diff --git a/net/irda/irlmp.c b/net/irda/irlmp.c index cedff8068fbc..f24cb755908e 100644 --- a/net/irda/irlmp.c +++ b/net/irda/irlmp.c | |||
@@ -353,6 +353,7 @@ void irlmp_unregister_link(__u32 saddr) | |||
353 | /* Final cleanup */ | 353 | /* Final cleanup */ |
354 | del_timer(&link->idle_timer); | 354 | del_timer(&link->idle_timer); |
355 | link->magic = 0; | 355 | link->magic = 0; |
356 | hashbin_delete(link->lsaps, (FREE_FUNC) __irlmp_close_lsap); | ||
356 | kfree(link); | 357 | kfree(link); |
357 | } | 358 | } |
358 | } | 359 | } |
diff --git a/net/irda/parameters.c b/net/irda/parameters.c index 2627dad7cd87..7183e9ef7996 100644 --- a/net/irda/parameters.c +++ b/net/irda/parameters.c | |||
@@ -463,7 +463,7 @@ int irda_param_insert(void *self, __u8 pi, __u8 *buf, int len, | |||
463 | int n = 0; | 463 | int n = 0; |
464 | 464 | ||
465 | IRDA_ASSERT(buf != NULL, return ret;); | 465 | IRDA_ASSERT(buf != NULL, return ret;); |
466 | IRDA_ASSERT(info != 0, return ret;); | 466 | IRDA_ASSERT(info != NULL, return ret;); |
467 | 467 | ||
468 | pi_minor = pi & info->pi_mask; | 468 | pi_minor = pi & info->pi_mask; |
469 | pi_major = pi >> info->pi_major_offset; | 469 | pi_major = pi >> info->pi_major_offset; |
@@ -517,7 +517,7 @@ static int irda_param_extract(void *self, __u8 *buf, int len, | |||
517 | int n = 0; | 517 | int n = 0; |
518 | 518 | ||
519 | IRDA_ASSERT(buf != NULL, return ret;); | 519 | IRDA_ASSERT(buf != NULL, return ret;); |
520 | IRDA_ASSERT(info != 0, return ret;); | 520 | IRDA_ASSERT(info != NULL, return ret;); |
521 | 521 | ||
522 | pi_minor = buf[n] & info->pi_mask; | 522 | pi_minor = buf[n] & info->pi_mask; |
523 | pi_major = buf[n] >> info->pi_major_offset; | 523 | pi_major = buf[n] >> info->pi_major_offset; |
@@ -570,7 +570,7 @@ int irda_param_extract_all(void *self, __u8 *buf, int len, | |||
570 | int n = 0; | 570 | int n = 0; |
571 | 571 | ||
572 | IRDA_ASSERT(buf != NULL, return ret;); | 572 | IRDA_ASSERT(buf != NULL, return ret;); |
573 | IRDA_ASSERT(info != 0, return ret;); | 573 | IRDA_ASSERT(info != NULL, return ret;); |
574 | 574 | ||
575 | /* | 575 | /* |
576 | * Parse all parameters. Each parameter must be at least two bytes | 576 | * Parse all parameters. Each parameter must be at least two bytes |
diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c index 9be1826e6cdd..7d231243754a 100644 --- a/net/netfilter/nf_conntrack_netlink.c +++ b/net/netfilter/nf_conntrack_netlink.c | |||
@@ -1024,8 +1024,10 @@ ctnetlink_create_conntrack(struct nlattr *cda[], | |||
1024 | } | 1024 | } |
1025 | 1025 | ||
1026 | /* setup master conntrack: this is a confirmed expectation */ | 1026 | /* setup master conntrack: this is a confirmed expectation */ |
1027 | if (master_ct) | 1027 | if (master_ct) { |
1028 | __set_bit(IPS_EXPECTED_BIT, &ct->status); | ||
1028 | ct->master = master_ct; | 1029 | ct->master = master_ct; |
1030 | } | ||
1029 | 1031 | ||
1030 | add_timer(&ct->timeout); | 1032 | add_timer(&ct->timeout); |
1031 | nf_conntrack_hash_insert(ct); | 1033 | nf_conntrack_hash_insert(ct); |
diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c index d9a3bded0d00..b6160e41eb1c 100644 --- a/net/netfilter/x_tables.c +++ b/net/netfilter/x_tables.c | |||
@@ -377,7 +377,9 @@ int xt_compat_match_to_user(struct xt_entry_match *m, void __user **dstptr, | |||
377 | u_int16_t msize = m->u.user.match_size - off; | 377 | u_int16_t msize = m->u.user.match_size - off; |
378 | 378 | ||
379 | if (copy_to_user(cm, m, sizeof(*cm)) || | 379 | if (copy_to_user(cm, m, sizeof(*cm)) || |
380 | put_user(msize, &cm->u.user.match_size)) | 380 | put_user(msize, &cm->u.user.match_size) || |
381 | copy_to_user(cm->u.user.name, m->u.kernel.match->name, | ||
382 | strlen(m->u.kernel.match->name) + 1)) | ||
381 | return -EFAULT; | 383 | return -EFAULT; |
382 | 384 | ||
383 | if (match->compat_to_user) { | 385 | if (match->compat_to_user) { |
@@ -468,7 +470,9 @@ int xt_compat_target_to_user(struct xt_entry_target *t, void __user **dstptr, | |||
468 | u_int16_t tsize = t->u.user.target_size - off; | 470 | u_int16_t tsize = t->u.user.target_size - off; |
469 | 471 | ||
470 | if (copy_to_user(ct, t, sizeof(*ct)) || | 472 | if (copy_to_user(ct, t, sizeof(*ct)) || |
471 | put_user(tsize, &ct->u.user.target_size)) | 473 | put_user(tsize, &ct->u.user.target_size) || |
474 | copy_to_user(ct->u.user.name, t->u.kernel.target->name, | ||
475 | strlen(t->u.kernel.target->name) + 1)) | ||
472 | return -EFAULT; | 476 | return -EFAULT; |
473 | 477 | ||
474 | if (target->compat_to_user) { | 478 | if (target->compat_to_user) { |
diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c index 19103678bf20..2ef44d8560c1 100644 --- a/net/netfilter/xt_hashlimit.c +++ b/net/netfilter/xt_hashlimit.c | |||
@@ -240,7 +240,7 @@ static bool select_all(const struct xt_hashlimit_htable *ht, | |||
240 | static bool select_gc(const struct xt_hashlimit_htable *ht, | 240 | static bool select_gc(const struct xt_hashlimit_htable *ht, |
241 | const struct dsthash_ent *he) | 241 | const struct dsthash_ent *he) |
242 | { | 242 | { |
243 | return jiffies >= he->expires; | 243 | return time_after_eq(jiffies, he->expires); |
244 | } | 244 | } |
245 | 245 | ||
246 | static void htable_selective_cleanup(struct xt_hashlimit_htable *ht, | 246 | static void htable_selective_cleanup(struct xt_hashlimit_htable *ht, |
diff --git a/net/sctp/ulpqueue.c b/net/sctp/ulpqueue.c index 4908041ffb31..1733fa29a501 100644 --- a/net/sctp/ulpqueue.c +++ b/net/sctp/ulpqueue.c | |||
@@ -53,6 +53,7 @@ static struct sctp_ulpevent * sctp_ulpq_reasm(struct sctp_ulpq *ulpq, | |||
53 | struct sctp_ulpevent *); | 53 | struct sctp_ulpevent *); |
54 | static struct sctp_ulpevent * sctp_ulpq_order(struct sctp_ulpq *, | 54 | static struct sctp_ulpevent * sctp_ulpq_order(struct sctp_ulpq *, |
55 | struct sctp_ulpevent *); | 55 | struct sctp_ulpevent *); |
56 | static void sctp_ulpq_reasm_drain(struct sctp_ulpq *ulpq); | ||
56 | 57 | ||
57 | /* 1st Level Abstractions */ | 58 | /* 1st Level Abstractions */ |
58 | 59 | ||
@@ -190,6 +191,7 @@ static void sctp_ulpq_set_pd(struct sctp_ulpq *ulpq) | |||
190 | static int sctp_ulpq_clear_pd(struct sctp_ulpq *ulpq) | 191 | static int sctp_ulpq_clear_pd(struct sctp_ulpq *ulpq) |
191 | { | 192 | { |
192 | ulpq->pd_mode = 0; | 193 | ulpq->pd_mode = 0; |
194 | sctp_ulpq_reasm_drain(ulpq); | ||
193 | return sctp_clear_pd(ulpq->asoc->base.sk, ulpq->asoc); | 195 | return sctp_clear_pd(ulpq->asoc->base.sk, ulpq->asoc); |
194 | } | 196 | } |
195 | 197 | ||
@@ -699,6 +701,37 @@ void sctp_ulpq_reasm_flushtsn(struct sctp_ulpq *ulpq, __u32 fwd_tsn) | |||
699 | } | 701 | } |
700 | } | 702 | } |
701 | 703 | ||
704 | /* | ||
705 | * Drain the reassembly queue. If we just cleared parted delivery, it | ||
706 | * is possible that the reassembly queue will contain already reassembled | ||
707 | * messages. Retrieve any such messages and give them to the user. | ||
708 | */ | ||
709 | static void sctp_ulpq_reasm_drain(struct sctp_ulpq *ulpq) | ||
710 | { | ||
711 | struct sctp_ulpevent *event = NULL; | ||
712 | struct sk_buff_head temp; | ||
713 | |||
714 | if (skb_queue_empty(&ulpq->reasm)) | ||
715 | return; | ||
716 | |||
717 | while ((event = sctp_ulpq_retrieve_reassembled(ulpq)) != NULL) { | ||
718 | /* Do ordering if needed. */ | ||
719 | if ((event) && (event->msg_flags & MSG_EOR)){ | ||
720 | skb_queue_head_init(&temp); | ||
721 | __skb_queue_tail(&temp, sctp_event2skb(event)); | ||
722 | |||
723 | event = sctp_ulpq_order(ulpq, event); | ||
724 | } | ||
725 | |||
726 | /* Send event to the ULP. 'event' is the | ||
727 | * sctp_ulpevent for very first SKB on the temp' list. | ||
728 | */ | ||
729 | if (event) | ||
730 | sctp_ulpq_tail_event(ulpq, event); | ||
731 | } | ||
732 | } | ||
733 | |||
734 | |||
702 | /* Helper function to gather skbs that have possibly become | 735 | /* Helper function to gather skbs that have possibly become |
703 | * ordered by an an incoming chunk. | 736 | * ordered by an an incoming chunk. |
704 | */ | 737 | */ |
diff --git a/net/tipc/socket.c b/net/tipc/socket.c index 6b792265dc06..24ddfd2ca38b 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c | |||
@@ -253,7 +253,7 @@ static int release(struct socket *sock) | |||
253 | dbg("sock_delete: %x\n",tsock); | 253 | dbg("sock_delete: %x\n",tsock); |
254 | if (!tsock) | 254 | if (!tsock) |
255 | return 0; | 255 | return 0; |
256 | down_interruptible(&tsock->sem); | 256 | down(&tsock->sem); |
257 | if (!sock->sk) { | 257 | if (!sock->sk) { |
258 | up(&tsock->sem); | 258 | up(&tsock->sem); |
259 | return 0; | 259 | return 0; |
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index cf43c49eab37..1af522bf12ca 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c | |||
@@ -2028,6 +2028,7 @@ void | |||
2028 | xfrm_audit_state_add(struct xfrm_state *x, int result, u32 auid, u32 sid) | 2028 | xfrm_audit_state_add(struct xfrm_state *x, int result, u32 auid, u32 sid) |
2029 | { | 2029 | { |
2030 | struct audit_buffer *audit_buf; | 2030 | struct audit_buffer *audit_buf; |
2031 | u32 spi; | ||
2031 | extern int audit_enabled; | 2032 | extern int audit_enabled; |
2032 | 2033 | ||
2033 | if (audit_enabled == 0) | 2034 | if (audit_enabled == 0) |
@@ -2037,8 +2038,8 @@ xfrm_audit_state_add(struct xfrm_state *x, int result, u32 auid, u32 sid) | |||
2037 | return; | 2038 | return; |
2038 | audit_log_format(audit_buf, " op=SAD-add res=%u",result); | 2039 | audit_log_format(audit_buf, " op=SAD-add res=%u",result); |
2039 | xfrm_audit_common_stateinfo(x, audit_buf); | 2040 | xfrm_audit_common_stateinfo(x, audit_buf); |
2040 | audit_log_format(audit_buf, " spi=%lu(0x%lx)", | 2041 | spi = ntohl(x->id.spi); |
2041 | (unsigned long)x->id.spi, (unsigned long)x->id.spi); | 2042 | audit_log_format(audit_buf, " spi=%u(0x%x)", spi, spi); |
2042 | audit_log_end(audit_buf); | 2043 | audit_log_end(audit_buf); |
2043 | } | 2044 | } |
2044 | EXPORT_SYMBOL_GPL(xfrm_audit_state_add); | 2045 | EXPORT_SYMBOL_GPL(xfrm_audit_state_add); |
@@ -2047,6 +2048,7 @@ void | |||
2047 | xfrm_audit_state_delete(struct xfrm_state *x, int result, u32 auid, u32 sid) | 2048 | xfrm_audit_state_delete(struct xfrm_state *x, int result, u32 auid, u32 sid) |
2048 | { | 2049 | { |
2049 | struct audit_buffer *audit_buf; | 2050 | struct audit_buffer *audit_buf; |
2051 | u32 spi; | ||
2050 | extern int audit_enabled; | 2052 | extern int audit_enabled; |
2051 | 2053 | ||
2052 | if (audit_enabled == 0) | 2054 | if (audit_enabled == 0) |
@@ -2056,8 +2058,8 @@ xfrm_audit_state_delete(struct xfrm_state *x, int result, u32 auid, u32 sid) | |||
2056 | return; | 2058 | return; |
2057 | audit_log_format(audit_buf, " op=SAD-delete res=%u",result); | 2059 | audit_log_format(audit_buf, " op=SAD-delete res=%u",result); |
2058 | xfrm_audit_common_stateinfo(x, audit_buf); | 2060 | xfrm_audit_common_stateinfo(x, audit_buf); |
2059 | audit_log_format(audit_buf, " spi=%lu(0x%lx)", | 2061 | spi = ntohl(x->id.spi); |
2060 | (unsigned long)x->id.spi, (unsigned long)x->id.spi); | 2062 | audit_log_format(audit_buf, " spi=%u(0x%x)", spi, spi); |
2061 | audit_log_end(audit_buf); | 2063 | audit_log_end(audit_buf); |
2062 | } | 2064 | } |
2063 | EXPORT_SYMBOL_GPL(xfrm_audit_state_delete); | 2065 | EXPORT_SYMBOL_GPL(xfrm_audit_state_delete); |
diff --git a/scripts/mkmakefile b/scripts/mkmakefile index 9ad1bd793252..e0f54b9d8fec 100644 --- a/scripts/mkmakefile +++ b/scripts/mkmakefile | |||
@@ -13,7 +13,7 @@ | |||
13 | test ! -r $2/Makefile -o -O $2/Makefile || exit 0 | 13 | test ! -r $2/Makefile -o -O $2/Makefile || exit 0 |
14 | # Only overwrite automatically generated Makefiles | 14 | # Only overwrite automatically generated Makefiles |
15 | # (so we do not overwrite kernel Makefile) | 15 | # (so we do not overwrite kernel Makefile) |
16 | if ! grep -q Automatically $2/Makefile | 16 | if test -e $2/Makefile && ! grep -q Automatically $2/Makefile |
17 | then | 17 | then |
18 | exit 0 | 18 | exit 0 |
19 | fi | 19 | fi |
diff --git a/sound/arm/pxa2xx-ac97.c b/sound/arm/pxa2xx-ac97.c index 7bc2767e1584..55c6c822bec1 100644 --- a/sound/arm/pxa2xx-ac97.c +++ b/sound/arm/pxa2xx-ac97.c | |||
@@ -113,9 +113,9 @@ static void pxa2xx_ac97_reset(struct snd_ac97 *ac97) | |||
113 | gsr_bits = 0; | 113 | gsr_bits = 0; |
114 | #ifdef CONFIG_PXA27x | 114 | #ifdef CONFIG_PXA27x |
115 | /* PXA27x Developers Manual section 13.5.2.2.1 */ | 115 | /* PXA27x Developers Manual section 13.5.2.2.1 */ |
116 | pxa_set_cken(1 << 31, 1); | 116 | pxa_set_cken(CKEN_AC97CONF, 1); |
117 | udelay(5); | 117 | udelay(5); |
118 | pxa_set_cken(1 << 31, 0); | 118 | pxa_set_cken(CKEN_AC97CONF, 0); |
119 | GCR = GCR_COLD_RST; | 119 | GCR = GCR_COLD_RST; |
120 | udelay(50); | 120 | udelay(50); |
121 | #else | 121 | #else |
diff --git a/sound/soc/pxa/pxa2xx-ac97.c b/sound/soc/pxa/pxa2xx-ac97.c index dd14abcdf1bd..60e6f4677f93 100644 --- a/sound/soc/pxa/pxa2xx-ac97.c +++ b/sound/soc/pxa/pxa2xx-ac97.c | |||
@@ -160,9 +160,9 @@ static void pxa2xx_ac97_cold_reset(struct snd_ac97 *ac97) | |||
160 | gsr_bits = 0; | 160 | gsr_bits = 0; |
161 | #ifdef CONFIG_PXA27x | 161 | #ifdef CONFIG_PXA27x |
162 | /* PXA27x Developers Manual section 13.5.2.2.1 */ | 162 | /* PXA27x Developers Manual section 13.5.2.2.1 */ |
163 | pxa_set_cken(31, 1); | 163 | pxa_set_cken(CKEN_AC97CONF, 1); |
164 | udelay(5); | 164 | udelay(5); |
165 | pxa_set_cken(31, 0); | 165 | pxa_set_cken(CKEN_AC97CONF, 0); |
166 | GCR = GCR_COLD_RST; | 166 | GCR = GCR_COLD_RST; |
167 | udelay(50); | 167 | udelay(50); |
168 | #else | 168 | #else |