linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lukas Wunner <lukas@wunner.de>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: Stefan Richter <stefanr@s5r6.in-berlin.de>,
	Vaibhav Gupta <vaibhavgupta40@gmail.com>,
	"Rafael J . Wysocki" <rafael@kernel.org>,
	linux1394-devel@lists.sourceforge.net, linux-pci@vger.kernel.org,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Bjorn Helgaas <bhelgaas@google.com>
Subject: Re: [PATCH v2] firewire: ohci: convert to generic power management
Date: Thu, 27 Oct 2022 08:03:42 +0200	[thread overview]
Message-ID: <20221027060342.GA444@wunner.de> (raw)
In-Reply-To: <20221025212521.686779-1-helgaas@kernel.org>

On Tue, Oct 25, 2022 at 04:25:21PM -0500, Bjorn Helgaas wrote:
> N.B. This changes the order of pmac_ohci_off() and pmac_ohci_on().
> Previously, pmac_ohci_off() was called *after* pci_save_state() and
> pci_set_power_state(), and this change calls it *before*.
> 
> Similarly, pmac_ohci_on() was previously called *before*
> pci_set_power_state() and pci_restore_state() and this change calls it
> *after*.

Seems likely the ordering change may break things.

pmac_ohci_on/off() toggles PMAC_FTR_1394_ENABLE, which is defined as:

 * enable/disable the firewire cell of an uninorth ASIC.

It sounds like it will cut power to the firewire controller and I'd
expect that pci_save_state() will then not be able to access config
space.

The only way to make this work is to define a struct dev_pm_domain
whose ->suspend_noirq callback first invokes the pci_bus_type
->suspend_noirq callback and then cuts power to the firewire cell
by calling pmac_ohci_off().

I've done something like this for Thunderbolt power management on
x86 Macs a few years back but didn't get around to upstream it so far:

https://github.com/l1k/linux/commit/4db7f0b1f5c9

Thanks,

Lukas

  parent reply	other threads:[~2022-10-27  6:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-25 21:25 [PATCH v2] firewire: ohci: convert to generic power management Bjorn Helgaas
2022-10-25 21:41 ` Bjorn Helgaas
2022-10-27  6:03 ` Lukas Wunner [this message]
2022-10-27 21:36   ` Bjorn Helgaas
  -- strict thread matches above, loose matches on Subject: below --
2022-06-07 21:21 [PATCH v2] firewire: ohci: Convert " Bjorn Helgaas
2022-06-08 14:24 ` Bjorn Helgaas

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=20221027060342.GA444@wunner.de \
    --to=lukas@wunner.de \
    --cc=bhelgaas@google.com \
    --cc=helgaas@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux1394-devel@lists.sourceforge.net \
    --cc=rafael@kernel.org \
    --cc=stefanr@s5r6.in-berlin.de \
    --cc=vaibhavgupta40@gmail.com \
    /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).