Bug 96981 - Thunderbolt hotplug not working on Macmini7,1
Summary: Thunderbolt hotplug not working on Macmini7,1
Status: NEW
Alias: None
Product: Drivers
Classification: Unclassified
Component: HotPlug (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Greg Kroah-Hartman
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-21 03:46 UTC by Adam Goode
Modified: 2015-09-25 23:55 UTC (History)
2 users (show)

See Also:
Kernel Version: 4.0.0-1.fc22.x86_64
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Adam Goode 2015-04-21 03:46:42 UTC
I am experimenting with Thunderbolt support on a newer Mac that claims to support Thunderbolt hotplug in Windows 8. (See https://support.apple.com/en-us/HT204154#26)

It is a "MacMini7,1".

This is good, since the new Linux thunderbolt driver doesn't seem to be doing anything on this system. (Only boot-present thunderbolt devices work.)

Unfortunately, with commit 7bc5a2bad0b8d9d1ac9f7b8b33150e4ddf197334 I can no longer seem to change the response to _OSI from anything but "Darwin".

This means that I cannot trigger this code in my DSDT:

                If (\_OSI ("Windows 2012"))
                {
                    OSYS = 0x07DC
                }

Which would enable some very interesting code just below:

                If ((OSYS >= 0x07DC))
                {
                    Debug = "Save Ridge Config on Boot"
                    R118 = UP18 /* External reference */
                    R119 = UP19 /* External reference */
                    R11A = UP1A /* External reference */
                    R11C = UP1C /* External reference */
                    R120 = UP20 /* External reference */
...


I am assuming "Ridge" is referring to Intel's thunderbolt controllers.


I suspect that with this newer series of Macs, we may be better off reporting as "Windows 2012" as before, without "Darwin".

At the very least, the hardcoding of "Darwin" should be configurable by a kernel flag, as "Linux" is in the same file.

I will try to build a kernel at some point and see if reverting the hardcoded "Darwin" will fix things.
Comment 1 Adam Goode 2015-04-21 04:00:17 UTC
There is other interesting code like this:

            If (!OSDW ())
            {
                If ((OSYS < 0x07DC))
                {
                    Debug = "RMCR Method called:"
                    \_SB.PCI0.RMCR ()
                }
                Else
                {
                    Debug = "RMCR skipped"
                }
            }


RMCR is "Remove Cactus Ridge", which has this debug message:
            Debug = "RMCR: Disable Link and Power Off Cactus Ridge Chip"


It looks like this BIOS does have the traditional hotplug support.
Comment 2 Greg Kroah-Hartman 2015-04-21 07:38:03 UTC
On Tue, Apr 21, 2015 at 03:46:42AM +0000, bugzilla-daemon@bugzilla.kernel.org wrote:
> https://bugzilla.kernel.org/show_bug.cgi?id=96981
> 
>             Bug ID: 96981
>            Summary: Thunderbolt hotplug not working on MacMini7,1

Please send this to the people listed in the MAINTAINERS file for
thunderbolt support, and the linux-kernel mailing list.
Comment 3 Adam Goode 2015-04-23 03:06:42 UTC
I sent this to lkml.

Also, an update. I was able to get this working. The only thing I needed to do was match on PCI_ANY_ID for subvendor and subdevice in the nhi_ids.

Previously it was matching .subvendor = 0x2222, .subdevice = 0x1111 which seems unnecessarily restrictive.
Comment 4 John Flatness 2015-09-25 23:55:07 UTC
Is this also resolved in light of Bug 100191? They seem to be the same thing.

Note You need to log in before you can comment on or make changes to this bug.