10 Sep, 2012

2 commits

  • The idea comes from Benjamin Herrenschmidt. The eeh cache helps
    fetching the pci device according to the given I/O address. Since
    the eeh cache is serving for eeh, it's reasonable for eeh cache
    to trace eeh device except pci device.

    The patch make eeh cache to trace eeh device. Also, the major
    eeh entry function eeh_dn_check_failure has been renamed to
    eeh_dev_check_failure since it will take eeh device as input
    parameter.

    Signed-off-by: Gavin Shan
    Signed-off-by: Benjamin Herrenschmidt

    Gavin Shan
     
  • Currently, we have 3 phases for EEH initialization on pSeries platform.
    All of them are done through builtin functions: platform initialization,
    EEH device creation, and EEH subsystem enablement. All of them are done
    no later than ppc_md.setup_arch. That means that the slab/slub isn't ready
    yet, so we have to allocate memory chunks on basis of PAGE_SIZE for those
    dynamically created EEH devices. That's pretty expensive.

    In order to utilize slab/slub for memory allocation, we have to move the EEH
    initialization functions around, but all of them should be called after slab
    is ready.

    Signed-off-by: Gavin Shan
    Signed-off-by: Benjamin Herrenschmidt

    Gavin Shan
     

24 Mar, 2012

1 commit

  • Pull PCI changes (including maintainer change) from Jesse Barnes:
    "This pull has some good cleanups from Bjorn and Yinghai, as well as
    some more code from Yinghai to better handle resource re-allocation
    when enabled.

    There's also a new initcall_debug feature from Arjan which will print
    out quirk timing information to help identify slow quirks for fixing
    or refinement (Yinghai sent in a few patches to do just that once the
    new debug code landed).

    Beyond that, I'm handing off PCI maintainership to Bjorn Helgaas.
    He's been a core PCI and Linux contributor for some time now, and has
    kindly volunteered to take over. I just don't feel I have the time
    for PCI review and work that it deserves lately (I've taken on some
    other projects), and haven't been as responsive lately as I'd like, so
    I approached Bjorn asking if he'd like to manage things. He's going
    to give it a try, and I'm confident he'll do at least as well as I
    have in keeping the tree managed, patches flowing, and keeping things
    stable."

    Fix up some fairly trivial conflicts due to other cleanups (mips device
    resource fixup cleanups clashing with list handling cleanup, ppc iseries
    removal clashing with pci_probe_only cleanup etc)

    * 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci: (112 commits)
    PCI: Bjorn gets PCI hotplug too
    PCI: hand PCI maintenance over to Bjorn Helgaas
    unicore32/PCI: move include to asm/pci.h
    sparc/PCI: convert devtree and arch-probed bus addresses to resource
    powerpc/PCI: allow reallocation on PA Semi
    powerpc/PCI: convert devtree bus addresses to resource
    powerpc/PCI: compute I/O space bus-to-resource offset consistently
    arm/PCI: don't export pci_flags
    PCI: fix bridge I/O window bus-to-resource conversion
    x86/PCI: add spinlock held check to 'pcibios_fwaddrmap_lookup()'
    PCI / PCIe: Introduce command line option to disable ARI
    PCI: make acpihp use __pci_remove_bus_device instead
    PCI: export __pci_remove_bus_device
    PCI: Rename pci_remove_behind_bridge to pci_stop_and_remove_behind_bridge
    PCI: Rename pci_remove_bus_device to pci_stop_and_remove_bus_device
    PCI: print out PCI device info along with duration
    PCI: Move "pci reassigndev resource alignment" out of quirks.c
    PCI: Use class for quirk for usb host controller fixup
    PCI: Use class for quirk for ti816x class fixup
    PCI: Use class for quirk for intel e100 interrupt fixup
    ...

    Linus Torvalds
     

09 Mar, 2012

