1
0
Fork 0
Commit Graph

6928 Commits (285767604576148fc1be7fcd112e4a90eb0d6ad2)

Author SHA1 Message Date
Linus Torvalds 8450493076 * Stratix10 SDRAM support to altera_edac (Thor Thayer)
* the usual misc fixes all over the place
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEzv7L6UO9uDPlPSfHEsHwGGHeVUoFAlsVQ/cACgkQEsHwGGHe
 VUrrVA/+NHpCe0dT97Q4NHZejusOZvujNdOeAZVMNVcg5fwFmwwXkStazY+J/lmK
 Zjh2P/JGVoL9CPCn/ya+F6KSDJPLaq0AQCpogEhDqEZrRcutWu/CtH2XEbjyknME
 LCGfaKRBbi1zxCEm8qCk3ghWO3rXtM14jLkuqPVxtCsBT9HXcBAXU/ivok23Yb4r
 d/NcoeV5veqFzdPMxkYRJFN9Me4uVN+MzoN9hhxTYll5n0eWhb7Aw8Aon8VR6OH5
 LSJFmxFOlE7OPHQ0AjBRiF0Q9MyUSFTWvn+i4rhSq1z8SCPZyPkG2YRNVDWS6Py9
 cLXSNMnv6ybPBst9LUMXjN06DBsnzeWNcsFFPw5uunD9JRFuaoxUgk633BLWMy2z
 Tx4fiwOligx65Fc4udQ1n2Ho5HKZaTHlafYDatYt3jecx71BQywnMi1zuwMnF+Id
 iHW0J413h1P0UZfeTZHGfv+THQNb+IoVDjWdY2nNil45OR1QCBva+CQVKCcB8xox
 RCW6yL1S7V2dzd4255F/xpMrbkvxeAaOBWWJqEQeUdsFGP//6Ub9Gy0IKsSDrHQ6
 3BtoOxGmBKCBCpysN7OtUUvC28Dd9PQCkH+Bn3SAjySWnEiTEdv6QeLdScJrsz75
 lcF4d17EKt2VtdX6z15QAGT9LMbRR177pizea03XDeFwb+eR0cA=
 =yBvi
 -----END PGP SIGNATURE-----

Merge tag 'edac_for_4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp

Pull EDAC updates from Borislav Petkov:

 - Stratix10 SDRAM support to altera_edac (Thor Thayer)

 - the usual misc fixes all over the place

[ Also, shared branch for socfpga_stratix10.dtsi file changes with the
  socfpga tree ]

* tag 'edac_for_4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp:
  EDAC, ghes: Make platform-based whitelisting x86-only
  EDAC, altera: Fix ARM64 build warning
  EDAC, skx: Fix skx_edac build error when ACPI_NFIT=m
  EDAC, ghes: Use BIT() macro
  EDAC, ghes: Add DDR4 and NVDIMM memory types
  EDAC, altera: Handle SDRAM Uncorrectable Errors on Stratix10
  Documentation: dt: edac: Move Altera SOCFPGA EDAC file
  EDAC, altera: Add support for Stratix10 SDRAM EDAC
  Documentation: dt: socfpga: Add Stratix10 ECC Manager binding
  EDAC, ghes: Remove unused argument to ghes_edac_report_mem_error()
  arm64: dts: stratix10: add sdram ecc
  EDAC, i7core: Fix spelling mistake: "redundacy" -> "redundancy"
  EDAC, ghes: Add a null pointer check in ghes_edac_unregister()
  ghes, EDAC: Fix ghes_edac registration
  arm64: dts: stratix10: Change pad skew values for EMAC0 PHY driver
  ARM: dts: consistently use 'atmel' as at24 manufacturer in cyclone5
  arm64: dts: stratix10: Add PL330 DMAC to Stratix10 dts
  arm64: dts: stratix10: enable i2c, add i2c periperals
  arm64: dts: stratix10: use clock bindings for the Stratix10 platform
2018-06-06 15:36:13 -07:00
Linus Torvalds f4fe74cc90 ACPI updates for 4.18-rc1
These update the ACPICA code in the kernel to the 20180508 upstream
 revision and make it support the RT patch, add CPPC v3 support to the
 ACPI CPPC library, add a WDAT-based watchdog quirk to prevent clashes
 with the RTC, add quirks to the ACPI AC and battery drivers, and
 update the ACPI SoC drivers.
 
 Specifics:
 
  - Update the ACPICA code in the kernel to the 20180508 upstream
    revision including:
    * iASL -tc option enhancement (Bob Moore).
    * Debugger improvements (Bob Moore).
    * Support for tables larger than 1 MB in acpidump/acpixtract
      (Bob Moore).
    * Minor fixes and cleanups (Colin Ian King, Toomas Soome).
 
  - Make the ACPICA code in the kernel support the RT patch (Sebastian
    Andrzej Siewior, Steven Rostedt).
 
  - Add a kmemleak annotation to the ACPICA code (Larry Finger).
 
  - Add CPPC v3 support to the ACPI CPPC library and fix two issues
    related to CPPC (Prashanth Prakash, Al Stone).
 
  - Add an ACPI WDAT-based watchdog quirk to prefer iTCO_wdt on
    systems where WDAT clashes with the RTC SRAM (Mika Westerberg).
 
  - Add some quirks to the ACPI AC and battery drivers (Carlo Caione,
    Hans de Goede).
 
  - Update the ACPI SoC drivers for Intel (LPSS) and AMD (APD)
    platforms (Akshu Agrawal, Hans de Goede).
 
  - Fix up some assorted minor issues (Al Stone, Laszlo Toth,
    Mathieu Malaterre).
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABCAAGBQJbFR2IAAoJEILEb/54YlRxsEcP/0vxyGvTXUnHH13h1ayhbcEL
 qKA//1Zvw55mFb86nlnIVWUfpVx5pN4sOd2MZL2bDmNP8+ZX1QFbwtkpP8MtnRyX
 0pmPb2QpmHz/ZHutVg3rGxFOV4Sk0IPevQW7d4eu/Gc6K/UkfREMj10PWu9EoNWm
 6UCKuONxeoUAtE/OTfvU33ghpYgBH506Kg6/EwLLRX0tA10NBa11L9ijUEkVfa0s
 RDn5Z9ndjGGed4XtlSNkfabEJpc6uX9JvbAw77DKZgyqEZgQyNa4CZ2C1ZtH66lZ
 HCS62eJ6ePGUvzW/KTn825+MOGni5YisGlfonHuF9xHpPNSp7Doxmyny3lMYHL7S
 l0XdI2G7UIOFO5eaRM/zYQPQyF05lna28MVvTWJWBA3bcUz4rav9fzPKYp5l+To0
 xK1Ol84sowlkOKoi/RIcOx5nsh05SufGqNu9RuXjRZ4iK0bJPCD3YNt+tH95b94M
 0YOuoDkIylieVET4xgHB5vBOj8EgMOLtSaGSpEbh816i+BdZMx7YnS4xSmQ+JFjd
 rVCJMnXcLZ82j3pkvPpR0W3VLVbEJPjLftENjSVJ+vA9lR567byBFrvzTEmsEQoi
 KlNWh5qDmoR96dPheLdhD1HtsL070xLhyqYOUDvtqTiVH8uNxoWfQzcSfvXPvLqc
 XGCcG/oPP9FFpNZfLzAB
 =FAIF
 -----END PGP SIGNATURE-----

