<feed xmlns='http://www.w3.org/2005/Atom'>
<title>lwn.git/drivers/ide/ide-scan-pci.c, branch docs-4.16</title>
<subtitle>Linux kernel documentation tree maintained by Jonathan Corbet</subtitle>
<id>http://mirrors.hust.edu.cn/git/lwn.git/atom?h=docs-4.16</id>
<link rel='self' href='http://mirrors.hust.edu.cn/git/lwn.git/atom?h=docs-4.16'/>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/'/>
<updated>2017-10-03T19:03:31+00:00</updated>
<entry>
<title>ide: fix IRQ assignment for PCI bus order probing</title>
<updated>2017-10-03T19:03:31+00:00</updated>
<author>
<name>Lorenzo Pieralisi</name>
<email>lorenzo.pieralisi@arm.com</email>
</author>
<published>2017-10-02T10:52:47+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=b1f9e5e355e909000fcccfd2bc31f7c1ded358ab'/>
<id>urn:sha1:b1f9e5e355e909000fcccfd2bc31f7c1ded358ab</id>
<content type='text'>
We used to assign IRQs for all devices at boot-time, before any drivers
claimed devices.  The following commits:

  30fdfb929e82 ("PCI: Add a call to pci_assign_irq() in pci_device_probe()")
  0e4c2eeb758a ("alpha/PCI: Replace pci_fixup_irqs() call with host bridge IRQ mapping hooks")

changed this so we now call pci_assign_irq() from pci_device_probe() when
we call a driver's probe method.

The ide_scan_pcibus() path (enabled by CONFIG_IDEPCI_PCIBUS_ORDER) bypasses
pci_device_probe() so it can guarantee devices are claimed in order of PCI
bus address.  It calls the driver's probe method directly, so it misses the
pci_assign_irq() call (and other PCI initialization functions), which
causes failures like this:

  ide0: disabled, no IRQ
  ide0: failed to initialize IDE interface
  ide0: disabling port
  cmd64x 0000:00:02.0: IDE controller (0x1095:0x0646 rev 0x07)
  CMD64x_IDE 0000:00:02.0: BAR 0: can't reserve [io  0x8050-0x8057]
  cmd64x 0000:00:02.0: can't reserve resources
  CMD64x_IDE: probe of 0000:00:02.0 failed with error -16
  ide_generic: please use "probe_mask=0x3f" module parameter for probing
  all legacy ISA IDE ports
  ------------[ cut here ]------------
  WARNING: CPU: 0 PID: 1 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x94/0xd0
  sysfs: cannot create duplicate filename '/class/ide_port/ide0'
  ...

  Trace:
  [&lt;fffffc000048c9f4&gt;] sysfs_warn_dup+0x94/0xd0
  [&lt;fffffc0000330928&gt;] warn_slowpath_fmt+0x58/0x70
  [&lt;fffffc000048c9f4&gt;] sysfs_warn_dup+0x94/0xd0
  [&lt;fffffc0000486d40&gt;] kernfs_path_from_node+0x30/0x60
  [&lt;fffffc00004874ac&gt;] kernfs_put+0x16c/0x2c0
  [&lt;fffffc00004874ac&gt;] kernfs_put+0x16c/0x2c0
  [&lt;fffffc000048d010&gt;] sysfs_do_create_link_sd.isra.2+0x100/0x120
  [&lt;fffffc00005b9d64&gt;] device_add+0x2a4/0x7c0
  [&lt;fffffc00005ba5cc&gt;] device_create_groups_vargs+0x14c/0x170
  [&lt;fffffc00005ba518&gt;] device_create_groups_vargs+0x98/0x170
  [&lt;fffffc00005ba690&gt;] device_create+0x50/0x70
  [&lt;fffffc00005df36c&gt;] ide_host_register+0x48c/0xa00
  [&lt;fffffc00005df330&gt;] ide_host_register+0x450/0xa00
  [&lt;fffffc00005ba2a0&gt;] device_register+0x20/0x50
  [&lt;fffffc00005df330&gt;] ide_host_register+0x450/0xa00
  [&lt;fffffc00005df944&gt;] ide_host_add+0x64/0xe0
  [&lt;fffffc000079b41c&gt;] kobject_uevent_env+0x16c/0x710
  [&lt;fffffc0000310288&gt;] do_one_initcall+0x68/0x260
  [&lt;fffffc00007b13bc&gt;] kernel_init+0x1c/0x1a0
  ...
  ---[ end trace 24a70433c3e4d374 ]---
  ide0: disabling port

