mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bjorn Helgaas <bhelgaas@google.com>
To: Abdelghani Ouchabane <abdelghani@ezono.com>
Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org
Subject: Re: PCIe can not rescan for new PCIe device ( FPGA board )
Date: Tue, 11 Oct 2011 09:22:47 -0600	[thread overview]
Message-ID: <CAErSpo7c8pgBUxLGC5rKrBbkSsf+MSGhXuEZAyrPkRj8X2YpBA@mail.gmail.com> (raw)
In-Reply-To: <4E93FA07.306@ezono.com>

On Tue, Oct 11, 2011 at 2:10 AM, Abdelghani Ouchabane
<abdelghani@ezono.com> wrote:
>
>>>>> * But our software returns : 0xFFFFFFFF
>>
>> This is reading from your device's memory region.  It looks like the
>> device is configured correctly (BAR values are reasonable and memory
>> decoding is enabled) and I assume the bridges leading to it are
>> configured correctly (if you posted the complete dmesg log we could
>> tell for sure).  After that point, Linux is out of the way and it's
>> just a question of whether your device responds correctly to the
>> memory access.
>> Are you sure the device is supposed to return something other than
>> 0xFFFFFFFF?
>
> Hi Bjorn,
>
> Yes, the device should return something similar to :
> resource file = /sys/bus/pci/devices/0000:02:00.0/resource
> base address  = 0xFDFFE000
>        0xFDFFE000      0x00000000      0x00000000      0x00000000
>        0xFDFFE008      0x00000008      0x00000000      0x00000000
>        0xFDFFE010      0x00000010      0x00000001      0x00020000
>        0xFDFFE018      0x00000018      0x00000000      0x00000000
>        0xFDFFE020      0x00000020      0x00000000      0x00000000
>        0xFDFFE028      0x00000028      0x00000000      0x00000000
>        0xFDFFE030      0x00000030      0x00000000      0x00000000
>        0xFDFFE038      0x00000038      0x00000000      0x00000000
>        0xFDFFE040      0x00000040      0x30012009      0x00101449
>        0xFDFFE048      0x00000048      0x00000000      0x00000781
>        0xFDFFE050      0x00000050      0x00000000      0x00000300
>        0xFDFFE058      0x00000058      0xCAFEBABE      0xDEADBEEF

How did you get this read to work?  Is this in a different system?
Maybe the difference between this working scenario and the broken
scenario will have a clue.

>> If it's memory, can you write to it and read the new
>> value back?  Can you use a PCIe analyzer and see if the device is
>> responding correctly on the bus?
>
> I have tried to write to the FPGA registers but I was always getting
> 0xFFFFFFFF
>>
>> Other than the possible pciehp rescan problem, this just looks like a
>> problem with your FPGA.
>
> Can it have a relation with the BIOS?
> I attached to you the whole dmesg log.

I don't think it's likely to be a BIOS problem.  Here's what looks
relevant from your dmesg log:

    ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-ff])
    pci_root PNP0A08:00: host bridge window [mem 0x40000000-0xffffffff]

    pci 0000:00:05.0: PCI bridge to [bus 02-02]
    pci 0000:00:05.0:   bridge window [mem 0x40000000-0x401fffff]
    pci 0000:00:05.0:   bridge window [mem 0x40200000-0x403fffff 64bit pref]

    pci 0000:02:00.0: BAR 2: assigned [mem 0x40200000-0x4023ffff 64bit pref]
    pci 0000:02:00.0: BAR 0: assigned [mem 0x40240000-0x40240fff 64bit pref]
    pci 0000:02:00.0: BAR 4: assigned [mem 0x40241000-0x40241fff 64bit pref]

The BIOS left the bridge to bus 02 with all windows disabled, but
Linux allocated and enabled the windows as above, and we assigned BARs
of device 02:00.0 inside those windows.  As far as I can tell,
everything leading to the FPGA is set up correctly.

Can you try another, known-working (not your FPGA), card in that slot?
 It still looks to me like a problem with your FPGA.

Bjorn

  reply	other threads:[~2011-10-11 15:23 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-07  7:16 Abdelghani Ouchabane
2011-10-07 15:37 ` Bjorn Helgaas
2011-10-07 16:22   ` Abdelghani Ouchabane
2011-10-07 16:36     ` Bjorn Helgaas
2011-10-11  1:39       ` Kenji Kaneshige
2011-10-11  8:11         ` Abdelghani Ouchabane
2011-10-12  6:36           ` Kenji Kaneshige
2011-10-12  8:35             ` Abdelghani Ouchabane
2011-10-13 12:50               ` Kenji Kaneshige
2011-10-14  9:40                 ` Abdelghani Ouchabane
2011-10-24  5:00                   ` Kenji Kaneshige
2011-10-24  9:20                     ` Abdelghani Ouchabane
2011-10-11  8:10       ` Abdelghani Ouchabane
2011-10-11 15:22         ` Bjorn Helgaas [this message]
     [not found]           ` <4E954251.5020801@ezono.com>
2011-10-12  8:03             ` Abdelghani Ouchabane
2011-10-12 15:58               ` Bjorn Helgaas
2011-10-14  9:27                 ` Abdelghani Ouchabane

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=CAErSpo7c8pgBUxLGC5rKrBbkSsf+MSGhXuEZAyrPkRj8X2YpBA@mail.gmail.com \
    --to=bhelgaas@google.com \
    --cc=abdelghani@ezono.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@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®