<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/pci/setup-res.c, branch linux-4.1.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.1.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.1.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2018-05-23T01:33:55Z</updated>
<entry>
<title>PCI: Make PCI_ROM_ADDRESS_MASK a 32-bit constant</title>
<updated>2018-05-23T01:33:55Z</updated>
<author>
<name>Matthias Kaehlcke</name>
</author>
<published>2017-04-14T20:38:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f052f848d7805ba6219c98cad6a7feec655c8953'/>
<id>urn:sha1:f052f848d7805ba6219c98cad6a7feec655c8953</id>
<content type='text'>
[ Upstream commit 76dc52684d0f72971d9f6cc7d5ae198061b715bd ]

A 64-bit value is not needed since a PCI ROM address consists in 32 bits.
This fixes a clang warning about "implicit conversion from 'unsigned long'
to 'u32'".

Also remove now unnecessary casts to u32 from __pci_read_base() and
pci_std_update_resource().

Signed-off-by: Matthias Kaehlcke &lt;mka@chromium.org&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
</content>
</entry>
<entry>
<title>PCI: Update BARs using property bits appropriate for type</title>
<updated>2018-01-17T17:31:33Z</updated>
<author>
<name>Sumit Semwal</name>
</author>
<published>2017-03-25T16:18:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=eeaf3677ba86c9eb95799358faa9c53d0354bf38'/>
<id>urn:sha1:eeaf3677ba86c9eb95799358faa9c53d0354bf38</id>
<content type='text'>
[ Upstream commit 45d004f4afefdd8d79916ee6d97a9ecd94bb1ffe ]

The BAR property bits (0-3 for memory BARs, 0-1 for I/O BARs) are supposed
to be read-only, but we do save them in res-&gt;flags and include them when
updating the BAR.

Mask the I/O property bits with ~PCI_BASE_ADDRESS_IO_MASK (0x3) instead of
PCI_REGION_FLAG_MASK (0xf) to make it obvious that we can't corrupt bits
2-3 of I/O addresses.

Use PCI_ROM_ADDRESS_MASK for ROM BARs.  This means we'll only check the top
21 bits (instead of the 28 bits we used to check) of a ROM BAR to see if
the update was successful.

Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
</content>
</entry>
<entry>
<title>PCI: Add comments about ROM BAR updating</title>
<updated>2018-01-17T17:31:18Z</updated>
<author>
<name>Sumit Semwal</name>
</author>
<published>2017-03-25T16:18:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d7b502b513fbd247fe5b8fd64858750ea5fe0028'/>
<id>urn:sha1:d7b502b513fbd247fe5b8fd64858750ea5fe0028</id>
<content type='text'>
[ Upstream commit 0b457dde3cf8b7c76a60f8e960f21bbd4abdc416 ]

pci_update_resource() updates a hardware BAR so its address matches the
kernel's struct resource UNLESS it's a disabled ROM BAR.  We only update
those when we enable the ROM.

It's not obvious from the code why ROM BARs should be handled specially.
Apparently there are Matrox devices with defective ROM BARs that read as
zero when disabled.  That means that if pci_enable_rom() reads the disabled
BAR, sets PCI_ROM_ADDRESS_ENABLE (without re-inserting the address), and
writes it back, it would enable the ROM at address zero.

Add comments and references to explain why we can't make the code look more
rational.