Merge tag 'acpi-4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI updates from Rafael Wysocki:
 "These update the ACPICA code in the kernel to the 20180508 upstream
  revision and make it support the RT patch, add CPPC v3 support to the
  ACPI CPPC library, add a WDAT-based watchdog quirk to prevent clashes
  with the RTC, add quirks to the ACPI AC and battery drivers, and
  update the ACPI SoC drivers.

  Specifics:

   - Update the ACPICA code in the kernel to the 20180508 upstream
     revision including:
       * iASL -tc option enhancement (Bob Moore).
       * Debugger improvements (Bob Moore).
       * Support for tables larger than 1 MB in acpidump/acpixtract (Bob
         Moore).
       * Minor fixes and cleanups (Colin Ian King, Toomas Soome).

   - Make the ACPICA code in the kernel support the RT patch (Sebastian
     Andrzej Siewior, Steven Rostedt).

   - Add a kmemleak annotation to the ACPICA code (Larry Finger).

   - Add CPPC v3 support to the ACPI CPPC library and fix two issues
     related to CPPC (Prashanth Prakash, Al Stone).

   - Add an ACPI WDAT-based watchdog quirk to prefer iTCO_wdt on systems
     where WDAT clashes with the RTC SRAM (Mika Westerberg).

   - Add some quirks to the ACPI AC and battery drivers (Carlo Caione,
     Hans de Goede).

   - Update the ACPI SoC drivers for Intel (LPSS) and AMD (APD)
     platforms (Akshu Agrawal, Hans de Goede).

   - Fix up some assorted minor issues (Al Stone, Laszlo Toth, Mathieu
     Malaterre)"

* tag 'acpi-4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (32 commits)
  ACPICA: Mark acpi_ut_create_internal_object_dbg() memory allocations as non-leaks
  ACPI / watchdog: Prefer iTCO_wdt always when WDAT table uses RTC SRAM
  mailbox: PCC: erroneous error message when parsing ACPI PCCT
  ACPICA: Update version to 20180508
  ACPICA: acpidump/acpixtract: Support for tables larger than 1MB
  ACPI: APD: Add AMD misc clock handler support
  clk: x86: Add ST oscout platform clock
  ACPICA: Update version to 20180427
  ACPICA: Debugger: Removed direct support for EC address space in "Test Objects"
  ACPICA: Debugger: Add Package support for "test objects" command
  ACPICA: Improve error messages for the namespace root node
  ACPICA: Fix potential infinite loop in acpi_rs_dump_byte_list
  ACPICA: vsnprintf: this statement may fall through
  ACPICA: Tables: Fix spelling mistake in comment
  ACPICA: iASL: Enhance the -tc option (create AML hex file in C)
  ACPI: Add missing prototype_for arch_post_acpi_subsys_init()
  ACPI / tables: improve comments regarding acpi_parse_entries_array()
  ACPICA: Convert acpi_gbl_hardware lock back to an acpi_raw_spinlock
  ACPICA: provide abstraction for raw_spinlock_t
  ACPI / CPPC: Fix invalid PCC channel status errors
  ...
2018-06-05 10:08:27 -07:00
Linus Torvalds 3c89adb0d1 Power management updates for 4.18-rc1
These include a significant update of the generic power domains (genpd)
 and Operating Performance Points (OPP) frameworks, mostly related to
 the introduction of power domain performance levels, cpufreq updates
 (new driver for Qualcomm Kryo processors, updates of the existing
 drivers, some core fixes, schedutil governor improvements), PCI power
 management fixes, ACPI workaround for EC-based wakeup events handling
 on resume from suspend-to-idle, and major updates of the turbostat
 and pm-graph utilities.
 
 Specifics:
 
  - Introduce power domain performance levels into the the generic
    power domains (genpd) and Operating Performance Points (OPP)
    frameworks (Viresh Kumar, Rajendra Nayak, Dan Carpenter).
 
  - Fix two issues in the runtime PM framework related to the
    initialization and removal of devices using device links (Ulf
    Hansson).
 
  - Clean up the initialization of drivers for devices in PM domains
    (Ulf Hansson, Geert Uytterhoeven).
 
  - Fix a cpufreq core issue related to the policy sysfs interface
    causing CPU online to fail for CPUs sharing one cpufreq policy in
    some situations (Tao Wang).
 
  - Make it possible to use platform-specific suspend/resume hooks
    in the cpufreq-dt driver and make the Armada 37xx DVFS use that
    feature (Viresh Kumar, Miquel Raynal).
 
  - Optimize policy transition notifications in cpufreq (Viresh Kumar).
 
  - Improve the iowait boost mechanism in the schedutil cpufreq
    governor (Patrick Bellasi).
 
  - Improve the handling of deferred frequency updates in the
    schedutil cpufreq governor (Joel Fernandes, Dietmar Eggemann,
    Rafael Wysocki, Viresh Kumar).
 
  - Add a new cpufreq driver for Qualcomm Kryo (Ilia Lin).
 
  - Fix and clean up some cpufreq drivers (Colin Ian King, Dmitry
    Osipenko, Doug Smythies, Luc Van Oostenryck, Simon Horman,
    Viresh Kumar).
 
  - Fix the handling of PCI devices with the DPM_SMART_SUSPEND flag
    set and update stale comments in the PCI core PM code (Rafael
    Wysocki).
 
  - Work around an issue related to the handling of EC-based wakeup
    events in the ACPI PM core during resume from suspend-to-idle if
    the EC has been put into the low-power mode (Rafael Wysocki).
 
  - Improve the handling of wakeup source objects in the PM core (Doug
    Berger, Mahendran Ganesh, Rafael Wysocki).
 
  - Update the driver core to prevent deferred probe from breaking
    suspend/resume ordering (Feng Kan).
 
  - Clean up the PM core somewhat (Bjorn Helgaas, Ulf Hansson, Rafael
    Wysocki).
 
  - Make the core suspend/resume code and cpufreq support the RT patch
    (Sebastian Andrzej Siewior, Thomas Gleixner).
 
  - Consolidate the PM QoS handling in cpuidle governors (Rafael
    Wysocki).
 
  - Fix a possible crash in the hibernation core (Tetsuo Handa).
 
  - Update the rockchip-io Adaptive Voltage Scaling (AVS) driver
    (David Wu).
 
  - Update the turbostat utility (fixes, cleanups, new CPU IDs, new
    command line options, built-in "Low Power Idle" counters support,
    new POLL and POLL% columns) and add an entry for it to MAINTAINERS
    (Len Brown, Artem Bityutskiy, Chen Yu, Laura Abbott, Matt Turner,
    Prarit Bhargava, Srinivas Pandruvada).
 
  - Update the pm-graph to version 5.1 (Todd Brandt).
 
  - Update the intel_pstate_tracer utility (Doug Smythies).
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABCAAGBQJbFRzjAAoJEILEb/54YlRxREQQAKD7IjnLA86ZDkmwiwzFa9Cz
 OJ0qlKAcMZGjeWH6LYq7lqWtaJ5PcFkBwNB4sRyKFdGPQOX3Ph8ZzILm2j8hhma4
 Azn9632P6CoYHABa8Vof+A1BZ/j0aWtvtJEfqXhtF6rAYyWQlF0UmOIRsMs+54a+
 Z/w4WuLaX8qYq3JlR60TogNtTIbdUjkjfvxMGrE9OSQ8n4oEhqoF/v0WoTHYLpWw
 fu81M378axOu0Sgq1ZQ8GPUdblUqIO97iWwF7k2YUl7D9n5dm4wOhXDz3CLI8Cdb
 RkoFFdp8bJIthbc5desKY2XFU1ClY8lxEVMXewFzTGwWMw0OyWgQP0/ZiG+Mujq3
 CSbstg8GGpbwQoWU+VrluYa0FtqofV2UaGk1gOuPaojMqaIchRU4Nmbd2U6naNwp
 XN7A1DzrOVGEt0ny8ztKH2Oqmj+NOCcRsChlYzdhLQ1wlqG54iCGwAML2ZJF9/Nw
 0Sx8hm6eyWLzjSa0L384Msb+v5oqCoac66gPHCl2x7W+3F+jmqx1KbmkI2SRNUAL
 7CS9lcImpvC4uZB54Aqya104vfqHiDse7WP0GrKqOmNVucD7hYCPiq/pycLwez+b
 V3zLyvly8PsuBIa4AOQGGiK45HGpaKuB4TkRqRyFO0Fb5uL1M+Ld6kJiWlacl4az
 STEUjY/90SRQvX3ocGyB
 =wqBV
 -----END PGP SIGNATURE-----

