16 Oct, 2020

1 commit

  • Pull drm updates from Dave Airlie:
    "Not a major amount of change, the i915 trees got split into display
    and gt trees to better facilitate higher level review, and there's a
    major refactoring of i915 GEM locking to use more core kernel concepts
    (like ww-mutexes). msm gets per-process pagetables, older AMD SI cards
    get DC support, nouveau got a bump in displayport support with common
    code extraction from i915.

    Outside of drm this contains a couple of patches for hexint
    moduleparams which you've acked, and a virtio common code tree that
    you should also get via it's regular path.

    New driver:
    - Cadence MHDP8546 DisplayPort bridge driver

    core:
    - cross-driver scatterlist cleanups
    - devm_drm conversions
    - remove drm_dev_init
    - devm_drm_dev_alloc conversion

    ttm:
    - lots of refactoring and cleanups

    bridges:
    - chained bridge support in more drivers

    panel:
    - misc new panels

    scheduler:
    - cleanup priority levels

    displayport:
    - refactor i915 code into helpers for nouveau

    i915:
    - split into display and GT trees
    - WW locking refactoring in GEM
    - execbuf2 extension mechanism
    - syncobj timeline support
    - GEN 12 HOBL display powersaving
    - Rocket Lake display additions
    - Disable FBC on Tigerlake
    - Tigerlake Type-C + DP improvements
    - Hotplug interrupt refactoring

    amdgpu:
    - Sienna Cichlid updates
    - Navy Flounder updates
    - DCE6 (SI) support for DC
    - Plane rotation enabled
    - TMZ state info ioctl
    - PCIe DPC recovery support
    - DC interrupt handling refactor
    - OLED panel fixes

    amdkfd:
    - add SMI events for thermal throttling
    - SMI interface events ioctl update
    - process eviction counters

    radeon:
    - move to dma_ for allocations
    - expose sclk via sysfs

    msm:
    - DSI support for sm8150/sm8250
    - per-process GPU pagetable support
    - Displayport support

    mediatek:
    - move HDMI phy driver to PHY
    - convert mtk-dpi to bridge API
    - disable mt2701 tmds

    tegra:
    - bridge support

    exynos:
    - misc cleanups

    vc4:
    - dual display cleanups

    ast:
    - cleanups

    gma500:
    - conversion to GPIOd API

    hisilicon:
    - misc reworks

    ingenic:
    - clock handling and format improvements

    mcde:
    - DSI support

    mgag200:
    - desktop g200 support

    mxsfb:
    - i.MX7 + i.MX8M
    - alpha plane support

    panfrost:
    - devfreq support
    - amlogic SoC support

    ps8640:
    - EDID from eDP retrieval

    tidss:
    - AM65xx YUV workaround

    virtio:
    - virtio-gpu exported resources

    rcar-du:
    - R8A7742, R8A774E1 and R8A77961 support
    - YUV planar format fixes
    - non-visible plane handling
    - VSP device reference count fix
    - Kconfig fix to avoid displaying disabled options in .config"

    * tag 'drm-next-2020-10-15' of git://anongit.freedesktop.org/drm/drm: (1494 commits)
    drm/ingenic: Fix bad revert
    drm/amdgpu: Fix invalid number of character '{' in amdgpu_acpi_init
    drm/amdgpu: Remove warning for virtual_display
    drm/amdgpu: kfd_initialized can be static
    drm/amd/pm: setup APU dpm clock table in SMU HW initialization
    drm/amdgpu: prevent spurious warning
    drm/amdgpu/swsmu: fix ARC build errors
    drm/amd/display: Fix OPTC_DATA_FORMAT programming
    drm/amd/display: Don't allow pstate if no support in blank
    drm/panfrost: increase readl_relaxed_poll_timeout values
    MAINTAINERS: Update entry for st7703 driver after the rename
    Revert "gpu/drm: ingenic: Add option to mmap GEM buffers cached"
    drm/amd/display: HDMI remote sink need mode validation for Linux
    drm/amd/display: Change to correct unit on audio rate
    drm/amd/display: Avoid set zero in the requested clk
    drm/amdgpu: align frag_end to covered address space
    drm/amdgpu: fix NULL pointer dereference for Renoir
    drm/vmwgfx: fix regression in thp code due to ttm init refactor.
    drm/amdgpu/swsmu: add interrupt work handler for smu11 parts
    drm/amdgpu/swsmu: add interrupt work function
    ...

    Linus Torvalds
     

26 Sep, 2020

1 commit


06 Sep, 2020

