09 Apr, 2020

1 commit

  • …ernel/git/chrome-platform/linux

    Pull chrome platform updates from Benson Leung:

    cros-usbpd-notify and cros_ec_typec:
    - Add a new notification driver that handles and dispatches USB PD
    related events to other drivers.
    - Add a Type C connector class driver for cros_ec

    CrOS EC:
    - Introduce a new cros_ec_cmd_xfer_status helper

    Sensors/iio:
    - A series from Gwendal that adds Cros EC sensor hub FIFO support

    Wilco EC:
    - Fix a build warning.
    - Platform data shouldn't include kernel.h

    Misc:
    - i2c api conversion complete, with i2c_new_client_device instead of
    i2c_new_device in chromeos_laptop.
    - Replace zero-length array with flexible-array member in
    cros_ec_chardev and wilco_ec
    - Update new structure for SPI transfer delays in cros_ec_spi

    * tag 'tag-chrome-platform-for-v5.7' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux: (34 commits)
    platform/chrome: cros_ec_spi: Wait for USECS, not NSECS
    iio: cros_ec: Use Hertz as unit for sampling frequency
    iio: cros_ec: Report hwfifo_watermark_max
    iio: cros_ec: Expose hwfifo_timeout
    iio: cros_ec: Remove pm function
    iio: cros_ec: Register to cros_ec_sensorhub when EC supports FIFO
    iio: expose iio_device_set_clock
    iio: cros_ec: Move function description to .c file
    platform/chrome: cros_ec_sensorhub: Add median filter
    platform/chrome: cros_ec_sensorhub: Add code to spread timestmap
    platform/chrome: cros_ec_sensorhub: Add FIFO support
    platform/chrome: cros_ec_sensorhub: Add the number of sensors in sensorhub
    platform/chrome: chromeos_laptop: make I2C API conversion complete
    platform/chrome: wilco_ec: event: Replace zero-length array with flexible-array member
    platform/chrome: cros_ec_chardev: Replace zero-length array with flexible-array member
    platform/chrome: cros_ec_typec: Update port info from EC
    platform/chrome: Add Type C connector class driver
    platform/chrome: cros_usbpd_notify: Pull PD_HOST_EVENT status
    platform/chrome: cros_usbpd_notify: Amend ACPI driver to plat
    platform/chrome: cros_usbpd_notify: Add driver data struct
    ...

    Linus Torvalds
     

08 Apr, 2020

1 commit

  • The use of `delay_usecs` in terminate_request() was replaced with the new
    `delay` struct used by the SPI subsystem, however the unit was
    set to SPI_DELAY_UNIT_NSECS instead of SPI_DELAY_UNIT_USECS. This fixes that.

    Fixes: 7d3ca507fda9 ("platform/chrome: cros_ec_spi: Use new structure for SPI transfer delays")
    Signed-off-by: Benson Leung

    Benson Leung
     

07 Apr, 2020