1 commit

  • Original EEH implementation depends on struct pci_dn heavily. However,
    EEH shouldn't depend on that actually because EEH needn't share much
    information with other PCI components. That's to say, EEH should have
    worked independently.

    The patch introduces struct eeh_dev so that EEH core components needn't
    be working based on struct pci_dn in future. Also, struct pci_dn, struct
    eeh_dev instances are created in dynamic fasion and the binding with EEH
    device, OF node, PCI device is implemented as well.

    The EEH devices are created after PHBs are detected and initialized, but
    PCI emunation hasn't started yet. Apart from that, PHB might be created
    dynamically through DLPAR component and the EEH devices should be creatd
    as well. Another case might be OF node is created dynamically by DR
    (Dynamic Reconfiguration), which has been defined by PAPR. For those OF
    nodes created by DR, EEH devices should be also created accordingly. The
    binding between EEH device and OF node is done while the EEH device is
    initially created.

    The binding between EEH device and PCI device should be done after PCI
    emunation is done. Besides, PCI hotplug also needs the binding so that
    the EEH devices could be traced from the newly coming PCI buses or PCI
    devices.

    Signed-off-by: Gavin Shan
    Signed-off-by: Benjamin Herrenschmidt

    Gavin Shan
     

24 Feb, 2012

1 commit

  • We already use pci_flags, so this just sets pci_flags directly and removes
    the intermediate step of figuring out pci_probe_only, then using it to set
    pci_flags.

    The PCI core provides a pci_flags definition (currently __weak), so drop
    the powerpc definitions in favor of that.

    CC: Benjamin Herrenschmidt
    CC: linuxppc-dev@lists.ozlabs.org
    Signed-off-by: Bjorn Helgaas

    Bjorn Helgaas
     

12 Jul, 2011

1 commit

  • This renames pci flags functions and enums in preparation for creating
    generic version in asm-generic/pci-bridge.h. The following search and
    replace is done:

    s/ppc_pci_/pci_/
    s/PPC_PCI_/PCI_/

    Direct accesses to ppc_pci_flag variable are replaced with helper
    functions.

    Signed-off-by: Rob Herring
    Acked-by: Benjamin Herrenschmidt
    Cc: Paul Mackerras

    Rob Herring
     

21 May, 2009

1 commit


06 Nov, 2008

1 commit

  • The pseries PCI hotplug code has a number of issues, ranging from
    incorrect resource setup to crashes, depending on what is added,
    when, whether it contains a bridge, etc etc....

    This fixes a whole bunch of these, while actually simplifying the code
    a bit, using more generic code in the process and factoring out common
    code between adding of a PHB, a slot or a device.

    Signed-off-by: Benjamin Herrenschmidt
    Signed-off-by: Paul Mackerras

    Benjamin Herrenschmidt
     

14 May, 2008

1 commit

  • Make a few things static in lparcfg.c
    Make init and exit routines static in rtas_flash.c
    Make things static in rtas_pci.c
    Make some functions static in rtas.c
    Make fops static in rtas-proc.c
    Remove unneeded extern for do_gtod in smp.c
    Make clocksource_init() static in time.c
    Make last_tick_len and ticklen_to_xs static in time.c
    Move the declaration of the pvr per-cpu into smp.h
    Make kexec_smp_down() and kexec_stack static in machine_kexec_64.c
    Don't return void in arch_teardown_msi_irqs() in msi.c
    Move declaration of GregorianDay()into asm/time.h

    Signed-off-by: Michael Ellerman
    Signed-off-by: Paul Mackerras

    Michael Ellerman
     

07 Apr, 2008

1 commit


01 Apr, 2008

1 commit


17 Jan, 2008

1 commit


20 Dec, 2007

1 commit

  • This adds to the 32 bits PCI code some flags, replacing the old
    pci_assign_all_busses global, that allow us to control various
    aspects of the PCI probing, such as whether to re-assign all
    resources or not, or to not try to assign anything at all.

    This also adds the flag x86 already has to avoid ISA alignment
    on bridges that don't have ISA forwarding enabled (no legacy
    devices on the top level bus) and sets it for PowerMacs.

    Signed-off-by: Benjamin Herrenschmidt
    Signed-off-by: Paul Mackerras

    Benjamin Herrenschmidt
     

11 Dec, 2007

1 commit


17 Aug, 2007

1 commit


14 Jun, 2007

