Bug 100191
Summary: | pciehp + tg3: Apple Thunderbolt 2 Gigabit Ethernet dongle not hot-pluggable (on MacbookPro12,1 2015 edition) | ||
---|---|---|---|
Product: | Drivers | Reporter: | Tormen (tormen) |
Component: | Network | Assignee: | drivers_network (drivers_network) |
Status: | RESOLVED CODE_FIX | ||
Severity: | normal | CC: | hugo, ivenvd, john, justin, kakuro69, ptitjes, thejoe, tim.sammut, tormen, victor.tran1 |
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 4.2.0 | Subsystem: | |
Regression: | No | Bisected commit-id: | |
Attachments: |
lspci -vvv after boot (startup) with plugged apple network dongle
working patch (kernel 4.2.0) fixing the problem |
Description
Tormen
2015-06-20 21:59:26 UTC
Just to precise: When the dongle gets recognized during boot-up it seems to work 100% fine and without any problems. The problem is with the recognition when unplugged and replugged. Another precision about just unplugging and replugging the network cable : Keeping the dongle plugged to the notebook and just remove the network cable seems to get the same effect: Replugging the network cable does NOT bring back (up) the interface "ens9": At this point the interface "ens9" was still listed in the output of "ip link list" Running an explicit "dhclient ens9" on the interface did result in a "Interface ens9 does not exist" error message and then a hanging dhclient. Hi, Please let me know if there is anything else I can provide or do to help ? Tormen I confirm this bug exists in MacbookPro12,1. Ping. Anybody ? It's not just the Ethernet adapter. Thunderbolt --> VGA adapter fails to work as well on a MacbookPro9,2. It fails to work at all - not even when connected at boot, so I had to downgrade my kernel because I rely on my second screen quite a lot. I can confirm that this issue is still present exactly as described so far on kernel 4.2.0-rc7 on a MacbookPro12,1 (mid-2015 15") Only for ethernet adapters however. I have a mini-display port to DVI cable that works and hotplugs correctly; it goes in the same port, but isn't exactly Thunderbolt. The issue for thunderbolt graphics adapters may remain.
For info:
I got a comment from one of the kernel PCI hotplug (pciehp) maintainers:
On Wed, Sep 02, 2015 at 04:35:49PM +0200, Tormen wrote:
> The bug is related to Broadcom tg3 driver and the pciehp hotplug framework.
> In order to sort out where the problem(s) lies, I wanted to kindly ask
> you if you could have a look at the bug :
> https://bugzilla.kernel.org/show_bug.cgi?id=100191
> ?
> And/or if you could help me figuring out if pciehp is causing this
> problem and/or if tg3 is to blame.
Odds are neither are the issue, this is a thunderbolt problem. Make
sure you have enabled thunderbolt properly in your kernel if you want
hot-add of a device to work.
I think the code has only been tested on older macbooks, changes might
be needed for newer ones given that Apple's thunderbolt controller is
"special" (i.e. doesn't follow the specification.)
good luck!
greg k-h
Probably not a lot of help at this stage, but I also experienced the same (only works on boot, no hotplug support) for an Apple thunderbolt display as well as the ethernet dongles. For some reason, my thunderbolt display doesn't even work on boot. Like I said, I'm using kernel 4.1 because I can't live without a second display. (MacBookPro 9,2) I had it work with kernel 4.2RC7. I haven't tested it with anything older. Perhaps try that first? (In reply to Justin Dray from comment #11) > I had it work with kernel 4.2RC7. I haven't tested it with anything older. > Perhaps try that first? Does it works also if you hotplug it? I want to precise : When booting / starting the notebook without the Apple VGA adapter plugged, then plugging it : It just works (tm) !! ... and always has worked for me -- current kernel 4.1.6. I checked dmesg: there is no messages when plugging unplugging appearing. Whereas starting without the Apple Ethernet adapter, then plugging it : It does NOT work. -------------------------- Besides I wanted to share another comment on this missing-functionality bug-report that I have received in the linux-hotplug@vger.kernel.org mailing list - thanks a lot Greg ! :) On 09/05/2015 05:38 AM, Greg KH wrote: > On Fri, Sep 04, 2015 at 09:54:18AM +0200, Tormen wrote: >> > On 09/02/2015 05:27 PM, Greg KH wrote: >>> > > On Wed, Sep 02, 2015 at 04:35:49PM +0200, Tormen wrote: >>>> > >> Hi, >>>> > >> >>>> > >> I am contacting you, hoping that either you can maybe help >>>> > >> or you know someone who can help :) >>>> > >> >>>> > >> I opened a bug related to the tg3 driver when hot-plugging via >>>> pciehp: >>>> > >> https://bugzilla.kernel.org/show_bug.cgi?id=100191 >>>> > >> >>>> > >> I am desperate because : >>>> > >> (a) there is also a brcmfmac related driver. >>>> > >> So both wireless and wired internet have problems: >>>> > >> https://bugzilla.kernel.org/show_bug.cgi?id=100201 >>>> > >> (b) there was no input by anybody so far. Maybe because I >>>> wrongly >>>> > >> categorized the tg3 bug ? >>>> > >> >>>> > >> The bug is related to Broadcom tg3 driver and the pciehp hotplug >>>> framework. >>>> > >> In order to sort out where the problem(s) lies, I wanted to kindly >>>> ask >>>> > >> you if you could have a look at the bug : >>>> > >> https://bugzilla.kernel.org/show_bug.cgi?id=100191 >>>> > >> ? >>>> > >> And/or if you could help me figuring out if pciehp is causing this >>>> > >> problem and/or if tg3 is to blame. >>> > > >>> > > Odds are neither are the issue, this is a thunderbolt problem. Make >>> > > sure you have enabled thunderbolt properly in your kernel if you want >>> > > hot-add of a device to work. >>> > > >>> > > I think the code has only been tested on older macbooks, changes might >>> > > be needed for newer ones given that Apple's thunderbolt controller is >>> > > "special" (i.e. doesn't follow the specification.) >>> > > >>> > > good luck! >>> > > >>> > > greg k-h >>> > > >> > >> > Thanks a lot for your feedback ! >> > >> > Is "the code" that you are referring to the thunderbolt kernel module ? > Yes. > >> > The kernel I am using uses: >> > CONFIG_THUNDERBOLT=m -- The module will be called thunderbolt. >> > But when I boot-up with the plugged network device, lsmod does not show >> > thunderbolt. > Have you loaded that module? Please do so: > modprobe thunderbolt > >> > So not sure how I can check further if thunderbolt is properly in my >> kernel? >> > Or is it possible that I would need to load the thunderbolt module >> > manually in order to make hotplug work? > Maybe. > >> > When the network driver is loaded it seems to connect as a "PCI Express" >> > device: >> > tg3 0000:0a:00.0 eth0: Tigon3 [partno(BCM957762) rev 57766000] (PCI >> > Express) > That's separate from the thunderbolt controller. > >> > When I unplug the adapter the first thing appearing in dmesg is pciehp: >> > [ 210.992938] usb 1-2: USB disconnect, device number 4 >> > [ 1557.453818] pciehp 0000:06:03.0:pcie24: slot(3-2): Link Down event >> > [ 1557.453870] pciehp 0000:06:03.0:pcie24: Cannot remove display device >> > 0000:08:00.0 >> > [ 1557.509812] pciehp 0000:06:03.0:pcie24: Card not present on Slot(3-2) >> > [ 1558.721344] tg3 0000:0a:00.0: tg3_abort_hw timed out, TX_MODE_ENABLE >> > will not clear MAC_TX_MODE=ffffffff >> > [ 1558.934601] pciehp 0000:09:00.0:pcie24: unloading service driver pciehp >> > [ 1558.935366] pciehp 0000:09:00.0:pcie24: Timeout on hotplug command >> > 0x1038 (issued 1557532 msec ago) >> > [ 1558.943460] pci_bus 0000:0a: busn_res: [bus 0a] is released >> > [ 1558.958426] pci_bus 0000:09: busn_res: [bus 09-0a] is released >> > [ 1558.958432] acpiphp: Slot [1] unregistered >> > [ 1558.958451] acpiphp: Slot [2-1] unregistered >> > [ 1558.958464] acpiphp: Slot [3-1] unregistered >> > [ 1558.958475] acpiphp: Slot [4-1] unregistered >> > [ 1558.958486] acpiphp: Slot [5-1] unregistered >> > >> > But I am not a kernel, pciehp, thunderbolt specialist :( >> > >> > How can I determine why the pciehp hotplug command 0x1038 timed out ? > No idea, sorry, this is very odd hardware that doesn't follow any spec. > Try emailing the author of the thunderbolt code, they should be able to > help you out more. > > good luck, > > greg k-h > For a reference - and it might be interesting to see if there are different versions out there: The model of the "Apple Thunderbolt Gigabit Ethernet Hotplug Adapter Dongle" ;) I am referring about is: Model A1433 EMC 2590 (as written in light grey on the dongle itself) + I apologize : But the VGA thunderbolt adapter I am using is NOT from Apple but I am using this one : http://www.amazon.fr/dp/B00JDNYYIY/ref=pe_386181_51767671_TE_dp_1 + In the meanwhile I am a happy camper using this USB3 dongle which "just works" (tm) :)) http://www.amazon.de/dp/B00YHAD5C4/ref=pe_386171_51767411_TE_dp_1 That linked adapter is display port; not thunderbolt. The apple ports also do display port on the same physical connector. And display port works fine, plugging and hot plugging; only thunderbolt adapters do not seem to work. Hi Justin. Yes, forgot about that ;) ... and the Apple VGA adapter is thunderbolt ? Created attachment 187481 [details]
lspci -vvv after boot (startup) with plugged apple network dongle
Created attachment 187741 [details]
working patch (kernel 4.2.0) fixing the problem
In correspondence with the maintainer of the thunderbolt kernel module (Andreas Noever) the attached patch was created and tested by myself and I can confirm that :
* starting the notebook WITHOUT the dongle attached
* then plugging the dongle, the network interface gets available
* unplugging makes the network interface disappear
* replugging the dongle makes the network interface re-appear !
:)
At this point I am so happy that I have to shout : THANKS A LOT TO GREG AND ANDREAS !!!
I'll see with Andreas how this change can make it into the kernel.
tormen
For the record here is the analysis and comment from Andreas that led to the working patch: """""""""""""""""""""""""""""""""""""""""""""""""""""""""" The pci device ids listed in the tb driver are to restrictive, which prevents the driver from being loaded. We have had a similar issue with the new Mac mini. Could you try to change subvendor and subdevice to PCI_ANY_ID in http://lxr.free-electrons.com/source/drivers/thunderbolt/nhi.c#L646 (for the second entry with .device = 0x156c). With this change the thunderbolt driver should load and bind to the pci device 07:00.0 System peripheral: Intel Corporation Device 156c which is the thunderbolt controller (look for thunderbolt in dmesg). I have never tested the driver with a thunderbolt 2 controller. But with some luck it might *just work*. :) """""""""""""""""""""""""""""""""""""""""""""""""""""""" And this did *just work* :)) I just tried it on mine, I left my thunderbolt ethernet adapter 9000km away, but I have a thunderbolt display here. After applying that patch to 4.3rc1 I can still detect it on startup; attached keyboard/mouse/hdd work fine. When I replug it, the monitor is no longer detected; but oddly enough the keyboard, mouse and even the webcam work fine! Hi. I don't have the thunderbolt display dongle. Just a displayport - vga dongle, which worked and works fine :) * Keyboard/mouse is XHCI (usb3) and * hdd is pci, so they are independent of thunderbolt. * Webcam : Did not try to use it, so can't tell for now. Otherwise I just tested: Booting with network dongle attached -> worked, then unplugged it and replugged it -> reworked again ! :) So as far as this bug is concerned (apple network dongle tg3 -> thunderbolt), all seems to be in order :) tormen I also confirm the network dongle replugging issue has been fixed by the patch.(Patched Linux 4.2) (In reply to Iven from comment #22) > I also confirm the network dongle replugging issue has been fixed by the > patch.(Patched Linux 4.2) Does it works by inserting the dongle after the OS has booted? Cold boot. Pour info : I tested both cases and both works fine now: I tried cold boot (see comment 18) and it works fine. I tried the non - cold boot (warm boot?) and it works fine too (see comment 21). (In reply to Tormen from comment #24) > Pour info : I tested both cases and both works fine now: > > I tried cold boot (see comment 18) and it works fine. > I tried the non - cold boot (warm boot?) and it works fine too (see comment > 21). Thank you very much Tormen for your reply, much appreciated! :) .... it's my bug, so I care ;) @Iven (Comment 22) : Thanks for the feedback ! I have a display port -> DVI adapter and that worked fine on all kernels; only thunderbolt displays and ethernet adapters had issues. I only have a thunderbolt display for the next 2 months, then I'm moving away from here, and can't justify the expense of buying one myself, but I can get any required info in that time. Should it be a separate bug? It's still a thunderbolt hot-swap issue on the new macbooks like this one. Hi Justin, As the described issue (see title of bug) is really 100% fixed with the patch, I'd say, lets close this baby. I won't open a new bug for the graphics adapter. As I am a happy camper with my Display-port VGA adapter (Which was btw 50% of the price of Apples thunderbolt adapter ;). Tormen should this be closed now, or after it's been accepted into the tree? As I got the following confirmation of the upstream acceptance of the patch: ================================================================== This is a note to let you know that I've just added the patch titled thunderbolt: Allow loading of module on recent Apple MacBooks with to my char-misc git tree which can be found at git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git in the char-misc-linus branch. The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.) The patch will hopefully also be merged in Linus's tree for the next -rc kernel release. ================================================================= I already closed this. ... but I'll follow through if the patch makes it into the kernel :) |