<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/of/address.c, branch v3.18.62</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v3.18.62</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v3.18.62'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2017-05-25T12:17:57+00:00</updated>
<entry>
<title>of: fix sparse warning in of_pci_range_parser_one</title>
<updated>2017-05-25T12:17:57+00:00</updated>
<author>
<name>Rob Herring</name>
<email>robh@kernel.org</email>
</author>
<published>2017-05-04T17:34:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3829ab9ff69fb78713addc58e642d40d5c28ba56'/>
<id>urn:sha1:3829ab9ff69fb78713addc58e642d40d5c28ba56</id>
<content type='text'>
commit eb3100365791b06242b8bb5c3c2854ba41dabfbc upstream.

sparse gives the following warning for 'pci_space':

../drivers/of/address.c:266:26: warning: incorrect type in assignment (different base types)
../drivers/of/address.c:266:26:    expected unsigned int [unsigned] [usertype] pci_space
../drivers/of/address.c:266:26:    got restricted __be32 const [usertype] &lt;noident&gt;

It appears that pci_space is only ever accessed on powerpc, so the endian
swap is often not needed.

Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>of/address: Don't loop forever in of_find_matching_node_by_address().</title>
<updated>2015-10-28T02:14:51+00:00</updated>
<author>
<name>David Daney</name>
<email>david.daney@cavium.com</email>
</author>
<published>2015-08-19T20:17:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=be2a16239713fcaa5c0479c5cb0821cdba59fc81'/>
<id>urn:sha1:be2a16239713fcaa5c0479c5cb0821cdba59fc81</id>
<content type='text'>
[ Upstream commit 3a496b00b6f90c41bd21a410871dfc97d4f3c7ab ]

If the internal call to of_address_to_resource() fails, we end up
looping forever in of_find_matching_node_by_address().  This can be
caused by a defective device tree, or calling with an incorrect
matches argument.

Fix by calling of_find_matching_node() unconditionally at the end of
the loop.

Signed-off-by: David Daney &lt;david.daney@cavium.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</content>
</entry>
<entry>
<title>of/address: use atomic allocation in pci_register_io_range()</title>
<updated>2015-07-05T14:12:48+00:00</updated>
<author>
<name>Jingoo Han</name>
<email>jingoohan1@gmail.com</email>
</author>
<published>2015-06-17T15:12:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d42b6b4635df53180e781d392f6441744c34b62e'/>
<id>urn:sha1:d42b6b4635df53180e781d392f6441744c34b62e</id>
<content type='text'>
[ Upstream commit 294240ffe784e951dc2ef070da04fa31ef6db3a0 ]

When kzalloc() is called under spin_lock(), GFP_ATOMIC should be
used to avoid sleeping allocation.
The call tree is:
  of_pci_range_to_resource()
    --&gt; pci_register_io_range() &lt;-- takes spin_lock(&amp;io_range_lock);
       --&gt; kzalloc()

Signed-off-by: Jingoo Han &lt;jingoohan1@gmail.com&gt;
Cc: stable@vger.kernel.org # 3.18+
Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</content>
</entry>
<entry>
<title>of/pci: Fix pci_address_to_pio() conversion of CPU address to I/O port</title>
<updated>2015-07-04T03:02:17+00:00</updated>
<author>
<name>Zhichang Yuan</name>
<email>yuanzhichang@hisilicon.com</email>
</author>
<published>2015-04-24T09:05:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ec4dc9ec65b03eb561c84ad75125eef4ac25fbeb'/>
<id>urn:sha1:ec4dc9ec65b03eb561c84ad75125eef4ac25fbeb</id>
<content type='text'>
[ Upstream commit 5dbb4c6167229c8d4f528e8ec26699a7305000a3 ]