Fix the IRQ allocation issue by calling pci_assign_irq() from
ide_scan_pcidev() before probing the IDE PCI drivers, so that IRQs for a
given PCI device are allocated for the IDE PCI drivers to use them for
device configuration.

Fixes: 30fdfb929e82 ("PCI: Add a call to pci_assign_irq() in pci_device_probe()")
Fixes: 0e4c2eeb758a ("alpha/PCI: Replace pci_fixup_irqs() call with host bridge IRQ mapping hooks")
Link: http://lkml.kernel.org/r/32ec730f-c1b0-5584-cd35-f8a809122b96@roeck-us.net
Reported-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Tested-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Lorenzo Pieralisi &lt;lorenzo.pieralisi@arm.com&gt;
[bhelgaas: changelog]
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Reviewed-by: Bartlomiej Zolnierkiewicz &lt;b.zolnierkie@samsung.com&gt;
Acked-by: David S. Miller &lt;davem@davemloft.net&gt;
Cc: Richard Henderson &lt;rth@twiddle.net&gt;
Cc: Ivan Kokshaysky &lt;ink@jurassic.park.msu.ru&gt;
Cc: Matt Turner &lt;mattst88@gmail.com&gt;</content>
</entry>
<entry>
<title>drivers/ide: make ide-scan-pci.c driver explicitly non-modular</title>
<updated>2016-01-18T19:12:33+00:00</updated>
<author>
<name>Paul Gortmaker</name>
<email>paul.gortmaker@windriver.com</email>
</author>
<published>2015-12-09T21:45:51+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=e04a2bd6d8c95608cbb2c803ee2875cebfd89f52'/>
<id>urn:sha1:e04a2bd6d8c95608cbb2c803ee2875cebfd89f52</id>
<content type='text'>
The Kconfig for this support is currently:

config IDEPCI_PCIBUS_ORDER
        bool "Probe IDE PCI devices in the PCI bus order (DEPRECATED)"

...meaning that it currently is not being built as a module by anyone.
Lets change the initcall to be the equivalent device_initcall, so that
when reading the driver code, there is no doubt it is builtin-only.

Unlike other similar changes, we leave the module.h header to be
included since this code interacts with other drivers and needs to
know what a struct module is.

Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
Cc: linux-ide@vger.kernel.org
Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ide/ide-scan-pci.c: Use for_each_pci_dev().</title>
<updated>2011-05-16T21:24:46+00:00</updated>
<author>
<name>Thiago Farina</name>
<email>tfransosi@gmail.com</email>
</author>
<published>2011-05-01T12:10:25+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=db210f824c2f155703edf03bc2137da1bd76e27d'/>
<id>urn:sha1:db210f824c2f155703edf03bc2137da1bd76e27d</id>
<content type='text'>
Use for_each_pci_dev() to simplify the code.

Signed-off-by: Thiago Farina &lt;tfransosi@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ide: replace remaining __FUNCTION__ occurrences</title>
<updated>2008-04-26T20:25:20+00:00</updated>
<author>
<name>Harvey Harrison</name>
<email>harvey.harrison@gmail.com</email>
</author>
<published>2008-04-26T20:25:20+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=eb63963a55f039f049d0dd1121f91f332af6ecc9'/>
<id>urn:sha1:eb63963a55f039f049d0dd1121f91f332af6ecc9</id>
<content type='text'>
__FUNCTION__ is gcc-specific, use __func__

[bart: fix checkpatch.pl errors in ide-lib.c and ppc/mpc8xx.c while at it]

Signed-off-by: Harvey Harrison &lt;harvey.harrison@gmail.com&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Bartlomiej Zolnierkiewicz &lt;bzolnier@gmail.com&gt;
</content>
</entry>
<entry>
<title>IDE: remove ide=reverse IDE core</title>
<updated>2008-04-17T22:46:20+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@suse.de</email>
</author>
<published>2008-04-17T22:46:20+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=a594eeb1a1d320981fccc29584b6f21fcebd765f'/>
<id>urn:sha1:a594eeb1a1d320981fccc29584b6f21fcebd765f</id>
<content type='text'>
This option is obsolete and can be removed safely.