2 commits

  • The DSDTs on most Cherry Trail devices have an ugly clutch where the PWM
    controller gets turned off from the _PS3 method of the graphics-card dev:

    Method (_PS3, 0, Serialized) // _PS3: Power State 3
    {
    ...
    PWMB = PWMC /* \_SB_.PCI0.GFX0.PWMC */
    PSAT |= 0x03
    Local0 = PSAT /* \_SB_.PCI0.GFX0.PSAT */
    ...
    }

    Where PSAT is the power-status register of the PWM controller.

    Since the i915 driver will do a pwm_get on the pwm device as it uses it to
    control the LCD panel backlight, there is a device-link marking the i915
    device as a consumer of the pwm device. So that the PWM controller will
    always be suspended after the i915 driver suspends (which is the right
    thing to do). This causes the above GFX0 PS3 AML code to run before
    acpi_lpss.c calls acpi_lpss_save_ctx().

    So on these devices the PWM controller will already be off when
    acpi_lpss_save_ctx() runs. This causes it to read/save all 1-s (0xffffffff)
    as ctx register values.

    When these bogus values get restored on resume the PWM controller actually
    keeps working, since most bits are reserved, but this does set bit 3 of
    the LPSS General purpose register, which for the PWM controller has the
    following function: "This bit is re-used to support 32kHz slow mode.
    Default is 19.2MHz as PWM source clock".

    This causes the clock of the PWM controller to switch from 19.2MHz to
    32KHz, which is a slow-down of a factor 600. Surprisingly enough so far
    there have been few bug reports about this. This is likely because the
    i915 driver was hardcoding the PWM frequency to 46 KHz, which divided
    by 600 would result in a PWM frequency of approx. 78 Hz, which mostly
    still works fine. There are some bug reports about the LCD backlight
    flickering after suspend/resume which are likely caused by this issue.

    But with the upcoming patch-series to finally switch the i915 drivers
    code for external PWM controllers to use the atomic API and to honor
    the PWM frequency specified in the video BIOS (VBT), this becomes a much
    bigger problem. On most cases the VBT specifies either 200 Hz or 20
    KHz as PWM frequency, which with the mentioned issue ends up being either
    1/3 Hz, where the backlight actually visible blinks on and off every 3s,
    or in 33 Hz and horrible flickering of the backlight.

    There are a number of possible solutions to this problem:

    1. Make acpi_lpss_save_ctx() run before GFX0._PS3
    Pro: Clean solution from pov of not medling with save/restore ctx code
    Con: As mentioned the current ordering is the right thing to do
    Con: Requires assymmetry in at what suspend/resume phase we do the save vs
    restore, requiring more suspend/resume ordering hacks in already
    convoluted acpi_lpss.c suspend/resume code.
    2. Do some sort of save once mode for the LPSS ctx
    Pro: Reasonably clean
    Con: Needs a new LPSS flag + code changes to handle the flag
    3. Detect we have failed to save the ctx registers and do not restore them
    Pro: Not PWM specific, might help with issues on other LPSS devices too
    Con: If we can get away with not restoring the ctx why bother with it at
    all?
    4. Do not save the ctx for CHT PWM controllers
    Pro: Clean, as simple as dropping a flag?
    Con: Not so simple as dropping a flag, needs a new flag to ensure that
    we still do lpss_deassert_reset() on device activation.
    5. Make the pwm-lpss code fixup the LPSS-context registers
    Pro: Keeps acpi_lpss.c code clean
    Con: Moves knowledge of LPSS-context into the pwm-lpss.c code

    1 and 5 both do not seem to be a desirable way forward.

    3 and 4 seem ok, but they both assume that restoring the LPSS-context
    registers is not necessary. I have done a couple of test and those do
    show that restoring the LPSS-context indeed does not seem to be necessary
    on devices using s2idle suspend (and successfully reaching S0i3). But I
    have no hardware to test deep / S3 suspend. So I'm not sure that not
    restoring the context is safe.

    That leaves solution 2, which is about as simple / clean as 3 and 4,
    so this commit fixes the described problem by implementing a new
    LPSS_SAVE_CTX_ONCE flag and setting that for the CHT PWM controllers.

    Acked-by: Rafael J. Wysocki
    Signed-off-by: Hans de Goede
    Link: https://patchwork.freedesktop.org/patch/msgid/20200903112337.4113-3-hdegoede@redhat.com

    Hans de Goede
     
  • The DSDTs on most Cherry Trail devices have an ugly clutch where the PWM
    controller gets poked from the _PS0 method of the graphics-card device:

    Local0 = PSAT /* \_SB_.PCI0.GFX0.PSAT */
    If (((Local0 & 0x03) == 0x03))
    {
    PSAT &= 0xFFFFFFFC
    Local1 = PSAT /* \_SB_.PCI0.GFX0.PSAT */
    RSTA = Zero
    RSTF = Zero
    RSTA = One
    RSTF = One
    PWMB |= 0xC0000000
    PWMC = PWMB /* \_SB_.PCI0.GFX0.PWMB */
    }

    Where PSAT is the power-status register of the PWM controller, so if it
    is in D3 when the GFX0 device's PS0 method runs then it will turn it on
    and restore the PWM ctrl register value it saved from its PS3 handler.
    Note not only does it restore it, it ors it with 0xC0000000 turning it
    on at a time where we may not want it to get turned on at all.

    The pwm_get call which the i915 driver does to get a reference to the
    PWM controller, already adds a device-link making the GFX0 device a
    consumer of the PWM device. So it should already have been resumed when
    the above AML runs and the AML should thus not do its undesirable poking
    of the PWM controller register.

    But the PCI core powers on PCI devices in the no-irq resume phase and
    thus calls the troublesome PS0 method in the no-irq resume phase.
    Where as LPSS devices by default are resumed in the early resume phase.

    This commit sets the resume_from_noirq flag in the bsw_pwm_dev_desc
    struct, so that Cherry Trail PWM controllers will be resumed in the
    no-irq phase. Together with the device-link added by the pwm-get this
    ensures that the PWM controller will be on when the troublesome PS0
    method runs, which stops it from poking the PWM controller.

    Acked-by: Rafael J. Wysocki
    Signed-off-by: Hans de Goede
    Link: https://patchwork.freedesktop.org/patch/msgid/20200903112337.4113-2-hdegoede@redhat.com

    Hans de Goede
     

25 Apr, 2020

