提交 c9c75143 编写于 作者: Y Yongji Xie 提交者: Bjorn Helgaas

PCI: Fix calculation of bridge window's size and alignment

In case that one device's alignment is greater than its size, we may
get an incorrect size and alignment for its bus's memory window in
pbus_size_mem().  Fix this case.
Signed-off-by: NYongji Xie <elohimes@gmail.com>
Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
上级 ea629d87
......@@ -1066,10 +1066,10 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask,
r->flags = 0;
continue;
}
size += r_size;
size += max(r_size, align);
/* Exclude ranges with size > align from
calculation of the alignment. */
if (r_size == align)
if (r_size <= align)
aligns[order] += align;
if (order > max_order)
max_order = order;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册