All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yijing Wang <wangyijing@huawei.com>
To: Yinghai Lu <yinghai@kernel.org>, Bjorn Helgaas <bhelgaas@google.com>
Cc: PCI <linux-pci@vger.kernel.org>, "Herui (Ray)" <Ray.herui@huawei.com>
Subject: Assign mem resource fail after remove and rescan
Date: Sat, 28 Mar 2015 18:02:04 +0800	[thread overview]
Message-ID: <55167C1C.6010001@huawei.com> (raw)

Hi Yinghai, Bjorn
   I found a memory resource assignment fail after I did remove and rescan a bridge device,
I don't know whether this is a kernel bug, I hope could get some advice from you, thanks!

My pci tree:
-[0000:00]-+-00.0  Intel Corporation 2nd Generation Core Processor Family DRAM Controller
...
           +-1c.0-[02-21]----00.0-[03-21]--+-01.0-[04-12]----00.0-[05-12]----19.0-[06-12]----00.0  PLX Technology, Inc. Device 1009
           |                               +-05.0-[13]--
           |                               +-07.0-[14-20]----00.0-[15-20]--+-08.0-[16]--+-00.0  NVIDIA Corporation GT218 [GeForce 210]
           |                               |                               |            \-00.1  NVIDIA Corporation High Definition Audio Controller
           |                               |                               +-14.0-[17]----00.0  Intel Corporation Device 0953
           |                               |                               \-19.0-[18-20]----00.0  PLX Technology, Inc. Device 1009
           |                               \-09.0-[21]--


Reproduce action:
1. echo 1 > /sys/bus/pci/devices/0000:05:19.0/remove
2. echo 1 > /sys/bus/pci/rescan

After above operations, I found the memory resource assigned fail.

Fail log:
[  105.905480] pci_bus 0000:06: busn_res: [bus 06-12] is released
[  125.771655] pci_bus 0000:01: busn_res: [bus 01] end is updated to 01
[  125.772519] pci 0000:05:19.0: [10b5:9797] type 01 class 0x060400
[  125.772846] pci 0000:05:19.0: PME# supported from D0 D3hot D3cold
[  125.778576] pci_bus 0000:06: busn_res: can not insert [bus 06-ff] under [bus 05-12] (conflicts with (null) [bus 05-12])
[  125.778638] pci 0000:06:00.0: [10b5:1009] type 00 class 0x088000
[  125.778693] pci 0000:06:00.0: reg 0x10: [mem 0xe8000000-0xe87fffff]
[  125.778761] pci 0000:06:00.0: reg 0x18: [mem 0xe4000000-0xe7ffffff 64bit]
[  125.782315] pci 0000:05:19.0: PCI bridge to [bus 06-ff]
[  125.782345] pci 0000:05:19.0:   bridge window [mem 0xe4000000-0xe87fffff]
[  125.782366] pci_bus 0000:06: busn_res: [bus 06-ff] end is updated to 12
[  125.782380] pci_bus 0000:05: busn_res: [bus 05-12] end is updated to 12
[  125.782393] pci_bus 0000:04: busn_res: [bus 04-12] end is updated to 12
[  125.782422] pci_bus 0000:13: busn_res: [bus 13] end is updated to 13
[  125.782674] pci_bus 0000:16: busn_res: [bus 16] end is updated to 16
[  125.782721] pci_bus 0000:17: busn_res: [bus 17] end is updated to 17
[  125.782751] pci_bus 0000:18: busn_res: [bus 18-20] end is updated to 20
[  125.782763] pci_bus 0000:15: busn_res: [bus 15-20] end is updated to 20
[  125.782775] pci_bus 0000:14: busn_res: [bus 14-20] end is updated to 20
[  125.782802] pci_bus 0000:21: busn_res: [bus 21] end is updated to 21
[  125.782812] pci_bus 0000:03: busn_res: [bus 03-21] end is updated to 21
[  125.782822] pci_bus 0000:02: busn_res: [bus 02-21] end is updated to 21
[  125.782845] pci_bus 0000:22: busn_res: [bus 22] end is updated to 22
[  125.786433] pci_bus 0000:24: busn_res: [bus 24] end is updated to 24
[  125.786450] pci_bus 0000:23: busn_res: [bus 23-24] end is updated to 24
[  125.786749] pci 0000:05:19.0: BAR 14: no space for [mem size 0x06000000]
[  125.786754] pci 0000:05:19.0: BAR 14: failed to assign [mem size 0x06000000]
[  125.786760] pci 0000:06:00.0: BAR 2: no space for [mem size 0x04000000 64bit]
[  125.786764] pci 0000:06:00.0: BAR 2: failed to assign [mem size 0x04000000 64bit]
[  125.786769] pci 0000:06:00.0: BAR 0: no space for [mem size 0x00800000]
[  125.786773] pci 0000:06:00.0: BAR 0: failed to assign [mem size 0x00800000]
[  125.786777] pci 0000:05:19.0: PCI bridge to [bus 06-12]
[  125.786819] pci 0000:23:00.0: PCI bridge to [bus 24]

System boot log:

...
[    0.122097] pci 0000:05:19.0: [10b5:9797] type 01 class 0x060400
[    0.122373] pci 0000:05:19.0: PME# supported from D0 D3hot D3cold
[    0.122481] pci 0000:04:00.0: PCI bridge to [bus 05-ff]
[    0.122501] pci 0000:04:00.0:   bridge window [mem 0xe4000000-0xe87fffff]
[    0.122708] pci 0000:06:00.0: [10b5:1009] type 00 class 0x088000
[    0.122749] pci 0000:06:00.0: reg 0x10: [mem 0xe8000000-0xe87fffff]
[    0.122816] pci 0000:06:00.0: reg 0x18: [mem 0xe4000000-0xe7ffffff 64bit]
[    0.123323] pci 0000:05:19.0: PCI bridge to [bus 06-ff]
[    0.123346] pci 0000:05:19.0:   bridge window [mem 0xe4000000-0xe87fffff]
...

I compared above log and found after we did remove and rescan, the bridge requested resource size extended to 0x06000000,
and when system boot up, it requested only 0x4800000.

In hotplug(remove and rescan) path, we would call calculate_mem_align() function which would align the resource at 0x2000000.

I wonder is this a resource assignment bug ?


Thanks!
Yijing.





-- 
Thanks!
Yijing


             reply	other threads:[~2015-03-28 10:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-28 10:02 Yijing Wang [this message]
2015-03-29  6:18 ` Assign mem resource fail after remove and rescan Yinghai Lu
2015-03-30  4:05   ` Yijing Wang
2015-03-31  6:38   ` Yijing Wang
2015-04-01 22:21     ` Yinghai Lu
2015-04-02  8:35       ` Yijing Wang
2015-04-09 11:12       ` Yijing Wang
2015-05-05 19:07       ` Bjorn Helgaas
2015-06-25  1:59         ` Yijing Wang
2015-06-25  7:05           ` Yinghai Lu
2015-06-25  7:25             ` Yijing Wang

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=55167C1C.6010001@huawei.com \
    --to=wangyijing@huawei.com \
    --cc=Ray.herui@huawei.com \
    --cc=bhelgaas@google.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=yinghai@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.