2 commits

  • Pull more ACPI updates from Rafael Wysocki:
    "Additional ACPI updates.

    These update the ACPICA code in the kernel to the 20200326 upstream
    revision, fix an ACPI-related CPU hotplug deadlock on x86, update
    Intel Tiger Lake device IDs in some places, add a new ACPI backlight
    blacklist entry, update the "acpi_backlight" kernel command line
    switch documentation and clean up a CPPC library routine.

    Specifics:

    - Update the ACPICA code in the kernel to upstream revision 20200326
    including:
    * Fix for a typo in a comment field (Bob Moore)
    * acpiExec namespace init file fixes (Bob Moore)
    * Addition of NHLT to the known tables list (Cezary Rojewski)
    * Conversion of PlatformCommChannel ASL keyword to PCC (Erik
    Kaneda)
    * acpiexec cleanup (Erik Kaneda)
    * WSMT-related typo fix (Erik Kaneda)
    * sprintf() utility function fix (John Levon)
    * IVRS IVHD type 11h parsing implementation (Michał Żygowski)
    * IVRS IVHD type 10h reserved field name fix (Michał Żygowski)

    - Fix ACPI-related CPU hotplug deadlock on x86 (Qian Cai)

    - Fix Intel Tiger Lake ACPI device IDs in several places (Gayatri
    Kammela)

    - Add ACPI backlight blacklist entry for Acer Aspire 5783z (Hans de
    Goede)

    - Fix documentation of the "acpi_backlight" kernel command line
    switch (Randy Dunlap)

    - Clean up the acpi_get_psd_map() CPPC library routine (Liguang
    Zhang)"

    * tag 'acpi-5.7-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
    x86: ACPI: fix CPU hotplug deadlock
    thermal: int340x_thermal: fix: Update Tiger Lake ACPI device IDs
    platform/x86: intel-hid: fix: Update Tiger Lake ACPI device ID
    ACPI: Update Tiger Lake ACPI device IDs
    ACPI: video: Use native backlight on Acer Aspire 5783z
    ACPI: video: Docs update for "acpi_backlight" kernel parameter options
    ACPICA: Update version 20200326
    ACPICA: Fixes for acpiExec namespace init file
    ACPICA: Add NHLT table signature
    ACPICA: WSMT: Fix typo, no functional change
    ACPICA: utilities: fix sprintf()
    ACPICA: acpiexec: remove redeclaration of acpi_gbl_db_opt_no_region_support
    ACPICA: Change PlatformCommChannel ASL keyword to PCC
    ACPICA: Fix IVRS IVHD type 10h reserved field name
    ACPICA: Implement IVRS IVHD type 11h parsing
    ACPICA: Fix a typo in a comment field
    ACPI: CPPC: clean up acpi_get_psd_map()

    Linus Torvalds
     
  • Pull more power management updates from Rafael Wysocki:
    "Additional power management updates.

    These fix a corner-case suspend-to-idle wakeup issue on systems where
    the ACPI SCI is shared with another wakeup source, add a kernel
    command line option to set pm_debug_messages via the kernel command
    line, add a document desctibing system-wide suspend and resume code
    flows, modify cpufreq Kconfig to choose schedutil as the preferred
    governor by default in a couple of cases and do some assorted
    cleanups.

    Specifics:

    - Fix corner-case suspend-to-idle wakeup issue on systems where the
    ACPI SCI is shared with another wakeup source (Hans de Goede).

    - Add document describing system-wide suspend and resume code flows
    to the admin guide (Rafael Wysocki).

    - Add kernel command line option to set pm_debug_messages (Chen Yu).

    - Choose schedutil as the preferred scaling governor by default on
    ARM big.LITTLE systems and on x86 systems using the intel_pstate
    driver in the passive mode (Linus Walleij, Rafael Wysocki).

    - Drop racy and redundant checks from the PM core's device_prepare()
    routine (Rafael Wysocki).

    - Make resume from hibernation take the hibernation_restore() return
    value into account (Dexuan Cui)"

    * tag 'pm-5.7-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
    platform/x86: intel_int0002_vgpio: Use acpi_register_wakeup_handler()
    ACPI: PM: Add acpi_[un]register_wakeup_handler()
    Documentation: PM: sleep: Document system-wide suspend code flows
    cpufreq: Select schedutil when using big.LITTLE
    PM: sleep: Add pm_debug_messages kernel command line option
    PM: sleep: core: Drop racy and redundant checks from device_prepare()
    PM: hibernate: Propagate the return value of hibernation_restore()
    cpufreq: intel_pstate: Select schedutil as the default governor

    Linus Torvalds
     

05 Apr, 2020