Merge tag 'pm-4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull power management updates from Rafael Wysocki:
 "These include a significant update of the generic power domains
  (genpd) and Operating Performance Points (OPP) frameworks, mostly
  related to the introduction of power domain performance levels,
  cpufreq updates (new driver for Qualcomm Kryo processors, updates of
  the existing drivers, some core fixes, schedutil governor
  improvements), PCI power management fixes, ACPI workaround for
  EC-based wakeup events handling on resume from suspend-to-idle, and
  major updates of the turbostat and pm-graph utilities.

  Specifics:

   - Introduce power domain performance levels into the the generic
     power domains (genpd) and Operating Performance Points (OPP)
     frameworks (Viresh Kumar, Rajendra Nayak, Dan Carpenter).

   - Fix two issues in the runtime PM framework related to the
     initialization and removal of devices using device links (Ulf
     Hansson).

   - Clean up the initialization of drivers for devices in PM domains
     (Ulf Hansson, Geert Uytterhoeven).

   - Fix a cpufreq core issue related to the policy sysfs interface
     causing CPU online to fail for CPUs sharing one cpufreq policy in
     some situations (Tao Wang).

   - Make it possible to use platform-specific suspend/resume hooks in
     the cpufreq-dt driver and make the Armada 37xx DVFS use that
     feature (Viresh Kumar, Miquel Raynal).

   - Optimize policy transition notifications in cpufreq (Viresh Kumar).

   - Improve the iowait boost mechanism in the schedutil cpufreq
     governor (Patrick Bellasi).

   - Improve the handling of deferred frequency updates in the schedutil
     cpufreq governor (Joel Fernandes, Dietmar Eggemann, Rafael Wysocki,
     Viresh Kumar).

   - Add a new cpufreq driver for Qualcomm Kryo (Ilia Lin).

   - Fix and clean up some cpufreq drivers (Colin Ian King, Dmitry
     Osipenko, Doug Smythies, Luc Van Oostenryck, Simon Horman, Viresh
     Kumar).

   - Fix the handling of PCI devices with the DPM_SMART_SUSPEND flag set
     and update stale comments in the PCI core PM code (Rafael Wysocki).

   - Work around an issue related to the handling of EC-based wakeup
     events in the ACPI PM core during resume from suspend-to-idle if
     the EC has been put into the low-power mode (Rafael Wysocki).

   - Improve the handling of wakeup source objects in the PM core (Doug
     Berger, Mahendran Ganesh, Rafael Wysocki).

   - Update the driver core to prevent deferred probe from breaking
     suspend/resume ordering (Feng Kan).

   - Clean up the PM core somewhat (Bjorn Helgaas, Ulf Hansson, Rafael
     Wysocki).

   - Make the core suspend/resume code and cpufreq support the RT patch
     (Sebastian Andrzej Siewior, Thomas Gleixner).

   - Consolidate the PM QoS handling in cpuidle governors (Rafael
     Wysocki).

   - Fix a possible crash in the hibernation core (Tetsuo Handa).

   - Update the rockchip-io Adaptive Voltage Scaling (AVS) driver (David
     Wu).

   - Update the turbostat utility (fixes, cleanups, new CPU IDs, new
     command line options, built-in "Low Power Idle" counters support,
     new POLL and POLL% columns) and add an entry for it to MAINTAINERS
     (Len Brown, Artem Bityutskiy, Chen Yu, Laura Abbott, Matt Turner,
     Prarit Bhargava, Srinivas Pandruvada).

   - Update the pm-graph to version 5.1 (Todd Brandt).

   - Update the intel_pstate_tracer utility (Doug Smythies)"

* tag 'pm-4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (128 commits)
  tools/power turbostat: update version number
  tools/power turbostat: Add Node in output
  tools/power turbostat: add node information into turbostat calculations
  tools/power turbostat: remove num_ from cpu_topology struct
  tools/power turbostat: rename num_cores_per_pkg to num_cores_per_node
  tools/power turbostat: track thread ID in cpu_topology
  tools/power turbostat: Calculate additional node information for a package
  tools/power turbostat: Fix node and siblings lookup data
  tools/power turbostat: set max_num_cpus equal to the cpumask length
  tools/power turbostat: if --num_iterations, print for specific number of iterations
  tools/power turbostat: Add Cannon Lake support
  tools/power turbostat: delete duplicate #defines
  x86: msr-index.h: Correct SNB_C1/C3_AUTO_UNDEMOTE defines
  tools/power turbostat: Correct SNB_C1/C3_AUTO_UNDEMOTE defines
  tools/power turbostat: add POLL and POLL% column
  tools/power turbostat: Fix --hide Pk%pc10
  tools/power turbostat: Build-in "Low Power Idle" counters support
  tools/power turbostat: Don't make man pages executable
  tools/power turbostat: remove blank lines
  tools/power turbostat: a small C-states dump readability immprovement
  ...
2018-06-05 09:38:39 -07:00
Linus Torvalds cf626b0da7 Merge branch 'hch.procfs' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull procfs updates from Al Viro:
 "Christoph's proc_create_... cleanups series"

