RE: [PATCH] pci: support Thunderbolt requirements for I/O resources.

From: Jamet, Michael
Date: Tue Nov 18 2014 - 03:15:51 EST


> -----Original Message-----
> From: Andy Shevchenko [mailto:andy.shevchenko@xxxxxxxxx]
> Sent: Wednesday, November 12, 2014 20:31
> To: Bjorn Helgaas
> Cc: Jamet, Michael; linux-pci@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx;
> Levy, Amir (Jer); Alloun, Dan; Rafael Wysocki; Andreas Noever
> Subject: Re: [PATCH] pci: support Thunderbolt requirements for I/O
> resources.
>
> On Wed, Nov 12, 2014 at 7:29 PM, Bjorn Helgaas <bhelgaas@xxxxxxxxxx>
> wrote:
>
> []
>
> >> To prevent this, we detect a chain contains a Thunderbolt device by
> >> checking the Thunderbolt PCI device id.
> >
> > I'm really not happy about checking a list of device IDs to identify
> > Thunderbolt devices. Surely there's a better way, because a list like
> > this has to be updated regularly.
>
> I recently proposed internally to use quirks (pci_fixup_early) for that, but
> apparently Michael didn't have time to answer. It might be he can just
> comment here since the patch already public.
>
> --
> With Best Regards,
> Andy Shevchenko

Indeed, I've explored the quirks option.
Unfortunately the fixup hook seems to be called too late in the code
since pci_enable_device()calls pcibios_enable_device() which actually
send a PCI command with CMD |=PCI_COMMAND_IO and configure the PCI HW.
The IORESOURCE_MEM and IORESOURCE_IO flags are set at the time the
pci_enable_device(), pci_enable_device_mem() or pci_enable_device_io()
is called during device initializations, so an early fixup call won't help either.
At this stage, the PCI HW is configured and a fixup call won't resolve the issue
unless another PCI command is sent to revert it
(generally not advised to execute again on hardware).

Michael
---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
N‹§²æ¸›yú²X¬¶ÇvØ–)Þ{.nlj·¥Š{±‘êX§¶›¡Ü}©ž²ÆzÚj:+v‰¨¾«‘êZ+€Êzf£¢·hšˆ§~†­†Ûÿû®w¥¢¸?™¨è&¢)ßf”ùy§m…á«a¶Úÿ 0¶ìå