1. 10 6月, 2020 2 次提交
    • M
      mm: reorder includes after introduction of linux/pgtable.h · 65fddcfc
      Mike Rapoport 提交于
      The replacement of <asm/pgrable.h> with <linux/pgtable.h> made the include
      of the latter in the middle of asm includes.  Fix this up with the aid of
      the below script and manual adjustments here and there.
      
      	import sys
      	import re
      
      	if len(sys.argv) is not 3:
      	    print "USAGE: %s <file> <header>" % (sys.argv[0])
      	    sys.exit(1)
      
      	hdr_to_move="#include <linux/%s>" % sys.argv[2]
      	moved = False
      	in_hdrs = False
      
      	with open(sys.argv[1], "r") as f:
      	    lines = f.readlines()
      	    for _line in lines:
      		line = _line.rstrip('
      ')
      		if line == hdr_to_move:
      		    continue
      		if line.startswith("#include <linux/"):
      		    in_hdrs = True
      		elif not moved and in_hdrs:
      		    moved = True
      		    print hdr_to_move
      		print line
      Signed-off-by: NMike Rapoport <rppt@linux.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Cain <bcain@codeaurora.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Chris Zankel <chris@zankel.net>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Greentime Hu <green.hu@gmail.com>
      Cc: Greg Ungerer <gerg@linux-m68k.org>
      Cc: Guan Xuetao <gxt@pku.edu.cn>
      Cc: Guo Ren <guoren@kernel.org>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Helge Deller <deller@gmx.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Ley Foon Tan <ley.foon.tan@intel.com>
      Cc: Mark Salter <msalter@redhat.com>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Max Filippov <jcmvbkbc@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Nick Hu <nickhu@andestech.com>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Rich Felker <dalias@libc.org>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Stafford Horne <shorne@gmail.com>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Vincent Chen <deanbo422@gmail.com>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Link: http://lkml.kernel.org/r/20200514170327.31389-4-rppt@kernel.orgSigned-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      65fddcfc
    • M
      mm: introduce include/linux/pgtable.h · ca5999fd
      Mike Rapoport 提交于
      The include/linux/pgtable.h is going to be the home of generic page table
      manipulation functions.
      
      Start with moving asm-generic/pgtable.h to include/linux/pgtable.h and
      make the latter include asm/pgtable.h.
      Signed-off-by: NMike Rapoport <rppt@linux.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Cain <bcain@codeaurora.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Chris Zankel <chris@zankel.net>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Greentime Hu <green.hu@gmail.com>
      Cc: Greg Ungerer <gerg@linux-m68k.org>
      Cc: Guan Xuetao <gxt@pku.edu.cn>
      Cc: Guo Ren <guoren@kernel.org>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Helge Deller <deller@gmx.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Ley Foon Tan <ley.foon.tan@intel.com>
      Cc: Mark Salter <msalter@redhat.com>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Max Filippov <jcmvbkbc@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Nick Hu <nickhu@andestech.com>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Rich Felker <dalias@libc.org>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Stafford Horne <shorne@gmail.com>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Vincent Chen <deanbo422@gmail.com>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Link: http://lkml.kernel.org/r/20200514170327.31389-3-rppt@kernel.orgSigned-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      ca5999fd
  2. 08 6月, 2020 1 次提交
    • R
      ACPI: PM: Avoid using power resources if there are none for D0 · 956ad9d9
      Rafael J. Wysocki 提交于
      As recently reported, some platforms provide a list of power
      resources for device power state D3hot, through the _PR3 object,
      but they do not provide a list of power resources for device power
      state D0.
      
      Among other things, this causes acpi_device_get_power() to return
      D3hot as the current state of the device in question if all of the
      D3hot power resources are "on", because it sees the power_resources
      flag set and calls acpi_power_get_inferred_state() which finds that
      D3hot is the shallowest power state with all of the associated power
      resources turned "on", so that's what it returns.  Moreover, that
      value takes precedence over the acpi_dev_pm_explicit_get() return
      value, because it means a deeper power state.  The device may very
      well be in D0 physically at that point, however.
      
      Moreover, the presence of _PR3 without _PR0 for a given device
      means that only one D3-level power state can be supported by it.
      Namely, because there are no power resources to turn "off" when
      transitioning the device from D0 into D3cold (which should be
      supported since _PR3 is present), the evaluation of _PS3 should
      be sufficient to put it straight into D3cold, but this means that
      the effect of turning "on" the _PR3 power resources is unclear,
      so it is better to avoid doing that altogether.  Consequently,
      there is no practical way do distinguish D3cold from D3hot for
      the device in question and the power states of it can be labeled
      so that D3hot is the deepest supported one (and Linux assumes
      that putting a device into D3hot via ACPI may cause power to be
      removed from it anyway, for legacy reasons).
      
      To work around the problem described above modify the ACPI
      enumeration of devices so that power resources are only used
      for device power management if the list of D0 power resources
      is not empty and make it mart D3cold as supported only if that
      is the case and the D3hot list of power resources is not empty
      too.
      
      Fixes: ef85bdbe ("ACPI / scan: Consolidate extraction of power resources lists")
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=205057
      Link: https://lore.kernel.org/linux-acpi/20200603194659.185757-1-hdegoede@redhat.com/Reported-by: NHans de Goede <hdegoede@redhat.com>
      Tested-by: NHans de Goede <hdegoede@redhat.com>
      Tested-by: youling257@gmail.com
      Cc: 3.10+ <stable@vger.kernel.org> # 3.10+
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: NHans de Goede <hdegoede@redhat.com>
      956ad9d9
  3. 09 5月, 2020 1 次提交
  4. 04 2月, 2020 1 次提交
  5. 18 10月, 2019 1 次提交
    • A
      ACPI: platform: Unregister stale platform devices · cb0701ac
      Andy Shevchenko 提交于
      When commit 68bdb677 ("ACPI: add support for ACPI reconfiguration
      notifiers") introduced reconfiguration notifiers, it missed the point
      that the ACPI table, which might be loaded and then unloaded via
      ConfigFS, could contain devices that were not enumerated by their
      parents.
      
      In such cases, the stale platform device is dangling in the system
      while the rest of the devices from the same table are already gone.
      
      Introduce acpi_platform_device_remove_notify() notifier that, in
      similar way to I²C or SPI buses, unregisters the platform devices
      on table removal event.
      
      Fixes: 68bdb677 ("ACPI: add support for ACPI reconfiguration notifiers")
      Depends-on: 00500147 ("drivers: Introduce device lookup variants by ACPI_COMPANION device")
      Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      [ rjw: Changelog & function rename ]
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      cb0701ac
  6. 03 8月, 2019 1 次提交
  7. 21 5月, 2019 1 次提交
  8. 09 4月, 2019 1 次提交
  9. 05 4月, 2019 1 次提交
  10. 27 3月, 2019 3 次提交
  11. 06 2月, 2019 1 次提交
    • H
      ACPI / scan: Create platform device for BSG2150 ACPI nodes · 96f984d3
      Hans de Goede 提交于
      The Point of View TAB-P1006W-232-3G tablet has an ACPI firmware node with
      a HID of BSG2150 describing the 2 Bosch sensors used in the device a
      BMC150 compatible accelerometer and a BMC150 compatible magnetometer.
      
      The ACPI firmware node actually contains 3 I2cSerialBusV2 resources,
      but this seems to be a copy and paste job from the BSG1160 firmware node
      on other devices, since there is no i2c-client listening to the 0x68
      address listed in the third resource and the 0x68 address is identical
      to the address of the third resource in the BSG1160 nodes, where as the
      other 2 addresses are different.
      
      Add the ID to the I2C multi instantiate list, so that the
      i2c-multi-instantiate.c driver can handle it;
      
      And add the necessary info to the i2c-multi-instantiate.c driver to
      enumerate all I2C slaves correctly.
      
      To avoid triggering the:
      
              if (i < multi->num_clients) {
                      dev_err(dev, "Error finding driver, idx %d\n", i);
      
      Error this commit lists the 3th device in the i2c_inst_data with a
      type of "bsg2150_dummy_dev".
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Acked-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      96f984d3
  12. 14 12月, 2018 1 次提交
  13. 04 12月, 2018 1 次提交
  14. 18 10月, 2018 1 次提交
    • H
      ACPI / scan: Create platform device for INT33FE ACPI nodes · 589edb56
      Hans de Goede 提交于
      Bay and Cherry Trail devices with a Dollar Cove or Whiskey Cove PMIC
      have an ACPI node with a HID of INT33FE which is a "virtual" battery
      device implementing a standard ACPI battery interface which depends upon
      a proprietary, undocument OpRegion called BMOP. Since we do have docs
      for the actual fuel-gauges used on these boards we instead use native
      fuel-gauge drivers talking directly to the fuel-gauge ICs on boards which
      rely on this INT33FE device for their battery monitoring.
      
      On boards with a Dollar Cove PMIC the INT33FE device's resources (_CRS)
      describe a non-existing I2C client at address 0x6b with a bus-speed of
      100KHz. This is a problem on some boards since there are actual devices
      on that same bus which need a speed of 400KHz to function properly.
      
      This commit adds the INT33FE HID to the list of devices with I2C resources
      which should be enumerated as a platform-device rather then letting the
      i2c-core instantiate an i2c-client matching the first I2C resource,
      so that its bus-speed will not influence the max speed of the I2C bus.
      This fixes e.g. the touchscreen not working on the Teclast X98 II Plus.
      
      The INT33FE device on boards with a Whiskey Cove PMIC is somewhat special.
      Its first I2C resource is for a secondary I2C address of the PMIC itself,
      which is already described in an ACPI device with an INT34D3 HID.
      
      But it has 3 more I2C resources describing 3 other chips for which we do
      need to instantiate I2C clients and which need device-connections added
      between them for things to work properly. This special case is handled by
      the drivers/platform/x86/intel_cht_int33fe.c code.
      
      Before this commit that code was binding to the i2c-client instantiated
      for the secondary I2C address of the PMIC, since we now instantiate a
      platform device for the INT33FE device instead, this commit also changes
      the intel_cht_int33fe driver from an i2c driver to a platform driver.
      
      This also brings the intel_cht_int33fe drv inline with how we instantiate
      multiple i2c clients from a single ACPI device in other cases, as done
      by the drivers/platform/x86/i2c-multi-instantiate.c code.
      Reported-and-tested-by: NAlexander Meiler <alex.meiler@protonmail.com>
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Acked-by: NAndy Shevchenko <andy.shevchenko@gmail.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      589edb56
  15. 08 9月, 2018 1 次提交
  16. 09 8月, 2018 3 次提交
    • H
      ACPI / scan: Create platform device for fwnodes with multiple i2c devices · aba94139
      Hans de Goede 提交于
      Some devices have multiple I2cSerialBus resources and for things to work
      an i2c-client must be instantiated for each, each with its own
      i2c_device_id.
      
      Normally we only instantiate an i2c-client for the first resource, using
      the ACPI HID as id.
      
      This commit adds a list of HIDs of devices, which need multiple i2c-clients
      instantiated from a single fwnode, to acpi_device_enumeration_by_parent and
      makes acpi_device_enumeration_by_parent return false for these devices so
      that a platform device will be instantiated.
      
      This allows the drivers/platform/x86/i2c-multi-instantiate.c driver, which
      knows which i2c_device_id to use for each resource, to bind to the fwnode
      and initiate an i2c-client for each resource.
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      aba94139
    • H
      ACPI / scan: Initialize status to ACPI_STA_DEFAULT · 5971b0c1
      Hans de Goede 提交于
      Since commit 63347db0 "ACPI / scan: Use acpi_bus_get_status() to
      initialize ACPI_TYPE_DEVICE devs" the status field of normal acpi_devices
      gets set to 0 by acpi_bus_type_and_status() and filled with its actual
      value later when acpi_add_single_object() calls acpi_bus_get_status().
      
      This means that any acpi_match_device_ids() calls in between will always
      fail with -ENOENT.
      
      We already have a workaround for this, which temporary forces status to
      ACPI_STA_DEFAULT in drivers/acpi/x86/utils.c: acpi_device_always_present()
      and the next commit in this series adds another acpi_match_device_ids()
      call between status being initialized as 0 and the acpi_bus_get_status()
      call.
      
      Rather then adding another workaround, this commit makes
      acpi_bus_type_and_status() initialize status to ACPI_STA_DEFAULT, this is
      safe to do as the only code looking at status between the initialization
      and the acpi_bus_get_status() call is those acpi_match_device_ids() calls.
      
      Note this does mean that we need to (re)set status to 0 in case the
      acpi_bus_get_status() call fails.
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      5971b0c1
    • J
      ACPI / scan: Add static attribute to indirect_io_hosts[] · a6f07295
      John Garry 提交于
      Array indirect_io_hosts[] is declared in acpi_is_indirect_io_slave() as a
      const array, which means that the array will be re-built for each call.
      
      Optimise by adding the static attribute, which means that the array is
      added to const-data pool and not re-built per function call.
      Reported-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NJohn Garry <john.garry@huawei.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      a6f07295
  17. 23 4月, 2018 1 次提交
    • M
      ACPI / scan: Initialize watchdog before PNP · cc6a0e31
      Mika Westerberg 提交于
      At least on one Dell system the PNP motherboard resources device
      includes resources used by WDAT table. Since PNP gets initialized before
      WDAT it results following error and no watchdog:
      
        platform wdat_wdt: failed to claim resource 3: [io  0x046a-0x046c]
        ACPI: watchdog: Device creation failed: -16
      
      Now, the PNP system driver is already accustomed with the situation that
      it cannot reserve all those motherboard resources because drivers using
      those might have reserved them already. In addition putting WDAT table
      resources under motherboard resources device makes sense in general.
      
      Fix this by initializing WDAT right before PNP. This allows WDAT to
      reserve all its resources and still keeps PNP system driver happy.
      
      Reported-by: Shubhrata.Priyadarsh@dell.com
      Reported-by: NTakashi Iwai <tiwai@suse.de>
      Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Acked-by: NGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      cc6a0e31
  18. 04 4月, 2018 2 次提交
    • J
      ACPI / scan: Do not enumerate Indirect IO host children · dfda4492
      John Garry 提交于
      Through the logical PIO framework, systems which otherwise have no IO space
      access to legacy ISA/LPC devices may access these devices through so-called
      "indirect IO" method.  In this, IO space accesses for non-PCI hosts are
      redirected to a host LLDD to manually generate the IO space (bus) accesses.
      Hosts are able to register a region in logical PIO space to map to its bus
      address range.
      
      Indirect IO child devices have an associated host-specific bus address.
      Special translation is required to map between a logical PIO address for a
      device and its host bus address.
      
      Since in the ACPI tables the child device IO resources would be the
      host-specific values, it is required the ACPI scan code should not
      enumerate these devices, and that this should be the responsibility of the
      host driver so that it can "fixup" the resources so that they map to the
      appropriate logical PIO addresses.
      
      To avoid enumerating these child devices, add a check from
      acpi_device_enumeration_by_parent() as to whether the parent for a device
      is a member of a known list of "indirect IO" hosts.  For now, the HiSilicon
      LPC host controller ID is added.
      Tested-by: Ndann frazier <dann.frazier@canonical.com>
      Signed-off-by: NJohn Garry <john.garry@huawei.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: NAndy Shevchenko <andy.shevchenko@gmail.com>
      Acked-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      dfda4492
    • J
      ACPI / scan: Rename acpi_is_serial_bus_slave() for more general use · d87fb091
      John Garry 提交于
      Currently the ACPI scan has special handling for serial bus slaves, in that
      it makes it the responsibility of the slave device's parent to enumerate
      the device.
      
      To support other types of slave devices which require the same special
      handling but where the bus is not strictly a serial bus, such as devices on
      the HiSilicon LPC controller bus, rename acpi_is_serial_bus_slave() to
      acpi_device_enumeration_by_parent(), so that the name can fit the wider
      purpose.
      
      Also rename the associated device flag acpi_device_flags.serial_bus_slave
      to .enumeration_by_parent.
      Signed-off-by: NJohn Garry <john.garry@huawei.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Acked-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      d87fb091
  19. 20 3月, 2018 1 次提交
  20. 04 2月, 2018 1 次提交
    • H
      ACPI / scan: Use acpi_bus_get_status() to initialize ACPI_TYPE_DEVICE devs · 63347db0
      Hans de Goede 提交于
      The acpi_get_bus_status wrapper for acpi_bus_get_status_handle has some
      code to handle certain device quirks, in some cases we also need this
      quirk handling for the initial _STA call.
      
      Specifically on some devices calling _STA before all _DEP dependencies
      are met results in errors like these:
      
      [    0.123579] ACPI Error: No handler for Region [ECRM] (00000000ba9edc4c)
                     [GenericSerialBus] (20170831/evregion-166)
      [    0.123601] ACPI Error: Region GenericSerialBus (ID=9) has no handler
                     (20170831/exfldio-299)
      [    0.123618] ACPI Error: Method parse/execution failed
                     \_SB.I2C1.BAT1._STA, AE_NOT_EXIST (20170831/psparse-550)
      
      acpi_get_bus_status already has code to avoid this, so by using it we
      also silence these errors from the initial _STA call.
      
      Note that in order for the acpi_get_bus_status handling for this to work,
      we initialize dep_unmet to 1 until acpi_device_dep_initialize gets called,
      this means that battery devices will be instantiated with an initial
      status of 0. This is not a problem, acpi_bus_attach will get called soon
      after the instantiation anyways and it will update the status as first
      point of order.
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      63347db0
  21. 21 11月, 2017 1 次提交
    • L
      ACPI / EC: Fix regression related to PM ops support in ECDT device · a64a62ce
      Lv Zheng 提交于
      On platforms (ASUS X550ZE and possibly all ASUS X series) with valid ECDT
      EC but invalid DSDT EC, EC PM ops won't be invoked as ECDT EC is not an
      ACPI device. Thus the following commit actually removed post-resume
      acpi_ec_enable_event() invocation for such platforms, and triggered a
      regression on them that after being resumed, EC (actually should be ECDT)
      driver stops handling EC events:
      
       Commit: c2b46d67
       Subject: ACPI / EC: Add PM operations to improve event handling for resume process
      
      Notice that the root cause actually is "ECDT is not an ACPI device" rather
      than "the timing of acpi_ec_enable_event() invocation", this patch fixes
      this issue by enumerating ECDT EC as an ACPI device. Due to the existence
      of the noirq stage, the ability of tuning the timing of
      acpi_ec_enable_event() invocation is still meaningful.
      
      This patch is a little bit different from the posted fix by moving
      acpi_config_boot_ec() from acpi_ec_ecdt_start() to acpi_ec_add() to make
      sure that EC event handling won't be stopped as long as the ACPI EC driver
      is bound. Thus the following sequence shouldn't disable EC event handling:
      unbind,suspend,resume,bind.
      
      Fixes: c2b46d67 (ACPI / EC: Add PM operations to improve event handling for resume process)
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=196847Reported-by: NLuya Tshimbalanga <luya@fedoraproject.org>
      Tested-by: NLuya Tshimbalanga <luya@fedoraproject.org>
      Cc: 4.9+ <stable@vger.kernel.org> # 4.9+
      Signed-off-by: NLv Zheng <lv.zheng@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      a64a62ce
  22. 20 10月, 2017 1 次提交
  23. 11 10月, 2017 1 次提交
    • S
      ACPI / LPIT: Add Low Power Idle Table (LPIT) support · eeb2d80d
      Srinivas Pandruvada 提交于
      Add functionality to read LPIT table, which provides:
      
       - Sysfs interface to read residency counters via
         /sys/devices/system/cpu/cpuidle/low_power_idle_cpu_residency_us
         /sys/devices/system/cpu/cpuidle/low_power_idle_system_residency_us
      
      Here the count "low_power_idle_cpu_residency_us" shows the time spent
      by CPU package in low power state.  This is read via MSR interface,
      which points to MSR for PKG C10.
      
      Here the count "low_power_idle_system_residency_us" show the count the
      system was in low power state. This is read via MMIO interface. This
      is mapped to SLP_S0 residency on modern Intel systems. This residency
      is achieved only when CPU is in PKG C10 and all functional blocks are
      in low power state.
      
      It is possible that none of the above counters present or anyone of the
      counter present or all counters present.
      
      For example: On my Kabylake system both of the above counters present.
      After suspend to idle these counts updated and prints:
      
       6916179
       6998564
      
      This counter can be read by tools like turbostat to display. Or it can
      be used to debug, if modern systems are reaching desired low power state.
      
       - Provides an interface to read residency counter memory address
      
         This address can be used to get the base address of PMC memory
         mapped IO.  This is utilized by intel_pmc_core driver to print
         more debug information.
      
      In addition, to avoid code duplication to read iomem, removed the read of
      iomem from acpi_os_read_memory() in osl.c and made a common function
      acpi_os_read_iomem(). This new function is used for reading iomem in
      in both osl.c and acpi_lpit.c.
      
      Link: http://www.uefi.org/sites/default/files/resources/Intel_ACPI_Low_Power_S0_Idle.pdfSigned-off-by: NSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      eeb2d80d
  24. 18 8月, 2017 2 次提交
  25. 07 8月, 2017 2 次提交
  26. 04 8月, 2017 1 次提交
  27. 22 7月, 2017 1 次提交
  28. 05 7月, 2017 1 次提交
    • L
      ACPI / scan: Indicate to platform when hot remove returns busy · d429e5c1
      Lee, Chun-Yi 提交于
      In hotplug logic, it always indicates non-specific failure to
      platform through _OST when handing ACPI hot-remove event failed. Then
      platform terminates the hot-remove process but it can not identify
      the reason.
      
      Base on current hot-remove code, there have two situations that it
      returns busy:
      
       - OSPM try to offline an individual device, but the device offline
         function returns "busy".
      
       - When the ejection event is applied to an "not offlined yet"
         container.  OSPM sends a kobject change event to userspace and
         returns "busy".
      
      Both of them will returns -EBUSY to ACPI device hotplug function.
      Then, the hotplug function indicates non-specific failure to platform
      just like for any other error, e.g. -ENODEV or -EIO.
      
      The benefit to the platform for identifying the OS "busy" state is
      that it can use a different approach to handle the "busy" instead of
      simply terminating the hot-remove operation for an unknown reason.
      For example, the platform can wait for a while and then re-trigger
      hot-remove.
      Signed-off-by: N"Lee, Chun-Yi" <jlee@suse.com>
      Reviewed-by: NAndy Shevchenko <andy.shevchenko@gmail.com>
      [ rjw: Changelog massage ]
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      d429e5c1
  29. 28 6月, 2017 1 次提交
    • R
      ACPI / PM: Drop run_wake from struct acpi_device_wakeup_flags · a1a66393
      Rafael J. Wysocki 提交于
      The run_wake flag in struct acpi_device_wakeup_flags stores the
      information on whether or not the device can generate wakeup
      signals at run time, but in ACPI that really is equivalent to
      being able to generate wakeup signals at all.
      
      In fact, run_wake will always be set after successful executeion of
      acpi_setup_gpe_for_wake(), but if that fails, the device will not be
      able to use a wakeup GPE at all, so it won't be able to wake up the
      systems from sleep states too.  Hence, run_wake actually means that
      the device is capable of triggering wakeup and so it is equivalent
      to the valid flag.
      
      For this reason, drop run_wake from struct acpi_device_wakeup_flags
      and make sure that the valid flag is only set if
      acpi_setup_gpe_for_wake() has been successful.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Acked-by: NBjorn Helgaas <bhelgaas@google.com>
      a1a66393
  30. 22 6月, 2017 3 次提交