]> git.pld-linux.org Git - packages/kernel.git/blob - acpi-irq-fixes.patch
- CSZ scheduler removed from kernel tree.
[packages/kernel.git] / acpi-irq-fixes.patch
1
2 From: Len Brown <len.brown@intel.com>
3
4 This patch updates 2.6.0-test5 to the current ACPI in 2.4.22-pre5
5 If nothing explodes, I'll be releasing it to Linus shortly via BK.
6
7 (then I'll send a patch with the upcoming linux-acpi-test-2.6.0 changes)
8
9 The thing most 2.6 users will notice is that the CONFIG_ACPI_HT_ONLY
10 scheme has been returned to the one used in 2.4.22 that people
11 liked better; but several key platform fixes are included too.
12
13 cheers,
14 -Len
15
16 It is also available here:
17 http://linux-acpi.bkbits.net:8080/linux-acpi-release-2.6.0
18
19 and here:
20 http://prdownloads.sourceforge.net/acpi/acpi-20030916-2.6.0-test5.diff?download
21
22 ChangeSet@1.1315.7.7, 2003-09-18 12:01:37-07:00, len.brown@intel.com
23   ACPI_CA_VERSION                 0x20030916
24
25 ChangeSet@1.1315.7.6, 2003-09-18 11:59:12-07:00, len.brown@intel.com
26   remove ASUS A7V BIOS version 1011 from blacklist (Eric Valette)
27
28 ChangeSet@1.1315.7.5, 2003-09-18 11:41:51-07:00, len.brown@intel.com
29   IBM ThinkPAD T30/T40 oops (David Shaohua Li)
30   https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=98849
31
32 ChangeSet@1.1315.7.4, 2003-09-18 11:29:42-07:00, len.brown@intel.com
33   Extended IRQ resource type for nForce (Andrew de Quincey)
34
35 ChangeSet@1.1315.7.3, 2003-09-18 10:58:41-07:00, len.brown@intel.com
36   [ACPI] Handle systems that specify non-ACPI-compliant SCI over-rides
37 (Jun Naka
38 jima)
39
40 ChangeSet@1.1315.7.2, 2003-09-18 10:54:11-07:00, len.brown@intel.com
41   Handle BIOS with _CRS that fails (Jun Nakajima)
42
43 ChangeSet@1.1315.7.1, 2003-09-18 00:52:06-04:00, len.brown@intel.com
44   [ACPI] merge 2.4.22 cleanup into 2.6
45   Restores CONFIG_ACPI_HT_ONLY as an alternative to CONFIG_ACPI
46   rather than a prerequisite
47
48 ChangeSet@1.1130.1.2, 2003-09-15 00:34:00-04:00, len.brown@intel.com
49   sync 2.4.22 changes into 2.6
50   Note that this restores CONFIG_ACPI_HT_ONLY as a sub-set of
51 CONFIG_ACPI rather
52  than a dependency.
53
54
55
56  arch/i386/kernel/acpi/boot.c   |   10 +--
57  arch/i386/kernel/dmi_scan.c    |   10 +--
58  arch/i386/kernel/mpparse.c     |   31 +++++------
59  arch/i386/kernel/setup.c       |    2 
60  drivers/acpi/Kconfig           |  108 ++++++++++++++++++++++-------------------
61  drivers/acpi/Makefile          |    2 
62  drivers/acpi/ec.c              |    7 +-
63  drivers/acpi/events/evregion.c |    6 +-
64  drivers/acpi/pci_link.c        |   74 +++++++++++++++++++++-------
65  include/acpi/acconfig.h        |    2 
66  include/linux/acpi.h           |    6 +-
67  init/do_mounts.h               |    1 
68  12 files changed, 155 insertions(+), 104 deletions(-)
69
70 diff -puN arch/i386/kernel/acpi/boot.c~acpi-20030916 arch/i386/kernel/acpi/boot.c
71 --- 25/arch/i386/kernel/acpi/boot.c~acpi-20030916       2003-09-26 22:15:04.000000000 -0700
72 +++ 25-akpm/arch/i386/kernel/acpi/boot.c        2003-09-26 22:15:04.000000000 -0700
73 @@ -183,8 +183,7 @@ acpi_parse_lapic_nmi (
74  
75  #endif /*CONFIG_X86_LOCAL_APIC*/
76  
77 -#ifdef CONFIG_X86_IO_APIC
78 -
79 +#if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_ACPI_INTERPRETER)
80  
81  static int __init
82  acpi_parse_ioapic (
83 @@ -368,7 +367,6 @@ acpi_boot_init (void)
84  
85         result = acpi_table_parse(ACPI_APIC, acpi_parse_madt);
86         if (!result) {
87 -               printk(KERN_WARNING PREFIX "MADT not present\n");
88                 return 0;
89         }
90         else if (result < 0) {
91 @@ -416,7 +414,7 @@ acpi_boot_init (void)
92  
93  #endif /*CONFIG_X86_LOCAL_APIC*/
94  
95 -#ifdef CONFIG_X86_IO_APIC
96 +#if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_ACPI_INTERPRETER)
97  
98         /* 
99          * I/O APIC 
100 @@ -472,7 +470,8 @@ acpi_boot_init (void)
101         acpi_irq_model = ACPI_IRQ_MODEL_IOAPIC;
102  
103         acpi_ioapic = 1;
104 -#endif /*CONFIG_X86_IO_APIC*/
105 +
106 +#endif /* CONFIG_X86_IO_APIC && CONFIG_ACPI_INTERPRETER */
107  
108  #ifdef CONFIG_X86_LOCAL_APIC
109         if (acpi_lapic && acpi_ioapic) {
110 @@ -480,6 +479,7 @@ acpi_boot_init (void)
111                 clustered_apic_check();
112         }
113  #endif
114 +
115  #ifdef CONFIG_HPET_TIMER
116         acpi_table_parse(ACPI_HPET, acpi_parse_hpet);
117  #endif
118 diff -puN arch/i386/kernel/dmi_scan.c~acpi-20030916 arch/i386/kernel/dmi_scan.c
119 --- 25/arch/i386/kernel/dmi_scan.c~acpi-20030916        2003-09-26 22:15:04.000000000 -0700
120 +++ 25-akpm/arch/i386/kernel/dmi_scan.c 2003-09-26 22:15:04.000000000 -0700
121 @@ -939,11 +939,6 @@ static __initdata struct dmi_blacklist d
122                         MATCH(DMI_BOARD_NAME, "CUR-DLS"),
123                         NO_MATCH, NO_MATCH }},
124  
125 -       { force_acpi_ht, "ASUS A7V", {
126 -                       MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC"),
127 -                       MATCH(DMI_BOARD_NAME, "<A7V>"),
128 -                       MATCH(DMI_BIOS_VERSION, "ASUS A7V ACPI BIOS Revision 1011"), NO_MATCH }},
129 -
130         { force_acpi_ht, "ABIT i440BX-W83977", {
131                         MATCH(DMI_BOARD_VENDOR, "ABIT <http://www.abit.com>"),
132                         MATCH(DMI_BOARD_NAME, "i440BX-W83977 (BP6)"),
133 @@ -978,7 +973,10 @@ static __initdata struct dmi_blacklist d
134         { disable_acpi_pci, "ASUS A7V", {
135                         MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC"),
136                         MATCH(DMI_BOARD_NAME, "<A7V>"),
137 -                       MATCH(DMI_BIOS_VERSION, "ASUS A7V ACPI BIOS Revision 1007"), NO_MATCH }},
138 +                       /* newer BIOS, Revision 1011, does work */
139 +                       MATCH(DMI_BIOS_VERSION, "ASUS A7V ACPI BIOS Revision 1007"),
140 +                       NO_MATCH }},
141 +
142  #endif
143  
144         { NULL, }
145 diff -puN arch/i386/kernel/mpparse.c~acpi-20030916 arch/i386/kernel/mpparse.c
146 --- 25/arch/i386/kernel/mpparse.c~acpi-20030916 2003-09-26 22:15:04.000000000 -0700
147 +++ 25-akpm/arch/i386/kernel/mpparse.c  2003-09-26 22:15:04.000000000 -0700
148 @@ -830,7 +830,7 @@ void __init mp_register_lapic (
149         MP_processor_info(&processor);
150  }
151  
152 -#ifdef CONFIG_X86_IO_APIC
153 +#if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_ACPI_INTERPRETER)
154  
155  #define MP_ISA_BUS             0
156  #define MP_MAX_IOAPIC_PIN      127
157 @@ -1019,10 +1019,6 @@ void __init mp_config_acpi_legacy_irqs (
158         }
159  }
160  
161 -#ifdef CONFIG_ACPI
162 -
163 -/* Ensure the ACPI SCI interrupt level is active low, edge-triggered */
164 -
165  extern FADT_DESCRIPTOR acpi_fadt;
166  
167  void __init mp_config_ioapic_for_sci(int irq)
168 @@ -1031,6 +1027,7 @@ void __init mp_config_ioapic_for_sci(int
169         int ioapic_pin;
170         struct acpi_table_madt *madt;
171         struct acpi_table_int_src_ovr *entry = NULL;
172 +       acpi_interrupt_flags flags;
173         void *madt_end;
174         acpi_status status;
175  
176 @@ -1054,15 +1051,12 @@ void __init mp_config_ioapic_for_sci(int
177                                  * See the note at the end of ACPI 2.0b section
178                                  * 5.2.10.8 for what this is about.
179                                  */
180 -                               if (entry->bus_irq != entry->global_irq) {
181 -                                       acpi_fadt.sci_int = entry->global_irq;
182 -                                       irq = entry->global_irq;
183 -                                       break;
184 -                               }
185 -                               else
186 -                                       return;
187 +                               flags = entry->flags;
188 +                               acpi_fadt.sci_int = entry->global_irq;
189 +                               irq = entry->global_irq;
190 +                               break;
191                         }
192 -
193 +                       
194                         entry = (struct acpi_table_int_src_ovr *)
195                                 ((unsigned long) entry + entry->header.length);
196                 }
197 @@ -1072,9 +1066,14 @@ void __init mp_config_ioapic_for_sci(int
198  
199         ioapic_pin = irq - mp_ioapic_routing[ioapic].irq_start;
200  
201 -       io_apic_set_pci_routing(ioapic, ioapic_pin, irq, 1, 1); // Active low, level triggered
202 +       if (flags.polarity == 0)
203 +               flags.polarity = 0x3;   /* Active low */ 
204 +       if (flags.trigger == 0) 
205 +               flags.trigger = 0x3;    /* Level-triggered */
206 +
207 +       io_apic_set_pci_routing(ioapic, ioapic_pin, irq, 
208 +                               (flags.trigger >> 1) , (flags.polarity >> 1));
209  }
210 -#endif /* CONFIG_ACPI */
211  
212  #ifdef CONFIG_ACPI_PCI
213  
214 @@ -1154,5 +1153,5 @@ void __init mp_parse_prt (void)
215  }
216  
217  #endif /*CONFIG_ACPI_PCI*/
218 -#endif /* CONFIG_X86_IO_APIC */
219 +#endif /*CONFIG_X86_IO_APIC && CONFIG_ACPI_INTERPRETER*/
220  #endif /*CONFIG_ACPI_BOOT*/
221 diff -puN arch/i386/kernel/setup.c~acpi-20030916 arch/i386/kernel/setup.c
222 --- 25/arch/i386/kernel/setup.c~acpi-20030916   2003-09-26 22:15:04.000000000 -0700
223 +++ 25-akpm/arch/i386/kernel/setup.c    2003-09-26 22:15:04.000000000 -0700
224 @@ -64,7 +64,7 @@ struct cpuinfo_x86 boot_cpu_data = { 0, 
225  unsigned long mmu_cr4_features;
226  EXPORT_SYMBOL_GPL(mmu_cr4_features);
227  
228 -#ifdef CONFIG_ACPI
229 +#ifdef CONFIG_ACPI_INTERPRETER
230         int acpi_disabled __initdata = 0;
231  #else
232         int acpi_disabled __initdata = 1;
233 diff -puN drivers/acpi/ec.c~acpi-20030916 drivers/acpi/ec.c
234 --- 25/drivers/acpi/ec.c~acpi-20030916  2003-09-26 22:15:04.000000000 -0700
235 +++ 25-akpm/drivers/acpi/ec.c   2003-09-26 22:15:04.000000000 -0700
236 @@ -32,7 +32,7 @@
237  #include <asm/io.h>
238  #include <acpi/acpi_bus.h>
239  #include <acpi/acpi_drivers.h>
240 -
241 +#include <acpi/actypes.h>
242  
243  #define _COMPONENT             ACPI_EC_COMPONENT
244  ACPI_MODULE_NAME               ("acpi_ec")
245 @@ -412,7 +412,10 @@ acpi_ec_space_setup (
246          * The EC object is in the handler context and is needed
247          * when calling the acpi_ec_space_handler.
248          */
249 -       *return_context = handler_context;
250 +       if(function == ACPI_REGION_DEACTIVATE) 
251 +               *return_context = NULL;
252 +       else 
253 +               *return_context = handler_context;
254  
255         return AE_OK;
256  }
257 diff -puN drivers/acpi/events/evregion.c~acpi-20030916 drivers/acpi/events/evregion.c
258 --- 25/drivers/acpi/events/evregion.c~acpi-20030916     2003-09-26 22:15:04.000000000 -0700
259 +++ 25-akpm/drivers/acpi/events/evregion.c      2003-09-26 22:15:04.000000000 -0700
260 @@ -382,7 +382,7 @@ acpi_ev_detach_region(
261         union acpi_operand_object       *obj_desc;
262         union acpi_operand_object       **last_obj_ptr;
263         acpi_adr_space_setup            region_setup;
264 -       void                            *region_context;
265 +       void                            **region_context;
266         union acpi_operand_object       *region_obj2;
267         acpi_status                     status;
268  
269 @@ -394,7 +394,7 @@ acpi_ev_detach_region(
270         if (!region_obj2) {
271                 return_VOID;
272         }
273 -       region_context = region_obj2->extra.region_context;
274 +       region_context = &region_obj2->extra.region_context;
275  
276         /* Get the address handler from the region object */
277  
278 @@ -450,7 +450,7 @@ acpi_ev_detach_region(
279  
280                         region_setup = handler_obj->address_space.setup;
281                         status = region_setup (region_obj, ACPI_REGION_DEACTIVATE,
282 -                                         handler_obj->address_space.context, &region_context);
283 +                                         handler_obj->address_space.context, region_context);
284  
285                         /* Init routine may fail, Just ignore errors */
286  
287 diff -puN drivers/acpi/Kconfig~acpi-20030916 drivers/acpi/Kconfig
288 --- 25/drivers/acpi/Kconfig~acpi-20030916       2003-09-26 22:15:04.000000000 -0700
289 +++ 25-akpm/drivers/acpi/Kconfig        2003-09-26 22:15:04.000000000 -0700
290 @@ -3,34 +3,14 @@
291  #
292  
293  menu "ACPI (Advanced Configuration and Power Interface) Support"
294 -
295 -config ACPI_HT
296 -       bool "ACPI Processor Enumeration for HT"
297 -       depends on X86
298 -       default y
299 -       ---help---
300 -         ACPI enumerates both logical (a.k.a. Hyper-Threaded -- HT)
301 -         and physical processors.  It is designed to obsolete several older
302 -         specifications, including the MultiProcessor Specification (MPS),
303 -         which supported only physical processors.
304 -
305 -         CONFIG_ACPI_HT includes the minimal ACPI boot-time code
306 -         necessary to enumerate logical processors and enable HT.
307 -
308 -         CONFIG_ACPI includes CONFIG_ACPI_HT, plus IO APIC enumeration,
309 -         and the hooks to run the ACPI AML interpreter for run-time events.
310 -
311 -         When CONFIG_ACPI is selected, the command-line option "acpi=ht"
312 -         is available to run just the ACPI boot-time code -- just as if
313 -         only CONFIG_ACPI_HT were selected.
314 -
315 -         Note that "acpi=off" can be used to disable all ACPI code in the kernel.
316 -
317 -config ACPI
318 -       bool "Full ACPI Support"
319         depends on !X86_VISWS
320         depends on !IA64_HP_SIM
321 -       depends on IA64 || (X86 || ACPI_HT)
322 +       depends on IA64 || X86
323 +
324 +config ACPI
325 +       bool "ACPI Support"
326 +       depends on IA64 || X86
327 +
328         default y
329         ---help---
330           Advanced Configuration and Power Interface (ACPI) support for 
331 @@ -60,14 +40,47 @@ config ACPI
332           available at:
333           <http://www.acpi.info>
334  
335 +config ACPI_HT_ONLY
336 +       bool "Restrict ACPI to minimum boot code to enable HT"
337 +       depends on X86
338 +       depends on ACPI
339 +       depends on SMP
340 +       default n
341 +       ---help---
342 +         ACPI enumerates both logical (a.k.a. Hyper-Threaded -- HT)
343 +         and physical processors.  It is designed to obsolete several older
344 +         specifications, including the MultiProcessor Specification (MPS),
345 +         which supported only physical processors.
346 +
347 +         CONFIG_ACPI_HT_ONLY includes just the minimal ACPI boot-time code
348 +         necessary to enumerate logical processors and enable HT.
349 +
350 +         CONFIG_ACPI includes this, plus IO APIC enumeration,
351 +         and the hooks to run the ACPI AML interpreter for run-time events.
352 +
353 +         When CONFIG_ACPI is selected, the command-line option "acpi=ht"
354 +         is available to run just the ACPI boot-time code -- just as if
355 +         only CONFIG_ACPI_HT_ONLY were selected.
356 +
357 +         Note that "acpi=off" can be used to disable all ACPI code in the kernel.
358 +
359 +
360  config ACPI_BOOT
361         bool
362 -       depends on ACPI || ACPI_HT
363 +       depends on ACPI
364 +       default y
365 +
366 +config ACPI_INTERPRETER
367 +       bool
368 +       depends on ACPI
369 +       depends on !IA64_SGI_SN
370 +       depends on !ACPI_HT_ONLY
371         default y
372  
373  config ACPI_SLEEP
374         bool "Sleep States (EXPERIMENTAL)"
375         depends on X86 && ACPI
376 +       depends on ACPI_INTERPRETER
377         depends on EXPERIMENTAL && PM
378         default y
379         ---help---
380 @@ -93,7 +106,8 @@ config ACPI_SLEEP_PROC_FS
381  
382  config ACPI_AC
383         tristate "AC Adapter"
384 -       depends on X86 && ACPI
385 +       depends on X86
386 +       depends on ACPI_INTERPRETER
387         default m
388         help
389           This driver adds support for the AC Adapter object, which indicates
390 @@ -102,7 +116,8 @@ config ACPI_AC
391  
392  config ACPI_BATTERY
393         tristate "Battery"
394 -       depends on X86 && ACPI
395 +       depends on X86
396 +       depends on ACPI_INTERPRETER
397         default m
398         help
399           This driver adds support for battery information through
400 @@ -111,7 +126,7 @@ config ACPI_BATTERY
401  
402  config ACPI_BUTTON
403         tristate "Button"
404 -       depends on ACPI
405 +       depends on ACPI_INTERPRETER
406         depends on !IA64_SGI_SN
407         default m
408         help
409 @@ -123,7 +138,7 @@ config ACPI_BUTTON
410  
411  config ACPI_FAN
412         tristate "Fan"
413 -       depends on ACPI
414 +       depends on ACPI_INTERPRETER
415         depends on !IA64_SGI_SN
416         default m
417         help
418 @@ -132,7 +147,7 @@ config ACPI_FAN
419  
420  config ACPI_PROCESSOR
421         tristate "Processor"
422 -       depends on ACPI
423 +       depends on ACPI_INTERPRETER
424         depends on !IA64_SGI_SN
425         default m
426         help
427 @@ -152,14 +167,15 @@ config ACPI_THERMAL
428  
429  config ACPI_NUMA
430         bool "NUMA support"
431 -       depends on ACPI
432 +       depends on ACPI_INTERPRETER
433         depends on NUMA
434         depends on !X86_64
435         default y if IA64_GENERIC || IA64_SGI_SN2
436  
437  config ACPI_ASUS
438          tristate "ASUS/Medion Laptop Extras"
439 -        depends on X86 && ACPI
440 +       depends on X86
441 +       depends on ACPI_INTERPRETER
442         default m
443          ---help---
444            This driver provides support for extra features of ACPI-compatible
445 @@ -185,7 +201,8 @@ config ACPI_ASUS
446            
447  config ACPI_TOSHIBA
448         tristate "Toshiba Laptop Extras"
449 -       depends on X86 && ACPI
450 +       depends on X86
451 +       depends on ACPI_INTERPRETER
452         default m
453         ---help---
454           This driver adds support for access to certain system settings
455 @@ -212,7 +229,7 @@ config ACPI_TOSHIBA
456  
457  config ACPI_DEBUG
458         bool "Debug Statements"
459 -       depends on ACPI
460 +       depends on ACPI_INTERPRETER
461         depends on !IA64_SGI_SN
462         default n
463         help
464 @@ -222,19 +239,14 @@ config ACPI_DEBUG
465  
466  config ACPI_BUS
467         bool
468 -       depends on ACPI
469 -       depends on !IA64_SGI_SN
470 -       default y
471 -
472 -config ACPI_INTERPRETER
473 -       bool
474 -       depends on ACPI
475 +       depends on ACPI_INTERPRETER
476         depends on !IA64_SGI_SN
477         default y
478  
479  config ACPI_EC
480         bool
481 -       depends on X86 && ACPI
482 +       depends on X86
483 +       depends on ACPI_INTERPRETER
484         default y
485         help
486           This driver is required on some systems for the proper operation of
487 @@ -243,19 +255,19 @@ config ACPI_EC
488  
489  config ACPI_POWER
490         bool
491 -       depends on ACPI
492 +       depends on ACPI_INTERPRETER
493         depends on !IA64_SGI_SN
494         default y
495  
496  config ACPI_PCI
497         bool
498 -       depends on ACPI
499 +       depends on ACPI_INTERPRETER
500         depends on !IA64_SGI_SN
501         default PCI
502  
503  config ACPI_SYSTEM
504         bool
505 -       depends on ACPI
506 +       depends on ACPI_INTERPRETER
507         depends on !IA64_SGI_SN
508         default y
509         help
510 @@ -264,7 +276,7 @@ config ACPI_SYSTEM
511  
512  config ACPI_EFI
513         bool
514 -       depends on ACPI
515 +       depends on ACPI_INTERPRETER
516         depends on IA64
517         default y
518  
519 diff -puN drivers/acpi/Makefile~acpi-20030916 drivers/acpi/Makefile
520 --- 25/drivers/acpi/Makefile~acpi-20030916      2003-09-26 22:15:04.000000000 -0700
521 +++ 25-akpm/drivers/acpi/Makefile       2003-09-26 22:15:04.000000000 -0700
522 @@ -18,7 +18,7 @@ obj-$(CONFIG_ACPI)            := acpi_ksyms.o 
523  # ACPI Boot-Time Table Parsing
524  #
525  obj-$(CONFIG_ACPI_BOOT)                += tables.o
526 -obj-$(CONFIG_ACPI)             += blacklist.o
527 +obj-$(CONFIG_ACPI_INTERPRETER) += blacklist.o
528  
529  #
530  # ACPI Core Subsystem (Interpreter)
531 diff -puN drivers/acpi/pci_link.c~acpi-20030916 drivers/acpi/pci_link.c
532 --- 25/drivers/acpi/pci_link.c~acpi-20030916    2003-09-26 22:15:04.000000000 -0700
533 +++ 25-akpm/drivers/acpi/pci_link.c     2003-09-26 22:15:04.000000000 -0700
534 @@ -220,7 +220,6 @@ acpi_pci_link_check_current (
535         return AE_CTRL_TERMINATE;
536  }
537  
538 -
539  static int
540  acpi_pci_link_get_current (
541         struct acpi_pci_link    *link)
542 @@ -279,6 +278,28 @@ end:
543         return_VALUE(result);
544  }
545  
546 +static int
547 +acpi_pci_link_try_get_current (
548 +       struct acpi_pci_link *link,
549 +       int irq)
550 +{
551 +       int result;
552 +
553 +       ACPI_FUNCTION_TRACE("acpi_pci_link_try_get_current");
554 +
555 +       result = acpi_pci_link_get_current(link);
556 +       if (result && link->irq.active) {
557 +               return_VALUE(result);
558 +       }
559 +
560 +       if (!link->irq.active) {
561 +               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "No active IRQ resource found\n"));
562 +               printk(KERN_WARNING "_CRS returns NULL! Using IRQ %d for device (%s [%s]).\n", irq, acpi_device_name(link->device), acpi_device_bid(link->device));
563 +               link->irq.active = irq;
564 +       }
565 +       
566 +       return 0;
567 +}
568  
569  static int
570  acpi_pci_link_set (
571 @@ -294,6 +315,7 @@ acpi_pci_link_set (
572         struct acpi_buffer      buffer = {sizeof(resource)+1, &resource};
573         int                     i = 0;
574         int                     valid = 0;
575 +       int                     resource_type = 0;
576  
577         ACPI_FUNCTION_TRACE("acpi_pci_link_set");
578  
579 @@ -317,20 +339,32 @@ acpi_pci_link_set (
580                 }
581         }
582  
583 +       /* If IRQ<=15, first try with a "normal" IRQ descriptor. If that fails, try with
584 +        * an extended one */
585 +       if (irq <= 15) {
586 +               resource_type = ACPI_RSTYPE_IRQ;
587 +       } else {
588 +               resource_type = ACPI_RSTYPE_EXT_IRQ;
589 +       }
590 +
591 +retry_programming:
592 +   
593         memset(&resource, 0, sizeof(resource));
594  
595         /* NOTE: PCI interrupts are always level / active_low / shared. But not all
596            interrupts > 15 are PCI interrupts. Rely on the ACPI IRQ definition for 
597            parameters */
598 -       if (irq <= 15) {
599 +       switch(resource_type) {
600 +       case ACPI_RSTYPE_IRQ:
601                 resource.res.id = ACPI_RSTYPE_IRQ;
602                 resource.res.length = sizeof(struct acpi_resource);
603                 resource.res.data.irq.edge_level = link->irq.edge_level;
604                 resource.res.data.irq.active_high_low = link->irq.active_high_low;
605                 resource.res.data.irq.number_of_interrupts = 1;
606                 resource.res.data.irq.interrupts[0] = irq;
607 -       }
608 -       else {
609 +               break;
610 +          
611 +       case ACPI_RSTYPE_EXT_IRQ:
612                 resource.res.id = ACPI_RSTYPE_EXT_IRQ;
613                 resource.res.length = sizeof(struct acpi_resource);
614                 resource.res.data.extended_irq.producer_consumer = ACPI_CONSUMER;
615 @@ -339,11 +373,21 @@ acpi_pci_link_set (
616                 resource.res.data.extended_irq.number_of_interrupts = 1;
617                 resource.res.data.extended_irq.interrupts[0] = irq;
618                 /* ignore resource_source, it's optional */
619 +               break;
620         }
621         resource.end.id = ACPI_RSTYPE_END_TAG;
622  
623         /* Attempt to set the resource */
624         status = acpi_set_current_resources(link->handle, &buffer);
625 +
626 +       /* if we failed and IRQ <= 15, try again with an extended descriptor */
627 +       if (ACPI_FAILURE(status) && (resource_type == ACPI_RSTYPE_IRQ)) {
628 +                resource_type = ACPI_RSTYPE_EXT_IRQ;
629 +                printk(PREFIX "Retrying with extended IRQ descriptor\n");
630 +                goto retry_programming;
631 +       }
632 +  
633 +       /* check for total failure */
634         if (ACPI_FAILURE(status)) {
635                 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _SRS\n"));
636                 return_VALUE(-ENODEV);
637 @@ -361,7 +405,7 @@ acpi_pci_link_set (
638         }
639  
640         /* Make sure the active IRQ is the one we requested. */
641 -       result = acpi_pci_link_get_current(link);
642 +       result = acpi_pci_link_try_get_current(link, irq);
643         if (result) {
644                 return_VALUE(result);
645         }
646 @@ -458,14 +502,14 @@ static int acpi_pci_link_allocate(struct
647                 irq = link->irq.possible[0];
648         }
649  
650 -               /* 
651 -                * Select the best IRQ.  This is done in reverse to promote 
652 -                * the use of IRQs 9, 10, 11, and >15.
653 -                */
654 -               for (i=(link->irq.possible_count-1); i>0; i--) {
655 -                       if (acpi_irq_penalty[irq] > acpi_irq_penalty[link->irq.possible[i]])
656 -                               irq = link->irq.possible[i];
657 -               }
658 +       /* 
659 +        * Select the best IRQ.  This is done in reverse to promote 
660 +        * the use of IRQs 9, 10, 11, and >15.
661 +        */
662 +       for (i=(link->irq.possible_count-1); i>0; i--) {
663 +               if (acpi_irq_penalty[irq] > acpi_irq_penalty[link->irq.possible[i]])
664 +                       irq = link->irq.possible[i];
665 +       }
666  
667         /* Attempt to enable the link device at this IRQ. */
668         if (acpi_pci_link_set(link, irq)) {
669 @@ -574,10 +618,6 @@ acpi_pci_link_add (
670                 else
671                         printk(" %d", link->irq.possible[i]);
672         }
673 -       if (!link->irq.active)
674 -               printk(", disabled");
675 -       else if (!found)
676 -               printk(", enabled at IRQ %d", link->irq.active);
677         printk(")\n");
678  
679         /* TBD: Acquire/release lock */
680 diff -puN include/acpi/acconfig.h~acpi-20030916 include/acpi/acconfig.h
681 --- 25/include/acpi/acconfig.h~acpi-20030916    2003-09-26 22:15:04.000000000 -0700
682 +++ 25-akpm/include/acpi/acconfig.h     2003-09-26 22:15:04.000000000 -0700
683 @@ -64,7 +64,7 @@
684  
685  /* Version string */
686  
687 -#define ACPI_CA_VERSION                 0x20030813
688 +#define ACPI_CA_VERSION                 0x20030916
689  
690  /* Maximum objects in the various object caches */
691  
692 diff -puN include/linux/acpi.h~acpi-20030916 include/linux/acpi.h
693 --- 25/include/linux/acpi.h~acpi-20030916       2003-09-26 22:15:04.000000000 -0700
694 +++ 25-akpm/include/linux/acpi.h        2003-09-26 22:15:04.000000000 -0700
695 @@ -424,17 +424,17 @@ int ec_write(u8 addr, u8 val);
696  
697  #endif /*CONFIG_ACPI_EC*/
698  
699 -#ifdef CONFIG_ACPI
700 +#ifdef CONFIG_ACPI_INTERPRETER
701  
702  int acpi_blacklisted(void);
703  
704 -#else
705 +#else /*!CONFIG_ACPI_INTERPRETER*/
706  
707  static inline int acpi_blacklisted(void)
708  {
709         return 0;
710  }
711  
712 -#endif /*CONFIG_ACPI*/
713 +#endif /*!CONFIG_ACPI_INTERPRETER*/
714  
715  #endif /*_LINUX_ACPI_H*/
716 diff -puN init/do_mounts.h~acpi-20030916 init/do_mounts.h
717 --- 25/init/do_mounts.h~acpi-20030916   2003-09-26 22:15:04.000000000 -0700
718 +++ 25-akpm/init/do_mounts.h    2003-09-26 22:15:04.000000000 -0700
719 @@ -104,4 +104,3 @@ void md_run_setup(void);
720  static inline void md_run_setup(void) {}
721  
722  #endif
723 -
724
725 _
726
727 From: Andi Kleen <ak@suse.de>
728
729 ACPI modules check acpi_disabled at module load time.  This fixes random
730 failures to load battery.o et.al.
731
732
733
734  25-akpm/arch/i386/kernel/setup.c |    4 ++--
735  25-akpm/arch/ia64/kernel/acpi.c  |    2 +-
736  2 files changed, 3 insertions(+), 3 deletions(-)
737
738 diff -puN arch/i386/kernel/setup.c~acpi_disabled-fix arch/i386/kernel/setup.c
739 --- 25/arch/i386/kernel/setup.c~acpi_disabled-fix       Tue Sep 23 14:01:14 2003
740 +++ 25-akpm/arch/i386/kernel/setup.c    Tue Sep 23 14:01:14 2003
741 @@ -65,9 +65,9 @@ unsigned long mmu_cr4_features;
742  EXPORT_SYMBOL_GPL(mmu_cr4_features);
743  
744  #ifdef CONFIG_ACPI_INTERPRETER
745 -       int acpi_disabled __initdata = 0;
746 +       int acpi_disabled = 0;
747  #else
748 -       int acpi_disabled __initdata = 1;
749 +       int acpi_disabled = 1;
750  #endif
751  EXPORT_SYMBOL(acpi_disabled);
752  
753 diff -puN arch/ia64/kernel/acpi.c~acpi_disabled-fix arch/ia64/kernel/acpi.c
754 --- 25/arch/ia64/kernel/acpi.c~acpi_disabled-fix        Tue Sep 23 14:01:14 2003
755 +++ 25-akpm/arch/ia64/kernel/acpi.c     Tue Sep 23 14:01:14 2003
756 @@ -56,7 +56,7 @@ void (*pm_power_off) (void);
757  
758  unsigned char acpi_kbd_controller_present = 1;
759  
760 -int acpi_disabled __initdata;  /* XXX this shouldn't be needed---we can't boot without ACPI! */
761 +int acpi_disabled;     /* XXX this shouldn't be needed---we can't boot without ACPI! */
762  
763  const char *
764  acpi_get_sysname (void)
765
766 _
767
768 From: Chris Wright <chrisw@osdl.org>
769
770 This got lost.
771
772
773  25-akpm/drivers/acpi/pci_link.c |   16 ++++++++--------
774  1 files changed, 8 insertions(+), 8 deletions(-)
775
776 diff -puN drivers/acpi/pci_link.c~acpi-pci-irq-fix-439 drivers/acpi/pci_link.c
777 --- 25/drivers/acpi/pci_link.c~acpi-pci-irq-fix-439     Mon Sep 22 14:08:48 2003
778 +++ 25-akpm/drivers/acpi/pci_link.c     Mon Sep 22 14:08:48 2003
779 @@ -500,15 +500,15 @@ static int acpi_pci_link_allocate(struct
780                 irq = link->irq.active;
781         } else {
782                 irq = link->irq.possible[0];
783 -       }
784  
785 -       /* 
786 -        * Select the best IRQ.  This is done in reverse to promote 
787 -        * the use of IRQs 9, 10, 11, and >15.
788 -        */
789 -       for (i=(link->irq.possible_count-1); i>0; i--) {
790 -               if (acpi_irq_penalty[irq] > acpi_irq_penalty[link->irq.possible[i]])
791 -                       irq = link->irq.possible[i];
792 +               /*
793 +                * Select the best IRQ.  This is done in reverse to promote
794 +                * the use of IRQs 9, 10, 11, and >15.
795 +                */
796 +               for (i=(link->irq.possible_count-1); i>0; i--) {
797 +                       if (acpi_irq_penalty[irq] > acpi_irq_penalty[link->irq.possible[i]])
798 +                               irq = link->irq.possible[i];
799 +               }
800         }
801  
802         /* Attempt to enable the link device at this IRQ. */
803
804 _
805
806 From: Ramon Casellas <casellas@infres.enst.fr>
807
808 Hi,
809
810 Original patch from Li, Shaohua <shaohua@in...> for 2.4.22/23, ported to 
811 2.6.0-test5-mm3 (with acpi 20030916), please test.
812
813 [1] Bug Report 
814 ----------------------------------------------------------
815 http://sourceforge.net/mailarchive/forum.php?thread_id=3144527&forum_id=6102
816
817 [2] Answer
818 -----------------------------------------------------------
819 > From: Li, Shaohua <shaohua@in...> 
820 > RE: Re: IBM Thinkpad and ACPI 20030916 for 2.4.23-pre4   
821 2003-09-17 17:28 
822
823 >Hi,
824 > Patch for the battery error is available in OSDL bugzilla #1038. Pl. 
825 try.
826 > Thanks,
827 > Shaohua
828 -----------------------------------------------------------
829
830 Note: Works for me.
831
832
833
834  25-akpm/drivers/acpi/utilities/utdelete.c |   36 +++++++++++++++++++++++++++---
835  1 files changed, 33 insertions(+), 3 deletions(-)
836
837 diff -puN drivers/acpi/utilities/utdelete.c~acpi-thinkpad-fix drivers/acpi/utilities/utdelete.c
838 --- 25/drivers/acpi/utilities/utdelete.c~acpi-thinkpad-fix      Fri Sep 19 11:11:57 2003
839 +++ 25-akpm/drivers/acpi/utilities/utdelete.c   Fri Sep 19 11:11:57 2003
840 @@ -417,6 +417,8 @@ acpi_ut_update_object_reference (
841         union acpi_generic_state         *state_list = NULL;
842         union acpi_generic_state         *state;
843  
844 +       union acpi_operand_object        *tmp;
845 +
846  
847         ACPI_FUNCTION_TRACE_PTR ("ut_update_object_reference", object);
848  
849 @@ -447,9 +449,16 @@ acpi_ut_update_object_reference (
850                  */
851                 switch (ACPI_GET_OBJECT_TYPE (object)) {
852                 case ACPI_TYPE_DEVICE:
853 -
854 -                       acpi_ut_update_ref_count (object->device.system_notify, action);
855 -                       acpi_ut_update_ref_count (object->device.device_notify, action);
856 +
857 +                       tmp = object->device.system_notify;
858 +                       if(tmp && tmp->common.reference_count<=1 && action == REF_DECREMENT)
859 +                               object->device.system_notify = NULL;
860 +                       acpi_ut_update_ref_count (tmp, action);
861 +
862 +                       tmp = object->device.device_notify;
863 +                       if(tmp && tmp->common.reference_count <=1 && action == REF_DECREMENT)
864 +                               object->device.device_notify = NULL;
865 +                       acpi_ut_update_ref_count (tmp, action);
866                         break;
867  
868  
869 @@ -467,6 +476,9 @@ acpi_ut_update_object_reference (
870                                  */
871                                 status = acpi_ut_create_update_state_and_push (
872                                                  object->package.elements[i], action, &state_list);
873 +                               tmp = object->package.elements[i];
874 +                               if(tmp && tmp->common.reference_count<=1  && action == REF_DECREMENT) /*reference count didn't refresh now*/
875 +                                       object->package.elements[i] = NULL;
876                                 if (ACPI_FAILURE (status)) {
877                                         goto error_exit;
878                                 }
879 @@ -478,6 +490,9 @@ acpi_ut_update_object_reference (
880  
881                         status = acpi_ut_create_update_state_and_push (
882                                          object->buffer_field.buffer_obj, action, &state_list);
883 +                       tmp = object->buffer_field.buffer_obj;
884 +                       if( tmp && tmp->common.reference_count <=1  && action == REF_DECREMENT)/*reference count didn't refresh now*/
885 +                               object->buffer_field.buffer_obj = NULL;
886                         if (ACPI_FAILURE (status)) {
887                                 goto error_exit;
888                         }
889 @@ -491,6 +506,9 @@ acpi_ut_update_object_reference (
890                         if (ACPI_FAILURE (status)) {
891                                 goto error_exit;
892                         }
893 +                       tmp = object->field.region_obj;
894 +                       if( tmp && tmp->common.reference_count <=1  && action == REF_DECREMENT)/*reference count didn't refresh now*/
895 +                               object->field.region_obj = NULL;
896                    break;
897  
898  
899 @@ -501,12 +519,18 @@ acpi_ut_update_object_reference (
900                         if (ACPI_FAILURE (status)) {
901                                 goto error_exit;
902                         }
903 +                       tmp = object->bank_field.bank_obj;
904 +                       if( tmp && tmp->common.reference_count <=1  && action == REF_DECREMENT)/*reference count didn't refresh now*/
905 +                               object->bank_field.bank_obj = NULL;
906  
907                         status = acpi_ut_create_update_state_and_push (
908                                          object->bank_field.region_obj, action, &state_list);
909                         if (ACPI_FAILURE (status)) {
910                                 goto error_exit;
911                         }
912 +                       tmp = object->bank_field.region_obj;
913 +                       if( tmp && tmp->common.reference_count <=1  && action == REF_DECREMENT)/*reference count didn't refresh now*/
914 +                               object->bank_field.region_obj = NULL;
915                         break;
916  
917  
918 @@ -517,12 +541,18 @@ acpi_ut_update_object_reference (
919                         if (ACPI_FAILURE (status)) {
920                                 goto error_exit;
921                         }
922 +                       tmp = object->index_field.index_obj;
923 +                       if( tmp && tmp->common.reference_count <=1  && action == REF_DECREMENT)/*reference count didn't refresh now*/
924 +                               object->index_field.index_obj = NULL;
925  
926                         status = acpi_ut_create_update_state_and_push (
927                                          object->index_field.data_obj, action, &state_list);
928                         if (ACPI_FAILURE (status)) {
929                                 goto error_exit;
930                         }
931 +                       tmp = object->index_field.data_obj;
932 +                       if( tmp && tmp->common.reference_count <=1  && action == REF_DECREMENT)/*reference count didn't refresh now*/
933 +                               object->index_field.data_obj = NULL;
934                         break;
935  
936  
937
938 _
939
940 From: Andi Kleen <ak@suse.de>
941
942 Try this (untested) patch
943
944 (2.6 version untested, I tested a similar patch on the 2.4 backport of
945 ACPI):
946
947
948
949  25-akpm/arch/i386/pci/acpi.c |    3 ++-
950  1 files changed, 2 insertions(+), 1 deletion(-)
951
952 diff -puN arch/i386/pci/acpi.c~acpi_off-fix arch/i386/pci/acpi.c
953 --- 25/arch/i386/pci/acpi.c~acpi_off-fix        Tue Sep  9 12:12:00 2003
954 +++ 25-akpm/arch/i386/pci/acpi.c        Tue Sep  9 12:12:00 2003
955 @@ -15,10 +15,11 @@ struct pci_bus * __devinit pci_acpi_scan
956  
957  static int __init pci_acpi_init(void)
958  {
959 +       extern int acpi_disabled;
960         if (pcibios_scanned)
961                 return 0;
962  
963 -       if (!(pci_probe & PCI_NO_ACPI_ROUTING)) {
964 +       if (!(pci_probe & PCI_NO_ACPI_ROUTING) && !acpi_disabled) {
965                 if (!acpi_pci_irq_init()) {
966                         printk(KERN_INFO "PCI: Using ACPI for IRQ routing\n");
967                         printk(KERN_INFO "PCI: if you experience problems, try using option 'pci=noacpi' or even 'acpi=off'\n");
968
969 _
This page took 0.21788 seconds and 3 git commands to generate.