<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/pci/probe.c, branch v3.4.2</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>PCI: fix bridge I/O window bus-to-resource conversion</title>
<updated>2012-03-20T17:41:27+00:00</updated>
<author>
<name>Bjorn Helgaas</name>
<email>bhelgaas@google.com</email>
</author>
<published>2012-03-16T23:47:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=cf48fb6a2bf2e59990e1438d0dedc706df911996'/>
<id>cf48fb6a2bf2e59990e1438d0dedc706df911996</id>
<content type='text'>
In 5bfa14ed9f3c, I forgot to initialize res2.flags before calling
pcibios_bus_to_resource(), which depends on the resource type to locate the
correct aperture.  This bug won't hurt x86, which currently never has an
offset between bus and CPU addresses, but will affect other architectures.

Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Signed-off-by: Jesse Barnes &lt;jbarnes@virtuousgeek.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In 5bfa14ed9f3c, I forgot to initialize res2.flags before calling
pcibios_bus_to_resource(), which depends on the resource type to locate the
correct aperture.  This bug won't hurt x86, which currently never has an
offset between bus and CPU addresses, but will affect other architectures.

Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Signed-off-by: Jesse Barnes &lt;jbarnes@virtuousgeek.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>PCI: Move "pci reassigndev resource alignment" out of quirks.c</title>
<updated>2012-02-24T22:37:26+00:00</updated>
<author>
<name>Yinghai Lu</name>
<email>yinghai@kernel.org</email>
</author>
<published>2012-02-16T05:40:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2069ecfbe14ebd71a6f98e8a00724e9adf4fe4ee'/>
<id>2069ecfbe14ebd71a6f98e8a00724e9adf4fe4ee</id>
<content type='text'>
This isn't really a quirk; calling it directly from pci_add_device makes
more sense.

Signed-off-by: Yinghai Lu &lt;yinghai@kernel.org&gt;
Signed-off-by: Jesse Barnes &lt;jbarnes@virtuousgeek.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This isn't really a quirk; calling it directly from pci_add_device makes
more sense.

Signed-off-by: Yinghai Lu &lt;yinghai@kernel.org&gt;
Signed-off-by: Jesse Barnes &lt;jbarnes@virtuousgeek.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>PCI: collapse pcibios_resource_to_bus</title>
<updated>2012-02-24T03:19:04+00:00</updated>
<author>
<name>Bjorn Helgaas</name>
<email>bhelgaas@google.com</email>
</author>
<published>2012-02-24T03:19:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=fb127cb9de791d62fb393d6e65fa9869bddd2460'/>
<id>fb127cb9de791d62fb393d6e65fa9869bddd2460</id>
<content type='text'>
Everybody uses the generic pcibios_resource_to_bus() supplied by the core
now, so remove the ARCH_HAS_GENERIC_PCI_OFFSETS used during conversion.

Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Everybody uses the generic pcibios_resource_to_bus() supplied by the core
now, so remove the ARCH_HAS_GENERIC_PCI_OFFSETS used during conversion.

Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>PCI: add generic pcibios_resource_to_bus()</title>
<updated>2012-02-24T03:19:00+00:00</updated>
<author>
<name>Bjorn Helgaas</name>
<email>bhelgaas@google.com</email>
</author>
<published>2012-02-24T03:19:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=36a66cd6fd0a70ac6848d740d9cf7a4360b5776a'/>
<id>36a66cd6fd0a70ac6848d740d9cf7a4360b5776a</id>
<content type='text'>
This replaces the generic versions of pcibios_resource_to_bus() and
pcibios_bus_to_resource() in asm-generic/pci.h with versions that use
pci_resource_to_bus() and pci_bus_to_resource().

The replacements are equivalent except that they can apply host
bridge window offsets when the arch has supplied them by using
pci_add_resource_offset().

Each arch can convert to using pci_add_resource_offset() individually by
removing its device resource fixups from pcibios_fixup_bus() and supplying
ARCH_HAS_GENERIC_PCI_OFFSETS.  ARCH_HAS_GENERIC_PCI_OFFSETS can be removed
after all have converted.

Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This replaces the generic versions of pcibios_resource_to_bus() and
pcibios_bus_to_resource() in asm-generic/pci.h with versions that use
pci_resource_to_bus() and pci_bus_to_resource().

