1. 22 12月, 2013 1 次提交
    • Y
      PCI: Convert pcibios_resource_to_bus() to take a pci_bus, not a pci_dev · fc279850
      Yinghai Lu 提交于
      These interfaces:
      
        pcibios_resource_to_bus(struct pci_dev *dev, *bus_region, *resource)
        pcibios_bus_to_resource(struct pci_dev *dev, *resource, *bus_region)
      
      took a pci_dev, but they really depend only on the pci_bus.  And we want to
      use them in resource allocation paths where we have the bus but not a
      device, so this patch converts them to take the pci_bus instead of the
      pci_dev:
      
        pcibios_resource_to_bus(struct pci_bus *bus, *bus_region, *resource)
        pcibios_bus_to_resource(struct pci_bus *bus, *resource, *bus_region)
      
      In fact, with standard PCI-PCI bridges, they only depend on the host
      bridge, because that's the only place address translation occurs, but
      we aren't going that far yet.
      
      [bhelgaas: changelog]
      Signed-off-by: NYinghai Lu <yinghai@kernel.org>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      fc279850
  2. 24 10月, 2013 3 次提交
    • G
      of/irq: simplify args to irq_create_of_mapping · e6d30ab1
      Grant Likely 提交于
      All the callers of irq_create_of_mapping() pass the contents of a struct
      of_phandle_args structure to the function. Since all the callers already
      have an of_phandle_args pointer, why not pass it directly to
      irq_create_of_mapping()?
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      Acked-by: NMichal Simek <monstr@monstr.eu>
      Acked-by: NTony Lindgren <tony@atomide.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      e6d30ab1
    • G
      of/irq: Replace of_irq with of_phandle_args · 530210c7
      Grant Likely 提交于
      struct of_irq and struct of_phandle_args are exactly the same structure.
      This patch makes the kernel use of_phandle_args everywhere. This in
      itself isn't a big deal, but it makes some follow-on patches simpler.
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      Acked-by: NMichal Simek <monstr@monstr.eu>
      Acked-by: NTony Lindgren <tony@atomide.com>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      530210c7
    • G
      of/irq: Rename of_irq_map_* functions to of_irq_parse_* · 0c02c800
      Grant Likely 提交于
      The OF irq handling code has been overloading the term 'map' to refer to
      both parsing the data in the device tree and mapping it to the internal
      linux irq system. This is probably because the device tree does have the
      concept of an 'interrupt-map' function for translating interrupt
      references from one node to another, but 'map' is still confusing when
      the primary purpose of some of the functions are to parse the DT data.
      
      This patch renames all the of_irq_map_* functions to of_irq_parse_*
      which makes it clear that there is a difference between the parsing
      phase and the mapping phase. Kernel code can make use of just the
      parsing or just the mapping support as needed by the subsystem.
      
      The patch was generated mechanically with a handful of sed commands.
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      Acked-by: NMichal Simek <monstr@monstr.eu>
      Acked-by: NTony Lindgren <tony@atomide.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      0c02c800
  3. 23 8月, 2013 1 次提交
  4. 14 8月, 2013 3 次提交
  5. 24 7月, 2013 1 次提交
    • G
      powerpc/pci: Partial tree hotplug support · ab444ec9
      Gavin Shan 提交于
      When EEH error happens to one specific PE, the device drivers
      of its attached EEH devices (PCI devices) are checked to see
      the further action: reset with complete hotplug, or reset without
      hotplug. However, that's not enough for those PCI devices whose
      drivers can't support EEH, or those PCI devices without driver.
      So we need do so-called "partial hotplug" on basis of PCI devices.
      In the situation, part of PCI devices of the specific PE are
      unplugged and plugged again after PE reset.
      
      The patch changes pcibios_add_pci_devices() so that it can support
      full hotplug and so-called "partial" hotplug based on device-tree
      or real hardware. It's notable that pci_of_scan.c has been changed
      for a bit in order to support the "partial" hotplug based on dev-tree.
      
      Most of the generic code already supports that, we just need to
      plumb it properly on our side.
      Signed-off-by: NGavin Shan <shangw@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      ab444ec9
  6. 30 6月, 2013 1 次提交
    • G
      powerpc/pci: Improve device hotplug initialization · 7846de40
      Guenter Roeck 提交于
      Commit 37f02195 (powerpc/pci: fix PCI-e devices rescan issue on powerpc
      platform) fixes a problem with interrupt and DMA initialization on hot
      plugged devices. With this commit, interrupt and DMA initialization for
      hot plugged devices is handled in the pci device enable function.
      
      This approach has a couple of drawbacks. First, it creates two code paths
      for device initialization, one for hot plugged devices and another for devices
      known during the initial PCI scan. Second, the initialization code for hot
      plugged devices is only called when the device is enabled, ie typically
      in the probe function. Also, the platform specific setup code is called each
      time pci_enable_device() is called, not only once during device discovery,
      meaning it is actually called multiple times, once for devices discovered
      during the initial scan and again each time a driver is re-loaded.
      
      The visible result is that interrupt pins are only assigned to hot plugged
      devices when the device driver is loaded. Effectively this changes the PCI
      probe API, since pci_dev->irq and the device's dma configuration will now
      only be valid after pci_enable() was called at least once. A more subtle
      change is that platform specific PCI device setup is moved from device
      discovery into the driver's probe function, more specifically into the
      pci_enable_device() call.
      
      To fix the inconsistencies, add new function pcibios_add_device.
      Call pcibios_setup_device from pcibios_setup_bus_devices if device setup
      is not complete, and from pcibios_add_device if bus setup is complete.
      
      With this change, device setup code is moved back into device initialization,
      and called exactly once for both static and hot plugged devices.
      
      [ This also fixes a regression introduced by the above patch which
        causes dev->irq to be overwritten under some cirumstances after
        MSIs have been enabled for the device which leads to crashes due
        to the MSI core "hijacking" dev->irq to store the base MSI number
        and not the LSI. --BenH
      ]
      
      Cc: Yuanquan Chen <Yuanquan.Chen@freescale.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Hiroo Matsumoto <matsumoto.hiroo@jp.fujitsu.com>
      Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      7846de40
  7. 10 6月, 2013 1 次提交
  8. 01 6月, 2013 2 次提交
  9. 24 5月, 2013 1 次提交
  10. 14 5月, 2013 1 次提交
  11. 06 5月, 2013 3 次提交
  12. 18 4月, 2013 2 次提交
    • B
      powerpc: Set default VGA device · c2e1d845
      Brian King 提交于
      Add a PCI quirk for VGA devices on Power to set the default VGA device.
      Ensures a default VGA is always set if a graphics adapter is present,
      even if firmware did not initialize it. If more than one graphics
      adapter is present, ensure the one initialized by firmware is set
      as the default VGA device. This ensures that X autoconfiguration
      will work.
      Signed-off-by: NBrian King <brking@linux.vnet.ibm.com>
      Signed-off-by: NMichael Ellerman <michael@ellerman.id.au>
      c2e1d845
    • Y
      powerpc/pci: fix PCI-e devices rescan issue on powerpc platform · 37f02195
      Yuanquan Chen 提交于
      Powerpc initializes the DMA and IRQ information in pci_scan_child_bus()->
      pcibios_fixup_bus()->pcibios_setup_bus_devices(). But for the devices
      which are hotpluged, bus->is added has been set for the first scan of the
      PCI-e bus, so the initialization code won't be called. Then the hotpluged
      devices' driver will fail to load.
      
      For example :
      The PCI-e device 0001:03:00.0 is the Intel PCI-e e1000e network card, remove
      it from the system:
      
          # echo 1 > /sys/bus/pci/devices/0001\:03\:00.0/remove
          # e1000e 0001:03:00.0 eth0: removed PHC
      
      Rescan it from it's bus:
      
          # echo 1 > /sys/bus/pci/devices/0001\:02\:00.0/rescan
          ...
          e1000e 0001:03:00.0: Disabling ASPM L0s L1
          e1000e 0001:03:00.0: No usable DMA configuration, aborting
          e1000e: probe of 0001:03:00.0 failed with error -5
      
      So we move the DMA & IRQ initialization code from pcibios_setup_devices() and
      construct a new function pcibios_enable_device. We call this function in
      pcibios_enable_device, which will be called by PCI-e rescan code. At the
      meanwhile, we avoid the the impact on cardbus. I also validate this patch with
      silicon's PCIe-sata which encounters the IRQ issue.
      Signed-off-by: NYuanquan Chen <Yuanquan.Chen@freescale.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Hiroo Matsumoto <matsumoto.hiroo@jp.fujitsu.com>
      Signed-off-by: NMichael Ellerman <michael@ellerman.id.au>
      37f02195
  13. 10 1月, 2013 1 次提交
  14. 04 1月, 2013 1 次提交
    • G
      POWERPC: drivers: remove __dev* attributes. · cad5cef6
      Greg Kroah-Hartman 提交于
      CONFIG_HOTPLUG is going away as an option.  As a result, the __dev*
      markings need to be removed.
      
      This change removes the use of __devinit, __devexit_p, __devinitdata,
      __devinitconst, and __devexit from these drivers.
      
      Based on patches originally written by Bill Pemberton, but redone by me
      in order to handle some of the coding style issues better, by hand.
      
      Cc: Bill Pemberton <wfp5p@virginia.edu>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      cad5cef6
  15. 29 11月, 2012 1 次提交
  16. 12 9月, 2012 1 次提交
  17. 07 9月, 2012 1 次提交
    • G
      powerpc/pci: Save P2P bridge resource if possible · cf1a4cf8
      Gavin Shan 提交于
      When PCI probe flag PCI_REASSIGN_ALL_RSRC has been passed into PCI
      core, it's hoped that all resources to be reassigned by PCI core.
      As to particular P2P (PCI-to-PCI) bridge, the size of the corresponding
      BAR (I/O, MMIO, prefetchable MMIO) is calculated by the resources
      required by the PCI devices behind the P2P bridge. That means that
      the information like start/end address retrieved from the hardware
      registers of the P2P bridge is meainingless in the case. However,
      we still count that in and the BARs might have been configured by
      firmware with non-zero size. That leads to space waste.
      
      The patch explicitly sets the size of P2P bridge BARs to zero in
      case that resource reassignment is expected with PCI probe flag
      PCI_REASSIGN_ALL_RSRC. In the result, it will save overall resource
      required by the system without waste.
      Signed-off-by: NGavin Shan <shangw@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      cf1a4cf8
  18. 06 7月, 2012 2 次提交
  19. 03 7月, 2012 1 次提交
  20. 16 6月, 2012 1 次提交
    • G
      devicetree: add helper inline for retrieving a node's full name · efd68e72
      Grant Likely 提交于
      The pattern (np ? np->full_name : "<none>") is rather common in the
      kernel, but can also make for quite long lines.  This patch adds a new
      inline function, of_node_full_name() so that the test for a valid node
      pointer doesn't need to be open coded at all call sites.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      efd68e72
  21. 14 6月, 2012 2 次提交
  22. 21 3月, 2012 2 次提交
  23. 24 2月, 2012 2 次提交
  24. 07 1月, 2012 3 次提交
  25. 07 12月, 2011 1 次提交
  26. 25 11月, 2011 1 次提交
    • B
      powerpc/pci: Change how re-assigning resouces work · 48c2ce97
      Benjamin Herrenschmidt 提交于
      When PCI_REASSIGN_ALL_RSRC is set, we used to clear all bus resources
      at the beginning of survey and re-allocate them later.
      
      This changes it so instead, during early fixup, we mark all resources
      as IORESOURCE_UNSET and move them down to be 0-based.
      
      Later, if bus resources are still unset at the beginning of the survey,
      then we clear them.
      
      This shouldn't impact the re-assignment case on 4xx, but will enable
      us to have the platform do some custom resource assignment before the
      survey, by clearing individual resources IORESOURCE_UNSET bit.
      
      Also limits the clutter in the kernel log from fixup when re-assigning
      since we don't care about the offset applied to the BAR values in this
      case.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      48c2ce97