3 commits

  • Because all callers of dev_pm_smart_suspend_and_suspended use it only
    for checking whether or not to skip driver suspend callbacks for a
    device, rename it to dev_pm_skip_suspend() in analogy with
    dev_pm_skip_resume().

    No functional impact.

    Suggested-by: Alan Stern
    Signed-off-by: Rafael J. Wysocki
    Acked-by: Alan Stern
    Acked-by: Bjorn Helgaas

    Rafael J. Wysocki
     
  • The name of dev_pm_may_skip_resume() may be easily confused with the
    power.may_skip_resume flag which is not checked by that function, so
    rename the former as dev_pm_skip_resume().

    No functional impact.

    Suggested-by: Alan Stern
    Signed-off-by: Rafael J. Wysocki
    Acked-by: Alan Stern
    Acked-by: Bjorn Helgaas

    Rafael J. Wysocki
     
  • The current code in device_resume_noirq() causes the entire early
    resume and resume phases of device suspend to be skipped for
    devices for which the noirq resume phase have been skipped (due
    to the LEAVE_SUSPENDED flag being set) on the premise that those
    devices should stay in runtime-suspend after system-wide resume.

    However, that may not be correct in two situations. First, the
    middle layer (subsystem) noirq resume callback may be missing for
    a given device, but its early resume callback may be present and it
    may need to do something even if it decides to skip the driver
    callback. Second, if the device's wakeup settings were adjusted
    in the suspend phase without resuming the device (that was in
    runtime suspend at that time), they most likely need to be
    adjusted again in the resume phase and so the driver callback
    in that phase needs to be run.

    For the above reason, modify the core to allow the middle layer
    ->resume_late callback to run even if its ->resume_noirq callback
    is missing (and the core has skipped the driver-level callback
    in that phase) and to allow all device callbacks to run in the
    resume phase. Also make the core set the PM-runtime status of
    devices with SMART_SUSPEND set whose resume callbacks are not
    skipped to "active" in the "noirq" resume phase and update the
    affected subsystems (PCI and ACPI) accordingly.

    After this change, middle-layer (subsystem) callbacks will always
    be invoked in all phases of system suspend and resume and driver
    callbacks will always run in the prepare, suspend, resume, and
    complete phases for all devices.

    For devices with SMART_SUSPEND set, driver callbacks will be
    skipped in the late and noirq phases of system suspend if those
    devices remain in runtime suspend in __device_suspend_late().
    Driver callbacks will also be skipped for them during the
    noirq and early phases of the "thaw" transition related to
    hibernation in that case.

    Setting LEAVE_SUSPENDED means that the driver allows its callbacks
    to be skipped in the noirq and early phases of system resume, but
    some additional conditions need to be met for that to happen (among
    other things, the power.may_skip_resume flag needs to be set for the
    device during system suspend for the driver callbacks to be skipped
    during the subsequent resume transition).

    For all devices with SMART_SUSPEND set whose driver callbacks are
    invoked during system resume, the PM-runtime status will be set to
    "active" (by the core).

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Alan Stern
    Acked-by: Bjorn Helgaas

    Rafael J. Wysocki
     

25 Mar, 2020

1 commit

  • The new macro set has a consistent namespace and uses C99 initializers
    instead of the grufty C89 ones.

    Rename the local macro wrapper to X86_MATCH for consistency. It stays for
    readability sake.

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Borislav Petkov
    Reviewed-by: Greg Kroah-Hartman
    Link: https://lkml.kernel.org/r/20200320131509.467730627@linutronix.de

    Thomas Gleixner
     

17 Dec, 2019

1 commit

  • At least Bay Trail (BYT) and Cherry Trail (CHT) devices can use 1 of 2
    different PWM controllers for controlling the LCD's backlight brightness.
    Either the one integrated into the PMIC or the one integrated into the
    SoC (the 1st LPSS PWM controller).

    So far in the LPSS code on BYT we have skipped registering the LPSS PWM
    controller "pwm_backlight" lookup entry when a Crystal Cove PMIC is
    present, assuming that in this case the PMIC PWM controller will be used.

    On CHT we have been relying on only 1 of the 2 PWM controllers being
    enabled in the DSDT at the same time; and always registered the lookup.

    So far this has been working, but the correct way to determine which PWM
    controller needs to be used is by checking a bit in the VBT table and
    recently I've learned about 2 different BYT devices:
    Point of View MOBII TAB-P800W
    Acer Switch 10 SW5-012

    Which use a Crystal Cove PMIC, yet the LCD is connected to the SoC/LPSS
    PWM controller (and the VBT correctly indicates this), so here our old
    heuristics fail.

    Since only the i915 driver has access to the VBT, this commit renames
    the "pwm_backlight" lookup entries for the 1st BYT/CHT LPSS PWM controller
    to "pwm_soc_backlight" so that the i915 driver can do a pwm_get() for
    the right controller depending on the VBT bit, instead of the i915 driver
    relying on a "pwm_backlight" lookup getting registered which magically
    points to the right controller.

    Acked-by: Jani Nikula
    Reviewed-by: Andy Shevchenko
    Acked-by: Rafael J. Wysocki
    Signed-off-by: Hans de Goede
    Link: https://patchwork.freedesktop.org/patch/msgid/20191216202906.1662893-2-hdegoede@redhat.com

    Hans de Goede
     

26 Nov, 2019

1 commit

  • * acpi-utils:
    iommu/amd: Switch to use acpi_dev_hid_uid_match()
    mmc: sdhci-acpi: Switch to use acpi_dev_hid_uid_match()
    ACPI / LPSS: Switch to use acpi_dev_hid_uid_match()
    ACPI / utils: Introduce acpi_dev_hid_uid_match() helper
    ACPI / utils: Move acpi_dev_get_first_match_dev() under CONFIG_ACPI
    ACPI / utils: Describe function parameters in kernel-doc

    * acpi-platform:
    ACPI: platform: Unregister stale platform devices
    ACPI: Always build evged in

    * acpi-video:
    ACPI: video: update doc for acpi_video_bus_DOS()

    * acpi-doc:
    ACPI: Documentation: Minor spelling fix in namespace.rst

    Rafael J. Wysocki
     

25 Oct, 2019

