public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Scott Telford <stelford@cadence.com>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Leif Lindholm <leif.lindholm@linaro.org>,
	"edk2-devel@lists.01.org" <edk2-devel@ml01.01.org>,
	"Tian, Feng" <feng.tian@intel.com>,
	"Zeng, Star" <star.zeng@intel.com>
Subject: Re: [PATCH] Copy bus scanning workaround from ARM Juno PCIe driver.
Date: Wed, 31 May 2017 10:51:53 +0000	[thread overview]
Message-ID: <BN6PR07MB3154B4A41288F8EA489DE6D7CFF10@BN6PR07MB3154.namprd07.prod.outlook.com> (raw)
In-Reply-To: <CAKv+Gu9GRe5=h=jkT8yKKC5a2U=FiEb-OifHEqbrgcg-53f9_A@mail.gmail.com>

> From: Ard Biesheuvel [mailto:ard.biesheuvel@linaro.org]
> Sent: 30 May 2017 11:14
> To: Scott Telford <stelford@cadence.com>
> Cc: Leif Lindholm <leif.lindholm@linaro.org>; edk2-devel@lists.01.org <edk2-
> devel@ml01.01.org>; Tian, Feng <feng.tian@intel.com>; Zeng, Star
> <star.zeng@intel.com>
> Subject: Re: [edk2] [PATCH] Copy bus scanning workaround from ARM Juno
> PCIe driver.

> >> I'd still like to understand why this issue does not occur under
> >> Linux, or if it does occur, if we need an ECAM quirk for Juno to work
> >> around it.

Reading up on the subject, in the PCI Express Base Specification 3.0, section 7.3.1 (Configuration Transaction Rules: Device Number) states "Non-ARI [Alternative Routing-ID Interpretation] Devices must respond to all Type 0 Configuration Read Requests, regardless of the Device Number specified in the Request", which I guess would explain what I'm seeing with the same device appearing at all possible device numbers when reading the VIDs, without the workaround present.

In Linux's drivers/pci/probe.c, the functions pci_scan_slot() and only_one_child() will scan only device 0 function 0 if the parent bus is a PCIe root port or downstream port. See the comment for commit f07852d6442c46c50b59c7e2acc8a1b291f9ab6d: "We can then speed up the pci_scan_slot by skipping the scan of subsequent devfns for PCIe devices which are the direct children of Root Ports or Downstream Ports.  These devices are only permitted to implement device 0, unless they are ARI devices, in which case they'll be scanned by the ARI code above." So it doesn't matter if they respond to all device numbers, because we know they're only allowed to have a device 0.

However, PciLib.c:PciScanBus() in TianoCore will always scan for all possible devices. Looks like it should be behaving more like the Linux driver in the case of PCIe?

Regards,
Scott.

      reply	other threads:[~2017-05-31 10:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-23 16:15 [PATCH] Copy bus scanning workaround from ARM Juno PCIe driver Scott Telford
2017-05-23 16:42 ` Ard Biesheuvel
2017-05-24  8:34   ` Scott Telford
2017-05-24 14:03     ` Ard Biesheuvel
2017-05-26 14:50       ` Leif Lindholm
2017-05-26 17:37         ` Ard Biesheuvel
2017-05-29 16:14           ` Scott Telford
2017-05-30 10:13             ` Ard Biesheuvel
2017-05-31 10:51               ` Scott Telford [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-list 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=BN6PR07MB3154B4A41288F8EA489DE6D7CFF10@BN6PR07MB3154.namprd07.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /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