* 'hch.procfs' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (44 commits)
  xfs, proc: hide unused xfs procfs helpers
  isdn/gigaset: add back gigaset_procinfo assignment
  proc: update SIZEOF_PDE_INLINE_NAME for the new pde fields
  tty: replace ->proc_fops with ->proc_show
  ide: replace ->proc_fops with ->proc_show
  ide: remove ide_driver_proc_write
  isdn: replace ->proc_fops with ->proc_show
  atm: switch to proc_create_seq_private
  atm: simplify procfs code
  bluetooth: switch to proc_create_seq_data
  netfilter/x_tables: switch to proc_create_seq_private
  netfilter/xt_hashlimit: switch to proc_create_{seq,single}_data
  neigh: switch to proc_create_seq_data
  hostap: switch to proc_create_{seq,single}_data
  bonding: switch to proc_create_seq_data
  rtc/proc: switch to proc_create_single_data
  drbd: switch to proc_create_single
  resource: switch to proc_create_seq_data
  staging/rtl8192u: simplify procfs code
  jfs: simplify procfs code
  ...
2018-06-04 10:00:01 -07:00
Rafael J. Wysocki 2448d1399b Merge branches 'acpi-soc' and 'acpi-tables'
* acpi-soc:
  ACPI: APD: Add AMD misc clock handler support
  clk: x86: Add ST oscout platform clock
  ACPI / LPSS: Only call pwm_add_table() for Bay Trail PWM if PMIC HRV is 2

* acpi-tables:
  ACPI / tables: improve comments regarding acpi_parse_entries_array()
2018-06-04 10:43:52 +02:00
Rafael J. Wysocki 6c128e798f Merge branches 'acpi-cppc', 'acpi-misc', 'acpi-battery' and 'acpi-ac'
* acpi-cppc:
  mailbox: PCC: erroneous error message when parsing ACPI PCCT
  ACPI / CPPC: Fix invalid PCC channel status errors
  ACPI / CPPC: Document CPPC sysfs interface
  cpufreq / CPPC: Support for CPPC v3
  ACPI / CPPC: Check for valid PCC subspace only if PCC is used
  ACPI / CPPC: Add support for CPPC v3

* acpi-misc:
  ACPI: Add missing prototype_for arch_post_acpi_subsys_init()
  ACPI: add missing newline to printk

* acpi-battery:
  ACPI / battery: Add quirk to avoid checking for PMIC with native driver
  ACPI / battery: Ignore AC state in handle_discharging on systems where it is broken
  ACPI / battery: Add handling for devices which wrongly report discharging state
  ACPI / battery: Remove initializer for unused ident dmi_system_id
  ACPI / AC: Remove initializer for unused ident dmi_system_id

* acpi-ac:
  ACPI / AC: Add quirk to avoid checking for PMIC with native driver
2018-06-04 10:43:34 +02:00
Rafael J. Wysocki ba609f7f21 Merge branch 'acpica'
* acpica:
  ACPICA: Mark acpi_ut_create_internal_object_dbg() memory allocations as non-leaks
  ACPICA: Update version to 20180508
  ACPICA: acpidump/acpixtract: Support for tables larger than 1MB
  ACPICA: Update version to 20180427
  ACPICA: Debugger: Removed direct support for EC address space in "Test Objects"
  ACPICA: Debugger: Add Package support for "test objects" command
  ACPICA: Improve error messages for the namespace root node
  ACPICA: Fix potential infinite loop in acpi_rs_dump_byte_list
  ACPICA: vsnprintf: this statement may fall through
  ACPICA: Tables: Fix spelling mistake in comment
  ACPICA: iASL: Enhance the -tc option (create AML hex file in C)
  ACPICA: Convert acpi_gbl_hardware lock back to an acpi_raw_spinlock
  ACPICA: provide abstraction for raw_spinlock_t
2018-06-04 10:43:12 +02:00
Rafael J. Wysocki a24e16b131 Merge branches 'pm-pci', 'acpi-pm', 'pm-sleep' and 'pm-avs'
* pm-pci:
  PCI / PM: Clean up outdated comments in pci_target_state()
  PCI / PM: Do not clear state_saved for devices that remain suspended

* acpi-pm:
  ACPI: EC: Dispatch the EC GPE directly on s2idle wake
  ACPICA: Introduce acpi_dispatch_gpe()

* pm-sleep:
  PM / hibernate: Fix oops at snapshot_write()
  PM / wakeup: Make s2idle_lock a RAW_SPINLOCK
  PM / s2idle: Make s2idle_wait_head swait based
  PM / wakeup: Make events_lock a RAW_SPINLOCK
  PM / suspend: Prevent might sleep splats

* pm-avs:
  PM / AVS: rockchip-io: add io selectors and supplies for PX30
2018-06-04 10:41:53 +02:00
Rafael J. Wysocki 5b550c92d7 Merge branch 'pm-domains'
* pm-domains:
  PM / domains: Improve wording of dev_pm_domain_attach() comment
  PM / Domains: Don't return -EEXIST at attach when PM domain exists
  spi: Respect all error codes from dev_pm_domain_attach()
  soundwire: Respect all error codes from dev_pm_domain_attach()
  mmc: sdio: Respect all error codes from dev_pm_domain_attach()
  i2c: Respect all error codes from dev_pm_domain_attach()
  driver core: Respect all error codes from dev_pm_domain_attach()
  amba: Respect all error codes from dev_pm_domain_attach()
  PM / Domains: Allow a better error handling of dev_pm_domain_attach()
  PM / Domains: Check for existing PM domain in dev_pm_domain_attach()
  PM / Domains: Drop redundant code in genpd while attaching devices
  PM / Domains: Drop comment in genpd about legacy Samsung DT binding
  PM / Domains: Fix error path during attach in genpd
2018-06-04 10:40:33 +02:00
Larry Finger 087ec15606 ACPICA: Mark acpi_ut_create_internal_object_dbg() memory allocations as non-leaks
In kernel 4.17.0-rcX, kmemleak reports 9 leaks with tracebacks similar to
the following:

unreferenced object 0xffff880224a077e0 (size 72):
  comm "swapper/0", pid 1, jiffies 4294892358 (age 1022.636s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 0e 01 01 00 00 00 00 01  ................
    00 00 00 80 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<000000004f506615>] acpi_ut_create_internal_object_dbg+0x4d/0x10e
    [<000000006e7730e3>] acpi_ds_build_internal_object+0xed/0x1cd
    [<00000000272b7c73>] acpi_ds_build_internal_package_obj+0x245/0x3a2
    [<000000000b64c50e>] acpi_ds_eval_data_object_operands+0x17b/0x21b
    [<00000000589647ac>] acpi_ds_exec_end_op+0x433/0x6c1
    [<000000001d69bcbf>] acpi_ps_parse_loop+0x926/0x9be
    [<000000005d6fa97d>] acpi_ps_parse_aml+0x1a2/0x4af
    [<00000000c4bef823>] acpi_ps_execute_table+0xbb/0x119
    [<00000000fd9632e4>] acpi_ns_execute_table+0x20c/0x260
    [<00000000e6ae17ac>] acpi_ns_parse_table+0x7d/0x1b3
    [<0000000008e1e148>] acpi_ns_load_table+0x8d/0x1c0
    [<000000009fc8346f>] acpi_tb_load_namespace+0x176/0x278
    [<0000000073f98b3b>] acpi_load_tables+0x6e/0xfd
    [<00000000d2ef13d2>] acpi_init+0x8c/0x340
    [<000000007da19d8d>] do_one_initcall+0x46/0x1fa
    [<0000000024681a1d>] kernel_init_freeable+0x1a2/0x237