The replacements are equivalent except that they can apply host
bridge window offsets when the arch has supplied them by using
pci_add_resource_offset().

Each arch can convert to using pci_add_resource_offset() individually by
removing its device resource fixups from pcibios_fixup_bus() and supplying
ARCH_HAS_GENERIC_PCI_OFFSETS.  ARCH_HAS_GENERIC_PCI_OFFSETS can be removed
after all have converted.

Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>PCI: convert bus addresses to resource when reading BARs</title>
<updated>2012-02-24T03:19:00+00:00</updated>
<author>
<name>Bjorn Helgaas</name>
<email>bhelgaas@google.com</email>
</author>
<published>2012-02-24T03:19:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5bfa14ed9f3ca21fcecbcfbf4a848c002b740c41'/>
<id>5bfa14ed9f3ca21fcecbcfbf4a848c002b740c41</id>
<content type='text'>
Some PCI host bridges translate CPU addresses to PCI bus addresses.
Previously, we initialized pci_dev resources with PCI bus addresses,
then converted them to CPU addresses later in arch-specific code
(pcibios_fixup_resources()), which leaves a window of time where the
pci_dev resources are incorrect.

This patch adds support in the core for this address translation.
When the arch creates the root bus, it can supply the host bridge
address translation information, and the core can use it to set the
pci_dev resources correctly from the beginning.

This gives us a way to fix the problem that quirks that run between device
discovery and pcibios_fixup_resources() fail because they use pci_dev
resources that haven't been converted.  The reference below is to one
such problem that affected ARM and ia64.

Note that this patch has no effect until an arch starts using
pci_add_resource_offset() with a non-zero offset: before that, all
all host bridge windows have a zero offset and pci_bus_to_resource()
copies the pci_bus_region directly to the struct resource.

Reference: https://lkml.org/lkml/2009/10/12/405
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some PCI host bridges translate CPU addresses to PCI bus addresses.
Previously, we initialized pci_dev resources with PCI bus addresses,
then converted them to CPU addresses later in arch-specific code
(pcibios_fixup_resources()), which leaves a window of time where the
pci_dev resources are incorrect.

This patch adds support in the core for this address translation.
When the arch creates the root bus, it can supply the host bridge
address translation information, and the core can use it to set the
pci_dev resources correctly from the beginning.

This gives us a way to fix the problem that quirks that run between device
discovery and pcibios_fixup_resources() fail because they use pci_dev
resources that haven't been converted.  The reference below is to one
such problem that affected ARM and ia64.

Note that this patch has no effect until an arch starts using
pci_add_resource_offset() with a non-zero offset: before that, all
all host bridge windows have a zero offset and pci_bus_to_resource()
copies the pci_bus_region directly to the struct resource.

