1. 07 6月, 2021 1 次提交
  2. 08 4月, 2021 1 次提交
  3. 26 9月, 2020 1 次提交
  4. 06 9月, 2020 2 次提交
    • H
      ACPI / LPSS: Save Cherry Trail PWM ctx registers only once (at activation) · 15aa5e4c
      Hans de Goede 提交于
      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: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200903112337.4113-3-hdegoede@redhat.com
      15aa5e4c
    • H
      ACPI / LPSS: Resume Cherry Trail PWM controller in no-irq phase · 5e31ee84
      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: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200903112337.4113-2-hdegoede@redhat.com
      5e31ee84
  5. 25 4月, 2020 3 次提交
    • R
      PM: sleep: core: Rename dev_pm_smart_suspend_and_suspended() · fa2bfead
      Rafael J. Wysocki 提交于
      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: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Acked-by: NBjorn Helgaas <bhelgaas@google.com>
      fa2bfead
    • R
      PM: sleep: core: Rename dev_pm_may_skip_resume() · 76c70cb5
      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: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Acked-by: NBjorn Helgaas <bhelgaas@google.com>
      76c70cb5
    • R
      PM: sleep: core: Do not skip callbacks in the resume phase · 6e176bf8
      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: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Acked-by: NBjorn Helgaas <bhelgaas@google.com>
      6e176bf8
  6. 25 3月, 2020 1 次提交
  7. 17 12月, 2019 1 次提交
    • H
      ACPI / LPSS: Rename pwm_backlight pwm-lookup to pwm_soc_backlight · b2147a3a
      Hans de Goede 提交于
      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: NJani Nikula <jani.nikula@intel.com>
      Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Acked-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191216202906.1662893-2-hdegoede@redhat.com
      b2147a3a
  8. 25 10月, 2019 3 次提交
  9. 15 10月, 2019 1 次提交
  10. 23 8月, 2019 1 次提交
  11. 03 7月, 2019 2 次提交
  12. 24 6月, 2019 1 次提交
    • S
      bus_find_device: Unify the match callback with class_find_device · 418e3ea1
      Suzuki K Poulose 提交于
      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 <alexander.shishkin@linux.intel.com>
      Cc: Andrew Lunn <andrew@lunn.ch>
      Cc: Andreas Noever <andreas.noever@gmail.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: Corey Minyard <minyard@acm.org>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: David Kershner <david.kershner@unisys.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Felipe Balbi <balbi@kernel.org>
      Cc: Frank Rowand <frowand.list@gmail.com>
      Cc: Grygorii Strashko <grygorii.strashko@ti.com>
      Cc: Harald Freudenberger <freude@linux.ibm.com>
      Cc: Hartmut Knaack <knaack.h@gmx.de>
      Cc: Heiko Stuebner <heiko@sntech.de>
      Cc: Jason Gunthorpe <jgg@ziepe.ca>
      Cc: Jonathan Cameron <jic23@kernel.org>
      Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
      Cc: Len Brown <lenb@kernel.org>
      Cc: Mark Brown <broonie@kernel.org>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Michael Jamet <michael.jamet@intel.com>
      Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
      Cc: Peter Oberparleiter <oberpar@linux.ibm.com>
      Cc: Sebastian Ott <sebott@linux.ibm.com>
      Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
      Cc: Yehezkel Bernat <YehezkelShB@gmail.com>
      Cc: rafael@kernel.org
      Acked-by: NCorey Minyard <minyard@acm.org>
      Acked-by: NDavid Kershner <david.kershner@unisys.com>
      Acked-by: NMark Brown <broonie@kernel.org>
      Acked-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
      Acked-by: Wolfram Sang <wsa@the-dreams.de> # for the I2C parts
      Acked-by: NRob Herring <robh@kernel.org>
      Signed-off-by: NSuzuki K Poulose <suzuki.poulose@arm.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      418e3ea1
  13. 19 6月, 2019 1 次提交
  14. 18 4月, 2019 1 次提交
  15. 22 2月, 2019 1 次提交
  16. 13 12月, 2018 1 次提交
    • H
      ACPI / LPSS: Ignore acpi_device_fix_up_power() return value · 1a2fa02f
      Hans de Goede 提交于
      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: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      1a2fa02f
  17. 02 10月, 2018 1 次提交
    • P
      x86/cpu: Sanitize FAM6_ATOM naming · f2c4db1b
      Peter Zijlstra 提交于
      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: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vince Weaver <vincent.weaver@maine.edu>
      Cc: dave.hansen@linux.intel.com
      Cc: len.brown@intel.com
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      f2c4db1b
  18. 01 10月, 2018 6 次提交
  19. 17 9月, 2018 1 次提交
    • H
      ACPI / LPSS: Exclude I2C busses shared with PUNIT from pmc_atom_d3_mask · 86b62e5c
      Hans de Goede 提交于
      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: NHans de Goede <hdegoede@redhat.com>
      Acked-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      86b62e5c
  20. 10 9月, 2018 1 次提交
  21. 06 9月, 2018 1 次提交
  22. 27 7月, 2018 1 次提交
  23. 14 6月, 2018 1 次提交
  24. 06 6月, 2018 1 次提交
    • H
      ACPI / LPSS: Add missing prv_offset setting for byt/cht PWM devices · fdcb613d
      Hans de Goede 提交于
      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: e1c74817 ("ACPI / LPSS: Add Intel BayTrail ACPI mode PWM")
      Fixes: 1bfbd8eb ("ACPI / LPSS: Add ACPI IDs for Intel Braswell")
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Acked-by: NRafael J . Wysocki <rjw@rjwysocki.net>
      Signed-off-by: NThierry Reding <thierry.reding@gmail.com>
      fdcb613d
  25. 10 5月, 2018 1 次提交
    • H
      ACPI / LPSS: Only call pwm_add_table() for Bay Trail PWM if PMIC HRV is 2 · c975e472
      Hans de Goede 提交于
      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: NHans de Goede <hdegoede@redhat.com>
      Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      c975e472
  26. 16 1月, 2018 1 次提交
    • H
      ACPI / LPSS: Do not instiate platform_dev for devs without MMIO resources · e1681599
      Hans de Goede 提交于
      acpi_lpss_create_device() skips handling LPSS devices which do not have
      a mmio resources in their resource list (typically these devices are
      disabled by the firmware). But since the LPSS code does not bind to the
      device, acpi_bus_attach() ends up still creating a platform device for
      it and the regular platform_driver for the ACPI HID still tries to bind
      to it.
      
      This happens e.g. on some boards which do not use the pwm-controller
      and have an empty or invalid resource-table for it. Currently this causes
      these error messages to get logged:
      
      [    3.281966] pwm-lpss 80862288:00: invalid resource
      [    3.287098] pwm-lpss: probe of 80862288:00 failed with error -22
      
      This commit stops the undesirable creation of a platform_device for
      disabled LPSS devices by setting pnp.type.platform_id to 0. Note that
      acpi_scan_attach_handler() also sets pnp.type.platform_id to 0 when there
      is a matching handler for the device and that handler has no attach
      callback, so we simply behave as a handler without an attach function
      in this case.
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Acked-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      e1681599
  27. 16 12月, 2017 1 次提交
  28. 09 11月, 2017 1 次提交
  29. 06 11月, 2017 1 次提交
    • R
      ACPI / PM: Take SMART_SUSPEND driver flag into account · 05087360
      Rafael J. Wysocki 提交于
      Make the ACPI PM domain take DPM_FLAG_SMART_SUSPEND into account in
      its system suspend callbacks.
      
      [Note that the pm_runtime_suspended() check in acpi_dev_needs_resume()
      is an optimization, because if is not passed, all of the subsequent
      checks may be skipped and some of them are much more overhead in
      general.]
      
      Also use the observation that if the device is in runtime suspend
      at the beginning of the "late" phase of a system-wide suspend-like
      transition, its state cannot change going forward (runtime PM is
      disabled for it at that time) until the transition is over and the
      subsequent system-wide PM callbacks should be skipped for it (as
      they generally assume the device to not be suspended), so add
      checks for that in acpi_subsys_suspend_late/noirq() and
      acpi_subsys_freeze_late/noirq().
      
      Moreover, if acpi_subsys_resume_noirq() is called during the
      subsequent system-wide resume transition and if the device was left
      in runtime suspend previously, its runtime PM status needs to be
      changed to "active" as it is going to be put into the full-power
      state going forward, so add a check for that too in there.
      
      In turn, if acpi_subsys_thaw_noirq() runs after the device has been
      left in runtime suspend, the subsequent "thaw" callbacks need
      to be skipped for it (as they may not work correctly with a
      suspended device), so set the power.direct_complete flag for the
      device then to make the PM core skip those callbacks.
      
      On top of the above, make the analogous changes in the acpi_lpss
      driver that uses the ACPI PM domain callbacks.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      05087360