3 commits

  • The iGPU / GFX0 device's _PS0 method on the ASUS T200TA depends on the
    I2C1 controller (which is connected to the embedded controller). But unlike
    in the T100TA/T100CHI this dependency is not listed in the _DEP of the GFX0
    device.

    This results in the dev_WARN_ONCE(..., "Transfer while suspended\n") call
    in i2c-designware-master.c triggering and the AML code not working as it
    should.

    This commit fixes this by adding a dmi based quirk mechanism for devices
    which miss a _DEP, and adding a quirk for the LNXVIDEO depending on the
    I2C1 device on the Asus T200TA.

    Fixes: 2d71ee0ce72f ("ACPI / LPSS: Add a device link from the GPU to the BYT I2C5 controller")
    Tested-by: Pierre-Louis Bossart
    Signed-off-by: Hans de Goede
    Reviewed-by: Andy Shevchenko
    Cc: 4.20+ # 4.20+
    Signed-off-by: Rafael J. Wysocki

    Hans de Goede
     
  • Various Asus Bay Trail devices (T100TA, T100CHI, T200TA) have an embedded
    controller connected to I2C1 and the iGPU (LNXVIDEO) _PS0/_PS3 methods
    access it, so we need to add a consumer link from LNXVIDEO to I2C1 on
    these devices to avoid suspend/resume ordering problems.

    Fixes: 2d71ee0ce72f ("ACPI / LPSS: Add a device link from the GPU to the BYT I2C5 controller")
    Tested-by: Pierre-Louis Bossart
    Signed-off-by: Hans de Goede
    Reviewed-by: Andy Shevchenko
    Cc: 4.20+ # 4.20+
    Signed-off-by: Rafael J. Wysocki

    Hans de Goede
     
  • So far on Bay Trail (BYT) we only have been adding a device_link adding
    the iGPU (LNXVIDEO) device as consumer for the I2C controller for the
    PMIC for I2C5, but the PMIC only uses I2C5 on BYT CR (cost reduced) on
    regular BYT platforms I2C7 is used and we were not adding the device_link
    sometimes causing resume ordering issues.

    This commit adds LNXVIDEO -> BYT I2C7 to the lpss_device_links table,
    fixing this.

    Fixes: 2d71ee0ce72f ("ACPI / LPSS: Add a device link from the GPU to the BYT I2C5 controller")
    Tested-by: Pierre-Louis Bossart
    Signed-off-by: Hans de Goede
    Reviewed-by: Andy Shevchenko
    Cc: 4.20+ # 4.20+
    Signed-off-by: Rafael J. Wysocki

    Hans de Goede
     

15 Oct, 2019

1 commit


23 Aug, 2019