Reference: https://lkml.org/lkml/2009/10/12/405
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>PCI: add struct pci_host_bridge_window with CPU/bus address offset</title>
<updated>2012-02-24T03:19:00+00:00</updated>
<author>
<name>Bjorn Helgaas</name>
<email>bhelgaas@google.com</email>
</author>
<published>2012-02-24T03:19:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0efd5aab41e18a1175f72641696cfda154ba6c87'/>
<id>0efd5aab41e18a1175f72641696cfda154ba6c87</id>
<content type='text'>
Some PCI host bridges apply an address offset, so bus addresses on PCI are
different from CPU addresses.  This patch adds a way for architectures to
tell the PCI core about this offset.  For example:

    LIST_HEAD(resources);
    pci_add_resource_offset(&amp;resources, host-&gt;io_space, host-&gt;io_offset);
    pci_add_resource_offset(&amp;resources, host-&gt;mem_space, host-&gt;mem_offset);
    pci_scan_root_bus(parent, bus, ops, sysdata, &amp;resources);

Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some PCI host bridges apply an address offset, so bus addresses on PCI are
different from CPU addresses.  This patch adds a way for architectures to
tell the PCI core about this offset.  For example:

    LIST_HEAD(resources);
    pci_add_resource_offset(&amp;resources, host-&gt;io_space, host-&gt;io_offset);
    pci_add_resource_offset(&amp;resources, host-&gt;mem_space, host-&gt;mem_offset);
    pci_scan_root_bus(parent, bus, ops, sysdata, &amp;resources);

Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>PCI: add struct pci_host_bridge and a list of all bridges found</title>
<updated>2012-02-24T03:18:59+00:00</updated>
<author>
<name>Bjorn Helgaas</name>
<email>bhelgaas@google.com</email>
</author>
<published>2012-02-24T03:18:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5a21d70dbd33d20713fb735ad9381711b0ae2c9b'/>
<id>5a21d70dbd33d20713fb735ad9381711b0ae2c9b</id>
<content type='text'>
This adds a list of all PCI host bridges we find and a way to look up
the host bridge from a pci_dev.

Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This adds a list of all PCI host bridges we find and a way to look up
the host bridge from a pci_dev.

Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>PCI: don't publish new root bus until it's fully initialized</title>
<updated>2012-02-24T03:18:59+00:00</updated>
<author>
<name>Bjorn Helgaas</name>
<email>bhelgaas@google.com</email>
</author>
<published>2012-02-24T03:18:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a5390aa6dc3646b08bed421944cef0daf78ab994'/>
<id>a5390aa6dc3646b08bed421944cef0daf78ab994</id>
<content type='text'>
When pci_create_root_bus() adds the new struct pci_bus to the global
pci_root_buses list, the bus becomes visible to other parts of the
kernel, so it should be fully initialized.

This patch delays adding the bus to the pci_root_buses list until after
all the struct pci_bus initialization is finished.

Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When pci_create_root_bus() adds the new struct pci_bus to the global
pci_root_buses list, the bus becomes visible to other parts of the
kernel, so it should be fully initialized.

