public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: "J.L. Burr" <jlburr-vna1KIf7WgpBDgjK7y7TUQ@public.gmane.org>
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: rdreier-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org
Subject: Re: mlx4 fix for 36-bit bus addresses on 32-bit arch
Date: Fri, 14 Jan 2011 07:46:01 -0500	[thread overview]
Message-ID: <4D304589.9070909@cadence.com> (raw)
In-Reply-To: <20110113221454.GB9681-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>

>>  > Although, while looking into this I wonder J.L., how does your PCI
>>  > device even work? Look at, eg pci_read_bridge_mmio_ref, it seems to me
>>  > it will bail if a bridge is seen with a 64 bit setting but the system
>>  > isn't 64 bit? IMHO, this is a bug, it should be testing for
>>  > sizeof(resource_size_t)
>>
>> I don't see that function... where are you looking?
>
> Sorry, I typo'd it
>
> static void __devinit pci_read_bridge_mmio_pref(struct pci_bus *child)
>
> drivers/pci/probe.c

Yes, on my embedded system, Linux does "bail".  That is, during enumeration,
I get the message:

PCI: Unable to handle 64-bit BAR for device 0000:13:00.0

At 2.6.26, pci_read_bridge_mmio_pref was not present, but the same basic
code is (within pci_read_bases() of probe.c).

When first working on getting the petabyte BAR device to work, I did add
some logic to this code so it was not wholly dependent on BITS_PER_LONG
being 64.  I used CONFIG_RESOURCES_64BIT in an "else" clause (although
using your suggestion of sizeof(resource_size_t) should be equivalent).
Starting with 2.6.28, CONFIG_RESOURCES_64BIT has been replaced by
CONFIG_PHYS_ADDR_T_64BIT.

However, I had to comment out my change in this area (i.e. go back to
the original behavior) as there was no way to allocate a petabyte area
within the 440's mappable space.  I believe there is 2GB of PCI mappable
space in the normal 440 setup under Linux.

My scheme (only viable in the controlled environment of an embedded system)
is to allow Linux enumeration to fail for the petabyte BAR device and
use a quirk routine to manually assign both the BAR value for the device
and to adjust the parent PCIe bridges' prefetchable ranges.

2+ years later, that's where I got in trouble when now adding the
Infiniband card to my "controlled environment".  My quirk routine is not
sensitive to the possibility that Linux enumeration may have established
proper 32-bit prefetchable ranges in the bridges.  I'm going to look at
reworking enumeration for my system to assign prefetchable memory at the
end of the 440 mappable area.  That way, the quirk routine should be able
to simply extend the size of any existing prefetchable ranges to include
the large petabyte area.

But back to your point, yes, my petabyte device is not handled by the
2.6.26 Linux enumeration but that's unavoidable for the PowerPC 440.
It means that the Linux kernel does not have a resource object for the
petabyte area, etc.  But that's OK because the 440 CPU can not access
it.  Our device has a smaller "baby BAR" for 440 CPU access to part of
its resources.  The petabyte BAR is used for peer accesses from other
PCIe devices.

I agree with you:  the use of BITS_PER_LONG looks wrong in probe.c for
environments like the PowerPC 440.  You may want to pose your question
in the linux-pci discussion group.

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2011-01-14 12:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-07  2:59 [PATCH 1/1 (resend)] mthca: Modify to support embedded PowerPC platforms J.L. Burr
2011-01-07  5:59 ` Roland Dreier
2011-01-11  4:12 ` Roland Dreier
     [not found]   ` <adafwt06puj.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2011-01-12  8:00     ` J.L. Burr
     [not found]       ` <4D2D5FAD.6030508-vna1KIf7WgpBDgjK7y7TUQ@public.gmane.org>
2011-01-12 17:53         ` mlx4 fix for 36-bit bus addresses on 32-bit arch (was: [PATCH 1/1 (resend)] mthca: Modify to support embedded PowerPC platforms) Roland Dreier
     [not found]           ` <adahbde57r7.fsf_-_-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2011-01-13 17:06             ` mlx4 fix for 36-bit bus addresses on 32-bit arch J.L. Burr
     [not found]               ` <4D2F310B.2010906-vna1KIf7WgpBDgjK7y7TUQ@public.gmane.org>
2011-01-13 18:44                 ` Jason Gunthorpe
     [not found]                   ` <20110113184432.GA9681-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2011-01-13 22:10                     ` Roland Dreier
     [not found]                       ` <ada62ts316q.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2011-01-13 22:14                         ` Jason Gunthorpe
     [not found]                           ` <20110113221454.GB9681-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2011-01-14 12:46                             ` J.L. Burr [this message]
2011-01-14 13:09             ` mlx4 fix for 36-bit bus addresses on 32-bit arch (was: [PATCH 1/1 (resend)] mthca: Modify to support embedded PowerPC platforms) Eli Cohen
2011-01-14 17:27               ` Jason Gunthorpe
     [not found]                 ` <20110114172721.GB16535-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2011-01-14 21:26                   ` mlx4 fix for 36-bit bus addresses on 32-bit arch Roland Dreier
     [not found]                     ` <adawrm718ja.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2011-01-14 22:40                       ` Jason Gunthorpe

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=4D304589.9070909@cadence.com \
    --to=jlburr-vna1kif7wgpbdgjk7y7tuq@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=rdreier-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.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