<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/pci/setup-res.c, branch linux-2.6.31.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.31.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.31.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2009-08-30T15:37:25Z</updated>
<entry>
<title>PCI SR-IOV: correct broken resource alignment calculations</title>
<updated>2009-08-30T15:37:25Z</updated>
<author>
<name>Chris Wright</name>
</author>
<published>2009-08-28T20:00:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6faf17f6f1ffc586d16efc2f9fa2083a7785ee74'/>
<id>urn:sha1:6faf17f6f1ffc586d16efc2f9fa2083a7785ee74</id>
<content type='text'>
An SR-IOV capable device includes an SR-IOV PCIe capability which
describes the Virtual Function (VF) BAR requirements.  A typical SR-IOV
device can support multiple VFs whose BARs must be in a contiguous region,
effectively an array of VF BARs.  The BAR reports the size requirement
for a single VF.  We calculate the full range needed by simply multiplying
the VF BAR size with the number of possible VFs and create a resource
spanning the full range.

This all seems sane enough except it artificially inflates the alignment
requirement for the VF BAR.  The VF BAR need only be aligned to the size
of a single BAR not the contiguous range of VF BARs.  This can cause us
to fail to allocate resources for the BAR despite the fact that we
actually have enough space.

This patch adds a thin PCI specific layer over the generic
resource_alignment() function which is aware of the special nature of
VF BARs and does sorting and allocation based on the smaller alignment
requirement.

I recognize that while resource_alignment is generic, it's basically a
PCI helper.  An alternative to this patch is to add PCI VF BAR specific
information to struct resource.  I opted for the extra layer rather than
adding such PCI specific information to struct resource.  This does
have the slight downside that we don't cache the BAR size and re-read
for each alignment query (happens a small handful of times during boot
for each VF BAR).

Signed-off-by: Chris Wright &lt;chrisw@sous-sol.org&gt;
Cc: Ivan Kokshaysky &lt;ink@jurassic.park.msu.ru&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Matthew Wilcox &lt;matthew@wil.cx&gt;
Cc: Yu Zhao &lt;yu.zhao@intel.com&gt;
Cc: stable@kernel.org
Signed-off-by: Jesse Barnes &lt;jbarnes@virtuousgeek.org&gt;
</content>
</entry>
<entry>
<title>Make pci_claim_resource() use request_resource() rather than insert_resource()</title>
<updated>2009-08-02T21:10:18Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2009-08-02T21:04:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=79896cf42f6a96d7e14f2dc3473443d68d74031d'/>
<id>urn:sha1:79896cf42f6a96d7e14f2dc3473443d68d74031d</id>
<content type='text'>
This function has traditionally used "insert_resource()", because before
commit cebd78a8c5 ("Fix pci_claim_resource") it used to just insert the
resource into whatever root resource tree that was indicated by
"pcibios_select_root()".

So there Matthew fixed it to actually look up the proper parent
resource, which means that now it's actively wrong to then traverse the
resource tree any more: we already know exactly where the new resource
should go.