According to gdb, the offending code is
              object =
                  acpi_ut_allocate_object_desc_dbg(module_name, line_number,
                                                   component_id);

As it is not possible to unload the ACPI code to test that this is a real
leak and not a false positive, and that only these 9 appear no matter how
long the system is up, a kmemleak_not_leak(object) call is inserted.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-05-27 12:23:03 +02:00
Rafael J. Wysocki 68e2201185 ACPI: EC: Dispatch the EC GPE directly on s2idle wake
On platforms where the Low Power S0 Idle _DSM interface is used,
on wakeup from suspend-to-idle, when it is known that the ACPI SCI
has triggered while suspended, dispatch the EC GPE in order to catch
all EC events that may have triggered the wakeup before carrying out
the noirq phase of device resume.

That is needed to handle power button wakeup on some platforms where
the EC goes into a low-power mode during suspend-to-idle and while in
that mode it will discard events after a timeout.  If that timeout is
shorter than the time it takes to complete the noirq resume of
devices, looking for EC events after the latter is too late.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reported-by: Zhang Rui <rui.zhang@intel.com>
Tested-by: Wendy Wang <wendy.wang@intel.com>
2018-05-25 10:32:13 +02:00
Rafael J. Wysocki 745364533e ACPICA: Introduce acpi_dispatch_gpe()
Introduce acpi_dispatch_gpe() as a wrapper around acpi_ev_detect_gpe()
for checking if the given GPE (as represented by a GPE device handle
and a GPE number) is currently active and dispatching it (if that's
the case) outside of interrupt context.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-05-25 10:30:35 +02:00
Mika Westerberg 5a802a7a28 ACPI / watchdog: Prefer iTCO_wdt always when WDAT table uses RTC SRAM
After we added quirk for Lenovo Z50-70 it turns out there are at least
two more systems where WDAT table includes instructions accessing RTC
SRAM. Instead of quirking each system separately, look for such
instructions in the table and automatically prefer iTCO_wdt if found.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=199033
Reported-by: Arnold Guy <aurnoldg@gmail.com>
Reported-by: Alois Nespor <nespor@fssp.cz>
Reported-by: Yury Pakin <zxwarior@gmail.com>
Reported-by: Ihor Chyhin <ihorchyhin@ukr.net>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-05-24 10:52:49 +02:00
Bob Moore 57b758ca4e ACPICA: acpidump/acpixtract: Support for tables larger than 1MB
acpidump: Expand the table offset field to 32 bits.
acpixtract: Add support to handle the expanded field.

Backwards compatibility is maintained.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-05-18 09:19:26 +02:00
Akshu Agrawal 3f4ba94e36 ACPI: APD: Add AMD misc clock handler support
AMD SoC exposes clock for general purpose use. The clock registration
is done in clk-st driver. The MMIO mapping are passed on to the
clock driver for accessing the registers.
The misc clock handler will create MMIO mappings to access the
clock registers and enable the clock driver to expose the clock
for use of drivers which will connect to it.

Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-05-17 12:44:06 +02:00
Christoph Hellwig e7b087fc6b acpi/battery: simplify procfs code
Use remove_proc_subtree to remove the whole subtree on cleanup, and
unwind the registration loop into individual calls.  Switch to use
proc_create_seq where applicable.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-05-16 07:24:30 +02:00
Christoph Hellwig 3f3942aca6 proc: introduce proc_create_single{,_data}
Variants of proc_create{,_data} that directly take a seq_file show
callback and drastically reduces the boilerplate code in the callers.

All trivial callers converted over.

Signed-off-by: Christoph Hellwig <hch@lst.de>
2018-05-16 07:23:35 +02:00
Bob Moore c6ba26e967 ACPICA: Debugger: Removed direct support for EC address space in "Test Objects"
None of the address spaces that require a communication protocol
are supported by the "Test Objects" command.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-05-15 10:16:10 +02:00
Bob Moore db2e11a7c2 ACPICA: Debugger: Add Package support for "test objects" command
This was missing in the initial implementation of "test objects".

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-05-15 10:16:10 +02:00
Bob Moore 4032cc3e51 ACPICA: Improve error messages for the namespace root node
Replace "\___" with actual descriptive text.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-05-15 10:16:10 +02:00
Colin Ian King 9df758d96d ACPICA: Fix potential infinite loop in acpi_rs_dump_byte_list
There is a potenial infinite loop if acpi_rs_dump_byte_list is
called with a Length greater than 255 since the current loop
counter is just a u8 and will wrap to zero and never reach
the desired value in Length.  Fix this by making the loop
counter the size type as Length.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-05-15 10:16:10 +02:00
Toomas Soome 0e8f62ebf4 ACPICA: vsnprintf: this statement may fall through
[rjw:] Add an explicit switch () statement fall-through marker.

Signed-off-by: Toomas Soome <tsoome@me.com>
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-05-15 10:16:10 +02:00
Colin Ian King c2fa79b8c5 ACPICA: Tables: Fix spelling mistake in comment
The spelling of "sucessfully" should be "successfully", fix this

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-05-15 10:16:10 +02:00
Bob Moore 83b2fa943b ACPICA: iASL: Enhance the -tc option (create AML hex file in C)
This change improves the -tc option by:
 1) Creates a unique symbol for the hex table, to simplify
    creation of multiple tables (DSDT/SSDT).
 2) Adds a protection #ifdef, similar to a .h file.

With assistance from:
 Sami Mujawar, sami.mujawar@arm.com
 Evan Lloyd, evan.lloyd@arm.com

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-05-15 10:16:10 +02:00
Rafael J. Wysocki e637d32641 Merge back earlier ACPICA material for v4.18. 2018-05-15 10:10:15 +02:00
Ulf Hansson 919b7308fc PM / Domains: Allow a better error handling of dev_pm_domain_attach()
The callers of dev_pm_domain_attach() currently checks the returned error
code for -EPROBE_DEFER and needs to ignore other error codes. This is an
unnecessary limitation, which also leads to a rather strange behaviour in
the error path.

Address this limitation, by changing the return codes from
acpi_dev_pm_attach() and genpd_dev_pm_attach(). More precisely, let them
return 0, when no PM domain is needed for the device and then return 1, in
case the device was successfully attached to its PM domain. In this way,
dev_pm_domain_attach(), gets a better understanding of what happens in the
attach attempts and also allowing its caller to better act on real errors
codes.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-05-14 22:58:44 +02:00
Ulf Hansson 4f688748c9 PM / Domains: Check for existing PM domain in dev_pm_domain_attach()
Instead of checking if an existing PM domain pointer has been assigned in
genpd_dev_pm_attach() and acpi_dev_pm_attach(), move the check to the
common path in dev_pm_domain_attach(), thus potentially avoid one
unnecessary check.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-05-14 22:58:44 +02:00
Bob Moore 7b34c0fb1b ACPICA: Add deferred package support for the Load and loadTable operators
Completes the support and fixes a regression introduced in
version 20180209.