1 commit

  • The Power Management Events (PMEs) the INT0002 driver listens for get
    signalled by the Power Management Controller (PMC) using the same IRQ
    as used for the ACPI SCI.

    Since commit fdde0ff8590b ("ACPI: PM: s2idle: Prevent spurious SCIs from
    waking up the system") the SCI triggering, without there being a wakeup
    cause recognized by the ACPI sleep code, will no longer wakeup the system.

    This breaks PMEs / wakeups signalled to the INT0002 driver, the system
    never leaves the s2idle_loop() now.

    Use acpi_register_wakeup_handler() to register a function which checks
    the GPE0a_STS register for a PME and trigger a wakeup when a PME has
    been signalled.

    Fixes: fdde0ff8590b ("ACPI: PM: s2idle: Prevent spurious SCIs from waking up the system")
    Cc: 5.4+ # 5.4+
    Signed-off-by: Hans de Goede
    Acked-by: Andy Shevchenko
    Signed-off-by: Rafael J. Wysocki

    Hans de Goede
     

01 Apr, 2020

2 commits

  • Tiger Lake's new unique ACPI device IDs for intel-hid driver is not
    valid because of missing 'C' in the ID. Fix the ID by updating it.

    After the update, the new ID should now look like
    INT1051 --> INTC1051

    Fixes: bdd11b654035 ("platform/x86: intel-hid: Add Tiger Lake ACPI device ID")
    Suggested-by: Srinivas Pandruvada
    Signed-off-by: Gayatri Kammela
    Reviewed-by: Andy Shevchenko
    Signed-off-by: Rafael J. Wysocki

    Gayatri Kammela
     
  • Pull x86 platform driver updates from Andy Shevchenko:

    - Fix for improper handling of fan_boost_mode in sysfs for ASUS
    laptops.

    - On newer ASUS laptops the 1st battery is named differently, here is a
    fix.

    - Fix Lex 2I385SW to allow both network cards to be used.

    - The power integrated circuit driver for Surface 3 has been added.

    - Refactor and clean up of Intel PMC driver and enable it on Intel
    Jasper Lake.

    - Clean up of Dell RBU driver.

    - Big update for Intel Speed Select technology support tool and driver.

    * tag 'platform-drivers-x86-v5.7-1' of git://git.infradead.org/linux-platform-drivers-x86: (75 commits)
    platform/x86: surface3_power: Fix always true condition in mshw0011_space_handler()
    platform/x86: surface3_power: Fix Kconfig section ordering
    platform/x86: surface3_power: Add missed headers
    platform/x86: surface3_power: Reformat GUID assignment
    platform/x86: surface3_power: Drop useless macro ACPI_PTR()
    platform/x86: surface3_power: Prefix POLL_INTERVAL with SURFACE_3
    platform/x86: surface3_power: Simplify mshw0011_adp_psr() to one liner
    platform/x86: surface3_power: Use dev_err() instead of pr_err()
    platform/x86: surface3_power: Drop unused structure definition
    platform/x86: surface3_power: MSHW0011 rev-eng implementation
    platform/x86: intel_pmc_core: Make pmc_core_substate_res_show() generic
    platform/x86: intel_pmc_core: Make pmc_core_lpm_display() generic for platforms that support sub-states
    tools/power/x86/intel-speed-select: Fix a typo in error message
    tools/power/x86/intel-speed-select: Update version
    tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
    tools/power/x86/intel-speed-select: Add display for enabled cpus count
    tools/power/x86/intel-speed-select: Print friendly warning for bad command line
    tools/power/x86/intel-speed-select: Fix avx options for turbo-freq feature
    tools/power/x86/intel-speed-select: Improve CLX commands
    tools/power/x86/intel-speed-select: Show error for invalid CPUs in the options
    ...

    Linus Torvalds
     

31 Mar, 2020

2 commits

  • Pull perf updates from Ingo Molnar:
    "The main changes in this cycle were:

    Kernel side changes:

    - A couple of x86/cpu cleanups and changes were grandfathered in due
    to patch dependencies. These clean up the set of CPU model/family
    matching macros with a consistent namespace and C99 initializer
    style.

    - A bunch of updates to various low level PMU drivers:
    * AMD Family 19h L3 uncore PMU
    * Intel Tiger Lake uncore support
    * misc fixes to LBR TOS sampling

    - optprobe fixes

    - perf/cgroup: optimize cgroup event sched-in processing

    - misc cleanups and fixes

    Tooling side changes are to:

    - perf {annotate,expr,record,report,stat,test}

    - perl scripting

    - libapi, libperf and libtraceevent

    - vendor events on Intel and S390, ARM cs-etm

    - Intel PT updates

    - Documentation changes and updates to core facilities

    - misc cleanups, fixes and other enhancements"

    * 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (89 commits)
    cpufreq/intel_pstate: Fix wrong macro conversion
    x86/cpu: Cleanup the now unused CPU match macros
    hwrng: via_rng: Convert to new X86 CPU match macros
    crypto: Convert to new CPU match macros
    ASoC: Intel: Convert to new X86 CPU match macros
    powercap/intel_rapl: Convert to new X86 CPU match macros
    PCI: intel-mid: Convert to new X86 CPU match macros
    mmc: sdhci-acpi: Convert to new X86 CPU match macros
    intel_idle: Convert to new X86 CPU match macros
    extcon: axp288: Convert to new X86 CPU match macros
    thermal: Convert to new X86 CPU match macros
    hwmon: Convert to new X86 CPU match macros
    platform/x86: Convert to new CPU match macros
    EDAC: Convert to new X86 CPU match macros
    cpufreq: Convert to new X86 CPU match macros
    ACPI: Convert to new X86 CPU match macros
    x86/platform: Convert to new CPU match macros
    x86/kernel: Convert to new CPU match macros
    x86/kvm: Convert to new CPU match macros
    x86/perf/events: Convert to new CPU match macros
    ...

    Linus Torvalds
     
  • Pull locking updates from Ingo Molnar:
    "The main changes in this cycle were:

    - Continued user-access cleanups in the futex code.

    - percpu-rwsem rewrite that uses its own waitqueue and atomic_t
    instead of an embedded rwsem. This addresses a couple of
    weaknesses, but the primary motivation was complications on the -rt
    kernel.

    - Introduce raw lock nesting detection on lockdep
    (CONFIG_PROVE_RAW_LOCK_NESTING=y), document the raw_lock vs. normal
    lock differences. This too originates from -rt.

    - Reuse lockdep zapped chain_hlocks entries, to conserve RAM
    footprint on distro-ish kernels running into the "BUG:
    MAX_LOCKDEP_CHAIN_HLOCKS too low!" depletion of the lockdep
    chain-entries pool.

    - Misc cleanups, smaller fixes and enhancements - see the changelog
    for details"

    * 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (55 commits)
    fs/buffer: Make BH_Uptodate_Lock bit_spin_lock a regular spinlock_t
    thermal/x86_pkg_temp: Make pkg_temp_lock a raw_spinlock_t
    Documentation/locking/locktypes: Minor copy editor fixes
    Documentation/locking/locktypes: Further clarifications and wordsmithing
    m68knommu: Remove mm.h include from uaccess_no.h
    x86: get rid of user_atomic_cmpxchg_inatomic()
    generic arch_futex_atomic_op_inuser() doesn't need access_ok()
    x86: don't reload after cmpxchg in unsafe_atomic_op2() loop
    x86: convert arch_futex_atomic_op_inuser() to user_access_begin/user_access_end()
    objtool: whitelist __sanitizer_cov_trace_switch()
    [parisc, s390, sparc64] no need for access_ok() in futex handling
    sh: no need of access_ok() in arch_futex_atomic_op_inuser()
    futex: arch_futex_atomic_op_inuser() calling conventions change
    completion: Use lockdep_assert_RT_in_threaded_ctx() in complete_all()
    lockdep: Add posixtimer context tracing bits
    lockdep: Annotate irq_work
    lockdep: Add hrtimer context tracing bits
    lockdep: Introduce wait-type checks
    completion: Use simple wait queues
    sched/swait: Prepare usage in completions
    ...

    Linus Torvalds
     

30 Mar, 2020

1 commit


29 Mar, 2020

12 commits


28 Mar, 2020

1 commit


26 Mar, 2020

1 commit

  • Patch was rebased on top of for-next. Thanks for your patience!

    Blaž

    I'm resubmitting this patch with review feedback addressed:

    https://patchwork.kernel.org/patch/10584079/

    The patch was previously not resubmitted because it required a change
    that was reverted in the ACPICA. That has since been corrected:

    https://github.com/acpica/acpica/commit/9159c09a2a5897a43f78c95cdffc160d399722c3

    We've been using this patch for a while and user reports confirm that it
    works:

    https://github.com/linux-surface/linux-surface

    Previous description follows.

    >8------------------------------------------------------8<

    The MSHW0011 device is a chip that replaces the battery firmware
    by using ACPI operation regions on the Surface 3.
    It is unclear whether or not the chip will be reused somewhere else
    (under Windows, the chip is called "Surface Platform Power Driver"
    and the driver is provided by Microsoft).

    The values have been obtained by reverse engineering, and are subject to
    errors. Looks like it works on overall pretty well.

    I couldn't manage to get the IRQ correctly triggered, so I am using a
    good old polling thread to check for changes. This is something
    to be fixed in a later version.

    Link: https://bugzilla.kernel.org/show_bug.cgi?id=106231

    Signed-off-by: Blaž Hrastnik
    Signed-off-by: Benjamin Tissoires
    Signed-off-by: Stephen Just
    Signed-off-by: Andy Shevchenko

    Blaž Hrastnik
     

25 Mar, 2020

2 commits


22 Mar, 2020

4 commits

  • The current codebase makes use of the zero-length array language
    extension to the C90 standard, but the preferred mechanism to declare
    variable-length types such as these ones is a flexible array member[1][2],
    introduced in C99:

    struct foo {
    int stuff;
    struct boo array[];
    };

    By making use of the mechanism above, we will get a compiler warning
    in case the flexible array does not occur last in the structure, which
    will help us prevent some kind of undefined behavior bugs from being
    inadvertently introduced[3] to the codebase from now on.

    Also, notice that, dynamic memory allocations won't be affected by
    this change:

    "Flexible array members have incomplete type, and so the sizeof operator
    may not be applied. As a quirk of the original implementation of
    zero-length arrays, sizeof evaluates to zero."[1]

    This issue was found with the help of Coccinelle.

    [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
    [2] https://github.com/KSPP/linux/issues/21
    [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour")

    Signed-off-by: Gustavo A. R. Silva
    Signed-off-by: Enric Balletbo i Serra

    Gustavo A. R. Silva
     
  • The current codebase makes use of the zero-length array language
    extension to the C90 standard, but the preferred mechanism to declare
    variable-length types such as these ones is a flexible array member[1][2],
    introduced in C99:

    struct foo {
    int stuff;
    struct boo array[];
    };

    By making use of the mechanism above, we will get a compiler warning
    in case the flexible array does not occur last in the structure, which
    will help us prevent some kind of undefined behavior bugs from being
    inadvertently introduced[3] to the codebase from now on.

    Also, notice that, dynamic memory allocations won't be affected by
    this change:

    "Flexible array members have incomplete type, and so the sizeof operator
    may not be applied. As a quirk of the original implementation of
    zero-length arrays, sizeof evaluates to zero."[1]

    This issue was found with the help of Coccinelle.

    [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
    [2] https://github.com/KSPP/linux/issues/21
    [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour")

    Signed-off-by: Gustavo A. R. Silva
    Signed-off-by: Enric Balletbo i Serra

    Gustavo A. R. Silva
     
  • After registering the ports at probe, get the current port information
    from EC and update the Type C connector class ports accordingly.

    Co-developed-by: Jon Flatley
    Signed-off-by: Prashant Malani
    Reviewed-by: Heikki Krogerus
    Signed-off-by: Enric Balletbo i Serra

    Prashant Malani
     
  • Add a driver to implement the Type C connector class for Chrome OS
    devices with ECs (Embedded Controllers).

    The driver relies on firmware device specifications for various port
    attributes. On ACPI platforms, this is specified using the logical
    device with HID GOOG0014. On DT platforms, this is specified using the
    DT node with compatible string "google,cros-ec-typec".

    The driver reads the device FW node and uses the port attributes to
    register the typec ports with the Type C connector class framework, but
    doesn't do much else.

    Subsequent patches will add more functionality to the driver, including
    obtaining current port information (polarity, vconn role, current power
    role etc.) after querying the EC.

    Co-developed-by: Benson Leung
    Signed-off-by: Prashant Malani
    Reviewed-by: Heikki Krogerus
    Signed-off-by: Enric Balletbo i Serra

    Prashant Malani
     

21 Mar, 2020

1 commit

  • In order to avoid future header hell, remove the inclusion of
    proc_fs.h from acpi_bus.h. All it needs is a forward declaration of a
    struct.

    Signed-off-by: Peter Zijlstra (Intel)
    Signed-off-by: Thomas Gleixner
    Signed-off-by: Peter Zijlstra (Intel)
    Acked-by: Andy Shevchenko
    Link: https://lkml.kernel.org/r/20200321113241.246190285@linutronix.de

    Peter Zijlstra
     

20 Mar, 2020

9 commits

  • Add touchscreen info for the Chuwi Vi8 Plus tablet. This tablet uses a
    Chipone ICN8505 touchscreen controller, with the firmware used by the
    touchscreen embedded in the EFI firmware.

    Acked-by: Andy Shevchenko
    Acked-by: Ard Biesheuvel
    Signed-off-by: Hans de Goede
    Link: https://lore.kernel.org/r/20200115163554.101315-11-hdegoede@redhat.com
    Signed-off-by: Greg Kroah-Hartman

    Hans de Goede
     
  • Sofar we have been unable to get permission from the vendors to put the
    firmware for touchscreens listed in touchscreen_dmi in linux-firmware.

    Some of the tablets with such a touchscreen have a touchscreen driver, and
    thus a copy of the firmware, as part of their EFI code.

    This commit adds the necessary info for the new EFI embedded-firmware code
    to extract these firmwares, making the touchscreen work OOTB without the
    user needing to manually add the firmware.

    Acked-by: Andy Shevchenko
    Acked-by: Ard Biesheuvel
    Signed-off-by: Hans de Goede
    Link: https://lore.kernel.org/r/20200115163554.101315-10-hdegoede@redhat.com
    Signed-off-by: Greg Kroah-Hartman

    Hans de Goede
     
  • Currently pmc_core_substate_res_show() uses array of char pointers
    i.e., lpm_modes for Tiger Lake directly to iterate through and to get
    the number of low power modes which is hardcoded and cannot be re-used
    for future platforms that support sub-states. To maintain readability,
    make pmc_core_substate_res_show() generic, so that it can re-used for
    future platforms.

    Cc: Chen Zhou
    Cc: Andy Shevchenko
    Cc: David E. Box
    Signed-off-by: Gayatri Kammela
    Signed-off-by: Andy Shevchenko

    Gayatri Kammela
     
  • …that support sub-states

    Currently pmc_core_lpm_display() uses an array of the struct pointers,
    i.e. tgl_lpm_maps for Tiger Lake directly to iterate through and to get
    the number of (live) status registers which is hard coded and can not
    be re-used for the future platforms that support sub-states. To maintain
    readability, make pmc_core_lpm_display() generic, so that it can be re-used
    for future platforms.

    Cc: Chen Zhou <chenzhou10@huawei.com>
    Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
    Cc: David E. Box <david.e.box@intel.com>
    Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
    Signed-off-by: Gayatri Kammela <gayatri.kammela@intel.com>
    Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

    Gayatri Kammela
     
  • Since snprintf() returns the would-be-output size instead of the
    actual output size, the succeeding calls may go beyond the given
    buffer limit. Fix it by replacing with scnprintf().

    Signed-off-by: Takashi Iwai
    Signed-off-by: Andy Shevchenko

    Takashi Iwai
     
  • Commit 1f27dbd8265d ("platform/x86: GPD pocket fan: Allow somewhat
    lower/higher temperature limits") changed the module-param sanity check
    to accept temperature limits between 20 and 90 degrees celcius.

    But the error message printed when the module params are outside this
    range was not updated. This commit updates the error message to match
    the new min and max value for the temp-limits.

    Reported-by: Pavel Machek
    Signed-off-by: Hans de Goede
    Acked-by: Pavel Machek
    Signed-off-by: Andy Shevchenko

    Hans de Goede
     
  • The MMIO driver is not unregistering with the correct type with the ISST
    common core during module removal. This should be unregistered with
    ISST_IF_DEV_MMIO instead of ISST_IF_DEV_MBOX.

    Signed-off-by: Srinivas Pandruvada
    Signed-off-by: Andy Shevchenko

    Srinivas Pandruvada
     
  • Function fan_boost_mode_store returns 0 if store is successful,
    this leads to infinite loop after any write to it's sysfs entry:

    # echo 0 >/sys/devices/platform/asus-nb-wmi/fan_boost_mode

    This command never ends, one CPU core is at 100% utilization.
    This patch fixes this by returning size of written data.

    Fixes: b096f626a682 ("platform/x86: asus-wmi: Switch fan boost mode")
    Signed-off-by: Leonid Maksymchuk
    Signed-off-by: Andy Shevchenko

    Leonid Maksymchuk
     
  • The WMI method to set the charge threshold does not provide a
    way to specific a battery, so we assume it is the first/primary
    battery (by checking if the name is BAT0).
    On some newer ASUS laptops (Zenbook UM431DA) though, the
    primary/first battery isn't named BAT0 but BATT, so we need
    to support that case.

    Fixes: 7973353e92ee ("platform/x86: asus-wmi: Refactor charge threshold to use the battery hooking API")
    Cc: stable@vger.kernel.org
    Signed-off-by: Kristian Klausen
    Signed-off-by: Andy Shevchenko

    Kristian Klausen