<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/pci/access.c, branch linux-3.11.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.11.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.11.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2013-11-29T18:42:15Z</updated>
<entry>
<title>PCI: Support PCIe Capability Slot registers only for ports with slots</title>
<updated>2013-11-29T18:42:15Z</updated>
<author>
<name>Bjorn Helgaas</name>
</author>
<published>2013-08-28T18:01:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=888123fed8befb905785525ee1796f5adfef087d'/>
<id>urn:sha1:888123fed8befb905785525ee1796f5adfef087d</id>
<content type='text'>
commit 6d3a1741f1e648cfbd5a0cc94477a0d5004c6f5e upstream.

Previously we allowed callers to access Slot Capabilities, Status, and
Control for Root Ports even if the Root Port did not implement a slot.
This seems dubious because the spec only requires these registers if a
slot is implemented.

It's true that even Root Ports without slots must have *space* for these
slot registers, because the Root Capabilities, Status, and Control
registers are after the slot registers in the capability.  However,
for a v1 PCIe Capability, the *semantics* of the slot registers are
undefined unless a slot is implemented.

Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Reviewed-By: Jiang Liu &lt;jiang.liu@huawei.com&gt;
Acked-by: Myron Stowe &lt;myron.stowe@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>PCI: Remove PCIe Capability version checks</title>
<updated>2013-11-29T18:42:15Z</updated>
<author>
<name>Bjorn Helgaas</name>
</author>
<published>2013-08-28T17:33:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1d7d090746787969d583161c26af7182512e5205'/>
<id>urn:sha1:1d7d090746787969d583161c26af7182512e5205</id>
<content type='text'>
commit c8b303d0206b28c4ff3aecada47108d1655ae00f upstream.

Previously we relied on the PCIe r3.0, sec 7.8, spec language that says
"For Functions that do not implement the [Link, Slot, Root] registers,
these spaces must be hardwired to 0b," which means that for v2 PCIe
capabilities, we don't need to check the device type at all.

But it's simpler if we don't need to check the capability version at all,
and I think the spec is explicit enough about which registers are required
for which types that we can remove the version checks.

Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Reviewed-By: Jiang Liu &lt;jiang.liu@huawei.com&gt;
Acked-by: Myron Stowe &lt;myron.stowe@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>PCI: Allow PCIe Capability link-related register access for switches</title>
<updated>2013-11-29T18:42:15Z</updated>
<author>
<name>Bjorn Helgaas</name>
</author>
<published>2013-08-27T15:54:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=850bf53b5219291b9c4543d8a69d2cd9a4908153'/>
<id>urn:sha1:850bf53b5219291b9c4543d8a69d2cd9a4908153</id>
<content type='text'>
commit d3694d4fa3f44f6a295f8ab064937c8a1549d174 upstream.

Every PCIe device has a link, except Root Complex Integrated Endpoints
and Root Complex Event Collectors.  Previously we didn't give access
to PCIe capability link-related registers for Upstream Ports, Downstream
Ports, and Bridges, so attempts to read PCI_EXP_LNKCTL incorrectly
returned zero.  See PCIe spec r3.0, sec 7.8 and 1.3.2.3.

Reference: http://lkml.kernel.org/r/979A8436335E3744ADCD3A9F2A2B68A52AD136BE@SJEXCHMB10.corp.ad.broadcom.com
Reported-by: Yuval Mintz &lt;yuvalmin@broadcom.com&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Reviewed-By: Jiang Liu &lt;jiang.liu@huawei.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>PCI: Fix PCI Express Capability accessors for PCI_EXP_FLAGS</title>
<updated>2013-02-15T18:46:24Z</updated>
<author>
<name>Alex Williamson</name>
</author>
<published>2013-02-14T18:35:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=969daa349f4821a02936af7202b51a9affc7b6da'/>
<id>urn:sha1:969daa349f4821a02936af7202b51a9affc7b6da</id>
<content type='text'>
PCI_EXP_FLAGS_TYPE is a mask, not an offset.  Fix it.

Previously, pcie_capability_read_word(..., PCI_EXP_FLAGS, ...) would
fail.

[bhelgaas:  tweak changelog]
Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
CC: stable@vger.kernel.org	# v3.7+</content>
</entry>
<entry>
<title>PCI: Use PCI Express Capability accessor</title>
<updated>2013-01-31T04:24:39Z</updated>
<author>
<name>Myron Stowe</name>
</author>
<published>2013-01-26T00:55:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1c531d82ee1a220ae7132ba0eb31edaf186b56d1'/>
<id>urn:sha1:1c531d82ee1a220ae7132ba0eb31edaf186b56d1</id>
<content type='text'>
Use PCI Express Capability access functions to simplify device
Capabilities Register usages.

Signed-off-by: Myron Stowe &lt;myron.stowe@redhat.com&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;</content>
</entry>
<entry>
<title>PCI: Add accessors for PCI Express Capability</title>
<updated>2012-08-23T15:41:20Z</updated>
<author>
<name>Jiang Liu</name>
</author>
<published>2012-07-24T09:20:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8c0d3a02c1309eb6112d2e7c8172e8ceb26ecfca'/>
<id>urn:sha1:8c0d3a02c1309eb6112d2e7c8172e8ceb26ecfca</id>
<content type='text'>
The PCI Express Capability (PCIe spec r3.0, sec 7.8) comes in two
versions, v1 and v2.  In v1 Capability structures (PCIe spec r1.0 and
r1.1), some fields are optional, so the structure size depends on the
device type.

