From: Bjorn Helgaas <helgaas@kernel.org>
To: Lukas Wunner <lukas@wunner.de>
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 16:36:20 -0500 [thread overview]
Message-ID: <20221027213620.GA842366@bhelgaas> (raw)
In-Reply-To: <20221027060342.GA444@wunner.de>
On Thu, Oct 27, 2022 at 08:03:42AM +0200, Lukas Wunner wrote:
> 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.
Yeah, definitely a risk, so I won't merge this myself since I have no
insight or way to test it.
> 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
Wow, that's some impressive reverse engineering and work!
We're not quite there yet, but if we ever get to the point where this
driver is the only thing preventing us from removing the PCI legacy PM
hooks, I think I'd be inclined to just sacrifice PM completely for
this driver. I can't really see putting in the kind of work you did
for Thunderbolt.
Bjorn
next prev parent reply other threads:[~2022-10-27 21:36 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
2022-10-27 21:36 ` Bjorn Helgaas [this message]
-- 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=20221027213620.GA842366@bhelgaas \
--to=helgaas@kernel.org \
--cc=bhelgaas@google.com \
--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=lukas@wunner.de \
--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).