linux-mips
[Top] [All Lists]

Re: Linux MIPS PCI resource sanity check

To: Andrew Sharp <andy.sharp@onstor.com>
Subject: Re: Linux MIPS PCI resource sanity check
From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Date: Mon, 18 Feb 2008 16:55:41 +0300
Cc: Michael Buesch <mb@bu3sch.de>, ralf@linux-mips.org, linux-mips@linux-mips.org
In-reply-to: <20080216153530.7a426a73@ripper.onstor.net>
Organization: MontaVista Software Inc.
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <200802161139.10791.mb@bu3sch.de> <47B6BFD4.5050404@ru.mvista.com> <20080216153530.7a426a73@ripper.onstor.net>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mozilla/5.0 (X11; U; Linux i686; rv:1.7.2) Gecko/20040803
Andrew Sharp wrote:

There's a sanity check in pcibios_enable_resources() that looks
like this:

        r = &dev->resource[idx];
        if (!r->start && r->end) {
                printk(KERN_ERR "PCI: Device %s not available
because of resource collisions\n", pci_name(dev)); return -EINVAL;
        }

What is this check actually doing?

  It makes sure that a PCI resource is allocated (base of 0 means
that it's unallocated due to previously detected resource conlict (or
some other reason).

Actually, IIRC, resources are based on what the device requested, so a
device behind a bridge could request a resource starting at 0.  I had

   Zero value in BAR was considered unallocated resource in the PCI 2.2 spec...

to change this for a system as well.  I changed it to

if (!r->start && !r->end) {

   r->end can't be 0.

WBR, Sergei


<Prev in Thread] Current Thread [Next in Thread>