Skip to content
Snippets Groups Projects
  1. Jan 07, 2011
    • Rafael J. Wysocki's avatar
      ACPI / PM: Use device wakeup flags for handling ACPI wakeup devices · f2b56bc8
      Rafael J. Wysocki authored
      
      There are ACPI devices (buttons and the laptop lid) that can wake up
      the system from sleep states and have no "physical" companion
      devices.  The ACPI subsystem uses two flags, wakeup.state.enabled and
      wakeup.flags.always_enabled, for handling those devices, but they
      are not accessible through the standard device wakeup infrastructure.
      User space can only control them via the /proc/acpi/wakeup interface
      that is not really convenient (e.g. the way in which devices are
      enabled to wake up the system is not portable between different
      systems, because it requires one to know the devices' "names" used in
      the system's ACPI tables).
      
      To address this problem, use standard device wakeup flags instead of
      the special ACPI flags for handling those devices.  In particular,
      use device_set_wakeup_capable() to mark the ACPI wakeup devices
      during initialization and use device_set_wakeup_enable() to allow
      or disallow them to wake up the system from sleep states.  Rework
      the /proc/acpi/wakeup interface to take these changes into account.
      
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: default avatarLen Brown <len.brown@intel.com>
      f2b56bc8
    • Rafael J. Wysocki's avatar
      ACPI / PM: Do not enable multiple devices to wake up simultaneously · b014f4f1
      Rafael J. Wysocki authored
      
      If a device is enabled to wake up the system from sleep states via
      /proc/acpi/wakeup and there are other devices associated with the
      same wakeup GPE, all of these devices are automatically enabled to
      wake up the system.  This isn't correct, because the fact the GPE is
      shared need not imply that wakeup power has to be enabled for all the
      devices at the same time (i.e. it is possible that one device will
      have its wakeup power enabled and it will wake up the system from a
      sleep state if the shared wakeup GPE is enabled, while another device
      having its wakeup power disabled will not wake up the system even
      though the GPE is enabled).  Rework acpi_system_write_wakeup_device()
      so that it only enables wakeup for one device at a time.
      
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: default avatarLen Brown <len.brown@intel.com>
      b014f4f1
  2. Aug 15, 2010
  3. Feb 04, 2010
  4. Oct 28, 2009
    • Arjan van de Ven's avatar
      ACPI: clean up video.c boundary checks and types · 52a2b11c
      Arjan van de Ven authored
      
      proc.c and video.c are a bit sloppy around types and style,
      confusing gcc for a new feature that'll be in 2.6.33 and will
      cause a warning on the current code.
      
      This patch changes
      
      if  (foo + 1 > sizeof bar)
      
      into
      
      if (foo >= sizeof(bar))
      
      which is more kernel-style.
      
      it also changes a variable in proc.c to unsigned; it gets assigned
      a value from an unsigned type, and is then only compared for > not
      for negative, so using unsigned is just outright the right type
      
      Signed-off-by: default avatarArjan van de Ven <arjan@linux.intel.com>
      Signed-off-by: default avatarLen Brown <len.brown@intel.com>
      52a2b11c
  5. Oct 03, 2009
  6. Apr 07, 2009
  7. Mar 27, 2009
    • Bjorn Helgaas's avatar
      ACPI: call acpi_sleep_proc_init() explicitly rather than as initcall · 9cee43e0
      Bjorn Helgaas authored
      
      This patch makes acpi_init() call acpi_sleep_proc_init() directly.
      Previously, acpi_sleep_proc_init() was a late_initcall (sequence 7),
      apparently to make sure that the /proc hierarchy already exists:
      
          2003/02/13 12:38:03-06:00 mochel
          acpi sleep: demote sleep proc file creation.
      
          - Make acpi_sleep_proc_init() a late_initcall(), and not called from
            acpi_sleep_init(). This guarantees that the acpi proc hierarchy is at
            least there when we create the dang file.
      
      This should no longer be an issue because acpi_bus_init() (called early
      in acpi_init()) creates acpi_root_dir (/proc/acpi).
      
      Signed-off-by: default avatarBjorn Helgaas <bjorn.helgaas@hp.com>
      Signed-off-by: default avatarLen Brown <len.brown@intel.com>
      9cee43e0
  8. Jan 09, 2009
  9. Dec 31, 2008
  10. Dec 10, 2008
  11. Nov 16, 2008
  12. Nov 07, 2008
    • Kay Sievers's avatar
      ACPI: struct device - replace bus_id with dev_name(), dev_set_name() · 0794469d
      Kay Sievers authored
      
      This patch is part of a larger patch series which will remove
      the "char bus_id[20]" name string from struct device. The device
      name is managed in the kobject anyway, and without any size
      limitation, and just needlessly copied into "struct device".
      
      To set and read the device name dev_name(dev) and dev_set_name(dev)
      must be used. If your code uses static kobjects, which it shouldn't
      do, "const char *init_name" can be used to statically provide the
      name the registered device should have. At registration time, the
      init_name field is cleared, to enforce the use of dev_name(dev) to
      access the device name at a later time.
      
      We need to get rid of all occurrences of bus_id in the entire tree
      to be able to enable the new interface. Please apply this patch,
      and possibly convert any remaining remaining occurrences of bus_id.
      
      We want to submit a patch to -next, which will remove bus_id from
      "struct device", to find the remaining pieces to convert, and finally
      switch over to the new api, which will remove the 20 bytes array
      and does no longer have a size limitation.
      
      Acked-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      Signed-Off-By: default avatarKay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: default avatarLen Brown <len.brown@intel.com>
      0794469d
  13. Oct 20, 2008
  14. Oct 04, 2008
  15. Jul 04, 2008
  16. Jun 11, 2008
  17. Apr 29, 2008
  18. Dec 28, 2007
    • Signed-off by Yi Yang's avatar
      ACPI: detect invalid argument written to /proc/acpi/alarm · 975c3025
      Signed-off by Yi Yang authored
      
      /proc/acpi/alarm can't be set correctly, here is a sample:
      
      [root@localhost /]# echo "2006 09" > /proc/acpi/alarm
      [root@localhost /]# cat /proc/acpi/alarm
      2007-12-09 09:09:09
      [root@localhost /]# echo "2006 04" > /proc/acpi/alarm
      [root@localhost /]# cat /proc/acpi/alarm
      2007-12-04 04:04:04
      [root@localhost /]#
      
      Obviously, it is wrong, it should consider it as an invalid input.
      
      after this patch:
      
      [root@localhost /]# echo "2008 09" > /proc/acpi/alarm
      -bash: echo: write error: Invalid argument
      [root@localhost /]#
      
      Signed-off-by: default avatarYi Yang <yi.y.yang@intel.com>
      Signed-off-by: default avatarLen Brown <len.brown@intel.com>
      975c3025
    • Yi Yang's avatar
      ACPI: /proc/acpi/alarm parsing: handle large numbers properly · 08798029
      Yi Yang authored
      
      In function acpi_system_write_alarm in file drivers/acpi/sleep/proc.c,
      big sec, min, hr, mo, day and yr are counted twice to get reasonable
      values, that is very superfluous, we can do that only once.
      
      In additon, /proc/acpi/alarm can set a related value which can be
      specified as YYYY years MM months DD days HH hours MM minutes SS
      senconds, it isn't a date, so you can specify as +0000-00-00 96:00:00
      , that means 3 days later, current code can't handle such a case.
      
      This patch removes unnecessary code and does with the aforementioned
      situation.
      
      Before applying this patch:
      
      [root@localhost /]# cat /proc/acpi/alarm
      2007-12-00 00:00:00
      [root@localhost /]# echo "0000-00-00 96:180:180" > /proc/acpi/alarm
      [root@localhost /]# cat /proc/acpi/alarm
      0007-12-02 **:**:**
      [root@localhost /]#
      
      After applying this patch:
      
      [root@localhost ~]# echo "2007-12-00 00:00:00" > /proc/acpi/alarm
      [root@localhost ~]# cat /proc/acpi/alarm
      2007-12-00 00:00:00
      [root@localhost ~]# echo "0000-00-00 96:180:180" > /proc/acpi/alarm
      [root@localhost ~]# cat /proc/acpi/alarm
      0007-12-04 03:03:00
      [root@localhost ~]#
      
      Signed-off-by: default avatarYi Yang <yi.y.yang@intel.com>
      Signed-off-by: default avatarLen Brown <len.brown@intel.com>
      08798029
  19. Oct 25, 2007
    • Linus Torvalds's avatar
      Fix /proc/acpi/alarm BCD alarm encodings · c67c36e4
      Linus Torvalds authored
      
      This fixes some totally illogical and wrong code that converts things to
      and from BCD mode essentially randomly, does math on values in BCD mode
      etc etc.  Introduce a few helper functions to make it a bit more obvious
      what is going on, and make sure that we always do all the arithmetic
      (and anythign else, for that matter) in binary, not BCD.
      
      Tested by Mark Lord, who found the problem originally, and also pushed
      the patch back and reminded me about it.
      
      Signed-off-by: default avatarMark Lord <mlord@pobox.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      c67c36e4
  20. Aug 28, 2007
  21. Jul 29, 2007
  22. Jul 24, 2007
    • Len Brown's avatar
      ACPI: Kconfig: fold /proc/acpi/sleep under CONFIG_ACPI_PROCFS · 43532c8a
      Len Brown authored
      
      /proc/acpi/sleep has had its own "default n" option,
      ACPI_SLEEP_PROC_SLEEP, for many months.
      Time to delete ACPI_SLEEP_PROC_SLEEP.
      
      Users that still need /proc/acpi/sleep can still get it
      along with the other deprecated /proc/acpi files
      by enabling CONFIG_ACPI_PROCFS.
      
      Also delete ACPI_SLEEP_PROC_FS, which was an umbrella
      for /proc/acpi/sleep, wakeup, alarm, because it was
      effectively just a synonym for ACPI_SLEEP.
      
      Signed-off-by: default avatarLen Brown <len.brown@intel.com>
      43532c8a
  23. May 10, 2007
  24. May 09, 2007
    • Rafael J. Wysocki's avatar
      PM: Separate hibernation code from suspend code · a3d25c27
      Rafael J. Wysocki authored
      
      [ 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: default avatarRafael 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: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a3d25c27
  25. May 08, 2007
  26. May 07, 2007
  27. Apr 25, 2007
    • David Brownell's avatar
      ACPI: make /proc/acpi/wakeup more useful · 8aa55591
      David Brownell authored
      
      This updates /proc/acpi/wakeup to be more informative, primarily by showing
      the sysfs node associated with each wakeup-enabled device.  Example:
      
      	Device	S-state	  Status   Sysfs node
      	PCI0	  S4	 disabled  no-bus:pci0000:00
      	PS2M	  S4	 disabled  pnp:00:05
      	PS2K	  S4	 disabled  pnp:00:06
      	UAR1	  S4	 disabled  pnp:00:08
      	USB1	  S3	 disabled  pci:0000:00:03.0
      	USB2	  S3	 disabled  pci:0000:00:03.1
      	USB3	  S3	 disabled
      	USB4	  S3	 disabled  pci:0000:00:03.3
      	S139	  S4	 disabled
      	LAN	  S4	 disabled  pci:0000:00:04.0
      	MDM	  S4	 disabled
      	AUD	  S4	 disabled  pci:0000:00:02.7
      	SLPB	  S4	*enabled
      
      Eventually this file should be removed, but until then it's almost the only
      way we have to tell how the relevant ACPI tables are broken (and cope).  In
      that example, two devices don't actually exist (USB3, S139), one can't issue
      wakeup events (PCI0), and two seem harmlessly (?) confused (MDM and AUD are
      the same PCI device, but it's the _modem_ that does wake-on-ring).
      
      In particular, we need to be sure driver model nodes are properly hooked
      up before we can get rid of this ACPI-only interface for wakeup events.
      
      Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLen Brown <len.brown@intel.com>
      8aa55591
  28. Feb 03, 2007
  29. Jul 10, 2006
  30. Sep 10, 2005
  31. Aug 05, 2005
  32. Jul 12, 2005
  33. Apr 16, 2005
    • Linus Torvalds's avatar
      Linux-2.6.12-rc2 · 1da177e4
      Linus Torvalds authored
      Initial git repository build. I'm not bothering with the full history,
      even though we have it. We can create a separate "historical" git
      archive of that later if we want to, and in the meantime it's about
      3.2GB when imported into git - space that would just make the early
      git days unnecessarily complicated, when we don't have a lot of good
      infrastructure for it.
      
      Let it rip!
      v2.6.12-rc2
      1da177e4
Loading