It allows us to remove the pci_get_device_reverse() function from the
PCI core.

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
Signed-off-by: Bartlomiej Zolnierkiewicz &lt;bzolnier@gmail.com&gt;
</content>
</entry>
<entry>
<title>ide: small ide-scan-pci.c cleanup</title>
<updated>2008-02-01T22:09:16+00:00</updated>
<author>
<name>Adrian Bunk</name>
<email>bunk@kernel.org</email>
</author>
<published>2008-02-01T22:09:16+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=2eae6ebbf99a083687466c010e3129fede9cdb4b'/>
<id>urn:sha1:2eae6ebbf99a083687466c010e3129fede9cdb4b</id>
<content type='text'>
- ide_scan_pcibus() can become static
- instead of ide_scan_pci() we can use ide_scan_pcibus() directly
  in module_init()

Signed-off-by: Adrian Bunk &lt;bunk@kernel.org&gt;
Signed-off-by: Bartlomiej Zolnierkiewicz &lt;bzolnier@gmail.com&gt;
</content>
</entry>
<entry>
<title>ide: move CONFIG_IDEPCI_PCIBUS_ORDER code to ide-scan-pci.c</title>
<updated>2008-01-26T19:13:09+00:00</updated>
<author>
<name>Bartlomiej Zolnierkiewicz</name>
<email>bzolnier@gmail.com</email>
</author>
<published>2008-01-26T19:13:09+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=9ac59226ca95889ad620b0e63c0f700679fee5dd'/>
<id>urn:sha1:9ac59226ca95889ad620b0e63c0f700679fee5dd</id>
<content type='text'>
Signed-off-by: Bartlomiej Zolnierkiewicz &lt;bzolnier@gmail.com&gt;
</content>
</entry>
<entry>
<title>ide: make remaining built-in only IDE host drivers modular (take 2)</title>
<updated>2008-01-26T19:13:07+00:00</updated>
<author>
<name>Bartlomiej Zolnierkiewicz</name>
<email>bzolnier@gmail.com</email>
</author>
<published>2008-01-26T19:13:07+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=ade2daf9c6e57845fe83a24e0a9fa1c03c6e91b1'/>
<id>urn:sha1:ade2daf9c6e57845fe83a24e0a9fa1c03c6e91b1</id>
<content type='text'>
* Make remaining built-in only IDE host drivers modular, add ide-scan-pci.c
  file for probing PCI host drivers registered with IDE core (special case
  for built-in IDE and CONFIG_IDEPCI_PCIBUS_ORDER=y) and then take care of
  the ordering in which all IDE host drivers are probed when IDE is built-in
  during link time.

* Move probing of gayle, falconide, macide, q40ide and buddha (m68k arch
  specific) host drivers, before PCI ones (no PCI on m68k), ide-cris (cris
  arch specific), cmd640 (x86 arch specific) and pmac (ppc arch specific).

* Move probing of ide-cris (cris arch specific) host driver before cmd640
  (x86 arch specific).

* Move probing of mpc8xx (ppc specific) host driver before ide-pnp (depends
  on ISA and none of ppc platform that use mpc8xx supports ISA) and ide-h8300
  (h8300 arch specific).

* Add "probe_vlb" kernel parameter to cmd640 host driver and update
  Documentation/ide.txt accordingly.

* Make IDE_ARM config option visible so it can also be disabled if needed.

* Remove bogus comment from ide.c while at it.

v2:
* Fix two issues spotted by Sergei:
  - replace ENOMEM error value by ENOENT in ide-h8300 host driver
  - fix MODULE_PARM_DESC() in cmd640 host driver

Cc: Sergei Shtylyov &lt;sshtylyov@ru.mvista.com&gt;
Cc: Mikael Starvik &lt;starvik@axis.com&gt;
Cc: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Cc: Roman Zippel &lt;zippel@linux-m68k.org&gt;
Cc: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Signed-off-by: Bartlomiej Zolnierkiewicz &lt;bzolnier@gmail.com&gt;
</content>
</entry>
</feed>