1 commit

  • This rewrites pretty much from scratch the handling of MMIO and PIO
    space allocations on powerpc64. The main goals are:

    - Get rid of imalloc and use more common code where possible
    - Simplify the current mess so that PIO space is allocated and
    mapped in a single place for PCI bridges
    - Handle allocation constraints of PIO for all bridges including
    hot plugged ones within the 2GB space reserved for IO ports,
    so that devices on hotplugged busses will now work with drivers
    that assume IO ports fit in an int.
    - Cleanup and separate tracking of the ISA space in the reserved
    low 64K of IO space. No ISA -> Nothing mapped there.

    I booted a cell blade with IDE on PIO and MMIO and a dual G5 so
    far, that's it :-)

    With this patch, all allocations are done using the code in
    mm/vmalloc.c, though we use the low level __get_vm_area with
    explicit start/stop constraints in order to manage separate
    areas for vmalloc/vmap, ioremap, and PCI IOs.

    This greatly simplifies a lot of things, as you can see in the
    diffstat of that patch :-)

    A new pair of functions pcibios_map/unmap_io_space() now replace
    all of the previous code that used to manipulate PCI IOs space.
    The allocation is done at mapping time, which is now called from
    scan_phb's, just before the devices are probed (instead of after,
    which is by itself a bug fix). The only other caller is the PCI
    hotplug code for hot adding PCI-PCI bridges (slots).

    imalloc is gone, as is the "sub-allocation" thing, but I do beleive
    that hotplug should still work in the sense that the space allocation
    is always done by the PHB, but if you unmap a child bus of this PHB
    (which seems to be possible), then the code should properly tear
    down all the HPTE mappings for that area of the PHB allocated IO space.

    I now always reserve the first 64K of IO space for the bridge with
    the ISA bus on it. I have moved the code for tracking ISA in a separate
    file which should also make it smarter if we ever are capable of
    hot unplugging or re-plugging an ISA bridge.

    This should have a side effect on platforms like powermac where VGA IOs
    will no longer work. This is done on purpose though as they would have
    worked semi-randomly before. The idea at this point is to isolate drivers
    that might need to access those and fix them by providing a proper
    function to obtain an offset to the legacy IOs of a given bus.

    Signed-off-by: Benjamin Herrenschmidt
    Signed-off-by: Paul Mackerras

    Benjamin Herrenschmidt
     

13 Apr, 2007

1 commit


09 Mar, 2007

1 commit


04 Dec, 2006

3 commits

  • powerpc: Merge 32 and 64 bits asm-powerpc/io.h

    The rework on io.h done for the new hookable accessors made it easier,
    so I just finished the work and merged 32 and 64 bits io.h for arch/powerpc.

    arch/ppc still uses the old version in asm-ppc, there is just too much gunk
    in there that I really can't be bothered trying to cleanup.

    Signed-off-by: Benjamin Herrenschmidt
    Signed-off-by: Paul Mackerras

    Benjamin Herrenschmidt
     
  • When enabled in Kconfig, it will pick up any of_platform_device
    matching it's match list (currently type "pci", "pcix", "pcie",
    or "ht" and setup a PHB for it.

    Platform must provide a ppc_md.pci_setup_phb() for it to work
    (for doing the necessary initialisations specific to a given PHB
    like setting up the config space ops).

    It's currently only available on 64 bits as the 32 bits PCI code
    can't quite cope with it in it's current form. I will fix that
    later.

    Signed-off-by: Benjamin Herrenschmidt
    Signed-off-by: Paul Mackerras

    Benjamin Herrenschmidt
     
  • The BUID is the first entry of a PCI host bridge "reg" property.

    Now that PCI busses can be anywhere in the device-tree, we need to
    fully translate the value there to a CPU physical address before
    we can use it with RTAS.

    Signed-off-by: Benjamin Herrenschmidt
    Signed-off-by: Paul Mackerras

    Benjamin Herrenschmidt
     

25 Aug, 2006

1 commit

  • Several RTAS calls take a "config_addr" parameter, which is a particular
    way of specifying a PCI busno, devfn and register number into a 32-bit word.
    Currently these are open-coded, and I'll be adding another soon, replace
    them with a helper that encapsulates the logic. Be more strict about masking
    the busno too, just in case.

    Booted on P5 LPAR.

    Signed-off-by: Michael Ellerman
    Signed-off-by: Paul Mackerras

    Michael Ellerman
     

