public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Matthew Garrett <mjg59@srcf.ucam.org>
To: Andreas Noever <andreas.noever@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 00/12] Thunderbolt hotplug support for Apple hardware (testers needed)
Date: Mon, 2 Dec 2013 16:29:39 +0000	[thread overview]
Message-ID: <20131202162938.GA11241@srcf.ucam.org> (raw)
In-Reply-To: <1385688949-7101-1-git-send-email-andreas.noever@gmail.com>

On Fri, Nov 29, 2013 at 02:35:37AM +0100, Andreas Noever wrote:> 
> There are still a number of limitations:
>  (1) The system must be booted with acpi_osi=Darwin. Otherwise ACPI will cut
> power to the controller.
>  (2) After suspend the controller is gone. I think that ACPI thinks that we are
> Windows and cuts power, even with acpi_osi=Darwin.

There's a few ACPI methods involved here. The first is DTLK, which is 
called by the firmware on resume. It'll cut power to the chip. So, you 
need to be able to power it back up. However, you only want to power it 
up if there's a device connected. The XRIL method will return 1 if 
there's a device connected and 0 otherwise. If there's a device 
connected, call XRPE with an argument of 1 to power it back up.

That works fine if there's no hotplugging involved, but there is so 
things get a little more complicated. Apple provide an out of band 
mechanism for receiving notifications on the device. Call the _GPE 
method and install a gpe handler for the value that you get back. This 
will be called on every device plug or unplug (possibly just plug? It's 
been a while since I tested). Call XRIL to confirm that there's a device 
attached and then call XRPE to power it up.

At least, that's my recollection. There's also the SXIO, SXIL, SXLV and 
SXFP methods that provide some kind of power management, but I'm not 
sure how those fit in.

If you want to confirm that you're supposed to be using these methods, 
call _DSM on the device with a UUID of 
C6B7B5A0-1813-1C44-B0C9-FE695EAF949B (see DTGP in the DSDT), arg1 of 1, 
arg2 of 0. If it's an Apple you'll get back return value of 1 and a 
buffer containing the string "power-save". If it's not an Apple, or if 
the device doesn't support power saving, you'll get back a zero or an 
error that the method wasn't found.


-- 
Matthew Garrett | mjg59@srcf.ucam.org

  parent reply	other threads:[~2013-12-02 16:29 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-29  1:35 [PATCH 00/12] Thunderbolt hotplug support for Apple hardware (testers needed) Andreas Noever
2013-11-29  1:35 ` [PATCH 01/12] thunderbolt: Add initial cactus ridge NHI support Andreas Noever
2013-11-29  1:35 ` [PATCH 02/12] thunderbolt: Add configuration channel interface Andreas Noever
2013-11-29  1:35 ` [PATCH 03/12] thunderbolt: Setup configuration channel Andreas Noever
2013-11-29  1:35 ` [PATCH 04/12] thunderbolt: Add tb_regs.h Andreas Noever
2013-11-29  1:35 ` [PATCH 05/12] thunderbolt: Initialize root switch and ports Andreas Noever
2013-11-29  1:35 ` [PATCH 06/12] thunderbolt: Add thunderbolt capability handling Andreas Noever
2013-11-29  1:35 ` [PATCH 07/12] thunderbolt: Enable plug events Andreas Noever
2013-11-29  1:35 ` [PATCH 08/12] thunderbolt: Scan for downstream switches Andreas Noever
2013-11-29  1:35 ` [PATCH 09/12] thunderbolt: Handle hotplug events Andreas Noever
2013-11-29  1:35 ` [PATCH 10/12] thunderbolt: Add path setup code Andreas Noever
2013-11-29  1:35 ` [PATCH 11/12] thunderbolt: Add support for simple pci tunnels Andreas Noever
2013-11-29  1:35 ` [PATCH 12/12] thunderbolt: Scan and activate one PCI device Andreas Noever
2013-12-02 16:29 ` Matthew Garrett [this message]
2014-03-04  0:09   ` [PATCH 00/12] Thunderbolt hotplug support for Apple hardware (testers needed) Matthew Garrett
2014-03-04 23:59     ` Andreas Noever
2014-03-05  0:26       ` Matthew Garrett
2014-03-08  2:40       ` Matthew Garrett
2014-03-11 13:08         ` Andreas Noever
2014-03-11 14:00           ` Matthew Garrett
  -- strict thread matches above, loose matches on Subject: below --
2013-11-29  9:05 Daniel J Blueman
2013-12-02  2:51 ` Daniel J Blueman
     [not found]   ` <CAMxnaaX67fnKS0bfmqeKR8WfEJUccpUCfwJVAkE57nNmHYic9w@mail.gmail.com>
2013-12-02 13:10     ` Daniel J Blueman

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=20131202162938.GA11241@srcf.ucam.org \
    --to=mjg59@srcf.ucam.org \
    --cc=andreas.noever@gmail.com \
    --cc=linux-kernel@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