From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Fri, 14 Dec 2012 12:34:33 +0200 From: "Kirill A. Shutemov" To: Linus Torvalds Cc: Yinghai Lu , Greg KH , Miles J Penner , John Ronciak , Mika Westerberg , Tushar N Dave , "Kirill A. Shutemov" , Bjorn Helgaas , Jesse Barnes , Amos Kong , "Rafael J. Wysocki" , "linux-pci@vger.kernel.org" , Linux Kernel Mailing List Subject: Re: [PATCH 3/3] PCI Hotplug: workaround for Thunderbolt on Intel DZ77RE-75K motherboard Message-ID: <20121214103433.GA15240@otc-wbsnb-06> References: <1355412708-20046-1-git-send-email-kirill.shutemov@linux.intel.com> <1355412708-20046-4-git-send-email-kirill.shutemov@linux.intel.com> <20121213184820.GC12105@kroah.com> <20121213200857.GA24939@otc-wbsnb-06> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="vkogqOf2sHV7VnPd" In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-ID: --vkogqOf2sHV7VnPd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Dec 13, 2012 at 12:30:04PM -0800, Linus Torvalds wrote: > On Thu, Dec 13, 2012 at 12:25 PM, Yinghai Lu wrote: > > > > Linus will not be happy with those kind of delay. >=20 > Indeed. And the DMI check is bogus too, since the "there can be > delays" is apparently part of the pcie hotplug spec. >=20 > So do the sane thing. Retry a few times, with increasingly long delays > (ie something like start with 10ms, then double the delay until you > hit 1s, and then just give up: end result, ~2s total wait, but 10ms > for any sane device that doesn't suck). >=20 > No DMI checks, no hacks, not insane default delays. I've realized that there's no strong criteria of hotplug success in ACPI PCI Hotplug. We can't know when we should stop retrying. In Thunderbolt case before any devices hotplugged you only see a root port. Thunderbolt host controller is powered off and kernel can't see it. On hotplug BIOS enables the host controller, initialize it and notify OS about hotplug. Normally kernel will enumerate 6 ports on Thunderbolt host controller, 2 ports on device Thunderbolt controller and target device itself. All this for simple non-chained case. With device chaining the hierarchy is even more complex. On DZ77RE-75K motherboard without the workaround kernel will discover only ports on host controller, but not device ports or device. So kernel will find devices on broken implementation, not all of them. Even worse: there's no way to distinguish between plug and unplug events and kernel uses the same code path for both cases. --=20 Kirill A. Shutemov --vkogqOf2sHV7VnPd Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQIcBAEBAgAGBQJQywC5AAoJEAd+omnVudOMikoP/3CbwzREtxykZ82Rn+MfSYK7 PklbiRzYWGKlWa9va6o8WKsFHNjlWtCedLkI8o7sl3ThwYU14j+Lu1wJUMe24r6A gUGC4IZDM35t8+zAR/BFtZ59B3hgEzuUqN9HLA+IcaeSd5IBkA36g6rlW3iUZGiC IPLx0Trx8utRRQgruDjjUA0BJbdtJhgHsAHt4eVSwHh9tNh5Bzi0AfEXOTe2M61E zqOwUo9qiOIpbdA7/YtNL0q27AuFgIrVGcJq4F7mvIbxx++CJ6QGxlu7seIX1w5e 1ASho2vJAs8g3plXoCUkkQpntl/XONfv35wG+yHyaJ0mn/G1twaWeRvSE8/2sPGn K0h63rvBh5R4iTXRiiiRZ9QpNnr9MNLcVjnUNVKSG82lareec+o2MolEaITdkILT ATaIhgzSVoSYlJ5b++boPQrFvQu0tdX6g2H/haIrK0LHI0LhOiMpuxDLFg8xBhLN rkTf/aC8JO0dsn+YNCgOX34qkIgkTAhvwVQZdVmLCCPTBtI1WyrBNHqM+MVylX5A wTu1CtODieuC0qCmjr/M85PMQo0xgQ48ZkCLjQEXh2r/Y7txcIRFg1Ld64hdlhdt 92w5QnGw0WkImm6IxgdCeeoxJ9c/tUoO7TlFEGQS0bpxTLoAKJ4y5kfoh4ct5g0c 7RFBnsCajEySL/vawBc8 =T3rD -----END PGP SIGNATURE----- --vkogqOf2sHV7VnPd--