The regression caused package objects that were loaded by the Load and
loadTable operators. This created an error message like the following:

[    0.251922] ACPI Error: No pointer back to namespace node in package
00000000fd2a44cd (20180313/dsargs-303)

Link: https://bugzilla.kernel.org/show_bug.cgi?id=199413
Fixes: 5a8361f7ec (ACPICA: Integrate package handling with module-level code)
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-05-14 22:25:45 +02:00
Al Stone 904aaf8050 ACPI / tables: improve comments regarding acpi_parse_entries_array()
I found the description of the table_size argument to the function
acpi_parse_entries_array() unclear and ambiguous.  This is a minor
documentation change to improve that description so I don't misuse
the argument again in the future, and it is hopefully clearer to
other future users.

Signed-off-by: Al Stone <ahs3@redhat.com>
[ rjw: Subject ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-05-12 13:53:46 +02:00
Alexandru Gagniuc 305d0e006a EDAC, ghes: Remove unused argument to ghes_edac_report_mem_error()
The use of the @ghes argument was removed in a previous commit, but
function signature was not updated to reflect this.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Acked-by: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: linux-acpi@vger.kernel.org
Cc: linux-edac <linux-edac@vger.kernel.org>
Link: http://lkml.kernel.org/r/20180430213358.8319-1-mr.nuke.me@gmail.com
Signed-off-by: Borislav Petkov <bp@suse.de>
2018-05-12 10:59:15 +02:00
Steven Rostedt c57c0ad4a3 ACPICA: Convert acpi_gbl_hardware lock back to an acpi_raw_spinlock
We hit the following bug with -RT:

|BUG: scheduling while atomic: swapper/7/0/0x00000002
|Pid: 0, comm: swapper/7 Not tainted 3.6.11-rt28.19.el6rt.x86_64.debug #1
|Call Trace:
|  rt_spin_lock+0x16/0x40
|  __schedule_bug+0x67/0x90
|  __schedule+0x793/0x7a0
|  acpi_os_acquire_lock+0x1f/0x23
|  acpi_write_bit_register+0x33/0xb0
|  rt_spin_lock_slowlock+0xe5/0x2f0
|  acpi_idle_enter_bm+0x8a/0x28e
…
As the acpi code disables interrupts in acpi_idle_enter_bm, and calls
code that grabs the acpi lock, it causes issues as the lock is currently
in RT a sleeping lock.

The lock was converted from a raw to a sleeping lock due to some
previous issues, and tests that showed it didn't seem to matter.
Unfortunately, it did matter for one of our boxes.

This patch converts the lock back to a raw lock. I've run this code on a
few of my own machines, one being my laptop that uses the acpi quite
extensively. I've been able to suspend and resume without issues.

[ tglx: Made the change exclusive for acpi_gbl_hardware_lock ]

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/1360765565.23152.5.camel@gandalf.local.home
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
[bigeasy: shorten the backtrace, use the type acpi_raw_spinlock incl.
 accessor]
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-05-10 17:18:45 +02:00
Prakash, Prashanth 58e1c03536 ACPI / CPPC: Fix invalid PCC channel status errors
Replace the faulty PCC status register polling code with a iopoll.h
macro to fix incorrect reporting of PCC check errors ("PCC check
channel failed").

There were potential codepaths where we could incorrectly return
PCC channel status as busy even without checking the PCC status
register once or not checking the status register before breaking
out of the polling loop. For example, if the thread polling PCC
status register was preempted and scheduled back after we have
crossed the deadline then we can report that the channel is busy
even without checking the status register.

Signed-off-by: Prashanth Prakash <pprakash@codeaurora.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-05-10 17:16:22 +02:00
Carlo Caione 91ea5b1dd3 ACPI / AC: Add quirk to avoid checking for PMIC with native driver
With commit af3ec837b8 (ACPI / AC: Add a blacklist with PMIC ACPI HIDs
with a native charger driver) a blacklist was introduced to avoid using
the ACPI drivers for AC when a native PMIC driver was already present.
While this is in general a good idea (because of broken DSDT or proprietary
and undocumented ACPI opregions for the ACPI AC devices) there are some
Cherry Trail devices which use a separate charger controller despite the
AXP288 having a builtin charger.

The net effect of blacklisting the ACPI drivers is that on these devices
the AC reporting is broken since the AXP288 PMIC charger bits are not
actually used on this hardware.

This commit adds an ac_do_not_check_pmic quirk for this and sets this on
the 2 devices currently known to use a separate FG controller,
the ECS EF20EA and the Lenovo Ideapad Miix 320.

[hdegoede@redhat.com: Merge the quirk handling and the adding of the DMI
 table entry into 1 commit, add a second DMI entry for the Miix 320.]

Signed-off-by: Carlo Caione <carlo@endlessm.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-05-10 17:12:39 +02:00
Carlo Caione ec625a37c1 ACPI / battery: Add quirk to avoid checking for PMIC with native driver
With commit dccfae6d4f (ACPI / battery: Add a blacklist with PMIC ACPI
HIDs with a native battery driver) a blacklist was introduced to avoid
using the ACPI drivers for the battery when a native PMIC driver was
already present. While this is in general a good idea (because of broken
DSDT or proprietary and undocumented ACPI opregions for the ACPI battery
devices) there are some Cherry Trail devices which use a separate FG
controller despite the AXP288 having a builtin FG.

The net effect of blacklisting the ACPI drivers is that on these devices
the battery reporting is broken since the AXP288 PMIC FG bits are not
actually used on this hardware.

This commit adds a battery_do_not_check_pmic quirk for this and sets
this on the 2 devices currently known to use a separate FG controller,
the ECS EF20EA and the Lenovo Ideapad Miix 320.

[hdegoede@redhat.com: Merge the quirk handling and the adding of the DMI
 table entry into 1 commit, add a second DMI entry for the Miix 320.]

Signed-off-by: Carlo Caione <carlo@endlessm.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-05-10 16:59:48 +02:00
Hans de Goede c975e472ec ACPI / LPSS: Only call pwm_add_table() for Bay Trail PWM if PMIC HRV is 2
The Point of View mobii wintab p800w Bay Trail tablet comes with a Crystal
Cove PMIC, yet uses the LPSS PWM for backlight control, rather then the
Crystal Cove's PWM, so we need to call pwm_add_table() to add a
pwm_backlight mapping for the LPSS pwm despite there being an INT33FD
ACPI device present.

On all Bay Trail devices the _HRV object of the INT33FD ACPI device
will normally return 2, to indicate the Bay Trail variant of the CRC
PMIC is present, except on this tablet where _HRV is 0xffff. I guess this
is a hack to make the windows Crystal Cove PWM driver not bind.

Out of the 44 DSTDs with an INT33FD device in there which I have (from
different model devices) only the pov mobii wintab p800w uses 0xffff for
the HRV.

The byt_pwm_setup code calls acpi_dev_present to check for the presence
of a INT33FD ACPI device which indicates that a CRC PMIC is present and
if the INT33FD ACPI device is present then byt_pwm_setup will not add
a pwm_backlight mapping for the LPSS pwm, so that the CRC PWM will get
used instead.

acpi_dev_present has a hrv parameter, this commit make us pass 2 instead
of -1, so that things still match on normal tablets, but on this special
case with its _HRV of 0xffff, the check will now fail so that the
pwm_backlight mapping for the LPSS pwm gets added fixing backlight
brightness control on this device.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-05-10 16:54:40 +02:00
Borislav Petkov cc7f3f1326 ghes, EDAC: Fix ghes_edac registration
Tony reported seeing

  "Internal error: Can't find EDAC structure"

when injecting correctable errors due to the fact that ghes_edac would
still load even if the whitelist won't hit. Drop the pr_err() in
ghes_edac_report_mem_error() for now due to the hacky way how ghes_edac
depends on ghes.c.

While at it, make ghes_edac_register() return an error if it doesn't hit
in the whitelist as it is the only sensible thing to do in that
situation.

Furthermore, move the call to it to happen last in ghes_probe() so that
GHES initializing properly does not depend on ghes_edac init at all
as latter is only reporting errors and not required for GHES's proper
functioning.

Reviewed-by: Toshi Kani <toshi.kani@hpe.com>
Tested-by: Sughosh Ganu <sughosh.ganu@arm.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Tony Luck <tony.luck@intel.com>
Link: https://lkml.kernel.org/r/20180420182015.zao3olss4tvvlxki@agluck-desk
2018-05-02 13:57:30 +02:00
Hans de Goede 1b799c5cf0 ACPI / battery: Ignore AC state in handle_discharging on systems where it is broken
On some devices the "AC" interface ACPI AML code uses the exact same broken
logic which is causing the battery code to wrongly report discharging to
determine the "AC" state. Specifically the ACPI AML code is checking the
charging status bits of the charger-IC rather then the vbus present or
power-good status bits.

This makes our workaround for devices which wrongly report discharging when
plugged into AC while the charge is above the start charging threshold not
work on these devices.

This commit adds a battery_ac_is_broken flag and when that is set it skips
the power_supply_is_system_supplied() check in the workaround fixing this.

This flag gets set by a DMI quirk selected by systems where we know the AC
AML code is broken in this way *and* the rate_now value can be trusted.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-05-02 13:06:59 +02:00
Hans de Goede 19fffc8450 ACPI / battery: Add handling for devices which wrongly report discharging state
On quite a few devices the battery code in the ACPI tables is buggy and
first checks the charging status bits of the charger-IC, and if those
report not charging it will report discharging, without looking at the
presence of AC power or at the battery dis(charge) current from the
fuel-gauge.

This causes the wrong status to be reported for the battery in the
following quite common scenario:

1) Plug in charger while battery is say half full, battery starts
charging, charging state bits indicate: pre-charge or fast-charge,
ACPI reported battery status is ok

2) When fully charged charging state bits indicate: end-of-charge,
ACPI reported battery status is ok

