1. 03 Oct, 2017 1 commit
    • Lorenzo Pieralisi's avatar
      ide: fix IRQ assignment for PCI bus order probing · b1f9e5e3
      Lorenzo Pieralisi authored
      We used to assign IRQs for all devices at boot-time, before any drivers
      claimed devices.  The following commits:
      
        30fdfb92 ("PCI: Add a call to pci_assign_irq() in pci_device_probe()")
        0e4c2eeb ("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:
        [<fffffc000048c9f4>] sysfs_warn_dup+0x94/0xd0
        [<fffffc0000330928>] warn_slowpath_fmt+0x58/0x70
        [<fffffc000048c9f4>] sysfs_warn_dup+0x94/0xd0
        [<fffffc0000486d40>] kernfs_path_from_node+0x30/0x60
        [<fffffc00004874ac>] kernfs_put+0x16c/0x2c0
        [<fffffc00004874ac>] kernfs_put+0x16c/0x2c0
        [<fffffc000048d010>] sysfs_do_create_link_sd.isra.2+0x100/0x120
        [<fffffc00005b9d64>] device_add+0x2a4/0x7c0
        [<fffffc00005ba5cc>] device_create_groups_vargs+0x14c/0x170
        [<fffffc00005ba518>] device_create_groups_vargs+0x98/0x170
        [<fffffc00005ba690>] device_create+0x50/0x70
        [<fffffc00005df36c>] ide_host_register+0x48c/0xa00
        [<fffffc00005df330>] ide_host_register+0x450/0xa00
        [<fffffc00005ba2a0>] device_register+0x20/0x50
        [<fffffc00005df330>] ide_host_register+0x450/0xa00
        [<fffffc00005df944>] ide_host_add+0x64/0xe0
        [<fffffc000079b41c>] kobject_uevent_env+0x16c/0x710
        [<fffffc0000310288>] do_one_initcall+0x68/0x260
        [<fffffc00007b13bc>] 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: 30fdfb92 ("PCI: Add a call to pci_assign_irq() in pci_device_probe()")
      Fixes: 0e4c2eeb ("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.netReported-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Tested-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      [bhelgaas: changelog]
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      Acked-by: default avatarDavid S. Miller <davem@davemloft.net>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Matt Turner <mattst88@gmail.com>
      b1f9e5e3
  2. 18 Jan, 2016 1 commit
    • Paul Gortmaker's avatar
      drivers/ide: make ide-scan-pci.c driver explicitly non-modular · e04a2bd6
      Paul Gortmaker authored
      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" <davem@davemloft.net>
      Cc: linux-ide@vger.kernel.org
      Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e04a2bd6
  3. 16 May, 2011 1 commit
  4. 26 Apr, 2008 1 commit
  5. 17 Apr, 2008 1 commit
  6. 01 Feb, 2008 1 commit
  7. 26 Jan, 2008 2 commits
    • Bartlomiej Zolnierkiewicz's avatar
    • Bartlomiej Zolnierkiewicz's avatar
      ide: make remaining built-in only IDE host drivers modular (take 2) · ade2daf9
      Bartlomiej Zolnierkiewicz authored
      * 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 <sshtylyov@ru.mvista.com>
      Cc: Mikael Starvik <starvik@axis.com>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Roman Zippel <zippel@linux-m68k.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: Bartlomiej Zolnierkiewicz's avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      ade2daf9