public inbox for linux-pci@vger.kernel.org
 help / color / mirror / Atom feed
From: Wei Yang <weiyang@linux.vnet.ibm.com>
To: Yinghai Lu <yinghai@kernel.org>
Cc: "Bjorn Helgaas" <bhelgaas@google.com>,
	"Gavin Shan" <gwshan@linux.vnet.ibm.com>,
	"Benjamin Herrenschmidt" <benh@kernel.crashing.org>,
	"Marek Kordík" <kordikmarek@gmail.com>,
	"Alexey Voronkov" <zermond@gmail.com>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] PCI: Clear all bridge res MEM_64 if host bridge has non mem64
Date: Wed, 10 Dec 2014 22:34:28 +0800	[thread overview]
Message-ID: <20141210143428.GB12497@richard> (raw)
In-Reply-To: <20141210141537.GA9298@richard>

My mutt hang, in case the mail isn't sent out, I resend it.

On Wed, Dec 10, 2014 at 10:15:37PM +0800, Wei Yang wrote:
>On Tue, Dec 09, 2014 at 03:13:49PM -0800, Yinghai Lu wrote:
>>On Tue, Dec 9, 2014 at 1:53 PM, Bjorn Helgaas <bhelgaas@google.com> wrote:
>>> On Tue, Dec 9, 2014 at 2:34 PM, Yinghai Lu <yinghai@kernel.org> wrote:
>>>> +       list_for_each_entry(window, &bridge->windows, list) {
>>>> +               res = window->res;
>>>> +               if (resource_type(res) == IORESOURCE_MEM ||
>>>> +                   res->end > 0xffffffff) {
>>>> +                       bridge->has_mem64_res = true;
>>>
>>> This is an interesting idea, but I think you're checking CPU addresses
>>> here, and you need to check PCI bus addresses.
>>
>>Looks like those IBM platforms have res > 4g, but pci bus address < 4g.
>>If we check pci bus address, and then we would break those platforms.
>>

Hi, Yinghai

I did some test with patch on my machine. It looks good.

While as Bjorn mentioned, I think we could change it a little. The pci space
on our machine is like this:

        cpu address                               pci address
  MEM   0x00003ff280000000..0x00003ff2fffeffff -> 0x00000000 8000 0000
  MEM64 0x00003d5000000000..0x00003d5fffffffff -> 0x00003d50 0000 0000

Each root bridge has two MMIO window. From this output we could see the pci
address for 64-bit window is above 4G.

I did a little change on your code, like this

        list_for_each_entry(window, &bridge->windows, list) {
                res = window->res;
                if (resource_type(res) == IORESOURCE_MEM ||
-                   res->end > 0xffffffff) {
+                   (res->end - window->offset) > 0xffffffff) {
                        bridge->has_mem64_res = true;
                        break;
                }
        }

This also works on my machine.

One more question, with this patch, do we still need previous patch for
Marek's problem?

>>Yinghai
>
>-- 
>Richard Yang
>Help you, Help me

-- 
Richard Yang
Help you, Help me


  parent reply	other threads:[~2014-12-10 14:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-09 21:34 [PATCH] PCI: Clear all bridge res MEM_64 if host bridge has non mem64 Yinghai Lu
2014-12-09 21:53 ` Bjorn Helgaas
2014-12-09 23:13   ` Yinghai Lu
     [not found]     ` <20141210141537.GA9298@richard>
2014-12-10 14:34       ` Wei Yang [this message]
2014-12-10 18:18         ` Yinghai Lu
2014-12-10 22:30 ` Gavin Shan
2014-12-11  0:13   ` Yinghai Lu

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=20141210143428.GB12497@richard \
    --to=weiyang@linux.vnet.ibm.com \
    --cc=benh@kernel.crashing.org \
    --cc=bhelgaas@google.com \
    --cc=gwshan@linux.vnet.ibm.com \
    --cc=kordikmarek@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=yinghai@kernel.org \
    --cc=zermond@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox