linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Jamet, Michael" <michael.jamet@intel.com>
To: Bjorn Helgaas <bhelgaas@google.com>,
	One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>
Cc: "linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Levy, Amir (Jer)" <amir.jer.levy@intel.com>,
	"Alloun, Dan" <dan.alloun@intel.com>,
	Rafael Wysocki <rjw@rjwysocki.net>,
	Andreas Noever <andreas.noever@gmail.com>,
	Mika Westerberg <mika.westerberg@linux.intel.com>
Subject: RE: [PATCH] pci: support Thunderbolt requirements for I/O resources.
Date: Sun, 18 Jan 2015 14:15:59 +0000	[thread overview]
Message-ID: <BC567D27D6B7384F84318942321624DE269180EC@hasmsx109.ger.corp.intel.com> (raw)
In-Reply-To: <CAErSpo407-LFjFh=224qGu5UC4pfMyd8FvWpNDEOsXqSAFfJeQ@mail.gmail.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 4241 bytes --]

> -----Original Message-----
> From: Bjorn Helgaas [mailto:bhelgaas@google.com]
> Sent: Wednesday, December 03, 2014 02:19
> To: One Thousand Gnomes
> Cc: Jamet, Michael; linux-pci@vger.kernel.org; linux-kernel@vger.kernel.org;
> Levy, Amir (Jer); Alloun, Dan; Rafael Wysocki; Andreas Noever
> Subject: Re: [PATCH] pci: support Thunderbolt requirements for I/O resources.
> 
> On Mon, Nov 24, 2014 at 2:17 AM, One Thousand Gnomes
> <gnomes@lxorguk.ukuu.org.uk> wrote:
> >> > This was also discussed internally and the only way to identify Thunderbolt
> devices is to check the device IDs.
> >> > As you said, this will require us to maintain and keep the list up-to-date as
> we deliver new devices.
> >>
> >> I don't really see how this can work.  You're asking me to put
> >> changes based on a secret spec into generic code that is used on
> >> every machine with PCI.  I have no way to maintain something like that.
> >
> >>
> >> This seems like a major screw up in the design and documentation of
> Thunderbolt.
> >
> > See
> > https://developer.apple.com/library/mac/documentation/HardwareDrivers/
> > Conceptual/ThunderboltDevGuide/ThunderboltDevGuide.pdf
> >
> > page 10 for one of the brief public notes on the not relying on I/O space.
> 
> I agree with that recommendation not to rely on I/O space.  It applies equally
> to *all* PCI devices, not just to Thunderbolt.
> 
> Presumably this patch fixes a problem.  The changelog says:
> 
>     Kernel shouldn't allocate the PCI I/O resources
>     as it interferes with BIOS operation.
>     Doing this may cause the devices in the Thunderbolt chain
>     not being detected or added, or worse to stuck the
>     Thunderbolt Host controller.
> 
> The problem of devices not being detected sounds like a general problem (I
> assume the problem is actually that we do enumerate the device, but we may
> not be able to assign I/O port space to it, which means we may not be able to
> operate it).  This could happen with any device.  If you can come up with a
> generic way to deal with it, that might work.  Note that we do already have
> pci_enable_device_mem() for drivers that don't need I/O space to operate
> their device.
> 
> If assigning I/O port space to a device can hang the Thunderbolt controller, that
> sounds like a controller defect, and maybe you could write a quirk to work
> around it.  I'm not opposed to adding device-specific workarounds for things
> like that.  I just have trouble with putting undocumented workarounds in the
> common path that everybody uses.
> 
> Bjorn

The actual problem the patch is meant to address is related to the PCI 
limitation of 64KB I/O space and the fact that allocations are 
performed in chunks of 4KB behind PCI-to-PCI bridges.
After a certain amount of devices the I/O resources may be exhausted. 
This is indeed a general issue, not only related to Thunderbolt, and 
as Bjorn suggested a general fix is advised.
 
Following further investigations it seems that we may not really need 
this patch for the following reasons:

1. It seems that the controller issues (written on the changelog) were 
related to the lack of support of hotplug topology changes in the old 
tested kernel (3.15) rather than the I/O space issue.

2. Kernel PCI driver handles properly allocations of I/O resources and 
prevents I/O resources exhaustion which may have caused issues (if not 
handled properly) to any PCI or Thunderbolt controller. Looks like 
first device asking I/O is the first served and this mechanism works fine.

3. For most devices supported today on Thunderbolt such as AHCI or  
iGB (E1000E), if no I/O resources is allocated, the device seems to 
continue to operate through the memory BARs.
 
/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Ç+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

      reply	other threads:[~2015-01-18 14:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-13  2:52 [PATCH] pci: support Thunderbolt requirements for I/O resources Michael Jamet
2014-11-12 17:29 ` Bjorn Helgaas
2014-11-12 18:30   ` Andy Shevchenko
2014-11-12 20:19     ` Andreas Noever
2014-11-18  8:20       ` Jamet, Michael
2014-11-18 15:47         ` Andreas Noever
2015-01-18 14:16           ` Jamet, Michael
2014-11-18  8:15     ` Jamet, Michael
2014-11-18  7:57   ` Jamet, Michael
2014-11-18 15:58     ` Bjorn Helgaas
2014-11-24  9:17       ` One Thousand Gnomes
2014-12-03  0:19         ` Bjorn Helgaas
2015-01-18 14:15           ` Jamet, Michael [this message]

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=BC567D27D6B7384F84318942321624DE269180EC@hasmsx109.ger.corp.intel.com \
    --to=michael.jamet@intel.com \
    --cc=amir.jer.levy@intel.com \
    --cc=andreas.noever@gmail.com \
    --cc=bhelgaas@google.com \
    --cc=dan.alloun@intel.com \
    --cc=gnomes@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=rjw@rjwysocki.net \
    /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;
as well as URLs for NNTP newsgroup(s).