41f8bba7f555 ("of/pci: Add pci_register_io_range() and
pci_pio_to_address()") added support for systems with several I/O ranges
described by OF bindings.  It modified pci_address_to_pio() look up the
io_range for a given CPU physical address, but the conversion was wrong.

Fix the conversion of address to I/O port.

[bhelgaas: changelog]
Fixes: 41f8bba7f555 ("of/pci: Add pci_register_io_range() and pci_pio_to_address()")
Signed-off-by: Zhichang Yuan &lt;yuanzhichang@hisilicon.com&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Acked-by: Liviu Dudau &lt;Liviu.Dudau@arm.com&gt;
CC: stable@vger.kernel.org	# v3.18+

Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</content>
</entry>
<entry>
<title>drivers/of: Add empty ranges quirk for PA-Semi</title>
<updated>2015-04-24T21:14:03+00:00</updated>
<author>
<name>Benjamin Herrenschmidt</name>
<email>benh@kernel.crashing.org</email>
</author>
<published>2015-03-23T03:16:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0bc444b17344e40fec8c3c050189b5d99b7ca56c'/>
<id>urn:sha1:0bc444b17344e40fec8c3c050189b5d99b7ca56c</id>
<content type='text'>
[ Upstream commit 41d9489319f28f06cf51731131bc353d5a6bce59 ]

The "sdc" node is missing the ranges property, it needs to be treated
as having an empty one otherwise translation fails for its children.

Fixes 746c9e9f92dd, "of/base: Fix PowerPC address parsing hack"

Tested-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Signed-off-by: Grant Likely &lt;grant.likely@linaro.org&gt;
Cc: Stable &lt;stable@vger.kernel.org&gt; # v3.18+
Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</content>
</entry>
<entry>
<title>of/base: Fix PowerPC address parsing hack</title>
<updated>2014-11-18T17:46:44+00:00</updated>
<author>
<name>Benjamin Herrenschmidt</name>
<email>benh@kernel.crashing.org</email>
</author>
<published>2014-11-14T06:55:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=746c9e9f92dde2789908e51a354ba90a1962a2eb'/>
<id>urn:sha1:746c9e9f92dde2789908e51a354ba90a1962a2eb</id>
<content type='text'>
We have a historical hack that treats missing ranges properties as the
equivalent of an empty one. This is needed for ancient PowerMac "bad"
device-trees, and shouldn't be enabled for any other PowerPC platform,
otherwise we get some nasty layout of devices in sysfs or even
duplication when a set of otherwise identically named devices is
created multiple times under a different parent node with no ranges
property.

This fix is needed for the PowerNV i2c busses to be exposed properly
and will fix a number of other embedded cases.

Signed-off-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
CC: &lt;stable@vger.kernel.org&gt;
Acked-by: Grant Likely &lt;grant.likely@linaro.org&gt;
Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
</content>
</entry>
<entry>
<title>of/pci: Fix the conversion of IO ranges into IO resources</title>
<updated>2014-09-30T23:08:40+00:00</updated>
<author>
<name>Liviu Dudau</name>
<email>Liviu.Dudau@arm.com</email>
</author>
<published>2014-09-29T14:29:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0b0b0893d49b34201a6c4416b1a707b580b91e3d'/>
<id>urn:sha1:0b0b0893d49b34201a6c4416b1a707b580b91e3d</id>
<content type='text'>
The ranges property for a host bridge controller in DT describes the
mapping between the PCI bus address and the CPU physical address.  The
resources framework however expects that the IO resources start at a pseudo
"port" address 0 (zero) and have a maximum size of IO_SPACE_LIMIT.  The
conversion from PCI ranges to resources failed to take that into account,
returning a CPU physical address instead of a port number.

Also fix all the drivers that depend on the old behaviour by fetching the
CPU physical address based on the port number where it is being needed.

Signed-off-by: Liviu Dudau &lt;Liviu.Dudau@arm.com&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Acked-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
CC: Grant Likely &lt;grant.likely@linaro.org&gt;
CC: Rob Herring &lt;robh+dt@kernel.org&gt;
CC: Arnd Bergmann &lt;arnd@arndb.de&gt;
CC: Thierry Reding &lt;thierry.reding@gmail.com&gt;
CC: Simon Horman &lt;horms@verge.net.au&gt;
CC: Catalin Marinas &lt;catalin.marinas@arm.com&gt;</content>
</entry>
<entry>
<title>of/pci: Move of_pci_range_to_resource() to of/address.c</title>
<updated>2014-09-30T19:29:09+00:00</updated>
<author>
<name>Liviu Dudau</name>
<email>Liviu.Dudau@arm.com</email>
</author>
<published>2014-09-29T14:29:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=83bbde1cc0ec9d156b9271e29ffe0dc89c687feb'/>
<id>urn:sha1:83bbde1cc0ec9d156b9271e29ffe0dc89c687feb</id>
<content type='text'>
We need to enhance of_pci_range_to_resources() enough that it won't make
sense for it to be inline anymore.  Move it to drivers/of/address.c, under
#ifdef CONFIG_PCI.

of_address.h previously implemented of_pci_range_to_resources()
unconditionally, regardless of any config options.  The implementation in
address.c is defined only when CONFIG_OF_ADDRESS=y and CONFIG_PCI=y,
so add a dummy version to avoid build errors when CONFIG_OF or
CONFIG_OF_ADDRESS is not defined.

[bhelgaas: drop extra detail from changelog, move def under CONFIG_PCI,
add dummy of_pci_range_to_resource() for build errors (from Arnd)]
Signed-off-by: Liviu Dudau &lt;Liviu.Dudau@arm.com&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
CC: Grant Likely &lt;grant.likely@linaro.org&gt;
CC: Rob Herring &lt;robh+dt@kernel.org&gt;
CC: Arnd Bergmann &lt;arnd@arndb.de&gt;
CC: Catalin Marinas &lt;catalin.marinas@arm.com&gt;</content>
</entry>
<entry>
<title>of/pci: Add pci_register_io_range() and pci_pio_to_address()</title>
<updated>2014-09-30T15:42:45+00:00</updated>
<author>
<name>Liviu Dudau</name>
<email>Liviu.Dudau@arm.com</email>
</author>
<published>2014-09-29T14:29:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=41f8bba7f5552d033583777dede2df7c36e7853d'/>
<id>urn:sha1:41f8bba7f5552d033583777dede2df7c36e7853d</id>
<content type='text'>
Some architectures do not have a simple view of the PCI I/O space and
instead use a range of CPU addresses that map to bus addresses.  For some
architectures these ranges will be expressed by OF bindings in a device
tree file.

This patch introduces a pci_register_io_range() helper function with a
generic implementation that can be used by such architectures to keep track
of the I/O ranges described by the PCI bindings.  If the PCI_IOBASE macro
is not defined, that signals lack of support for PCI and we return an
error.

In order to retrieve the CPU address associated with an I/O port, a new
helper function pci_pio_to_address() is introduced.  This will search in
the list of ranges registered with pci_register_io_range() and return the
CPU address that corresponds to the given port.

[arnd: add dummy !CONFIG_OF pci_pio_to_address() to fix build errors]
Signed-off-by: Liviu Dudau &lt;Liviu.Dudau@arm.com&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Reviewed-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Acked-by: Rob Herring &lt;robh@kernel.org&gt;
CC: Grant Likely &lt;grant.likely@linaro.org&gt;</content>
</entry>
<entry>
<title>of: Provide a function to request and map memory</title>
<updated>2014-07-23T10:02:30+00:00</updated>
<author>
<name>Matthias Brugger</name>
<email>matthias.bgg@gmail.com</email>
</author>
<published>2014-07-18T09:36:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=efd342fb0031a17758571dce42e3f373d94e2fec'/>
<id>urn:sha1:efd342fb0031a17758571dce42e3f373d94e2fec</id>
<content type='text'>
A call to of_iomap does not request the memory region. This patch adds the
function of_io_request_and_map which requests the memory region before
mapping it.

Signed-off-by: Matthias Brugger &lt;matthias.bgg@gmail.com&gt;
Suggested-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Suggested-by: Rob Herring &lt;robh@kernel.org&gt;
Acked-by: Rob Herring &lt;robh@kernel.org&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
</content>
</entry>
</feed>