1 commit

  • My assumption in commit b53548f9d9e4 ("spi: pxa2xx: Remove LPSS private
    register restoring during resume") that Intel Lynxpoint and compatible
    based chipsets may not need LPSS private registers saving and restoring
    over suspend/resume cycle turned out to be false on Intel Broadwell.

    Curtis Malainey sent a patch bringing above change back and reported the
    LPSS SPI Chip Select control was lost over suspend/resume cycle on
    Broadwell machine.

    Instead of reverting above commit lets add LPSS private register
    saving/restoring also for all LPSS SPI, I2C and UART controllers on
    Lynxpoint and compatible chipset to make sure context is not lost in
    case nothing else preserves it like firmware or if LPSS is always on.

    Fixes: b53548f9d9e4 ("spi: pxa2xx: Remove LPSS private register restoring during resume")
    Reported-by: Curtis Malainey
    Tested-by: Curtis Malainey
    Cc: 5.0+ # 5.0+
    Signed-off-by: Jarkko Nikula
    Reviewed-by: Andy Shevchenko
    Signed-off-by: Rafael J. Wysocki

    Jarkko Nikula
     

13 Jul, 2019

1 commit

  • Pull driver core and debugfs updates from Greg KH:
    "Here is the "big" driver core and debugfs changes for 5.3-rc1

    It's a lot of different patches, all across the tree due to some api
    changes and lots of debugfs cleanups.

    Other than the debugfs cleanups, in this set of changes we have:

    - bus iteration function cleanups

    - scripts/get_abi.pl tool to display and parse Documentation/ABI
    entries in a simple way

    - cleanups to Documenatation/ABI/ entries to make them parse easier
    due to typos and other minor things

    - default_attrs use for some ktype users

    - driver model documentation file conversions to .rst

    - compressed firmware file loading

    - deferred probe fixes

    All of these have been in linux-next for a while, with a bunch of
    merge issues that Stephen has been patient with me for"

    * tag 'driver-core-5.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (102 commits)
    debugfs: make error message a bit more verbose
    orangefs: fix build warning from debugfs cleanup patch
    ubifs: fix build warning after debugfs cleanup patch
    driver: core: Allow subsystems to continue deferring probe
    drivers: base: cacheinfo: Ensure cpu hotplug work is done before Intel RDT
    arch_topology: Remove error messages on out-of-memory conditions
    lib: notifier-error-inject: no need to check return value of debugfs_create functions
    swiotlb: no need to check return value of debugfs_create functions
    ceph: no need to check return value of debugfs_create functions
    sunrpc: no need to check return value of debugfs_create functions
    ubifs: no need to check return value of debugfs_create functions
    orangefs: no need to check return value of debugfs_create functions
    nfsd: no need to check return value of debugfs_create functions
    lib: 842: no need to check return value of debugfs_create functions
    debugfs: provide pr_fmt() macro
    debugfs: log errors when something goes wrong
    drivers: s390/cio: Fix compilation warning about const qualifiers
    drivers: Add generic helper to match by of_node
    driver_find_device: Unify the match function with class_find_device()
    bus_find_device: Unify the match callback with class_find_device
    ...

    Linus Torvalds
     

08 Jul, 2019

1 commit

  • * pm-sleep:
    PM: sleep: Drop dev_pm_skip_next_resume_phases()
    ACPI: PM: Drop unused function and function header
    ACPI: PM: Introduce "poweroff" callbacks for ACPI PM domain and LPSS
    ACPI: PM: Simplify and fix PM domain hibernation callbacks
    PCI: PM: Simplify bus-level hibernation callbacks
    PM: ACPI/PCI: Resume all devices during hibernation
    kernel: power: swap: use kzalloc() instead of kmalloc() followed by memset()
    PM: sleep: Update struct wakeup_source documentation
    drivers: base: power: remove wakeup_sources_stats_dentry variable
    PM: suspend: Rename pm_suspend_via_s2idle()
    PM: sleep: Show how long dpm_suspend_start() and dpm_suspend_end() take
    PM: hibernate: powerpc: Expose pfn_is_nosave() prototype

    Rafael J. Wysocki
     

03 Jul, 2019

2 commits

  • In general, it is not correct to call pm_generic_suspend(),
    pm_generic_suspend_late() and pm_generic_suspend_noirq() during the
    hibernation's "poweroff" transition, because device drivers may
    provide special callbacks to be invoked then and the wrappers in
    question cause system suspend callbacks to be run. Unfortunately,
    that happens in the ACPI PM domain and ACPI LPSS.

    To address this potential issue, introduce "poweroff" callbacks
    for the ACPI PM and LPSS that will use pm_generic_poweroff(),
    pm_generic_poweroff_late() and pm_generic_poweroff_noirq() as
    appropriate.

    Fixes: 05087360fd7a (ACPI / PM: Take SMART_SUSPEND driver flag into account)
    Signed-off-by: Rafael J. Wysocki
    Reviewed-by: Mika Westerberg
    Reviewed-by: Hans de Goede

    Rafael J. Wysocki
     
  • First, after a previous change causing all runtime-suspended devices
    in the ACPI PM domain (and ACPI LPSS devices) to be resumed before
    creating a snapshot image of memory during hibernation, it is not
    necessary to worry about the case in which them might be left in
    runtime-suspend any more, so get rid of the code related to that from
    ACPI PM domain and ACPI LPSS hibernation callbacks.

    Second, it is not correct to use pm_generic_resume_early() and
    acpi_subsys_resume_noirq() in hibernation "restore" callbacks (which
    currently happens in the ACPI PM domain and ACPI LPSS), so introduce
    proper _restore_late and _restore_noirq callbacks for the ACPI PM
    domain and ACPI LPSS.

    Fixes: 05087360fd7a (ACPI / PM: Take SMART_SUSPEND driver flag into account)
    Signed-off-by: Rafael J. Wysocki
    Reviewed-by: Mika Westerberg
    Reviewed-by: Hans de Goede

    Rafael J. Wysocki
     

24 Jun, 2019

1 commit

  • There is an arbitrary difference between the prototypes of
    bus_find_device() and class_find_device() preventing their callers
    from passing the same pair of data and match() arguments to both of
    them, which is the const qualifier used in the prototype of
    class_find_device(). If that qualifier is also used in the
    bus_find_device() prototype, it will be possible to pass the same
    match() callback function to both bus_find_device() and
    class_find_device(), which will allow some optimizations to be made in
    order to avoid code duplication going forward. Also with that, constify
    the "data" parameter as it is passed as a const to the match function.

    For this reason, change the prototype of bus_find_device() to match
    the prototype of class_find_device() and adjust its callers to use the
    const qualifier in accordance with the new prototype of it.

    Cc: Alexander Shishkin
    Cc: Andrew Lunn
    Cc: Andreas Noever
    Cc: Arnd Bergmann
    Cc: Bjorn Helgaas
    Cc: Corey Minyard
    Cc: Christian Borntraeger
    Cc: David Kershner
    Cc: "David S. Miller"
    Cc: David Airlie
    Cc: Felipe Balbi
    Cc: Frank Rowand
    Cc: Grygorii Strashko
    Cc: Harald Freudenberger
    Cc: Hartmut Knaack
    Cc: Heiko Stuebner
    Cc: Jason Gunthorpe
    Cc: Jonathan Cameron
    Cc: "James E.J. Bottomley"
    Cc: Len Brown
    Cc: Mark Brown
    Cc: Michael Ellerman
    Cc: Michael Jamet
    Cc: "Martin K. Petersen"
    Cc: Peter Oberparleiter
    Cc: Sebastian Ott
    Cc: Srinivas Kandagatla
    Cc: Yehezkel Bernat
    Cc: rafael@kernel.org
    Acked-by: Corey Minyard
    Acked-by: David Kershner
    Acked-by: Mark Brown
    Acked-by: Rafael J. Wysocki
    Acked-by: Srinivas Kandagatla
    Acked-by: Wolfram Sang # for the I2C parts
    Acked-by: Rob Herring
    Signed-off-by: Suzuki K Poulose
    Signed-off-by: Greg Kroah-Hartman

    Suzuki K Poulose
     

19 Jun, 2019

1 commit

  • Based on 2 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation #

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 4122 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Enrico Weigelt
    Reviewed-by: Kate Stewart
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

18 Apr, 2019

1 commit

  • Commit 48402cee6889 ("ACPI / LPSS: Resume BYT/CHT I2C controllers from
    resume_noirq") makes acpi_lpss_{suspend_late,resume_early}() bail early
    on BYT/CHT as resume_from_noirq is set.

    This means that on resume from hibernate dw_i2c_plat_resume() doesn't get
    called by the restore_early callback, acpi_lpss_resume_early(). Instead it
    should be called by the restore_noirq callback matching how things are done
    when resume_from_noirq is set and we are doing a regular resume.

    Change the restore_noirq callback to acpi_lpss_resume_noirq so that
    dw_i2c_plat_resume() gets properly called when resume_from_noirq is set
    and we are resuming from hibernate.

    Likewise also change the poweroff_noirq callback so that
    dw_i2c_plat_suspend gets called properly.

    Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=202139
    Fixes: 48402cee6889 ("ACPI / LPSS: Resume BYT/CHT I2C controllers from resume_noirq")
    Reported-by: Kai-Heng Feng
    Signed-off-by: Hans de Goede
    Cc: 4.20+ # 4.20+
    Signed-off-by: Rafael J. Wysocki

    Hans de Goede
     

22 Feb, 2019

1 commit


13 Dec, 2018

1 commit

  • Ignore acpi_device_fix_up_power() return value. If we return an error
    we end up with acpi_default_enumeration() still creating a platform-
    device for the device and we end up with the device still being used
    but without the special LPSS related handling which is not useful.

    Specicifically ignoring the error fixes the touchscreen no longer
    working after a suspend/resume on a Prowise PT301 tablet.

    This tablet has a broken _PS0 method on the touchscreen's I2C controller,
    causing acpi_device_fix_up_power() to fail, causing fallback to standard
    platform-dev handling and specifically causing acpi_lpss_save/restore_ctx
    to not run.

    The I2C controllers _PS0 method does actually turn on the device, but then
    does some more nonsense which fails when run during early boot trying to
    use I2C opregion handling on another not-yet registered I2C controller.

    Signed-off-by: Hans de Goede
    Signed-off-by: Rafael J. Wysocki

    Hans de Goede
     

23 Oct, 2018

1 commit

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

    - Lots of perf tooling changes too voluminous to list (big perf trace
    and perf stat improvements, lots of libtraceevent reorganization,
    etc.), so I'll list the authors and refer to the changelog for
    details:

    Benjamin Peterson, Jérémie Galarneau, Kim Phillips, Peter
    Zijlstra, Ravi Bangoria, Sangwon Hong, Sean V Kelley, Steven
    Rostedt, Thomas Gleixner, Ding Xiang, Eduardo Habkost, Thomas
    Richter, Andi Kleen, Sanskriti Sharma, Adrian Hunter, Tzvetomir
    Stoyanov, Arnaldo Carvalho de Melo, Jiri Olsa.

    ... with the bulk of the changes written by Jiri Olsa, Tzvetomir
    Stoyanov and Arnaldo Carvalho de Melo.

    - Continued intel_rdt work with a focus on playing well with perf
    events. This also imported some non-perf RDT work due to
    dependencies. (Reinette Chatre)

    - Implement counter freezing for Arch Perfmon v4 (Skylake and newer).
    This allows to speed up the PMI handler by avoiding unnecessary MSR
    writes and make it more accurate. (Andi Kleen)

    - kprobes cleanups and simplification (Masami Hiramatsu)

    - Intel Goldmont PMU updates (Kan Liang)

    - ... plus misc other fixes and updates"

    * 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (155 commits)
    kprobes/x86: Use preempt_enable() in optimized_callback()
    x86/intel_rdt: Prevent pseudo-locking from using stale pointers
    kprobes, x86/ptrace.h: Make regs_get_kernel_stack_nth() not fault on bad stack
    perf/x86/intel: Export mem events only if there's PEBS support
    x86/cpu: Drop pointless static qualifier in punit_dev_state_show()
    x86/intel_rdt: Fix initial allocation to consider CDP
    x86/intel_rdt: CBM overlap should also check for overlap with CDP peer
    x86/intel_rdt: Introduce utility to obtain CDP peer
    tools lib traceevent, perf tools: Move struct tep_handler definition in a local header file
    tools lib traceevent: Separate out tep_strerror() for strerror_r() issues
    perf python: More portable way to make CFLAGS work with clang
    perf python: Make clang_has_option() work on Python 3
    perf tools: Free temporary 'sys' string in read_event_files()
    perf tools: Avoid double free in read_event_file()
    perf tools: Free 'printk' string in parse_ftrace_printk()
    perf tools: Cleanup trace-event-info 'tdata' leak
    perf strbuf: Match va_{add,copy} with va_end
    perf test: S390 does not support watchpoints in test 22
    perf auxtrace: Include missing asm/bitsperlong.h to get BITS_PER_LONG
    tools include: Adopt linux/bits.h
    ...

    Linus Torvalds
     

02 Oct, 2018

1 commit

  • Going primarily by:

    https://en.wikipedia.org/wiki/List_of_Intel_Atom_microprocessors

    with additional information gleaned from other related pages; notably:

    - Bonnell shrink was called Saltwell
    - Moorefield is the Merriefield refresh which makes it Airmont

    The general naming scheme is: FAM6_ATOM_UARCH_SOCTYPE

    for i in `git grep -l FAM6_ATOM` ; do
    sed -i -e 's/ATOM_PINEVIEW/ATOM_BONNELL/g' \
    -e 's/ATOM_LINCROFT/ATOM_BONNELL_MID/' \
    -e 's/ATOM_PENWELL/ATOM_SALTWELL_MID/g' \
    -e 's/ATOM_CLOVERVIEW/ATOM_SALTWELL_TABLET/g' \
    -e 's/ATOM_CEDARVIEW/ATOM_SALTWELL/g' \
    -e 's/ATOM_SILVERMONT1/ATOM_SILVERMONT/g' \
    -e 's/ATOM_SILVERMONT2/ATOM_SILVERMONT_X/g' \
    -e 's/ATOM_MERRIFIELD/ATOM_SILVERMONT_MID/g' \
    -e 's/ATOM_MOOREFIELD/ATOM_AIRMONT_MID/g' \
    -e 's/ATOM_DENVERTON/ATOM_GOLDMONT_X/g' \
    -e 's/ATOM_GEMINI_LAKE/ATOM_GOLDMONT_PLUS/g' ${i}
    done

    Signed-off-by: Peter Zijlstra (Intel)
    Cc: Alexander Shishkin
    Cc: Arnaldo Carvalho de Melo
    Cc: Jiri Olsa
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Thomas Gleixner
    Cc: Vince Weaver
    Cc: dave.hansen@linux.intel.com
    Cc: len.brown@intel.com
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     

01 Oct, 2018

6 commits

  • On some Cherry Trail systems the GPU ACPI fwnode has power-resources which
    point to the PMIC, which is connected over a LPSS I2C controller.

    We add a device-link to make sure that the I2C controller is resumed before
    the GPU is. But the pci-core changes the power-state of PCI devices from
    D3 to D0 at noirq time (to restore the PCI config registers) and before
    this commit we were bringing up the I2C controllers from a resume_early
    handler which runs later. More specifically the pm-core will first run
    all resume_noirq handlers in order and then all resume_early handlers.

    So we must not only make sure that the handlers are run in the right order,
    but also that the resume of the I2C controller is done at noirq time.

    The behavior before this commit, resuming the I2C controller from a
    resume_early handler leads to the following errors:

    i2c_designware 808622C1:06: controller timed out
    ACPI Error: AE_ERROR, Returned by Handler for [UserDefinedRegion]
    ACPI Error: Method parse/execution failed \_SB.P18W._ON, AE_ERROR
    video LNXVIDEO:00: Failed to change power state to D0

    This commit changes the acpi_lpss.c code to resume the BYT/CHT I2C
    controllers at resume_noirq time fixing this.

    Tested-by: Jarkko Nikula
    Signed-off-by: Hans de Goede
    Reviewed-by: Andy Shevchenko
    Signed-off-by: Rafael J. Wysocki

    Hans de Goede
     
  • On some Bay Trail systems the GPU ACPI fwnode has power-resources which
    point to the PMIC, which is connected over the LPSS I2C5 controller.

    This one was quite nasty to debug, unlike on CHT where the same problem
    leads to errors like these:

    i2c_designware 808622C1:06: controller timed out
    ACPI Error: AE_ERROR, Returned by Handler for [UserDefinedRegion]
    ACPI Error: Method parse/execution failed \_SB.P18W._ON, AE_ERROR
    video LNXVIDEO:00: Failed to change power state to D0

    On BYT the read-modify-write done by drivers/acpi/pmic/intel_pmic_xpower.c
    on the AXP288 PMIC register to change the power-resource state *seems* to
    succeed.

    But in reality, because the I2C controller has not been resumed yet, the
    read silently fails and returns the wrong value, where as the write does
    succeed, writing back the wrong value for all the other power-resources
    in the same register, turning off a bunch of them. Which of course does
    not end well.

    This commit adds a RPM consumer link from the GPU (which has a LNXVIDEO
    HID) to the BYT LPSS I2C5 controller, so that the I2C controller gets
    resumed before the GPU is resumed and thus before we try to change the
    power-resource.

    Signed-off-by: Hans de Goede
    Tested-by: Jarkko Nikula
    Reviewed-by: Andy Shevchenko
    Signed-off-by: Rafael J. Wysocki

    Hans de Goede
     
  • On some Cherry Trail systems the GPU ACPI fwnode has power-resources which
    point to the PMIC, which is connected over the LPSS I2C7 controller.

    Due to probe ordering currently we resume the GPU and thus try to access
    the ACPI power-resources before the I2C controller has been resumed. This
    leads to the following errors:

    i2c_designware 808622C1:06: controller timed out
    ACPI Error: AE_ERROR, Returned by Handler for [UserDefinedRegion]
    ACPI Error: Method parse/execution failed \_SB.P18W._ON, AE_ERROR
    video LNXVIDEO:00: Failed to change power state to D0

    This commit adds a RPM consumer link from the GPU (which has a LNXVIDEO
    HID) to the CHT LPSS I2C7 controller, so that the I2C controller gets
    resumed before the GPU is resumed.

    Tested-by: Jarkko Nikula
    Signed-off-by: Hans de Goede
    Reviewed-by: Andy Shevchenko
    Signed-off-by: Rafael J. Wysocki

    Hans de Goede
     
  • On some Cherry Trail systems the GPU ACPI fwnode has power-resources which
    point to the PMIC, which is connected over one of the LPSS I2C controllers.

    To get the suspend/resume ordering correct for this we need to be able to
    add device-links between the GPU and the I2c controller. The GPU is a PCI
    device, so this requires acpi_lpss_find_device() to also work on PCI devs.

    Tested-by: Jarkko Nikula
    Signed-off-by: Hans de Goede
    Reviewed-by: Andy Shevchenko
    Signed-off-by: Rafael J. Wysocki

    Hans de Goede
     
  • Make hid_uid_match helper accept a NULL uid argument, so that we can also
    check for matches against devices with are not expected to have a uid such
    as the LNXVIDEO device.

    Tested-by: Jarkko Nikula
    Signed-off-by: Hans de Goede
    Reviewed-by: Andy Shevchenko
    Signed-off-by: Rafael J. Wysocki

    Hans de Goede
     
  • The hid_uid_match() helper is only used to check if a given acpi_device
    matches a certain hid + uid combination. Make the first argument the
    acpi_device to check to make this more clear.

    Tested-by: Jarkko Nikula
    Signed-off-by: Hans de Goede
    Reviewed-by: Andy Shevchenko
    Signed-off-by: Rafael J. Wysocki

    Hans de Goede
     

17 Sep, 2018

1 commit

  • lpss_iosf_enter_d3_state() checks if all hw-blocks using the DMA
    controllers are in d3 before powering down the DMA controllers.

    But on devices, where the I2C bus connected to the PMIC is shared by
    the PUNIT, the controller for that bus will never reach d3 since it has
    an effectively empty _PS3 method. Instead it appears to automatically
    power-down during S0i3 and we never see it as being in d3.

    This causes the DMA controllers to never be powered-down on these devices,
    causing them to never reach S0i3. This commit uses the ACPI _SEM method
    to detect if an I2C bus is shared with the PUNIT and if it is, it removes
    it from the mask of devices which lpss_iosf_enter_d3_state() checks for.

    This fixes these devices never reaching any S0ix states.

    Signed-off-by: Hans de Goede
    Acked-by: Mika Westerberg
    Signed-off-by: Rafael J. Wysocki

    Hans de Goede
     

10 Sep, 2018

1 commit

  • Bay and Cherry Trail DSTDs represent a different set of devices depending
    on which OS the device think it is booting. One set of decices for Windows
    and another set of devices for Android which targets the Android-x86 Linux
    kernel fork (which e.g. used to have its own display driver instead of
    using the i915 driver).

    Which set of devices we are actually going to get is out of our control,
    this is controlled by the ACPI OSID variable, which gets either set through
    an EFI setup option, or sometimes is autodetected. So we need to support
    both.

    This commit adds support for the 80862286 and 808622C0 ACPI HIDs which we
    get for the first resp. second DMA controller on Cherry Trail devices when
    OSID is set to Android.

    Signed-off-by: Hans de Goede
    Reviewed-by: Andy Shevchenko
    Signed-off-by: Rafael J. Wysocki

    Hans de Goede
     

06 Sep, 2018

1 commit

  • Commit 12864ff8545f (ACPI / LPSS: Avoid PM quirks on suspend and resume
    from hibernation) bypasses lpss quirks for S3 and S4, by setting a flag
    for S3/S4 in acpi_lpss_suspend(), and check that flag in
    acpi_lpss_resume().

    But this overlooks the boot case where acpi_lpss_resume() may get called
    without a corresponding acpi_lpss_suspend() having been called.

    Thus force setting the flag during boot.

    Fixes: 12864ff8545f (ACPI / LPSS: Avoid PM quirks on suspend and resume from hibernation)
    Link: https://bugzilla.kernel.org/show_bug.cgi?id=200989
    Reported-and-tested-by: William Lieurance
    Signed-off-by: Zhang Rui
    Cc: 4.15+ # 4.15+: 12864ff8545f (ACPI / LPSS: Avoid ...)
    Signed-off-by: Rafael J. Wysocki

    Zhang Rui
     

27 Jul, 2018

1 commit

  • Commit a09c59130688 (ACPI / LPSS: Avoid PM quirks on suspend and
    resume from S3) modified the ACPI driver for Intel SoCs (LPSS) to
    avoid applying PM quirks on suspend and resume from S3 to address
    system-wide suspend and resume problems on some systems, but it is
    reported that the same issue also affects hibernation, so extend
    the approach used by that commit to cover hibernation as well.

    Fixes: a09c59130688 (ACPI / LPSS: Avoid PM quirks on suspend and resume from S3)
    Link: https://bugs.launchpad.net/bugs/1774950
    Reported-by: Kai-Heng Feng
    Cc: 4.15+ # 4.15+
    Signed-off-by: Rafael J. Wysocki
    Reviewed-by: Mika Westerberg

    Rafael J. Wysocki
     

21 Jun, 2018

1 commit

  • These are a stable-candidate suspend/resume fix of the ACPI driver for
    Intel SoCs (LPSS) and an inline stub fix for the ACPI processor driver.

    * acpi-soc:
    ACPI / LPSS: Avoid PM quirks on suspend and resume from S3

    * acpi-processor:
    ACPI / processor: Finish making acpi_processor_ppc_has_changed() void

    Rafael J. Wysocki
     

14 Jun, 2018

2 commits

  • It is reported that commit a192aa923b66a (ACPI / LPSS: Consolidate
    runtime PM and system sleep handling) introduced a system suspend
    regression on some machines, but the only functional change made by
    it was to cause the PM quirks in the LPSS to also be used during
    system suspend and resume. While that should always work for
    suspend-to-idle, it turns out to be problematic for S3
    (suspend-to-RAM).

    To address that issue restore the previous S3 suspend and resume
    behavior of the LPSS to avoid applying PM quirks then.

    Fixes: a192aa923b66a (ACPI / LPSS: Consolidate runtime PM and system sleep handling)
    Link: https://bugs.launchpad.net/bugs/1774950
    Reported-by: Kai-Heng Feng
    Tested-by: Kai-Heng Feng
    Signed-off-by: Rafael J. Wysocki
    Reviewed-by: Ulf Hansson
    Reviewed-by: Andy Shevchenko
    Acked-by: Mika Westerberg
    Cc: 4.15+ # 4.15+

    Rafael J. Wysocki
     
  • …ierry.reding/linux-pwm

    Pull pwm updates from Thierry Reding:
    "This contains a couple of fixes and cleanups for the Meson and
    ACPI/LPSS drivers as well as capture support for STM32.

    Note that given the cross- subsystem changes, the STM32 patches were
    merged through the MFD and PWM trees, both sharing an immutable
    branch"

    * tag 'pwm/for-4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm:
    pwm: stm32: Fix build warning with CONFIG_DMA_ENGINE disabled
    pwm: stm32: Enforce dependency on CONFIG_MFD_STM32_TIMERS
    ACPI / LPSS: Add missing prv_offset setting for byt/cht PWM devices
    pwm: lpss: platform: Save/restore the ctrl register over a suspend/resume
    dt-bindings: mfd: stm32-timers: Add support for dmas
    pwm: simplify getting .drvdata
    pwm: meson: Fix allocation of PWM channel array

    Linus Torvalds
     

06 Jun, 2018

1 commit

  • The LPSS PWM device on on Bay Trail and Cherry Trail devices has a set
    of private registers at offset 0x800, the current lpss_device_desc for
    them already sets the LPSS_SAVE_CTX flag to have these saved/restored
    over device-suspend, but the current lpss_device_desc was not setting
    the prv_offset field, leading to the regular device registers getting
    saved/restored instead.

    This is causing the PWM controller to no longer work, resulting in a black
    screen, after a suspend/resume on systems where the firmware clears the
    APB clock and reset bits at offset 0x804.

    This commit fixes this by properly setting prv_offset to 0x800 for
    the PWM devices.

    Cc: stable@vger.kernel.org
    Fixes: e1c748179754 ("ACPI / LPSS: Add Intel BayTrail ACPI mode PWM")
    Fixes: 1bfbd8eb8a7f ("ACPI / LPSS: Add ACPI IDs for Intel Braswell")
    Signed-off-by: Hans de Goede
    Acked-by: Rafael J . Wysocki
    Signed-off-by: Thierry Reding

    Hans de Goede