This patch adds functions to access this capability so drivers don't
have to be aware of the differences between v1 and v2.  Note that these
new functions apply only to the "PCI Express Capability," not to any of
the other "PCI Express Extended Capabilities" (AER, VC, ACS, MFVC, etc.)

Function pcie_capability_read_word/dword() reads the PCIe Capabilities
register and returns the value in the reference parameter "val".  If
the PCIe Capabilities register is not implemented on the PCIe device,
"val" is set to 0.

Function pcie_capability_write_word/dword() writes the value to the
specified PCIe Capability register.

Function pcie_capability_clear_and_set_word/dword() sets and/or clears bits
of a PCIe Capability register.

[bhelgaas: changelog, drop "pci_" prefixes, don't export
pcie_capability_reg_implemented()]
Signed-off-by: Jiang Liu &lt;jiang.liu@huawei.com&gt;
Signed-off-by: Yijing Wang &lt;wangyijing@huawei.com&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;</content>
</entry>
<entry>
<title>PCI: export pci_user functions for use by other drivers</title>
<updated>2012-06-12T15:21:42Z</updated>
<author>
<name>Alex Williamson</name>
</author>
<published>2012-06-11T05:27:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c63587d7f5b9db84e71daf5962dc0394eb657da2'/>
<id>urn:sha1:c63587d7f5b9db84e71daf5962dc0394eb657da2</id>
<content type='text'>
VFIO PCI support will make use of these for user-initiated
PCI config accesses.

Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;</content>
</entry>
<entry>
<title>PCI: Introduce INTx check &amp; mask API</title>
<updated>2012-01-06T20:10:34Z</updated>
<author>
<name>Jan Kiszka</name>
</author>
<published>2011-11-04T08:46:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a2e27787f893621c5a6b865acf6b7766f8671328'/>
<id>urn:sha1:a2e27787f893621c5a6b865acf6b7766f8671328</id>
<content type='text'>
These new PCI services allow to probe for 2.3-compliant INTx masking
support and then use the feature from PCI interrupt handlers. The
services are properly synchronized with concurrent config space access
via sysfs or on device reset.

This enables generic PCI device drivers like uio_pci_generic or KVM's
device assignment to implement the necessary kernel-side IRQ handling
without any knowledge about device-specific interrupt status and control
registers.

Acked-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Jan Kiszka &lt;jan.kiszka@siemens.com&gt;
Signed-off-by: Jesse Barnes &lt;jbarnes@virtuousgeek.org&gt;
</content>
</entry>
<entry>
<title>PCI: Rework config space blocking services</title>
<updated>2012-01-06T20:10:33Z</updated>
<author>
<name>Jan Kiszka</name>
</author>
<published>2011-11-04T08:45:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fb51ccbf217c1c994607b6519c7d85250928553d'/>
<id>urn:sha1:fb51ccbf217c1c994607b6519c7d85250928553d</id>
<content type='text'>
pci_block_user_cfg_access was designed for the use case that a single
context, the IPR driver, temporarily delays user space accesses to the
config space via sysfs. This assumption became invalid by the time
pci_dev_reset was added as locking instance. Today, if you run two loops
in parallel that reset the same device via sysfs, you end up with a
kernel BUG as pci_block_user_cfg_access detect the broken assumption.

This reworks the pci_block_user_cfg_access to a sleeping service
pci_cfg_access_lock and an atomic-compatible variant called
pci_cfg_access_trylock. The former not only blocks user space access as
before but also waits if access was already locked. The latter service
just returns false in this case, allowing the caller to resolve the
conflict instead of raising a BUG.

Adaptions of the ipr driver were originally written by Brian King.

Acked-by: Brian King &lt;brking@linux.vnet.ibm.com&gt;
Acked-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Jan Kiszka &lt;jan.kiszka@siemens.com&gt;
Signed-off-by: Jesse Barnes &lt;jbarnes@virtuousgeek.org&gt;
</content>
</entry>
<entry>
<title>PCI: handle positive error codes</title>
<updated>2011-05-10T22:43:36Z</updated>
<author>
<name>Greg Thelen</name>
</author>
<published>2011-04-17T15:20:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=34e3207205ef492451cc5c53694d4772a9728b9f'/>
<id>urn:sha1:34e3207205ef492451cc5c53694d4772a9728b9f</id>
<content type='text'>
Callers expect pci_user_{read,write}_config_*() to indicate errors by
returning negative values.  Prior to this change, the indicated routines
could return positive error codes (e.g. PCIBIOS_BAD_REGISTER_NUMBER)
which callers would mistakenly interpret as success.

This change converts any non-zero return from the mentioned routines
into unambiguous negative value return codes.

Signed-off-by: Greg Thelen &lt;gthelen@google.com&gt;
Signed-off-by: Jesse Barnes &lt;jbarnes@virtuousgeek.org&gt;
</content>
</entry>
</feed>