The code changes are from 755528c860b0 ("Ignore disabled ROM resources at
setup") and 8085ce084c0f ("[PATCH] Fix PCI ROM mapping").

Link: https://lkml.org/lkml/2005/8/30/138
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Reviewed-by: Gavin Shan &lt;gwshan@linux.vnet.ibm.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
</content>
</entry>
<entry>
<title>PCI: Remove pci_resource_bar() and pci_iov_resource_bar()</title>
<updated>2018-01-17T17:31:13Z</updated>
<author>
<name>Sumit Semwal</name>
</author>
<published>2017-03-25T16:18:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c6268b0a8d1d1169f876245967ebb8ffffdcb640'/>
<id>urn:sha1:c6268b0a8d1d1169f876245967ebb8ffffdcb640</id>
<content type='text'>
[ Upstream commit 286c2378aaccc7343ebf17ec6cd86567659caf70 ]

pci_std_update_resource() only deals with standard BARs, so we don't have
to worry about the complications of VF BARs in an SR-IOV capability.

Compute the BAR address inline and remove pci_resource_bar().  That makes
pci_iov_resource_bar() unused, so remove that as well.

Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Reviewed-by: Gavin Shan &lt;gwshan@linux.vnet.ibm.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
</content>
</entry>
<entry>
<title>PCI: Separate VF BAR updates from standard BAR updates</title>
<updated>2018-01-17T17:31:08Z</updated>
<author>
<name>Sumit Semwal</name>
</author>
<published>2017-03-25T16:18:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e71f476f1f27be45803526c3cd44ad87a86e4a0d'/>
<id>urn:sha1:e71f476f1f27be45803526c3cd44ad87a86e4a0d</id>
<content type='text'>
[ Upstream commit 6ffa2489c51da77564a0881a73765ea2169f955d ]

Previously pci_update_resource() used the same code path for updating
standard BARs and VF BARs in SR-IOV capabilities.

Split the VF BAR update into a new pci_iov_update_resource() internal
interface, which makes it simpler to compute the BAR address (we can get
rid of pci_resource_bar() and pci_iov_resource_bar()).

This patch:

  - Renames pci_update_resource() to pci_std_update_resource(),
  - Adds pci_iov_update_resource(),
  - Makes pci_update_resource() a wrapper that calls the appropriate one,

No functional change intended.

Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Reviewed-by: Gavin Shan &lt;gwshan@linux.vnet.ibm.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
</content>
</entry>
<entry>
<title>PCI: Mark invalid BARs as unassigned</title>
<updated>2015-03-12T23:52:12Z</updated>
<author>
<name>Bjorn Helgaas</name>
</author>
<published>2015-03-12T17:30:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c770cb4cb505c096eaca0fbbca3169c3aa4c3474'/>
<id>urn:sha1:c770cb4cb505c096eaca0fbbca3169c3aa4c3474</id>
<content type='text'>
If a BAR is not inside any upstream bridge window, or if it conflicts with
another resource, mark it as IORESOURCE_UNSET so we don't try to use it.
We may be able to assign a different address for it.

Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Acked-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;</content>
</entry>
<entry>
<title>PCI: Tidy resource assignment messages</title>
<updated>2014-07-08T22:29:08Z</updated>
<author>
<name>Bjorn Helgaas</name>
</author>
<published>2014-07-08T22:04:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=64da465e9841f93183744a9dadf992f938ac3910'/>
<id>urn:sha1:64da465e9841f93183744a9dadf992f938ac3910</id>
<content type='text'>
Print messages about failures in pci_assign_resource().  We can drop the
"by-hand" message from _pci_assign_resource() because %pR now prints the
size rather than the address if the resource hasn't been assigned.

No functional change.

Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;</content>
</entry>
<entry>
<title>PCI: Return conventional error values from pci_revert_fw_address()</title>
<updated>2014-07-08T22:29:08Z</updated>
<author>
<name>Bjorn Helgaas</name>
</author>
<published>2014-07-08T22:00:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=947788359527d9598356c274c50522e0f6d0ad0f'/>
<id>urn:sha1:947788359527d9598356c274c50522e0f6d0ad0f</id>
<content type='text'>
Previously we returned zero for success or 1 for failure.  This changes
that so we return zero for success or a negative errno for failure.

No functional change.

Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;</content>
</entry>
<entry>
<title>PCI: Cleanup control flow</title>
<updated>2014-07-08T22:29:08Z</updated>
<author>
<name>Bjorn Helgaas</name>
</author>
<published>2014-07-04T21:58:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=28f6dbe2c669c6a02c04c8ece21cafbcb20370ab'/>
<id>urn:sha1:28f6dbe2c669c6a02c04c8ece21cafbcb20370ab</id>
<content type='text'>
Return errors immediately so the straightline path is the normal,
no-error path.  No functional change.

Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;</content>
</entry>
<entry>
<title>PCI: Keep original resource if we fail to expand it</title>
<updated>2014-07-04T00:30:29Z</updated>
<author>
<name>Guo Chao</name>
</author>
<published>2014-07-04T00:30:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c33377082dd9ede1e998f7ce416077e4b1c2276c'/>
<id>urn:sha1:c33377082dd9ede1e998f7ce416077e4b1c2276c</id>
<content type='text'>
If we have space assigned to a resource, we try to expand the resource
(e.g., to accommodate SR-IOV resources), and the expansion attempt fails,
we should keep the original assignment.

After bd064f0a231a ("PCI: Mark resources as IORESOURCE_UNSET if we can't
assign them"), we left the resource marked IORESOURCE_UNSET when the
expansion failed, even if it had originally been set.  That caused errors
like this:

  pci 0003:00:00.0: can't enable device: BAR 15 [mem size 0x0c000000 64bit pref] not assigned
  pci 0003:00:00.0: Error enabling bridge (-22), continuing

Fix this by restoring the original flags when reassignment fails.

[bhelgaas: reworked to simplify, changelog]
Fixes: bd064f0a231a ("PCI: Mark resources as IORESOURCE_UNSET if we can't assign them")
Signed-off-by: Guo Chao &lt;yan@linux.vnet.ibm.com&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
CC: stable@vger.kernel.org	# v3.15+</content>
</entry>
</feed>
