From: Wei Yang Date: Wed, 25 Mar 2015 08:23:47 +0000 (+0800) Subject: PCI: Calculate maximum number of buses required for VFs X-Git-Tag: omap-for-v4.1/fixes-rc1~126^2~7^2~15 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4449f079722c86d2f6925da039835acdd8e973a8;p=pandora-kernel.git PCI: Calculate maximum number of buses required for VFs An SR-IOV device can change its First VF Offset and VF Stride based on the values of ARI Capable Hierarchy and NumVFs. The number of buses required for all VFs is determined by NumVFs, First VF Offset, and VF Stride (see SR-IOV spec r1.1, sec 2.1.2). Previously pci_iov_bus_range() computed how many buses would be required by TotalVFs, but this was based on a single NumVFs value and may not have been the maximum for all NumVFs configurations. Iterate over all valid NumVFs and calculate the maximum number of bus numbers that could ever be required for VFs of this device. [bhelgaas: changelog, compute busnr of NumVFs, not TotalVFs, remove kerenl-doc comment marker] Signed-off-by: Wei Yang Acked-by: Bjorn Helgaas Signed-off-by: Benjamin Herrenschmidt --- Reading git-diff-tree failed