3) unplug the charger, wait 1 minute, replug. Now the battery voltage is
still above the start-charging threshold, so the charger will not start
charging to avoid wrecking the battery by repeatedly recharging the last 1%
capacity. The charger IC charging state bits now are all 0 (not-charging)
and the broken ACPI code wrongly translate this to "discharging" and ends
up setting the ACPI_BATTERY_STATE_DISCHARGING bit in its state field.

Reporting this "not charging" state as discharging is confusing for users,
making the user think his adapter/power-brick is broken or not properly
plugged in.

This commit adds a helper for handling the ACPI_BATTERY_STATE_DISCHARGING
state. This helper checks if we're an AC and the current going out of the
battery is 0 and in that case reports a status of "not charging" to
userspace rather then "discharging".

This replaces commit c68f0676ef ("ACPI / battery: Add quirk for Asus
GL502VSK and UX305LA"), a previous fix for this which was reverted.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Daniel Drake <drake@endlessm.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-05-02 13:06:59 +02:00
Hans de Goede 91afa07664 ACPI / battery: Remove initializer for unused ident dmi_system_id
The battery code does not use the dmi_system_id ident member, so there is
no need to initialize it. This saves us storing the unused strings as
as const data.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-05-02 13:06:59 +02:00
Hans de Goede 6605e3423f ACPI / AC: Remove initializer for unused ident dmi_system_id
The ac.c code does not use the dmi_system_id ident member, so there is
no need to initialize it. This saves us storing the unused "thinkpad e530"
string as const data.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-05-02 13:06:59 +02:00
Laszlo Toth dd73e72259 ACPI: add missing newline to printk
...and restore reverse xmas tree while at it.

Signed-off-by: Laszlo Toth <laszlth@gmail.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-05-02 13:01:08 +02:00
Linus Torvalds fe03a7594d ACPI fixes for 4.17-rc3
- Change the ACPI subsystem initialization ordering to initialize
    the WDAT watchodg before reserving PNP motherboard resources so
    as to allow the watchdog to allocate its resources before the PNP
    code gets to them and prevents it from working correctly (Mika
    Westerberg).
 
  - Add a quirk for Lenovo Z50-70 to use the iTCO watchdog instead of
    the WDAT one which conflicts with the RTC on that platform (Mika
    Westerberg).
 
  - Avoid breaking backlight handling on Dell XPS 13 2013 model by
    allowing laptops to use the ACPI backlight by default even if they
    are Windows 8-ready in principle (Hans de Goede).
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABCAAGBQJa4diFAAoJEILEb/54YlRx3FoP/jfycW8kv8RxIVdgbkGs6QlY
 cy/mCDzTSke0W5pZGQT3uo+rvUPcnaw+cgYGQUZRECZhwaW6DAxp6TxDfeuvJQUr
 iwNTmAwToIoSUF9OG91O1+xHDupNDjTVf/SovufMXh5u7xqzfmE1cqOHHzQ0vmNT
 N35J5Uk9oXIIIIKp96VDbLSDBHIyGj8dt+0CIYbypq43G5WaFCCLCfDAdrmPMOzZ
 rJ9K59syptyrclOsC7LURjThgnwAB279kquB8hSnusfgpbb3qKmXXYOsSqUhpEb9
 m0OaDezfiah0rOi8ClYvUAzEy35lGwflbaR8EcHw1QdDcaQWa9L+CnwxvdoaOgol
 uYIkXKPMSBUCrBGxMQvK+sw+YF0DQq1qb5lua82vI+vYD/UHCpvmir+elRNXlzcO
 bL7Nn/039nkunWkwMVqT4MZ8hLphN8SDU4q+/j8C4zQVKumz/BWOAACfWIsL42H3
 RfMA+jnwhVdGbegDGAoIt6bI25wjBDnuSDs+cwpP26htHQy2TbSiMuFMOHjv7mjd
 c970W2ZC5aolLphe9yfRgGnQjMNAIx9TZo7J+TkpCGt+ahPW4U4lPDd58ovHOfjL
 PDI+FyVLozlugX+AzdSVFrj2T+ynbdGoICdBFSAFwrMbFOvSiLhj46w07Ul2qyrU
 vScBf9ucYarT+fPi2OIf
 =yaXB
 -----END PGP SIGNATURE-----

Merge tag 'acpi-4.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI fixes from Rafael Wysocki:
 "These are two watchdog-related fixes, fix for a backlight regression
  from the 4.16 cycle that unfortunately was propagated to -stable and a
  button module modification to prevent graphics driver modules from
  failing to load due to unmet dependencies if ACPI is disabled from the
  kernel command line.

  Specifics:

   - Change the ACPI subsystem initialization ordering to initialize the
     WDAT watchodg before reserving PNP motherboard resources so as to
     allow the watchdog to allocate its resources before the PNP code
     gets to them and prevents it from working correctly (Mika
     Westerberg).

   - Add a quirk for Lenovo Z50-70 to use the iTCO watchdog instead of
     the WDAT one which conflicts with the RTC on that platform (Mika
     Westerberg).

   - Avoid breaking backlight handling on Dell XPS 13 2013 model by
     allowing laptops to use the ACPI backlight by default even if they
     are Windows 8-ready in principle (Hans de Goede)"

* tag 'acpi-4.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  ACPI / video: Only default only_lcd to true on Win8-ready _desktops_
  ACPI / button: make module loadable when booted in non-ACPI mode
  ACPI / watchdog: Prefer iTCO_wdt on Lenovo Z50-70
  ACPI / scan: Initialize watchdog before PNP
2018-04-26 11:06:36 -07:00
Rafael J. Wysocki bd6dff55de Merge branches 'acpi-watchdog', 'acpi-button' and 'acpi-video'
* acpi-watchdog:
  ACPI / watchdog: Prefer iTCO_wdt on Lenovo Z50-70

* acpi-button:
  ACPI / button: make module loadable when booted in non-ACPI mode

* acpi-video:
  ACPI / video: Only default only_lcd to true on Win8-ready _desktops_
2018-04-26 15:11:39 +02:00
Hans de Goede 53fa1f6e8a ACPI / video: Only default only_lcd to true on Win8-ready _desktops_
Commit 5928c28152 (ACPI / video: Default lcd_only to true on Win8-ready
and newer machines) made only_lcd default to true on all machines where
acpi_osi_is_win8() returns true, including laptops.

The purpose of this is to avoid the bogus / non-working acpi backlight
interface which many newer BIOS-es define on desktop machines.

But this is causing a regression on some laptops, specifically on the
Dell XPS 13 2013 model, which does not have the LCD flag set for its
fully functional ACPI backlight interface.

Rather then DMI quirking our way out of this, this commits changes the
logic for setting only_lcd to true, to only do this on machines with
a desktop (or server) dmi chassis-type.

Note that we cannot simply only check the chassis-type and not register
the backlight interface based on that as there are some laptops and
tablets which have their chassis-type set to "3" aka desktop. Hopefully
the combination of checking the LCD flag, but only on devices with
a desktop(ish) chassis-type will avoid the needs for DMI quirks for this,
or at least limit the amount of DMI quirks which we need to a minimum.

Fixes: 5928c28152 (ACPI / video: Default lcd_only to true on Win8-ready and newer machines)
Reported-and-tested-by: James Hogan <jhogan@kernel.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Cc: 4.15+ <stable@vger.kernel.org> # 4.15+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-04-24 22:42:35 +02:00
Ard Biesheuvel ac1e55b1fd ACPI / button: make module loadable when booted in non-ACPI mode
Modules such as nouveau.ko and i915.ko have a link time dependency on
acpi_lid_open(), and due to its use of acpi_bus_register_driver(),
the button.ko module that provides it is only loadable when booted in
ACPI mode. However, the ACPI button driver can be built into the core
kernel as well, in which case the dependency can always be satisfied,
and the dependent modules can be loaded regardless of whether the
system was booted in ACPI mode or not.

So let's fix this asymmetry by making the ACPI button driver loadable
as a module even if not booted in ACPI mode, so it can provide the
acpi_lid_open() symbol in the same way as when built into the kernel.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
[ rjw: Minor adjustments of comments, whitespace and names. ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-04-24 12:47:34 +02:00
Prashanth Prakash 6fa12d584d ACPI / CPPC: Check for valid PCC subspace only if PCC is used
Changes the behavior where we return error if there are no valid PCC
subspace for a given performance domain.

The ACPI spec does not mandate the use PCC, so it is possible to have
platforms where a PCC subspace may not be present, so we need to check
for a valid PCC subspace ID only if the register is a PCC register.

Signed-off-by: Prashanth Prakash <pprakash@codeaurora.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-04-24 12:33:28 +02:00
Prashanth Prakash 4773e77cdc ACPI / CPPC: Add support for CPPC v3
CPPC V3 introduces two new entries to make it easier to convert between
abstract processor performance and frequency. The two new entries are
lowest frequency and nominal frequency. These are the frequencies
corresponding to lowest and nominal abstract performance.

Add support to read the new entries and populate them as part of the
CPPC performance capabilities which can be used by cpufreq drivers

Signed-off-by: Prashanth Prakash <pprakash@codeaurora.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-04-24 12:33:28 +02:00
Mika Westerberg a0a37862a4 ACPI / watchdog: Prefer iTCO_wdt on Lenovo Z50-70
WDAT table on Lenovo Z50-70 is using RTC SRAM (ports 0x70 and 0x71) to
store state of the timer. This conflicts with Linux RTC driver
(rtc-cmos.c) who fails to reserve those ports for itself preventing RTC
from functioning. In addition the WDAT table seems not to be fully
functional because it does not reset the system when the watchdog times
out.

On this system iTCO_wdt works just fine so we simply prefer to use it
instead of WDAT. This makes RTC working again and also results working
watchdog via iTCO_wdt.

Reported-by: Peter Milley <pbmilley@gmail.com>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=199033
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-04-24 11:12:59 +02:00
Mika Westerberg cc6a0e315a ACPI / scan: Initialize watchdog before PNP
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: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-04-23 08:56:38 +02:00
Chen Yu 855c1c2fce ACPI / PM: Blacklist Low Power S0 Idle _DSM for ThinkPad X1 Tablet(2016)
ThinkPad X1 Tablet(2016) is reported to have issues with
the Low Power S0 Idle _DSM interface and since this machine
model generally can do ACPI S3 just fine, and user would
like to use S3 as default sleep model, add a blacklist
entry to disable that interface for ThinkPad X1 Tablet(2016).

Link: https://bugzilla.kernel.org/show_bug.cgi?id=199057
Reported-and-tested-by: Robin Lee <robinlee.sysu@gmail.com>
Signed-off-by: Chen Yu <yu.c.chen@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-04-23 08:53:17 +02:00