13 Mar, 2008

2 commits

  • Currently, if drivers/macintosh/apm_emu is a module and the config
    doesn't have CONFIG_SUSPEND we get:

    ERROR: "pmu_batteries" [drivers/macintosh/apm_emu.ko] undefined!
    ERROR: "pmu_battery_count" [drivers/macintosh/apm_emu.ko] undefined!
    ERROR: "pmu_power_flags" [drivers/macintosh/apm_emu.ko] undefined!

    on PPC32. The variables aren't wrapped in '#if defined(CONFIG_SUSPEND)'
    so we probably shouldn't wrap the exports either. This removes the
    CONFIG_SUSPEND part of the export, which fixes compilation on ppc32.

    Signed-off-by: Guido Guenther
    Signed-off-by: Paul Mackerras

    Guido Guenther
     
  • The PMU backlight code would kick in during sleep/resume even on
    machines that use a different backlight method. This breaks
    sleep on some PowerBooks.

    This fixes it by adding a flag to indicate whether the backlight
    is controlled by the PMU, and testing that before trying to use
    the PMU to turn off the backlight during sleep.

    Signed-off-by: Benjamin Herrenschmidt
    Signed-off-by: Paul Mackerras

    Benjamin Herrenschmidt
     

24 Feb, 2008

1 commit

  • During the last step of hibernation in the "platform" mode (with the
    help of ACPI) we use the suspend code, including the devices'
    ->suspend() methods, to prepare the system for entering the ACPI S4
    system sleep state.

    But at least for some devices the operations performed by the
    ->suspend() callback in that case must be different from its operations
    during regular suspend.

    For this reason, introduce the new PM event type PM_EVENT_HIBERNATE and
    pass it to the device drivers' ->suspend() methods during the last phase
    of hibernation, so that they can distinguish this case and handle it as
    appropriate. Modify the drivers that handle PM_EVENT_SUSPEND in a
    special way and need to handle PM_EVENT_HIBERNATE in the same way.

    These changes are necessary to fix a hibernation regression related
    to the i915 driver (ref. http://lkml.org/lkml/2008/2/22/488).

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Pavel Machek
    Tested-by: Jeff Chua
    Signed-off-by: Linus Torvalds

    Rafael J. Wysocki
     

15 Feb, 2008

1 commit

  • The current pmac32_defconfig fails to build with the following error:

    Building modules, stage 2.
    ERROR: "check_media_bay" [drivers/block/swim3.ko] undefined!
    WARNING: modpost: Found 23 section mismatch(es).
    To see full details build your kernel with:
    'make CONFIG_DEBUG_SECTION_MISMATCH=y'
    make[2]: *** [__modpost] Error 1

    This patch fixes that.

    Signed-off-by: Tony Breeds
    Acked-by: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Acked-by: Bartlomiej Zolnierkiewicz
    Cc: Josh Boyer
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tony Breeds
     

08 Feb, 2008

1 commit

  • It appears that with the U3 northbridge, if the processor is in NAP
    mode the whole time while waiting for an SMU command to complete,
    then the SMU will fail. It could be related to the weird backward
    mechanism the SMU uses to get to system memory via i2c to the
    northbridge that doesn't operate properly when the said bridge is
    in napping along with the CPU. That is on U3 at least, U4 doesn't
    seem to be affected.

    This didn't show before NO_HZ as the timer wakeup was enough to make
    it work it seems, but that is no longer the case.

    This fixes it by disabling NAP mode on those machines while
    an SMU command is in flight.

    Signed-off-by: Benjamin Herrenschmidt
    Signed-off-by: Paul Mackerras

    Benjamin Herrenschmidt
     

06 Feb, 2008

2 commits

  • * Replace incorrect CONFIG_BLK_DEV_IDE #ifdef in
    check_media_bay() by CONFIG_MAC_FLOPPY one.

    * Replace incorrect CONFIG_BLK_DEV_IDE #ifdef-s by
    CONFIG_BLK_DEV_IDE_PMAC ones.

    * check_media_bay() is used only by drivers/block/swim3.c
    so make this function available only if CONFIG_MAC_FLOPPY
    is defined.

    * check_media_bay_by_base() and media_bay_set_ide_infos()
    are used only by drivers/ide/ppc/pmac.c so so make these
    functions available only if CONFIG_MAC_FLOPPY is defined.

    v2:
    * Remove ifdefs from function prototypes. (Andrew Morton)

    Cc: Benjamin Herrenschmidt
    Cc: Andrew Morton
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • Corrects a mistake I made in a comment.

    Signed-off-by: Finn Thain
    Signed-off-by: Geert Uytterhoeven
    Cc: Roman Zippel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Finn Thain
     

04 Feb, 2008

2 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial: (79 commits)
    Jesper Juhl is the new trivial patches maintainer
    Documentation: mention email-clients.txt in SubmittingPatches
    fs/binfmt_elf.c: spello fix
    do_invalidatepage() comment typo fix
    Documentation/filesystems/porting fixes
    typo fixes in net/core/net_namespace.c
    typo fix in net/rfkill/rfkill.c
    typo fixes in net/sctp/sm_statefuns.c
    lib/: Spelling fixes
    kernel/: Spelling fixes
    include/scsi/: Spelling fixes
    include/linux/: Spelling fixes
    include/asm-m68knommu/: Spelling fixes
    include/asm-frv/: Spelling fixes
    fs/: Spelling fixes
    drivers/watchdog/: Spelling fixes
    drivers/video/: Spelling fixes
    drivers/ssb/: Spelling fixes
    drivers/serial/: Spelling fixes
    drivers/scsi/: Spelling fixes
    ...

    Linus Torvalds
     
  • Commit c9f6d3d5c6d4f4cd3a53549a69c92951180e2a76 ("[POWERPC] adb: Replace
    sleep notifier with platform driver suspend/resume hooks") introduced
    compile errors on m68k because is not
    explicitly included. On powerpc, it's pulled in through .

    Signed-off-by: Geert Uytterhoeven
    Signed-off-by: Linus Torvalds

    Geert Uytterhoeven
     

03 Feb, 2008

3 commits


31 Jan, 2008

1 commit


28 Jan, 2008

2 commits


27 Jan, 2008

1 commit

  • * Rename init_hwif_data() to ide_init_port_data() and export it.

    * For all users of ide_register_hw() with 'initializing' argument set
    hwif->present and hwif->hold are always zero so convert these host
    drivers to use ide_find_port()+ide_init_port_data()+ide_init_port_hw()
    instead (also no need for init_hwif_default() call since the setup
    done by it gets over-ridden by ide_init_port_hw() call).

    * Drop 'initializing' argument from ide_register_hw().

    Cc: Geert Uytterhoeven
    Cc: Roman Zippel
    Acked-by: Sergei Shtylyov
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     

25 Jan, 2008

2 commits


24 Jan, 2008

1 commit


17 Jan, 2008

3 commits

  • We don't care if the device_create_file calls fail, the driver will work
    just as well without them, so just issue a runtime warning.

    drivers/macintosh/therm_adt746x.c: In function 'thermostat_init':
    drivers/macintosh/therm_adt746x.c:615: warning: ignoring return value of 'device_create_file', declared with attribute warn_unused_result
    drivers/macintosh/therm_adt746x.c:616: warning: ignoring return value of 'device_create_file', declared with attribute warn_unused_result
    drivers/macintosh/therm_adt746x.c:617: warning: ignoring return value of 'device_create_file', declared with attribute warn_unused_result
    drivers/macintosh/therm_adt746x.c:618: warning: ignoring return value of 'device_create_file', declared with attribute warn_unused_result
    drivers/macintosh/therm_adt746x.c:619: warning: ignoring return value of 'device_create_file', declared with attribute warn_unused_result
    drivers/macintosh/therm_adt746x.c:620: warning: ignoring return value of 'device_create_file', declared with attribute warn_unused_result
    drivers/macintosh/therm_adt746x.c:621: warning: ignoring return value of 'device_create_file', declared with attribute warn_unused_result
    drivers/macintosh/therm_adt746x.c:622: warning: ignoring return value of 'device_create_file', declared with attribute warn_unused_result
    drivers/macintosh/therm_adt746x.c:623: warning: ignoring return value of 'device_create_file', declared with attribute warn_unused_result
    drivers/macintosh/therm_adt746x.c:625: warning: ignoring return value of 'device_create_file', declared with attribute warn_unused_result

    Signed-off-by: Stephen Rothwell
    Signed-off-by: Paul Mackerras

    Stephen Rothwell
     
  • We don't care if the device_create_file calls fail, the driver will work
    just as well without them, so just issue a runtime warning.

    drivers/macintosh/therm_windtunnel.c: In function 'setup_hardware':
    drivers/macintosh/therm_windtunnel.c:268: warning: ignoring return value of 'device_create_file', declared with attribute warn_unused_result
    drivers/macintosh/therm_windtunnel.c:269: warning: ignoring return value of 'device_create_file', declared with attribute warn_unused_result

    Signed-off-by: Stephen Rothwell
    Signed-off-by: Paul Mackerras

    Stephen Rothwell
     
  • We don't really care if any of these calls to device_create_file fails,
    so just issue warnings in that case.

    drivers/macintosh/therm_pm72.c: In function 'init_cpu_state':
    drivers/macintosh/therm_pm72.c:1185: warning: ignoring return value of 'device_create_file', declared with attribute warn_unused_result
    drivers/macintosh/therm_pm72.c:1186: warning: ignoring return value of 'device_create_file', declared with attribute warn_unused_result
    drivers/macintosh/therm_pm72.c:1187: warning: ignoring return value of 'device_create_file', declared with attribute warn_unused_result
    drivers/macintosh/therm_pm72.c:1188: warning: ignoring return value of 'device_create_file', declared with attribute warn_unused_result
    drivers/macintosh/therm_pm72.c:1189: warning: ignoring return value of 'device_create_file', declared with attribute warn_unused_result
    drivers/macintosh/therm_pm72.c:1191: warning: ignoring return value of 'device_create_file', declared with attribute warn_unused_result
    drivers/macintosh/therm_pm72.c:1192: warning: ignoring return value of 'device_create_file', declared with attribute warn_unused_result
    drivers/macintosh/therm_pm72.c:1193: warning: ignoring return value of 'device_create_file', declared with attribute warn_unused_result
    drivers/macintosh/therm_pm72.c:1194: warning: ignoring return value of 'device_create_file', declared with attribute warn_unused_result
    drivers/macintosh/therm_pm72.c:1195: warning: ignoring return value of 'device_create_file', declared with attribute warn_unused_result
    drivers/macintosh/therm_pm72.c: In function 'init_backside_state':
    drivers/macintosh/therm_pm72.c:1383: warning: ignoring return value of 'device_create_file', declared with attribute warn_unused_result
    drivers/macintosh/therm_pm72.c:1384: warning: ignoring return value of 'device_create_file', declared with attribute warn_unused_result
    drivers/macintosh/therm_pm72.c: In function 'init_drives_state':
    drivers/macintosh/therm_pm72.c:1503: warning: ignoring return value of 'device_create_file', declared with attribute warn_unused_result
    drivers/macintosh/therm_pm72.c:1504: warning: ignoring return value of 'device_create_file', declared with attribute warn_unused_result
    drivers/macintosh/therm_pm72.c: In function 'init_dimms_state':
    drivers/macintosh/therm_pm72.c:1625: warning: ignoring return value of 'device_create_file', declared with attribute warn_unused_result
    drivers/macintosh/therm_pm72.c: In function 'init_slots_state':
    drivers/macintosh/therm_pm72.c:1743: warning: ignoring return value of 'device_create_file', declared with attribute warn_unused_result
    drivers/macintosh/therm_pm72.c:1744: warning: ignoring return value of 'device_create_file', declared with attribute warn_unused_result

    Signed-off-by: Stephen Rothwell
    Signed-off-by: Paul Mackerras

    Stephen Rothwell
     

15 Jan, 2008

1 commit

  • If the user has turned on the "restore_caplock_events" parameter, the
    code mangles the capslock events correctly, then erroneously ignores
    those events. Fix logic to allow correct fallthrough.

    Signed-off-by: Andy Wingo
    Acked-by: Andrew McNabb
    Cc: Dmitry Torokhov
    Cc: Benjamin Herrenschmidt
    cc: Paul Mackerras
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Wingo
     

21 Dec, 2007

2 commits

  • This fixes a few issues with via-pmu based backlight control.

    First, it fixes a sign problem with the setup of the backlight
    curve since the `range' value there -can- (and will) go negative.

    Then, it reworks the interaction between this and the via-pmu sleep
    code to properly restore backlight on wakeup from sleep.

    Signed-off-by: Benjamin Herrenschmidt
    Signed-off-by: Paul Mackerras

    Benjamin Herrenschmidt
     
  • These hooks ensure that a decrementer interrupt is not pending when
    suspending; otherwise, problems may occur on 6xx/7xx/7xxx-based
    systems (except for powermacs, which use a separate suspend path).
    For example, with deep sleep on the 831x, a pending decrementer will
    cause a system freeze because the SoC thinks the decrementer interrupt
    would have woken the system, but the core must have interrupts
    disabled due to the setup required for deep sleep.

    Changed via-pmu.c to use the new ppc_md hooks, and made the arch_*
    functions call the generic_* functions unconditionally. -- paulus

    Signed-off-by: Scott Wood
    Signed-off-by: Paul Mackerras

    Scott Wood
     

19 Dec, 2007

8 commits

  • This adds platform_suspend_ops for PMU based machines, directly in
    the PMU driver. This allows suspending via /sys/power/state
    on powerbooks.

    The patch also replaces the PMU ioctl with a simple call to
    pm_suspend(PM_SUSPEND_MEM).

    Additionally, it cleans up some debug code.

    Signed-off-by: Johannes Berg
    Cc: Benjamin Herrenschmidt
    Signed-off-by: Paul Mackerras

    Johannes Berg
     
  • Sleep on the powerbook 3400 has been broken since the change that made
    powerbook_sleep_3400 call pmac_suspend_devices(), which disables
    interrupts. There are a couple of loops in powerbook_sleep_3400 that
    depend on interrupts being enabled, and in fact it has to have
    interrupts enabled at the point of going to sleep since it is an
    interrupt from the PMU that wakes it up.

    This fixes it by using pmu_wait_complete() instead of a spinloop, and
    by explicitly enabling interrupts before putting the CPU into sleep
    mode (which is OK since all interrupts except the PMU interrupt have
    been disabled at the interrupt controller by this stage).

    This changes the logic so that it keeps putting the CPU into sleep mode
    until the completion of the interrupt transaction from the PMU that
    signals the end of sleep. Also, we now call pmu_unlock() before sleep
    so that the via_pmu_interrupt() code can process the interrupt event
    from the PMU properly.

    Now that generic code saves and restores PCI state, it is no longer
    necessary to do that here. Thus pbook_pci_save/restore and related
    functions are no longer necessary, so this removes them.

    Lastly, this moves the ioremap of the memory controller to init code
    rather than doing it on every sleep/wakeup cycle.

    Signed-off-by: Paul Mackerras

    Paul Mackerras
     
  • This is fairly straightforward, and lets us get rid of x.completion
    as well.

    Signed-off-by: Paul Mackerras

    Paul Mackerras
     
  • This converts the therm_pm72.c driver to use the kthread API. I
    thought about making it use kthread_stop() instead of the `state'
    variable and the `ctrl_complete' completion, but that isn't simple and
    will require changing the way that `state' is used.

    Signed-off-by: Paul Mackerras

    Paul Mackerras
     
  • This converts adb.c to use the kthread API.

    It also changes adb_request so that if the ADBREQ_SYNC flag is
    specified, we now sleep waiting for the request to finish using an
    on-stack completion rather than spinning. To implement this, we now
    require that if the ADBREQ_SYNC flag is set, the `done' parameter must
    be NULL. All of the existing callers of adb_request that pass
    ADBREQ_SYNC appear to be in process context and have done == NULL.
    Doing this allows us to get rid of an awful hack in adb_request()
    where we used to test whether the request was coming from the adb
    probe task and use a completion if it was, and otherwise spin.

    This also gets rid of a static request block that was used if the req
    parameter to adb_request was NULL. None of the callers do that any
    more, so the static request block is no longer necessary.

    Signed-off-by: Paul Mackerras

    Paul Mackerras
     
  • We aren't supposed to use kernel_thread directly in drivers any more,
    and in fact using kthread_run is a bit simpler.

    Signed-off-by: Paul Mackerras

    Paul Mackerras
     
  • This kills off the remnants of the old sleep notifiers now that they
    are no longer used.

    Signed-off-by: Johannes Berg
    Cc: Benjamin Herrenschmidt
    Signed-off-by: Paul Mackerras

    Johannes Berg
     
  • This replaces the pmu sleep notifier that adb had with suspend/resume
    hooks in a new platform driver/device.

    Signed-off-by: Johannes Berg
    Cc: Benjamin Herrenschmidt
    Signed-off-by: Paul Mackerras

    Johannes Berg
     

18 Dec, 2007

1 commit

  • The error handling code should undo the ioremap as well.

    The problem was detected using the following semantic match
    (http://www.emn.fr/x-info/coccinelle/)

    //
    @@
    type T,T1,T2;
    identifier E;
    statement S;
    expression x1,x2;
    constant C;
    int ret;
    @@

    T E;
    ...
    * E = ioremap(...);
    if (E == NULL) S
    ... when != iounmap(E)
    when != if (E != NULL) { ... iounmap(E); ...}
    when != x1 = (T1)E
    if (...) {
    ... when != iounmap(E)
    when != if (E != NULL) { ... iounmap(E); ...}
    when != x2 = (T2)E
    (
    * return;
    |
    * return C;
    |
    * return ret;
    )
    }
    //

    Signed-off-by: Julia Lawall
    Cc: Johannes Berg
    Cc: Olaf Hering
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Julia Lawall
     

03 Dec, 2007

2 commits


08 Nov, 2007

1 commit

  • When I fixed the windfarm freezer interaction first in commit
    1ed2ddf380e19dafeec2150ca709ef7f4a67cd21, an earlier patch than the one
    I came up with after comments was committed. This has come back to haunt
    us now because commit d5d8c5976d6adeddb8208c240460411e2198b393 changed
    the freezer to no long send signals. Fix it by removing the windfarm
    thread's signal logic and restoring the original try_to_freeze().

    We could simply revert 1ed2ddf380e19dafeec2150ca709ef7f4a67cd21 now
    but I feel that the assertion that no signal is delivered to the
    windfarm thread needs not be there.

    Signed-off-by: Johannes Berg
    Acked-by: Rafael J. Wysocki
    Signed-off-by: Paul Mackerras

    Johannes Berg
     

20 Oct, 2007

3 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial: (74 commits)
    fix do_sys_open() prototype
    sysfs: trivial: fix sysfs_create_file kerneldoc spelling mistake
    Documentation: Fix typo in SubmitChecklist.
    Typo: depricated -> deprecated
    Add missing profile=kvm option to Documentation/kernel-parameters.txt
    fix typo about TBI in e1000 comment
    proc.txt: Add /proc/stat field
    small documentation fixes
    Fix compiler warning in smount example program from sharedsubtree.txt
    docs/sysfs: add missing word to sysfs attribute explanation
    documentation/ext3: grammar fixes
    Documentation/java.txt: typo and grammar fixes
    Documentation/filesystems/vfs.txt: typo fix
    include/asm-*/system.h: remove unused set_rmb(), set_wmb() macros
    trivial copy_data_pages() tidy up
    Fix typo in arch/x86/kernel/tsc_32.c
    file link fix for Pegasus USB net driver help
    remove unused return within void return function
    Typo fixes retrun -> return
    x86 hpet.h: remove broken links
    ...

    Linus Torvalds
     
  • * Add ->fixup method to ide_hwif_t.

    * Set hwif->fixup in ide_pci_setup_ports() to d->fixup.

    * Use hwif->fixup in probe_hwif().

    * Use probe_hwif_init() instead of probe_hwif_init_with_fixup() in
    ide_setup_pci_device().

    * Add 'fixup' argument to ide_register_hw() and use it to set hwif->fixup,
    update all ide_register_hw() users accordingly.

    * Convert ide-cs/delkin_cb host drivers to use ide_register_hw().

    * Restore hwif->fixup in ide_hwif_restore().

    * Remove ide_register_hw_with_fixup(), probe_hwif_init_with_fixup()
    and 'fixup' argument from probe_hwif().

    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • From: Jean Delvare

    Signed-off-by: Jean Delvare
    Signed-off-by: Adrian Bunk

    Jean Delvare