All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <bhelgaas@google.com>
To: Rajat Jain <rajatxjain@gmail.com>
Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
	rajatjain@juniper.net, groeck@juniper.net
Subject: Re: [PATCH] pci/probe: Ignore the device id while handling CRS
Date: Mon, 22 Sep 2014 12:53:15 -0600	[thread overview]
Message-ID: <20140922185315.GA1880@google.com> (raw)
In-Reply-To: <540E1D75.5000500@gmail.com>

On Mon, Sep 08, 2014 at 02:19:49PM -0700, Rajat Jain wrote:
> Some root ports may return the actual device id returned by the
> endpoint, instead of faking up a synthetic id (0xFFFF) as specified
> by the PCIe spec (sec 2.3.2). We have seen such broken devices in the
> past that match this behaviour:
> (Ref: https://lkml.org/lkml/2007/11/1/198)
> 
> To take care of the same, CRS was disabled then, however, we want to
> enable CRS now (https://lkml.org/lkml/2014/9/2/509), but still do not
> want to break such devices. Thus check only against the
> (vendor id == 1) and ignore the device id.
> 
> Signed-off-by: Rajat Jain <rajatxjain@gmail.com>
> Signed-off-by: Rajat Jain <rajatjain@juniper.net>
> Signed-off-by: Guenter Roeck <groeck@juniper.net>

Applied to pci/enumeration for v3.18, thanks!

> ---
>  drivers/pci/probe.c |    9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
> index 3c4c35c..0076a9b 100644
> --- a/drivers/pci/probe.c
> +++ b/drivers/pci/probe.c
> @@ -1305,8 +1305,13 @@ bool pci_bus_read_dev_vendor_id(struct pci_bus *bus, int devfn, u32 *l,
>  	    *l == 0x0000ffff || *l == 0xffff0000)
>  		return false;
>  
> -	/* Configuration request Retry Status */
> -	while (*l == 0xffff0001) {
> +	/*
> +	 * Configuration request Retry Status. Note that some root ports
> +	 * are broken and may return actual device ID instead of a synthetic ID
> +	 * (0xFFFF) to be faked as per the PCIe spec. Hence ignore the device ID
> +	 * and only check for (vendor id == 1)
> +	 */
> +	while (*l & 0xffff == 0x0001) {
>  		if (!crs_timeout)
>  			return false;
>  
> -- 
> 1.7.9.5
> 

      reply	other threads:[~2014-09-22 18:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-08 21:19 [PATCH] pci/probe: Ignore the device id while handling CRS Rajat Jain
2014-09-22 18:53 ` Bjorn Helgaas [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=20140922185315.GA1880@google.com \
    --to=bhelgaas@google.com \
    --cc=groeck@juniper.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=rajatjain@juniper.net \
    --cc=rajatxjain@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.