This patch delays adding the bus to the pci_root_buses list until after
all the struct pci_bus initialization is finished.

Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>PCI: fix memleak for pci dev removing during hotplug</title>
<updated>2012-02-23T20:08:53+00:00</updated>
<author>
<name>Yinghai Lu</name>
<email>yinghai@kernel.org</email>
</author>
<published>2012-02-11T08:18:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f796841e49fe086176e27ed0e1f3f7a1123a4a6b'/>
<id>f796841e49fe086176e27ed0e1f3f7a1123a4a6b</id>
<content type='text'>
unreferenced object 0xffff880276d17700 (size 64):
  comm "swapper/0", pid 1, jiffies 4294897182 (age 3976.028s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 18 f9 de 76 02 88 ff ff  ...........v....
    10 00 00 00 0e 00 00 00 0f 28 40 00 00 00 00 00  .........(@.....
  backtrace:
    [&lt;ffffffff81c8aede&gt;] kmemleak_alloc+0x26/0x43
    [&lt;ffffffff811385f0&gt;] __kmalloc+0x121/0x183
    [&lt;ffffffff813cf821&gt;] pci_add_cap_save_buffer+0x35/0x7c
    [&lt;ffffffff813d12b7&gt;] pci_allocate_cap_save_buffers+0x1d/0x65
    [&lt;ffffffff813cdb52&gt;] pci_device_add+0x92/0xf1
    [&lt;ffffffff81c8afe6&gt;] pci_scan_single_device+0x9f/0xa1
    [&lt;ffffffff813cdbd2&gt;] pci_scan_slot.part.20+0x21/0x106
    [&lt;ffffffff813cdce2&gt;] pci_scan_slot+0x2b/0x35
    [&lt;ffffffff81c8dae4&gt;] __pci_scan_child_bus+0x51/0x107
    [&lt;ffffffff81c8d75b&gt;] pci_scan_bridge+0x376/0x6ae
    [&lt;ffffffff81c8db60&gt;] __pci_scan_child_bus+0xcd/0x107
    [&lt;ffffffff81c8dbab&gt;] pci_scan_child_bus+0x11/0x2a
    [&lt;ffffffff81cca58c&gt;] pci_acpi_scan_root+0x18b/0x21c
    [&lt;ffffffff81c916be&gt;] acpi_pci_root_add+0x1e1/0x42a
    [&lt;ffffffff81406210&gt;] acpi_device_probe+0x50/0x190
    [&lt;ffffffff814a0227&gt;] really_probe+0x99/0x126

Need to free saved_buffer for capabilities.

Signed-off-by: Yinghai Lu &lt;yinghai@kernel.org&gt;
Signed-off-by: Jesse Barnes &lt;jbarnes@virtuousgeek.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
unreferenced object 0xffff880276d17700 (size 64):
  comm "swapper/0", pid 1, jiffies 4294897182 (age 3976.028s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 18 f9 de 76 02 88 ff ff  ...........v....
    10 00 00 00 0e 00 00 00 0f 28 40 00 00 00 00 00  .........(@.....
  backtrace:
    [&lt;ffffffff81c8aede&gt;] kmemleak_alloc+0x26/0x43
    [&lt;ffffffff811385f0&gt;] __kmalloc+0x121/0x183
    [&lt;ffffffff813cf821&gt;] pci_add_cap_save_buffer+0x35/0x7c
    [&lt;ffffffff813d12b7&gt;] pci_allocate_cap_save_buffers+0x1d/0x65
    [&lt;ffffffff813cdb52&gt;] pci_device_add+0x92/0xf1
    [&lt;ffffffff81c8afe6&gt;] pci_scan_single_device+0x9f/0xa1
    [&lt;ffffffff813cdbd2&gt;] pci_scan_slot.part.20+0x21/0x106
    [&lt;ffffffff813cdce2&gt;] pci_scan_slot+0x2b/0x35
    [&lt;ffffffff81c8dae4&gt;] __pci_scan_child_bus+0x51/0x107
    [&lt;ffffffff81c8d75b&gt;] pci_scan_bridge+0x376/0x6ae
    [&lt;ffffffff81c8db60&gt;] __pci_scan_child_bus+0xcd/0x107
    [&lt;ffffffff81c8dbab&gt;] pci_scan_child_bus+0x11/0x2a
    [&lt;ffffffff81cca58c&gt;] pci_acpi_scan_root+0x18b/0x21c
    [&lt;ffffffff81c916be&gt;] acpi_pci_root_add+0x1e1/0x42a
    [&lt;ffffffff81406210&gt;] acpi_device_probe+0x50/0x190
    [&lt;ffffffff814a0227&gt;] really_probe+0x99/0x126

Need to free saved_buffer for capabilities.

Signed-off-by: Yinghai Lu &lt;yinghai@kernel.org&gt;
Signed-off-by: Jesse Barnes &lt;jbarnes@virtuousgeek.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>PCI: Fix device class print out</title>
<updated>2012-02-23T20:05:59+00:00</updated>
<author>
<name>Yinghai Lu</name>
<email>yinghai@kernel.org</email>
</author>
<published>2012-02-19T22:50:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2dd8ba921d570fcd016f8038c63fa9668892d16b'/>
<id>2dd8ba921d570fcd016f8038c63fa9668892d16b</id>
<content type='text'>
Found debug print of class is shifted.

| pci 0000:f8:15.2: [8086:2b56] type 0 class 0x000600

Code is trying to print class with 6 digits, but use shifted class with
4 digits valid value as variable.

Change to original dev-&gt;class directly.

Also remove not needed calculating of local variable class, because it
will be updated after pci_fixup_device(pci_fixup_early...)

Also unify type print out when class and header is not matched.

Signed-off-by: Yinghai Lu &lt;yinghai@kernel.org&gt;
Signed-off-by: Jesse Barnes &lt;jbarnes@virtuousgeek.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Found debug print of class is shifted.

| pci 0000:f8:15.2: [8086:2b56] type 0 class 0x000600

Code is trying to print class with 6 digits, but use shifted class with
4 digits valid value as variable.

Change to original dev-&gt;class directly.

Also remove not needed calculating of local variable class, because it
will be updated after pci_fixup_device(pci_fixup_early...)

Also unify type print out when class and header is not matched.

Signed-off-by: Yinghai Lu &lt;yinghai@kernel.org&gt;
Signed-off-by: Jesse Barnes &lt;jbarnes@virtuousgeek.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
