19 Mar, 2011

1 commit

  • ACPI uses a sysdev class and a sysdev for executing
    irqrouter_resume() before turning on interrupts on the boot CPU.
    However, since irqrouter_resume() ignores its argument, the entire
    mechanism may be replaced with a struct syscore_ops object which
    is considerably simpler.

    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Len Brown

    Rafael J. Wysocki
     

16 Oct, 2010

1 commit


30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

17 Jan, 2010

1 commit

  • The ids field of the struct acpi_driver is constant in
    so it is worth to make the initialization data also constant.

    The semantic match that finds this kind of pattern is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @r@
    disable decl_init,const_decl_init;
    identifier I1, I2, x;
    @@
    struct I1 {
    ...
    const struct I2 *x;
    ...
    };
    @s@
    identifier r.I1, y;
    identifier r.x, E;
    @@
    struct I1 y = {
    .x = E,
    };
    @c@
    identifier r.I2;
    identifier s.E;
    @@
    const struct I2 E[] = ... ;
    @depends on !c@
    identifier r.I2;
    identifier s.E;
    @@
    + const
    struct I2 E[] = ...;
    //

    Signed-off-by: Márton Németh
    Cc: Julia Lawall
    Cc: cocci@diku.dk
    Signed-off-by: Len Brown

    Márton Németh
     

29 Aug, 2009

1 commit

  • Linux/ACPI core files using internal.h all PREFIX "ACPI: ",
    however, not all ACPI drivers use/want it -- and they
    should not have to #undef PREFIX to define their own.

    Add GPL commment to internal.h while we are there.

    This does not change any actual console output,
    asside from a whitespace fix.

    Signed-off-by: Len Brown

    Len Brown
     

17 Mar, 2009

4 commits


07 Feb, 2009

1 commit


09 Jan, 2009

1 commit


31 Dec, 2008

2 commits

  • Sparse asked whether these could be static.

    Signed-off-by: Roel Kluin
    Signed-off-by: Len Brown

    Roel Kluin
     
  • According to the ACPI specification the SCI_EN flag is controlled by
    the hardware, which sets this flag to inform the kernel that ACPI is
    enabled. For this reason, we shouldn't try to modify SCI_EN
    directly. Also, we don't need to do it in irqrouter_resume(), since
    lower-level resume code takes care of enabling ACPI in case it hasn't
    been enabled by the BIOS before passing control to the kernel (which
    by the way is against the ACPI specification).

    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Len Brown

    Rafael J. Wysocki
     

12 Nov, 2008

1 commit

  • This removes the acpi_irq_balance_set() interface from the PCI
    interrupt link driver.

    x86 used acpi_irq_balance_set() to tell the PCI interrupt link
    driver to configure links to minimize IRQ sharing. But the link
    driver can easily figure out whether to turn on IRQ balancing
    based on the IRQ model (PIC/IOAPIC/etc), so we can get rid of
    that external interface.

    It's better for the driver to figure this out at init-time. If
    we set it externally via the x86 code, the interface reduces
    modularity, and we depend on the fact that acpi_process_madt()
    happens before we process the kernel command line.

    Signed-off-by: Bjorn Helgaas
    Signed-off-by: Len Brown

    Bjorn Helgaas
     

23 Oct, 2008

2 commits


11 Oct, 2008

1 commit


15 Aug, 2008