31 Jul, 2006

1 commit


03 Jul, 2006

1 commit

  • This adds the new irq remapper core and removes the old one. Because
    there are some fundamental conflicts with the old code, like the value
    of NO_IRQ which I'm now setting to 0 (as per discussions with Linus),
    etc..., this commit also changes the relevant platform and driver code
    over to use the new remapper (so as not to cause difficulties later
    in bisecting).

    This patch removes the old pre-parsing of the open firmware interrupt
    tree along with all the bogus assumptions it made to try to renumber
    interrupts according to the platform. This is all to be handled by the
    new code now.

    For the pSeries XICS interrupt controller, a single remapper host is
    created for the whole machine regardless of how many interrupt
    presentation and source controllers are found, and it's set to match
    any device node that isn't a 8259. That works fine on pSeries and
    avoids having to deal with some of the complexities of split source
    controllers vs. presentation controllers in the pSeries device trees.

    The powerpc i8259 PIC driver now always requests the legacy interrupt
    range. It also has the feature of being able to match any device node
    (including NULL) if passed no device node as an input. That will help
    porting over platforms with broken device-trees like Pegasos who don't
    have a proper interrupt tree.

    Signed-off-by: Benjamin Herrenschmidt
    Signed-off-by: Paul Mackerras

    Benjamin Herrenschmidt
     

15 Jun, 2006

1 commit


17 Mar, 2006

1 commit


16 Mar, 2006

1 commit

  • The dynamic add path for PCI Host Bridges can fail to configure children
    adapters under P5IOC controllers. It fails to properly fixup bus/device
    resources, and it fails to properly enable EEH. Both of these steps
    need to occur before any children devices are enabled in
    pci_bus_add_devices().

    Signed-off-by: John Rose
    Signed-off-by: Paul Mackerras

    John Rose
     

10 Feb, 2006

1 commit


10 Jan, 2006

1 commit


09 Jan, 2006

1 commit

  • The pre-parsed addrs/n_addrs fields in struct device_node are finally
    gone. Remove the dodgy heuristics that did that parsing at boot and
    remove the fields themselves since we now have a good replacement with
    the new OF parsing code. This patch also fixes a bunch of drivers to use
    the new code instead, so that at least pmac32, pseries, iseries and g5
    defconfigs build.

    Signed-off-by: Benjamin Herrenschmidt
    Signed-off-by: Paul Mackerras

    Benjamin Herrenschmidt
     

16 Nov, 2005

1 commit

  • I discovered that in some cases (PowerMac for example) we wouldn't
    properly map the PCI IO space on recent kernels. In addition, the code
    for initializing PCI host bridges was scattered all over the place with
    some duplication between platforms.

    This patch fixes the problem and does a small cleanup by creating a
    pcibios_alloc_controller() in pci_64.c that is similar to the one in
    pci_32.c (just takes an additional device node argument) that takes care
    of all the grunt allocation and initialisation work. It should work for
    both boot time and dynamically allocated PHBs.

    Signed-off-by: Benjamin Herrenschmidt
    Signed-off-by: Paul Mackerras

    Benjamin Herrenschmidt
     

10 Nov, 2005

1 commit

  • This patch moves a bunch more files from arch/ppc64 and
    include/asm-ppc64 which have no equivalents in ppc32 code into
    arch/powerpc and include/asm-powerpc. The file affected are:
    hvcall.h
    proc_ppc64.c
    sysfs.c
    lparcfg.c
    rtas_pci.c

    The only changes apart from the move and corresponding Makefile
    changes are:
    - #ifndef/#define in includes updated to _ASM_POWERPC_ form
    - trailing whitespace removed
    - comments giving full paths removed

    Built and booted on POWER5 LPAR (ARCH=powerpc and ARCH=ppc64), built
    for 32-bit powermac (ARCH=powerpc).

    Signed-off-by: David Gibson
    Signed-off-by: Paul Mackerras

    David Gibson