mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bjorn Helgaas <bjorn.helgaas@hp.com>
To: Ben Greear <greearb@candelatech.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [pci] pci/mrst:  Detect loops when reading fixed BAR cap.
Date: Fri, 16 Jul 2010 11:43:04 -0600	[thread overview]
Message-ID: <201007161143.05187.bjorn.helgaas@hp.com> (raw)
In-Reply-To: <1279126923-27926-1-git-send-email-greearb@candelatech.com>

On Wednesday, July 14, 2010 11:02:03 am Ben Greear wrote:
> The mrst logic introduced in 2.6.33-rc8 in commit
> a712ffbc199849364c46e9112b93b66de08e2c26 causes boot
> to hang on at least this platform:
> 
> Intel E5405 CPU
> System Information
> 	Manufacturer: Supermicro
> 	Product Name: X7DBU
> 
> The cause of the hang is that pci_cap points to itself
> as the next capability, putting the fixed_bar_cap into
> an endless loop.
> 
> This patch detects the loop, prints a warning, and
> continues on with useful work.  This strategy was
> suggested by Robert Hancock <hancockrwd@gmail.com>
> 
> This should be a candidate for 2.6.34.y as well.
> 
> Signed-off-by: Ben Greear <greearb@candelatech.com>
> ---
> :100644 100644 1cdc02c... 9535ba9... M	arch/x86/pci/mrst.c
>  arch/x86/pci/mrst.c |   11 +++++++++++
>  1 files changed, 11 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/x86/pci/mrst.c b/arch/x86/pci/mrst.c
> index 1cdc02c..9535ba9 100644
> --- a/arch/x86/pci/mrst.c
> +++ b/arch/x86/pci/mrst.c
> @@ -76,6 +76,17 @@ static int fixed_bar_cap(struct pci_bus *bus, unsigned int devfn)
>  				return pos;
>  		}
>  
> +		if ((pcie_cap >> 20) == 0)
> +			break;
> +		
> +		if ((pcie_cap >> 20) <= pos) {
> +			printk(KERN_WARNING "WARNING: mrst:  detected loop"
> +			       " when searching for fixed BAR cap, previous"
> +			       " position: 0x%x new position: 0x%x"
> +			       " bus-number: %i  devfn: %i\n",
> +			       pos, pcie_cap >> 20, bus->number, devfn);

Can you use dev_warn() here to print the device info in the
standard way?

Bjorn

  reply	other threads:[~2010-07-16 17:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-14 17:02 Ben Greear
2010-07-16 17:43 ` Bjorn Helgaas [this message]
2010-07-16 17:47   ` Ben Greear

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=201007161143.05187.bjorn.helgaas@hp.com \
    --to=bjorn.helgaas@hp.com \
    --cc=greearb@candelatech.com \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®