1. 22 7月, 2007 2 次提交
    • D
      x86_64: fake pxm-to-node mapping for fake numa · 3484d798
      David Rientjes 提交于
      For NUMA emulation, our SLIT should represent the true NUMA topology of the
      system but our proximity domain to node ID mapping needs to reflect the
      emulated state.
      
      When NUMA emulation has successfully setup fake nodes on the system, a new
      function, acpi_fake_nodes() is called.  This function determines the proximity
      domain (_PXM) for each true node found on the system.  It then finds which
      emulated nodes have been allocated on this true node as determined by its
      starting address.  The node ID to PXM mapping is changed so that each fake
      node ID points to the PXM of the true node that it is located on.
      
      If the machine failed to register a SLIT, then we assume there is no special
      requirement for emulated node affinity so we use the default LOCAL_DISTANCE,
      which is newly exported to this code, as our measurement if the emulated nodes
      appear in the same PXM.  Otherwise, we use REMOTE_DISTANCE.
      
      PXM_INVAL and NID_INVAL are also exported to the ACPI header file so that we
      can compare node_to_pxm() results in generic code (in this case, the SRAT
      code).
      
      Cc: Len Brown <lenb@kernel.org>
      Signed-off-by: NDavid Rientjes <rientjes@google.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NAndi Kleen <ak@suse.de>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      3484d798
    • D
      x86_64: various cleanups in NUMA scan node · ae2c6dcf
      David Rientjes 提交于
      In acpi_scan_nodes(), we immediately return -1 if acpi_numa <= 0, meaning
      we haven't detected any underlying ACPI topology or we have explicitly
      disabled its use from the command-line with numa=noacpi.
      
      acpi_table_print_srat_entry() and acpi_table_parse_srat() are only
      referenced within drivers/acpi/numa.c, so we can mark them as static and
      remove their prototypes from the header file.
      
      Likewise, pxm_to_node_map[] and node_to_pxm_map[] are only used within
      drivers/acpi/numa.c, so we mark them as static and remove their externs
      from the header file.
      
      The automatic 'result' variable is unused in acpi_numa_init(), so it's
      removed.
      Signed-off-by: NDavid Rientjes <rientjes@google.com>
      Signed-off-by: NAndi Kleen <ak@suse.de>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      ae2c6dcf
  2. 21 7月, 2007 1 次提交
  3. 20 7月, 2007 4 次提交
    • P
      mm: Remove slab destructors from kmem_cache_create(). · 20c2df83
      Paul Mundt 提交于
      Slab destructors were no longer supported after Christoph's
      c59def9f change. They've been
      BUGs for both slab and slub, and slob never supported them
      either.
      
      This rips out support for the dtor pointer from kmem_cache_create()
      completely and fixes up every single callsite in the kernel (there were
      about 224, not including the slab allocator definitions themselves,
      or the documentation references).
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      20c2df83
    • R
      PM: Introduce pm_power_off_prepare · bd804eba
      Rafael J. Wysocki 提交于
      Introduce the pm_power_off_prepare() callback that can be registered by the
      interested platforms in analogy with pm_idle() and pm_power_off(), used for
      preparing the system to power off (needed by ACPI).
      
      This allows us to drop acpi_sysclass and device_acpi that are only defined in
      order to register the ACPI power off preparation callback, which is needed by
      pm_power_off() registered in a much different way.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: NPavel Machek <pavel@ucw.cz>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      bd804eba
    • R
      ACPI: Do not prepare for hibernation in acpi_shutdown · d7372cdf
      Rafael J. Wysocki 提交于
      Since we are now explicitly calling hibernation_ops->prepare() before
      hibernation_ops->enter() in hibernation_platform_enter() (defined in
      kernel/power/disk.c), ACPI should not call acpi_sleep_prepare(ACPI_STATE_S4)
      from acpi_shutdown().
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: NPavel Machek <pavel@ucw.cz>
      Cc: Len Brown <lenb@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d7372cdf
    • R
      swsusp: introduce restore platform operations · a634cc10
      Rafael J. Wysocki 提交于
      At least on some machines it is necessary to prepare the ACPI firmware for the
      restoration of the system memory state from the hibernation image if the
      "platform" mode of hibernation has been used.  Namely, in that cases we need
      to disable the GPEs before replacing the "boot" kernel with the "frozen"
      kernel (cf.  http://bugzilla.kernel.org/show_bug.cgi?id=7887).  After the
      restore they will be re-enabled by hibernation_ops->finish(), but if the
      restore fails, they have to be re-enabled by the restore code explicitly.
      
      For this purpose we can introduce two additional hibernation operations,
      called pre_restore() and restore_cleanup() and call them from the restore code
      path.  Still, they should be called if the "platform" mode of hibernation has
      been used, so we need to pass the information about the hibernation mode from
      the "frozen" kernel to the "boot" kernel in the image header.
      
      Apparently, we can't drop the disabling of GPEs before the restore because of
      Bug #7887 .   We also can't do it unconditionally, because the GPEs wouldn't
      have been enabled after a successful restore if the suspend had been done in
      the 'shutdown' or 'reboot' mode.
      
      In principle we could (and probably should) unconditionally disable the GPEs
      before each snapshot creation *and* before the restore, but then we'd have to
      unconditionally enable them after the snapshot creation as well as after the
      restore (or restore failure)   Still, for this purpose we'd need to modify
      acpi_enter_sleep_state_prep() and acpi_leave_sleep_state() and we'd have to
      introduce some mechanism synchronizing the disablind/enabling of the GPEs with
      the device drivers' .suspend()/.resume() routines and with
      disable_/enable_nonboot_cpus().   However, this would have affected the
      suspend (ie.  s2ram) code as well as the hibernation, which I'd like to avoid
      in this patch series.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Cc: Nigel Cunningham <nigel@nigel.suspend2.net>
      Cc: Pavel Machek <pavel@ucw.cz>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a634cc10
  4. 18 7月, 2007 1 次提交
    • J
      Add common orderly_poweroff() · 10a0a8d4
      Jeremy Fitzhardinge 提交于
      Various pieces of code around the kernel want to be able to trigger an
      orderly poweroff.  This pulls them together into a single
      implementation.
      
      By default the poweroff command is /sbin/poweroff, but it can be set
      via sysctl: kernel/poweroff_cmd.  This is split at whitespace, so it
      can include command-line arguments.
      
      This patch replaces four other instances of invoking either "poweroff"
      or "shutdown -h now": two sbus drivers, and acpi thermal
      management.
      
      sparc64 has its own "powerd"; still need to determine whether it should
      be replaced by orderly_poweroff().
      Signed-off-by: NJeremy Fitzhardinge <jeremy@xensource.com>
      Acked-by: NLen Brown <lenb@kernel.org>
      Signed-off-by: NChris Wright <chrisw@sous-sol.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Randy Dunlap <randy.dunlap@oracle.com>
      Cc: Andi Kleen <ak@suse.de>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: David S. Miller <davem@davemloft.net>
      10a0a8d4
  5. 12 7月, 2007 1 次提交
    • A
      PCI: Change all drivers to use pci_device->revision · 44c10138
      Auke Kok 提交于
      Instead of all drivers reading pci config space to get the revision
      ID, they can now use the pci_device->revision member.
      
      This exposes some issues where drivers where reading a word or a dword
      for the revision number, and adding useless error-handling around the
      read. Some drivers even just read it for no purpose of all.
      
      In devices where the revision ID is being copied over and used in what
      appears to be the equivalent of hotpath, I have left the copy code
      and the cached copy as not to influence the driver's performance.
      
      Compile tested with make all{yes,mod}config on x86_64 and i386.
      Signed-off-by: NAuke Kok <auke-jan.h.kok@intel.com>
      Acked-by: NDave Jones <davej@redhat.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      44c10138
  6. 03 7月, 2007 1 次提交
  7. 02 7月, 2007 1 次提交
    • M
      asus_acpi: fix oops on non-asus machines · 5ebffd7c
      Maxime Austruy 提交于
      If asus_acpi_init doesn't find any device it knows about, it mistakenly
      returns a "success" error code even though it cleans up after itself.  Later
      when trying to rmmod asus_acpi, the module_exit routine would try to clean up
      one more time and we would end up calling
      acpi_bus_unregister_driver(&asus_hotk_driver) twice.  This patch addresses
      this first problem by returning -ENODEV when no appropriate device is found.
      
      Then there was also another bug with the code handling the return value of
      backlight_device_register.  If this function ever failed, the driver would
      cleanup by calling the module_exit routine from module_init, but it would
      still return "success".  So any attempt to rmmod this module would result in
      asus_acpi_exit being called twice but it's not ready to handle it (I haven't
      hit this bug, just found it by code inspection).  This patch fixes that by
      inserting a return -ENODEV; at the end of this error handling path.
      Signed-off-by: NMaxime Austruy <maxime@tralhalla.org>
      Cc: Len Brown <lenb@kernel.org>
      Cc: Richard Purdie <rpurdie@rpsys.net>
      Cc: Jan Engelhardt <jengelh@computergmbh.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      5ebffd7c
  8. 23 6月, 2007 1 次提交
    • V
      ACPI: fix 2.6.20 SMP boot regression · d5a3d32a
      Venkatesh Pallipadi 提交于
      Always disable/enable interrupts in the acpi idle routine,
      even in the error path.
      
      This is required as the 2.6.20 change in git commit d331e739...
      "Fix interrupt race in idle callback" expects the idle handler
      to enable interrupt before returning.
      
      There was a case in acpi idle routine, in which interrupt was not being
      enabled before return, which caused the system to hang at bootup, while
      enabling C-states on an SMP system.
      
      The signature of the hang was that "processor.nocst"
      was required to enable boot.
      Signed-off-by: NVenkatesh Pallipadi <venkatesh.pallipadi@intel.com>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      d5a3d32a
  9. 18 6月, 2007 2 次提交
  10. 17 6月, 2007 1 次提交
  11. 02 6月, 2007 2 次提交
  12. 01 6月, 2007 1 次提交
    • S
      acpi: fix section mismatch warning in asus + toshiba · b2b77b23
      Sam Ravnborg 提交于
      Fix following section mismatch warnings in acpi
      
      WARNING: drivers/acpi/asus_acpi.o(.init.text+0xb7): Section mismatch: reference to .exit.text: (after 'init_module')
      WARNING: o-i386/drivers/acpi/toshiba_acpi.o(.init.text+0x13a): Section mismatch: reference to .exit.text: (after 'init_module')
      
      The exit function is used in the init function during an error codition.
      As __exit may be discarded during link-time / run-time this is no good.
      Do not mark the exit function __exit.
      
      Note: This warning is only seen by my local copy of modpost
            but the change will soon hit upstream.
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      Cc: Len Brown <lenb@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b2b77b23
  13. 30 5月, 2007 5 次提交
    • L
      ACPI: add __init to acpi_initialize_subsystem() · dd272b57
      Len Brown 提交于
      Add __init to:
      acpi_initialize_subsystem() (and un-export it)
      acpi_os_initialize()
      
      Add __initdata to:
      acpi_osl_dmi_table[]
      Signed-off-by: NLen Brown <len.brown@intel.com>
      dd272b57
    • L
      ACPI: Make _OSI(Linux) a special case · f507654d
      Len Brown 提交于
      _OSI("Linux") is like _OS("Linux"), it is ill-defined and
      virtually no BIOS vendors test interaction with it.
      As a result, it can do more damage than good because
      it causes the BIOS to follow un-tested paths.
      
      Recently, several machines have turned up that erroneously
      test this string in a way which causes them to _not_ test other
      compatibility strings, including the ZI9 and Toshiba.
      So it appears that this bad code has made it into
      a BIOS vendor's reference BIOS.
      
      Linux has no choice but to stop advertising compatibility
      with _OSI string "Linux" - as there are an unbounded
      number of possible incompatibilities going forward.
      
      But some BIOSes have already shipped which do use it
      for things like conditionally re-enabling video on resume
      from S3.  (Too bad they didn't do that unconditionally)
      
      Add special case code for _OSI(Linux)
      Squawk to dmesg if _OSI(Linux) is requested
      Add DMI list both to enable and disable _OSI(Linux)
      But for now, keep the default enabled via
      #define OSI_LINUX_ENABLED.
      
      http://bugzilla.kernel.org/show_bug.cgi?id=7787Signed-off-by: NLen Brown <len.brown@intel.com>
      f507654d
    • L
      ACPI: extend "acpi_osi=" boot option · ae00d812
      Len Brown 提交于
      The boot option "acpi_osi=" has always disabled Linux _OSI support,
      thus disabling all OS Interface strings which are advertised
      by Linux to the BIOS.
      
      Now...
      acpi_osi="string" adds the interface string, and
      acpi_osi="!string" invalidates the pre-defined interface string
      
      eg. acpi_osi="!Windows 2006"
      would disable Linux's claim of Vista compatibility.
      Signed-off-by: NLen Brown <len.brown@intel.com>
      ae00d812
    • T
      ACPI: thermal: Replace pointer with name in trip_points · 68ccfaa8
      Thomas Renninger 提交于
      For users with active thermal trip points, they need
      the fan's name, rather than its address, to understand
      where to look to observe and control fan state.
      Signed-off-by: NThomas Renninger <trenn@suse.de>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      68ccfaa8
    • L
      ACPICA: allow Load(OEMx) tables · 0efabac9
      Len Brown 提交于
      HP and Hitachi machines have been implemented with SSDT's
      that use the "OEMx" signatures.  But upon Load, ACPICA is rejecting
      these tables because they are not using the "SSDT" signature.
      
      ACPI Error (tbinstal-0134): Table has invalid signature [OEMx], must be SSDT...
      Signed-off-by: NLen Brown <len.brown@intel.com>
      0efabac9
  14. 17 5月, 2007 1 次提交
  15. 10 5月, 2007 7 次提交
    • L
      acpi,msi-laptop: Fall back to EC polling mode for MSI laptop specific EC commands · 00eb43a1
      Lennart Poettering 提交于
      The ACPI EC that is used in MSI laptops knows some non-standard
      commands for changing the screen brighntess and a few other things,
      which are used by the msi-laptop.c driver. Unfortunately for these
      commands no GPE events for IBF and OBF are triggered. Since nowadays
      the EC code uses the ec_intr=1 mode by default, this causes these
      operations to timeout, although they don't fail. In result, all
      operations that you can do with the msi-laptop.c driver take more or
      less 1s to complete, which is awfully slow.
      
      In one of the more recent kernels (2.6.20?) the EC subsystem has been
      revamped. With that change the EC timeout has been increased. before
      that increase the MSI EC accesses were slow -- but not *that* slow,
      hence I took notice of this limitation of the MSI EC hardware only very
      recently.
      
      The standard EC operations on the MSI EC as defined in the ACPI spec
      support GPE events properly.
      
      The following patch adds a new argument "force_poll" to the
      ec_transaction() function (and friends). If set to 1, the function
      will poll for IBF/OBF even if ec_intr=1 is enabled. If set to 0 the
      current behaviour is used. The msi-laptop driver is modified to make
      use of this new flag, so that OBF/IBF is polled for the special MSI EC
      transactions -- but only for them.
      Signed-off-by: NLennart Poettering <mzxreary@0pointer.de>
      Acked-by: NAlexey Starikovskiy <aystarik@gmail.com>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      00eb43a1
    • L
      ACPICA: Lindent · fd350943
      Len Brown 提交于
      Signed-off-by: NLen Brown <len.brown@intel.com>
      fd350943
    • A
      ACPI: created a dedicated workqueue for notify() execution · 88db5e14
      Alexey Starikovskiy 提交于
      HP nx6125/nx6325/... machines have a _GPE handler with an infinite
      loop sending Notify() events to different ACPI subsystems.
      
      Notify handler in ACPI driver is a C-routine, which may call ACPI
      interpreter again to get access to some ACPI variables
      (acpi_evaluate_xxx).
      On these HP machines such an evaluation changes state of some variable
      and lets the loop above break.
      
      In the current ACPI implementation Notify requests are being deferred
      to the same kacpid workqueue on which the above GPE handler with
      infinite loop is executing. Thus we have a deadlock -- loop will
      continue to spin, sending notify events, and at the same time
      preventing these notify events from being run on a workqueue. All
      notify events are deferred, thus we see increase in memory consumption
      noticed by author of the thread. Also as GPE handling is bloked,
      machines overheat. Eventually by external poll of the same
      acpi_evaluate, kacpid is released and all the queued notify events are
      free to run, thus 100% cpu utilization by kacpid for several seconds
      or more.
      
      To prevent all these horrors it's needed to not put notify events to
      kacpid workqueue by either executing them immediately or putting them
      on some other thread. It's dangerous to execute notify events in
      place, as it will put several ACPI interpreter stacks on top of each
      other (at least 4 in case of nx6125), thus causing kernel  stack
      overflow.
      
      First attempt to create a new thread was done by Peter Wainwright
      He created a bunch of threads, which were stealing work from a kacpid
      workqueue.
      This patch appeared in 2.6.15 kernel shipped with Ubuntu 6.06 LTS.
      
      Second attempt was done by me, I created a new thread for each Notify
      event. This worked OK on HP nx machines, but broke Linus' Compaq
      n620c, by producing threads with a speed what they stopped the machine
      completely. Thus this patch was reverted from 18-rc2 as I remember.
      I re-made the patch to create second workqueue just for notify events,
      thus hopping it will not break Linus' machine. Patch was tested on the
      same HP nx machines in #5534 and #7122, but I did not received reply
      from Linus on a test patch sent to him.
      Patch went to 19-rc and was rejected with much fanfare again.
      There was 4th patch, which inserted schedule_timeout(1) into deferred
      execution of kacpid, if we had any notify requests pending, but Linus
      decided that it was too complex (involved either changes to workqueue
      to see if it's empty or atomic inc/dec).
      Now you see last variant which adds yield() to every GPE execution.
      
      http://bugzilla.kernel.org/show_bug.cgi?id=5534
      http://bugzilla.kernel.org/show_bug.cgi?id=8385Signed-off-by: NAlexey Starikovskiy <alexey.y.starikovskiy@intel.com>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      88db5e14
    • L
      Revert "ACPICA: fix AML mutex re-entrancy" · 262a7a28
      Len Brown 提交于
      This reverts commit c0d127b5.
      
      These changes to AML locking were made to allow
      Notify handlers to be called on the stack
      and not deadlock.  However, that scheme turns
      out to be flawed and was reverted by the previous commit,
      so this commit restores the locking to it previous design.
      Signed-off-by: NLen Brown <len.brown@intel.com>
      262a7a28
    • L
      Revert "Execute AML Notify() requests on stack." · 40d07080
      Len Brown 提交于
      This reverts commit 5f7748cf.
      
      While that change fixed the HP
      http://bugzilla.kernel.org/show_bug.cgi?id=5534
      
      it broke the ACER:
      http://bugzilla.kernel.org/show_bug.cgi?id=8385
      which as AML that caused Linux go recursive
      and stack fault.
      
      So this commit by itself will restore the ACER
      and again break the HP, which we'll fix another way.
      Signed-off-by: NLen Brown <len.brown@intel.com>
      40d07080
    • L
      Revert "ACPICA: revert "acpi_serialize" changes" · 4d2acd9e
      Len Brown 提交于
      This reverts commit a8f4af6d.
      Thus restoring ACPICA's new acpi_serialize code.
      
      This commit by itself may cause a regression, but
      it is reverted in this order so that subsequent
      reverts reverts under this one can be made
      without conflict.
      Signed-off-by: NLen Brown <len.brown@intel.com>
      4d2acd9e
    • R
      PM: Separate hibernation code from suspend code · a3d25c27
      Rafael J. Wysocki 提交于
      [ With Johannes Berg <johannes@sipsolutions.net> ]
      
      Separate the hibernation (aka suspend to disk code) from the other suspend
      code.  In particular:
      
       * Remove the definitions related to hibernation from include/linux/pm.h
       * Introduce struct hibernation_ops and a new hibernate() function to hibernate
         the system, defined in include/linux/suspend.h
       * Separate suspend code in kernel/power/main.c from hibernation-related code
         in kernel/power/disk.c and kernel/power/user.c (with the help of
         hibernation_ops)
       * Switch ACPI (the only user of pm_ops.pm_disk_mode) to hibernation_ops
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Cc: Greg KH <greg@kroah.com>
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: Nigel Cunningham <nigel@nigel.suspend2.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a3d25c27
  16. 09 5月, 2007 6 次提交
  17. 08 5月, 2007 1 次提交
  18. 03 5月, 2007 1 次提交
    • J
      [PATCH] x86: Log reason why TSC was marked unstable · 5a90cf20
      john stultz 提交于
      Change mark_tsc_unstable() so it takes a string argument, which holds the
      reason the TSC was marked unstable.
      
      This is then displayed the first time mark_tsc_unstable is called.
      
      This should help us better debug why the TSC was marked unstable on certain
      systems and allow us to make sure we're not being overly paranoid when
      throwing out this troublesome clocksource.
      
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Andi Kleen <ak@suse.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NAndi Kleen <ak@suse.de>
      5a90cf20
  19. 01 5月, 2007 1 次提交
    • L
      ACPI: delete un-reliable concept of cooling mode · eaca2d3f
      Len Brown 提交于
      The scheme where the thermal driver displayed the
      cooling mode /proc/acpi/thermal_zone/*/cooling_mode
      was flawed in two ways.
      
      First, the success of _SCP doesn't actually mean
      that the BIOS moved any trip points.
      On many BIOS, _SCP is present, but does nothing.
      So displaying what _SCP executed actually
      was wrong more times than it was right.
      
      Second, examining the relative position of the
      trip points when the thermal_zone is added
      is insufficient -- as the BIOS reserves the right
      to change the trip points at run-time.
      
      The only reliable way for the user to determine if
      the thermal zone is in active, passive, or critical
      mode is to examine the relative position of the trip points.
      The user can do this without the kernel doing it
      for them by looking in /proc/acpi/thermal_zone/*/trip_points
      
      New contents for /proc/acpi/thermal_zone/*/cooling_mode:
      
      If _SCP available:
      "0 - Active; 1 - Passive\n"
      
      If _SCP unavailable:
      "<setting not supported>\n"
      Signed-off-by: NLen Brown <len.brown@intel.com>
      eaca2d3f