1. 25 9月, 2014 1 次提交
    • B
      ACPICA: Update to GPIO region handler interface. · 75ec6e55
      Bob Moore 提交于
      Changes to correct several GPIO issues:
      
      1) The update_rule in a GPIO field definition is now ignored;
      a read-modify-write operation is never performed for GPIO fields.
      (Internally, this means that the field assembly/disassembly
      code is completely bypassed for GPIO.)
      
      2) The Address parameter passed to a GPIO region handler is
      now the bit offset of the field from a previous Connection()
      operator. Thus, it becomes a "Pin Number Index" into the
      Connection() resource descriptor.
      
      3) The bit_width parameter passed to a GPIO region handler is
      now the exact bit width of the GPIO field. Thus, it can be
      interpreted as "number of pins".
      
      Overall, we can now say that the region handler interface
      to GPIO handlers is a raw "bit/pin" addressed interface, not
      a byte-addressed interface like the system_memory handler interface.
      Signed-off-by: NBob Moore <robert.moore@intel.com>
      Signed-off-by: NLv Zheng <lv.zheng@intel.com>
      Cc: 3.15+ <stable@vger.kernel.org> # 3.15+
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      75ec6e55
  2. 16 9月, 2014 1 次提交
  3. 09 9月, 2014 3 次提交
    • F
      ACPI / LPSS: complete PM entries for LPSS power domain · f4168b61
      Fu Zhonghui 提交于
      PM entries of LPSS power domain were not implemented correctly
      in commit c78b0830 "ACPI / LPSS: custom power domain for LPSS".
      
      This patch fixes and completes these PM entries.
      
      Fixes: c78b0830 (ACPI / LPSS: custom power domain for LPSS)
      Signed-off-by: NLi Aubrey <aubrey.li@linux.intel.com>
      Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NFu Zhonghui <zhonghui.fu@linux.intel.com>
      Cc: 3.16+ <stable@vger.kernel.org> # 3.16+
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      f4168b61
    • B
      Revert "ACPI / battery: fix wrong value of capacity_now reported when fully charged" · 508b3c67
      Bjørn Mork 提交于
      This reverts commit 232de514 ("ACPI / battery: fix wrong value of
      capacity_now reported when fully charged")
      
      There is nothing wrong or unexpected about 'capacity_now' increasing above
      the last 'full_charge_capacity' value. Different charging cycles will cause
      'full_charge_capacity' to vary, both up and down.  Good battery firmwares
      will update 'full_charge_capacity' when the current charging cycle is
      complete, increasing it if necessary. It might even go above
      'design_capacity' on a fresh and healthy battery.
      
      Capping 'capacity_now' to 'full_charge_capacity' is plain wrong, and
      printing a warning if this doesn't happen to match the 'design_capacity'
      is both annoying and terribly wrong.
      
      This results in bogus warnings on perfectly working systems/firmwares:
      
       [Firmware Bug]: battery: reported current charge level (39800) is higher than reported maximum charge level (39800).
      
      and wrong values being reported for 'capacity_now' and
      'full_charge_capacity' after the warning has been triggered.
      
      Fixes: 232de514 ("ACPI / battery: fix wrong value of capacity_now reported when fully charged")
      Cc: 3.16+ <stable@vger.kernel.org> # 3.16+
      Signed-off-by: NBjørn Mork <bjorn@mork.no>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      508b3c67
    • B
      Revert "ACPI / battery: Fix warning message in acpi_battery_get_state()" · 583ee394
      Bjørn Mork 提交于
      This reverts commit d719870b ("ACPI / battery: Fix warning message in
      acpi_battery_get_state()")
      
      Capping 'capacity_now' to 'full_charge_capacity' is plain wrong. If this
      is necessary to work around some buggy firmware, then the workaround needs
      protection against being applied to working firmwares.
      
      Good battery firmwares will allow 'capacity_now' to increase above
      'full_charge_capacity', and will update the latter when the battery
      is fully charged.  By capping 'capacity_now' we lose accurate capacity
      reporting until charging is complete whenever 'full_charge_capacity'
      needs to be increased.
      
      Fixes: d719870b ("ACPI / battery: Fix warning message in acpi_battery_get_state()")
      Cc: 3.16+ <stable@vger.kernel.org> # 3.16+
      Signed-off-by: NBjørn Mork <bjorn@mork.no>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      583ee394
  4. 08 9月, 2014 1 次提交
  5. 04 9月, 2014 2 次提交
    • J
      ACPI / cpuidle: fix deadlock between cpuidle_lock and cpu_hotplug.lock · 6726655d
      Jiri Kosina 提交于
      There is a following AB-BA dependency between cpu_hotplug.lock and
      cpuidle_lock:
      
      1) cpu_hotplug.lock -> cpuidle_lock
      enable_nonboot_cpus()
       _cpu_up()
        cpu_hotplug_begin()
         LOCK(cpu_hotplug.lock)
       cpu_notify()
        ...
        acpi_processor_hotplug()
         cpuidle_pause_and_lock()
          LOCK(cpuidle_lock)
      
      2) cpuidle_lock -> cpu_hotplug.lock
      acpi_os_execute_deferred() workqueue
       ...
       acpi_processor_cst_has_changed()
        cpuidle_pause_and_lock()
         LOCK(cpuidle_lock)
        get_online_cpus()
         LOCK(cpu_hotplug.lock)
      
      Fix this by reversing the order acpi_processor_cst_has_changed() does
      thigs -- let it first execute the protection against CPU hotplug by
      calling get_online_cpus() and obtain the cpuidle lock only after that (and
      perform the symmentric change when allowing CPUs hotplug again and
      dropping cpuidle lock).
      
      Spotted by lockdep.
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      Cc: All applicable <stable@vger.kernel.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      6726655d
    • Y
      ACPI / scan: not cache _SUN value in struct acpi_device_pnp · a383b68d
      Yasuaki Ishimatsu 提交于
      The _SUN device indentification object is not guaranteed to return
      the same value every time it is executed, so we should not cache its
      return value, but rather execute it every time as needed.  If it is
      cached, an incorrect stale value may be used in some situations.
      
      This issue was exposed by commit 202317a5 (ACPI / scan: Add
      acpi_device objects for all device nodes in the namespace).  Fix it
      by avoiding to cache the return value of _SUN.
      
      Fixes: 202317a5 (ACPI / scan: Add acpi_device objects for all device nodes in the namespace)
      Signed-off-by: NYasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
      Cc: 3.14+ <stable@vger.kernel.org> # 3.14+
      [ rjw: Changelog ]
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      a383b68d
  6. 02 9月, 2014 5 次提交
  7. 29 8月, 2014 1 次提交
  8. 26 8月, 2014 5 次提交
  9. 10 8月, 2014 1 次提交
  10. 08 8月, 2014 2 次提交
    • J
      x86, irq, PCI: Keep IRQ assignment for PCI devices during suspend/hibernation · 3eec5952
      Jiang Liu 提交于
      Now IOAPIC driver dynamically allocates IRQ numbers for IOAPIC pins.
      We need to keep IRQ assignment for PCI devices during suspend/hibernation,
      otherwise it may cause failure of suspend/hibernation due to:
      1) Device driver calls pci_enable_device() to allocate an IRQ number
         and register interrupt handler on the returned IRQ.
      2) Device driver's suspend callback calls pci_disable_device() and
         release assigned IRQ in turn.
      3) Device driver's resume callback calls pci_enable_device() to
         allocate IRQ number again. A different IRQ number may be assigned
         by IOAPIC driver this time.
      4) Now the hardware delivers interrupt to the new IRQ but interrupt
         handler is still registered against the old IRQ, so it breaks
         suspend/hibernation.
      
      To fix this issue, we keep IRQ assignment during suspend/hibernation.
      Flag pci_dev.dev.power.is_prepared is used to detect that
      pci_disable_device() is called during suspend/hibernation.
      Reported-and-Tested-by: NBorislav Petkov <bp@suse.de>
      Signed-off-by: NJiang Liu <jiang.liu@linux.intel.com>
      Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Joerg Roedel <joro@8bytes.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: Randy Dunlap <rdunlap@infradead.org>
      Cc: Yinghai Lu <yinghai@kernel.org>
      Cc: Grant Likely <grant.likely@linaro.org>
      Cc: Len Brown <lenb@kernel.org>
      Link: http://lkml.kernel.org/r/1407478071-29399-1-git-send-email-jiang.liu@linux.intel.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      3eec5952
    • T
      ACPI / hotplug: Check scan handlers in acpi_scan_hot_remove() · dee15926
      Tang Chen 提交于
      When ACPI_HOTPLUG_MEMORY is not configured, memory_device_handler.attach
      is not set.  In acpi_scan_attach_handler(), the acpi_device->handler will
      not be initialized.
      
      In acpi_scan_hot_remove(), it doesn't check if acpi_device->handler is NULL.
      If we do memory hot-remove without ACPI_HOTPLUG_MEMORY configured, the kernel
      will panic.
      
       BUG: unable to handle kernel NULL pointer dereference at 0000000000000088
       IP: [<ffffffff813e318f>] acpi_device_hotplug+0x1d7/0x4c4
       PGD 0
       Oops: 0000 [#1] SMP
       Modules linked in: sd_mod(E) sr_mod(E) cdrom(E) crc_t10dif(E) crct10dif_common(E) ata_piix(E) libata(E)
       CPU: 0 PID: 41 Comm: kworker/u2:1 Tainted: G            E 3.16.0-rc7--3.16-rc7-tangchen+ #20
       Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.7.5-0-ge51488c-20140602_164612-nilsson.home.kraxel.org 04/01/2014
       Workqueue: kacpi_hotplug acpi_hotplug_work_fn
       task: ffff8800182436c0 ti: ffff880018254000 task.ti: ffff880018254000
       RIP: 0010:[<ffffffff813e318f>]  [<ffffffff813e318f>] acpi_device_hotplug+0x1d7/0x4c4
       RSP: 0000:ffff880018257da8  EFLAGS: 00000246
       RAX: 0000000000000000 RBX: ffff88001cd8d800 RCX: 0000000000000000
       RDX: 0000000000000000 RSI: ffff88001e40e6f8 RDI: 0000000000000246
       RBP: ffff880018257df0 R08: 0000000000000096 R09: 00000000000011a0
       R10: 63735f6970636120 R11: 725f746f685f6e61 R12: 0000000000000003
       R13: ffff88001cc1c400 R14: ffff88001e062028 R15: 0000000000000040
       FS:  0000000000000000(0000) GS:ffff88001e400000(0000) knlGS:0000000000000000
       CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
       CR2: 0000000000000088 CR3: 000000001a9a2000 CR4: 00000000000006f0
       DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
       DR3: 0000000000000000 DR6: 0000000000000000 DR7: 0000000000000000
       Stack:
        00000000523cab58 ffff88001cd8d9f8 ffff88001852d480 00000000523cab58
        ffff88001852d480 ffff880018221e40 ffff88001cc1c400 ffff88001cce2d00
        0000000000000040 ffff880018257e08 ffffffff813dc31d ffff88001852d480
       Call Trace:
        [<ffffffff813dc31d>] acpi_hotplug_work_fn+0x1e/0x29
        [<ffffffff8108eefb>] process_one_work+0x17b/0x460
        [<ffffffff8108f69d>] worker_thread+0x11d/0x5b0
        [<ffffffff8108f580>] ? rescuer_thread+0x3a0/0x3a0
        [<ffffffff81096811>] kthread+0xe1/0x100
        [<ffffffff81096730>] ? kthread_create_on_node+0x1a0/0x1a0
        [<ffffffff816cc6bc>] ret_from_fork+0x7c/0xb0
        [<ffffffff81096730>] ? kthread_create_on_node+0x1a0/0x1a0
      
      This patch fixes this problem by checking if acpi_device->handler is NULL
      in acpi_scan_hot_remove().
      
      Fixes: d22ddcbc (ACPI / hotplug: Add demand_offline hotplug profile flag)
      Signed-off-by: NTang Chen <tangchen@cn.fujitsu.com>
      Cc: 3.14+ <stable@vger.kernel.org> # 3.14+
      [rjw: Subject]
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      dee15926
  11. 07 8月, 2014 1 次提交
  12. 01 8月, 2014 2 次提交
  13. 31 7月, 2014 10 次提交
  14. 30 7月, 2014 3 次提交
  15. 24 7月, 2014 2 次提交
    • L
      ACPI / sleep: Do not save NVS for new machines to accelerate S3 · 821d6f03
      Lan Tianyu 提交于
      NVS region is saved and restored unconditionally for machines without
      nvs_nosave quirk during S3. Tested some new machines and the operation
      is not necessary. Saving NVS region also affects S2RAM speed. The time of
      NVS saving and restoring depends on the size of NVS region and it consumes
      7~10ms normally.
      
      This patch is to make machines produced from 2012 to now not saving NVS region
      to accelerate S3.
      Signed-off-by: NLan Tianyu <tianyu.lan@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      821d6f03
    • R
      ACPI / scan: No implicit wake notification for buttons · bd9b2f9a
      Rafael J. Wysocki 提交于
      The ACPI device enumeration code in Linux assumes that buttons always
      are wakeup devices, so it calls acpi_setup_gpe_for_wake() for them
      which leads to undesirable side effects.  Namely, that function sets
      up implicit device wake notification mechanism for a given GPE if
      there is no handler method in the ACPI namespace, which from the
      ACPICA's perspective means that there always is a way to handle
      that GPE if enabled.  However, we don't handle wake notify events
      for buttons, so if there are no handler methods for their GPEs in
      the namespace, enabling a button GPE at run time leads to a GPE
      storm in some cases (the GPE triggers, ACPICA carries out the
      implicit wake notification for it which isn't handled, so the
      GPE triggers again and so on).
      
      To prevent that from happening use acpi_mark_gpe_for_wake()
      instead of acpi_setup_gpe_for_wake() for buttons which will cause
      ACPICA to only enable button GPEs if there are handler methods for
      the in the namespace.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      bd9b2f9a