1 commit

  • acpi_penalize_isa_irq() should validate irq before using it to
    index the acpi_irq_penalty[] table.

    Here's the path I'm concerned about:

    pnpacpi_parse_allocated_irqresource()
    {
    ...
    irq = acpi_register_gsi(gsi, triggering, polarity);
    if (irq >= 0)
    pcibios_penalize_isa_irq(irq, 1);

    There's no guarantee that acpi_register_gsi() will return an IRQ
    within the bounds of acpi_irq_penalty[].

    I have not seen a failure I can attribute to this. However,
    ACPI_MAX_IRQS is only 256, and I'm pretty sure ia64 can have
    IRQs larger than that.

    I think this should go in 2.6.27.

    Signed-off-by: Bjorn Helgaas
    Signed-off-by: Andi Kleen

    Bjorn Helgaas
     

18 Jul, 2008

1 commit

  • Silently ignore _PRS End Tags. We already ignore Start Dependent Functions in
    _PRS, and we already ignore End Tags in _CRS, so we might as well ignore End
    Tags in _PRS as well.

    Silently ignore _PRS IRQ descriptors that mention no interrupts. The spec
    allows this (section 6.4.2.1 in ACPI 3.0b spec), and it probably means the
    interrupt link can't be configured at all.

    This patch doesn't change any functional behavior; it just removes confusing
    complaints like these:

    ACPI: Blank IRQ resource
    ACPI: Resource is not an IRQ entry

    when parsing _PRS data "23 00 00 18 79 00" from an IBM xSeries 335 dual
    Pentium IV Xeon 2.40 GHz machine. For more details, see
    http://bugzilla.kernel.org/show_bug.cgi?id=11049

    The "23 00 00 18" part is a three-byte-long small IRQ resource with no bits set
    in the IRQ mask ("00 00"), and level-triggered, active low, shareable ("18").

    The "79 00" is an End Tag (type 0x7). It is superfluous since there is no
    Start Dependent Function tag and there are no resources after it, but it is
    harmless.

    Thanks to Gabriele Trombetti
    (aka Kurk) for reporting this and testing the patch.

    Signed-off-by: Bjorn Helgaas
    Signed-off-by: Andi Kleen

    Bjorn Helgaas
     

07 Feb, 2008

1 commit

  • This patch contains the following possible cleanups:
    - make the following needlessly global code static:
    - drivers/acpi/bay.c:dev_attr_eject
    - drivers/acpi/bay.c:dev_attr_present
    - drivers/acpi/dock.c:dev_attr_docked
    - drivers/acpi/dock.c:dev_attr_flags
    - drivers/acpi/dock.c:dev_attr_uid
    - drivers/acpi/dock.c:dev_attr_undock
    - drivers/acpi/pci_bind.c:acpi_pci_unbind()
    - drivers/acpi/pci_link.c:acpi_link_lock
    - drivers/acpi/sbs.c:acpi_sbs_callback()
    - drivers/acpi/sbshc.c:acpi_smbus_transaction()
    - drivers/acpi/sleep/main.c:acpi_sleep_prepare()
    - #if 0 the following unused global functions:
    - drivers/acpi/numa.c:acpi_unmap_pxm_to_node()
    - remove the following unused EXPORT_SYMBOL's:
    - acpi_register_gsi
    - acpi_unregister_gsi
    - acpi_strict
    - acpi_bus_receive_event
    - register_acpi_bus_type
    - unregister_acpi_bus_type
    - acpi_os_printf
    - acpi_os_sleep
    - acpi_os_stall
    - acpi_os_read_pci_configuration
    - acpi_os_create_semaphore
    - acpi_os_delete_semaphore
    - acpi_os_wait_semaphore
    - acpi_os_signal_semaphore
    - acpi_os_signal
    - acpi_pci_irq_enable
    - acpi_get_pxm

    Signed-off-by: Adrian Bunk
    Acked-by: Alexey Starikovskiy
    Signed-off-by: Len Brown

    Adrian Bunk
     

25 Jan, 2008

1 commit


24 Jul, 2007

1 commit


22 Jul, 2007

1 commit


13 Feb, 2007

3 commits

  • Cosmetic only.

    Except in a single case, #define ACPI_*_DRIVER_NAME
    were invoked 0 or 1 times.

    Signed-off-by: Len Brown

    Len Brown
     
  • It was erroneously used as a description rather than a name.

    ie. turn this:

    lenb@se7525gp2:/sys> ls bus/acpi/drivers
    ACPI AC Adapter Driver ACPI Embedded Controller Driver ACPI Power Resource Driver
    ACPI Battery Driver ACPI Fan Driver ACPI Processor Driver
    ACPI Button Driver ACPI PCI Interrupt Link Driver ACPI Thermal Zone Driver
    ACPI container driver ACPI PCI Root Bridge Driver hpet

    into this:

    lenb@se7525gp2:~> ls /sys/bus/acpi/drivers
    ac battery button container ec fan hpet pci_link pci_root power processor thermal

    Signed-off-by: Len Brown

    Len Brown
     
  • cosmetic only

    Make "module name" actually match the file name.
    Invoke with ';' as leaving it off confuses Lindent and gcc doesn't care.
    Fix indentation where Lindent did get confused.

    Signed-off-by: Len Brown

    Len Brown
     

03 Feb, 2007

2 commits


21 Dec, 2006

1 commit


16 Dec, 2006

1 commit


14 Oct, 2006

2 commits


10 Jul, 2006

1 commit

  • Replace acpi_in_resume with a more general hack
    to check irqs_disabled() on any kmalloc() from ACPI.
    While setting (system_state != SYSTEM_RUNNING) on resume
    seemed more general, Andrew Morton preferred this approach.

    http://bugzilla.kernel.org/show_bug.cgi?id=3469

    Make acpi_os_allocate() into an inline function to
    allow /proc/slab_allocators to work.

    Delete some memset() that could fault on allocation failure.

    Signed-off-by: Len Brown

    Len Brown
     

30 Jun, 2006

2 commits


27 Jun, 2006

4 commits


23 Jun, 2006

1 commit

  • * 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (65 commits)
    ACPI: suppress power button event on S3 resume
    ACPI: resolve merge conflict between sem2mutex and processor_perflib.c
    ACPI: use for_each_possible_cpu() instead of for_each_cpu()
    ACPI: delete newly added debugging macros in processor_perflib.c
    ACPI: UP build fix for bugzilla-5737
    Enable P-state software coordination via _PDC
    P-state software coordination for speedstep-centrino
    P-state software coordination for acpi-cpufreq
    P-state software coordination for ACPI core
    ACPI: create acpi_thermal_resume()
    ACPI: create acpi_fan_suspend()/acpi_fan_resume()
    ACPI: pass pm_message_t from acpi_device_suspend() to root_suspend()
    ACPI: create acpi_device_suspend()/acpi_device_resume()
    ACPI: replace spin_lock_irq with mutex for ec poll mode
    ACPI: Allow a WAN module enable/disable on a Thinkpad X60.
    sem2mutex: acpi, acpi_link_lock
    ACPI: delete unused acpi_bus_drivers_lock
    sem2mutex: drivers/acpi/processor_perflib.c
    ACPI add ia64 exports to build acpi_memhotplug as a module
    ACPI: asus_acpi_init(): propagate correct return value
    ...

    Manual resolve of conflicts in:

    arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
    arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
    include/acpi/processor.h

    Linus Torvalds