And when we then did commit a76117dfd6 ("x86: Use pci_claim_resource"),
which changed the x86 PCI code from the open-coded

	pr = pci_find_parent_resource(dev, r);
	if (!pr || request_resource(pr, r) &lt; 0) {

to using

	if (pci_claim_resource(dev, idx) &lt; 0) {

that "insert_resource()" now suddenly became a problem, and causes a
regression covered by

	http://bugzilla.kernel.org/show_bug.cgi?id=13891

which this fixes.

Reported-and-tested-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
Cc: Matthew Wilcox &lt;willy@linux.intel.com&gt;
Cc: Andrew Patterson &lt;andrew.patterson@hp.com&gt;
Cc: Linux PCI &lt;linux-pci@vger.kernel.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6</title>
<updated>2009-06-22T18:59:51Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2009-06-22T18:59:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=59ef7a83f1127038a433464597df02e2dc9540e7'/>
<id>urn:sha1:59ef7a83f1127038a433464597df02e2dc9540e7</id>
<content type='text'>
* 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6: (74 commits)
  PCI: make msi_free_irqs() to use msix_mask_irq() instead of open coded write
  PCI: Fix the NIU MSI-X problem in a better way
  PCI ASPM: remove get_root_port_link
  PCI ASPM: cleanup pcie_aspm_sanity_check
  PCI ASPM: remove has_switch field
  PCI ASPM: cleanup calc_Lx_latency
  PCI ASPM: cleanup pcie_aspm_get_cap_device
  PCI ASPM: cleanup clkpm checks
  PCI ASPM: cleanup __pcie_aspm_check_state_one
  PCI ASPM: cleanup initialization
  PCI ASPM: cleanup change input argument of aspm functions
  PCI ASPM: cleanup misc in struct pcie_link_state
  PCI ASPM: cleanup clkpm state in struct pcie_link_state
  PCI ASPM: cleanup latency field in struct pcie_link_state
  PCI ASPM: cleanup aspm state field in struct pcie_link_state
  PCI ASPM: fix typo in struct pcie_link_state
  PCI: drivers/pci/slot.c should depend on CONFIG_SYSFS
  PCI: remove redundant __msi_set_enable()
  PCI PM: consistently use type bool for wake enable variable
  x86/ACPI: Correct maximum allowed _CRS returned resources and warn if exceeded
  ...
</content>
</entry>
<entry>
<title>Fix pci_claim_resource</title>
<updated>2009-06-17T21:04:42Z</updated>
<author>
<name>Matthew Wilcox</name>
</author>
<published>2009-06-17T20:33:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cebd78a8c5624b5cf04c39c3335a5fc8670a7b69'/>
<id>urn:sha1:cebd78a8c5624b5cf04c39c3335a5fc8670a7b69</id>
<content type='text'>
Instead of starting from the iomem or ioport roots, start from the
parent bus' resources.  This fixes a bug where child resources would
appear above their parents resources if they had the same size.

Signed-off-by: Matthew Wilcox &lt;willy@linux.intel.com&gt;
Tested-by: Andrew Patterson &lt;andrew.patterson@hp.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>PCI: improve resource allocation under transparent bridges</title>
<updated>2009-06-11T19:04:07Z</updated>
<author>
<name>Yinghai Lu</name>
</author>
<published>2009-04-24T03:49:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d09ee9687e027fc7d2c6b95daf05a8ef3ff06340'/>
<id>urn:sha1:d09ee9687e027fc7d2c6b95daf05a8ef3ff06340</id>
<content type='text'>
We could run out of space under under 4g, but devices under transparent
bridges can use 64bit resources, so keep trying on the parent bus until
we hit a non-transparent bridge.

Impact: better support for assigning unassigned resources

Reviewed-by: Ivan Kokshaysky &lt;ink@jurassic.park.msu.ru&gt;
Signed-off-by: Yinghai Lu &lt;yinghai@kernel.org&gt;
Signed-off-by: Jesse Barnes &lt;jbarnes@virtuousgeek.org&gt;
</content>
</entry>
<entry>
<title>PCI: allow assignment of memory resources with a specified alignment</title>
<updated>2009-03-20T17:48:15Z</updated>
<author>
<name>Yuji Shimada</name>
</author>
<published>2009-03-16T08:13:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=32a9a682bef2f6fce7026bd94d1ce20028b0e52d'/>
<id>urn:sha1:32a9a682bef2f6fce7026bd94d1ce20028b0e52d</id>
<content type='text'>
This patch allows memory resources to be assigned with a specified
alignment at boot-time or run-time. The patch is useful when we use PCI
pass-through, because page-aligned memory resources are required to
securely share PCI resources with guest drivers.

If you want to assign the resource at boot time, please set
"pci=resource_alignment=" boot parameter.

This is format of "pci=resource_alignment=" boot parameter:

        [&lt;order of align&gt;@][&lt;domain&gt;:]&lt;bus&gt;:&lt;slot&gt;.&lt;func&gt;[; ...]
                Specifies alignment and device to reassign
                aligned memory resources.
                If &lt;order of align&gt; is not specified, PAGE_SIZE is
                used as alignment.
                PCI-PCI bridge can be specified, if resource
                windows need to be expanded.

This is example:

        pci=resource_alignment=20@07:00.0;18@0f:00.0;00:1d.7

If you want to assign the resource at run-time, please set
"/sys/bus/pci/resource_alignment" file, and hot-remove the device and
hot-add the device.  For this purpose, fakephp or PCI hotplug interfaces
can be used.

The format of "/sys/bus/pci/resource_alignment" file is the same with
boot parameter. You can use "," instead of ";".

For example:

        # cd /sys/bus/pci
        # echo -n 20@12:00.0 &gt; resource_alignment
        # echo 1 &gt; devices/0000:12:00.0/remove
        # echo 1 &gt; rescan

Reviewed-by: Alex Chiang &lt;achiang@hp.com&gt;
Reviewed-by: Yu Zhao &lt;yu.zhao@intel.com&gt;
Signed-off-by: Yuji Shimada &lt;shimada-yxb@necst.nec.co.jp&gt;
Signed-off-by: Jesse Barnes &lt;jbarnes@virtuousgeek.org&gt;
</content>
</entry>
<entry>
<title>PCI: add a new function to map BAR offsets</title>
<updated>2009-01-07T19:13:04Z</updated>
<author>
<name>Yu Zhao</name>
</author>
<published>2008-11-21T18:41:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=613e7ed6f72b1a115f7ece8ce1b66cf095de1348'/>
<id>urn:sha1:613e7ed6f72b1a115f7ece8ce1b66cf095de1348</id>
<content type='text'>
Add a function to map a given resource number to a corresponding
register so drivers can get the offset and type of device specific BARs.

Signed-off-by: Yu Zhao &lt;yu.zhao@intel.com&gt;
Signed-off-by: Jesse Barnes &lt;jbarnes@virtuousgeek.org&gt;
</content>
</entry>
<entry>
<title>PCI: remove unnecessary arg of pci_update_resource()</title>
<updated>2009-01-07T19:13:00Z</updated>
<author>
<name>Yu Zhao</name>
</author>
<published>2008-11-21T18:38:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=14add80b5120966fe0659d61815b9e9b4b68fdc5'/>
<id>urn:sha1:14add80b5120966fe0659d61815b9e9b4b68fdc5</id>
<content type='text'>
This cleanup removes unnecessary argument 'struct resource *res' in
pci_update_resource(), so it takes same arguments as other companion
functions (pci_assign_resource(), etc.).

Signed-off-by: Yu Zhao &lt;yu.zhao@intel.com&gt;
Signed-off-by: Jesse Barnes &lt;jbarnes@virtuousgeek.org&gt;
</content>
</entry>
<entry>
<title>PCI: Don't carp about BAR allocation failures in quiet boot</title>
<updated>2009-01-07T19:12:42Z</updated>
<author>
<name>Ingo Molnar</name>
</author>
<published>2008-12-12T05:49:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=104bafcfab7ce3031399e60069949f10acecc022'/>
<id>urn:sha1:104bafcfab7ce3031399e60069949f10acecc022</id>
<content type='text'>
These are easy to trigger (more or less harmlessly) with multiple video
cards, since the ROM BAR will typically not be given any space by the
BIOS bridge setup.  No reason to punish quiet boot for this.

Signed-off-by: Adam Jackson &lt;ajax@redhat.com&gt;
Signed-off-by: Jesse Barnes &lt;jbarnes@virtuousgeek.org&gt;
</content>
</entry>
<entry>
<title>PCI: use resource_size() everywhere.</title>
<updated>2008-10-20T17:54:28Z</updated>
<author>
<name>Zhao, Yu</name>
</author>
<published>2008-10-13T11:24:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=022edd86d7c864bc8fadc3c8ac4e6a464472ab05'/>
<id>urn:sha1:022edd86d7c864bc8fadc3c8ac4e6a464472ab05</id>
<content type='text'>
This is a cleanup that replaces the resource calculation formula with
resource_size().

Signed-off-by: Yu Zhao &lt;yu.zhao@intel.com&gt;
Signed-off-by: Jesse Barnes &lt;jbarnes@virtuousgeek.org&gt;
</content>
</entry>
</feed>
