From: Thierry Reding <thierry.reding@gmail.com>
To: Hans de Goede <hdegoede@redhat.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
"Rafael J . Wysocki" <rjw@rjwysocki.net>,
Len Brown <lenb@kernel.org>,
linux-pwm@vger.kernel.org, linux-acpi@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH v2 1/2] pwm: lpss: platform: Save/restore the ctrl register over a suspend/resume
Date: Wed, 6 Jun 2018 10:03:51 +0200 [thread overview]
Message-ID: <20180606080351.GA11810@ulmo> (raw)
In-Reply-To: <20180426121024.22023-1-hdegoede@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1805 bytes --]
On Thu, Apr 26, 2018 at 02:10:23PM +0200, Hans de Goede wrote:
> On some devices the contents of the ctrl register get lost over a
> suspend/resume and the PWM comes back up disabled after the resume.
>
> This is seen on some Bay Trail devices with the PWM in ACPI enumerated
> mode, so it shows up as a platform device instead of a PCI device.
>
> If we still think it is enabled and then try to change the duty-cycle
> after this, we end up with a "PWM_SW_UPDATE was not cleared" error and
> the PWM is stuck in that state from then on.
>
> This commit adds suspend and resume pm callbacks to the pwm-lpss-platform
> code, which save/restore the ctrl register over a suspend/resume, fixing
> this.
>
> Note that:
>
> 1) There is no need to do this over a runtime suspend, since we
> only runtime suspend when disabled and then we properly set the enable
> bit and reprogram the timings when we re-enable the PWM.
>
> 2) This may be happening on more systems then we realize, but has been
> covered up sofar by a bug in the acpi-lpss.c code which was save/restoring
> the regular device registers instead of the lpss private registers due to
> lpss_device_desc.prv_offset not being set. This is fixed by a later patch
> in this series.
>
> Cc: stable@vger.kernel.org
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
> Changes in v2:
> -Add Cc: stable@vger.kernel.org to make sure this goes into stable
> together with "ACPI / LPSS: Add missing prv_offset setting for byt/cht
> PWM devices" which depends on this
> ---
> drivers/pwm/pwm-lpss-platform.c | 5 +++++
> drivers/pwm/pwm-lpss.c | 30 ++++++++++++++++++++++++++++++
> drivers/pwm/pwm-lpss.h | 2 ++
> 3 files changed, 37 insertions(+)
Applied, thanks.
Thierry
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2018-06-06 8:03 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-26 12:10 [PATCH v2 1/2] pwm: lpss: platform: Save/restore the ctrl register over a suspend/resume Hans de Goede
2018-04-26 12:10 ` [PATCH v2 2/2] ACPI / LPSS: Add missing prv_offset setting for byt/cht PWM devices Hans de Goede
2018-05-10 15:25 ` [PATCH v2 1/2] pwm: lpss: platform: Save/restore the ctrl register over a suspend/resume Rafael J. Wysocki
2018-05-14 11:10 ` Andy Shevchenko
2018-05-14 11:50 ` Thierry Reding
2018-05-14 14:08 ` Hans de Goede
2018-05-14 20:36 ` Rafael J. Wysocki
2018-06-01 13:54 ` Hans de Goede
2018-06-06 8:03 ` Thierry Reding [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180606080351.GA11810@ulmo \
--to=thierry.reding@gmail.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=hdegoede@redhat.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=rjw@rjwysocki.net \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).