[Skiboot] [PATCH v12 00/23] PCI Slot Managment

Gavin Shan gwshan at linux.vnet.ibm.com
Mon Jun 20 21:58:54 AEST 2016


On Mon, Jun 20, 2016 at 04:02:11PM +1000, Stewart Smith wrote:
>Stewart Smith <stewart at linux.vnet.ibm.com> writes:
>> Gavin Shan <gwshan at linux.vnet.ibm.com> writes:
>>> The series of patches intend to support PCI slots for various tasks like
>>> retrieving PCI slot status, PCI slot reset, and PCI slot hotplug. The
>>> design is highlighted as below:
>>>
>>>    * Each PHB is expected to have one associated "PHB" slot, which is
>>>      created by platform.
>>>    * Each PCI slot is created by platform as well, which might inherit
>>>      some properties from PHB slot.
>>>    * Currently, Firenze is the only one platform that populates PCI slots.
>>>    * Each PCI slot has couple of callbacks implemented to support various
>>>      functions it should support in pci-slot.c, which can be overrided by
>>>      platforms to have their own particular behaviour or PCI slot properties.
>>>    * The PCI slot functionality is implemented with state machine, which
>>>      is inherited from Ben's original code to support PHBs. The PCI slots
>>>      allowed to be overrided by platforms as well.
>>>    * When removing or adding adapter to one particular PCI slot, the device
>>>      nodes tied through the PCI slot will be removed or added (after rescanning).
>>>      All device-tree changes is formated as message sent to OS, which needs
>>>      those inforamtion to populate pci_dn and eeh_dev.
>>>
>>> Changelog
>>> =========
>>> v12:
>>>    * Comments cleanup according to Russell's input
>>>    * Code refactoring according to Andrew, Russell, Stewart's comments
>>>    * Alistair's comments to merge the states will be done in future.
>>> v11:
>>>    * Serialize the taks in cpu.c as Steward suggested.
>>>    * opal_get_device_tree() is extended to return the memory length.
>>>    * opal_pci_set_power_state() adds/removes PCI devices and device nodes
>>>      that was done in platform backend. The backend function just issues
>>>      I2C request to power off/on the slot.
>>>    * opal_pci_set_power_state() is extended to slot's downstream adapters
>>>      to offline or online without changing its power state as CAPI developers
>>>      asked.
>>>    * Documenting improvement.
>>>    * Patch split and merge.
>>> v10:
>>>    * Rebased to commit 0e47de7 ("mambo: Flatten device tree at the end")
>>>      plus 3 additional patches: https://patchwork.ozlabs.org/patch/614760/
>>>    * uint64_t argument for newly introduced APIs for extension in future.
>>>    * Introduced opal_pci_poll2() that accepts two arguments.
>>>    * Fix misc comments from Daniel.
>>>    * Several patches that were merged to upstream and dropped from the
>>>      series.
>>> v9:
>>>    * Rebased to commit dfab2fb ("Fix endian flip in printf for FSP in
>>>      hdata/fsp.c").
>>>    * Patch split/merge for easier review.
>>>    * Add retry mechanism required by fundamental reset on PHB3.
>>>    * Created PHB slots for NPU PHBs.
>>>    * Support PCI slots on astbmc platforms.
>>>    * Fixed PCI slot power status and presence status with help of macros
>>>      in opal-api.h.
>>>    * More description added to doc/pci-slot.txt for the message sent at
>>>      PCI hotplug/unplug time.
>>> v8:
>>>    * Removed dt_counter. To transfer device sub-tree under the specified
>>>      node with OPAL API opal_get_device_tree.
>>> v7:
>>>    * Use dt_counter to track device-tree change.
>>> v6:
>>>    * Rebased to commit 0d275bc ("Fix boot-tests for BMC machines due to FSP
>>>      password in dotfile").
>>>    * Remove SDC/SDL check when sending I2C data to slave.
>>>    * Allow to change the default I2C request timeout, instead of disabling it.
>>>    * Split PCI slot core to two files (pci-slot.c and pcie-slot.c).
>>>    * PHB slot is created by default. It's not created by individual platforms
>>>      any more.
>>>    * Use flat device-tree blob to convey device sub-tree. The original one
>>>      based on strings has been dropped.
>>>    * Merged PATCH[v5 12/15] ("PCI: Reinitialize devices on slot reset") to
>>>      PATCH[v5 7/15] ("core/pci: PCI slot management core").
>>>    * Commit log cleanup.
>>> v5:
>>>    * Fix I2C issues caused by wrong I2C master frequency.
>>>    * Fix reserved PE# when unmapping RID on PHB3.
>>>    * Add logic to support PCI hotplug: When one adapter is removed from the
>>>      slot, the power supply and the device nodes tied through the slot will
>>>      be cut off. When adding one adapter to PCI slot, the PCI bus leading
>>>      from the slot will be rescanned. On any PCI topology changes, the device
>>>      tree changes will be sent to OS for updating.
>>>    * Refactor the PCI slot states and remove unnecessary ones.
>>>
>>> Gavin Shan (23):
>>>   hw/p8-i2c: Allow to set I2C request timeout
>>>   core/fdt: Improve debugging functionality
>>>   core/fdt: Introduce flatten_dt_properties()
>>>   core/fdt: Allow to specify FDT blob
>>>   core/fdt: Introduce __create_dtb()
>>>   core/fdt: Allow to exclude root node
>>>   core/fdt: Introduce opal_get_device_tree()
>>>   core/cpu: Introduce DEBUG_SERIALIZE_CPU_JOBS
>>>   core/pci: Fix wrong reserved PE# in enumeration
>>>   core/pci: Extend pci_walk_dev() for PCI slot
>>>   core/pci: Extend pci_restore_bridge_buses() for PCI slot
>>>   core/pci: Return value for struct phb_ops::device_init
>>>   core/pci: Support PCI slot
>>>   hw/p7ioc: Support PHB slot
>>>   hw/phb3: Remove useless comments
>>>   hw/phb3: Support PHB slot
>>>   hw/npu: Support PHB slot
>>>   platforms/ibm-fsp: Support PCI slot
>>>   platforms/astbmc: Support PCI slot
>>>   core/pci: Use PCI slot in enumeration
>>>   core/pci: Power off empty hotpluggable slot
>>>   core/opal: Support PCI slot and new APIs
>>>   doc: PCI slot
>>>
>>>  core/Makefile.inc                                |    4 +-
>>>  core/cpu.c                                       |    5 +
>>>  core/fdt.c                                       |  171 ++--
>>>  core/init.c                                      |    2 +-
>>>  core/pci-opal.c                                  |  235 ++++-
>>>  core/pci-slot.c                                  |  206 ++++
>>>  core/pci.c                                       |  341 ++++---
>>>  core/pcie-slot.c                                 |  452 +++++++++
>>>  doc/opal-api/opal-get-device-tree-118.txt        |   24 +
>>>  doc/opal-api/opal-pci-get-power-state-120.txt    |   19 +
>>>  doc/opal-api/opal-pci-get-presence-state-119.txt |   22 +
>>>  doc/opal-api/opal-pci-set-power-state-121.txt    |   36 +
>>>  doc/pci-slot-properties.txt                      |   17 -
>>>  doc/pci-slot.txt                                 |  119 +++
>>>  hw/npu.c                                         |   62 +-
>>>  hw/p7ioc-phb.c                                   | 1152 +++++++++-------------
>>>  hw/p8-i2c.c                                      |   25 +-
>>>  hw/phb3.c                                        |  707 ++++++-------
>>>  include/i2c.h                                    |    9 +
>>>  include/opal-api.h                               |   18 +-
>>>  include/p7ioc.h                                  |   48 +-
>>>  include/pci-slot.h                               |  255 +++++
>>>  include/pci.h                                    |  162 +--
>>>  include/phb3.h                                   |   54 +-
>>>  include/platform.h                               |    1 +
>>>  include/skiboot.h                                |    2 +-
>>>  platforms/astbmc/slots.c                         |   58 +-
>>>  platforms/ibm-fsp/Makefile.inc                   |    3 +-
>>>  platforms/ibm-fsp/apollo-pci.c                   |   94 ++
>>>  platforms/ibm-fsp/apollo.c                       |   23 +-
>>>  platforms/ibm-fsp/firenze-pci.c                  |  957 ++++++++++++++++++
>>>  platforms/ibm-fsp/firenze.c                      |  345 +------
>>>  platforms/ibm-fsp/ibm-fsp.h                      |   13 +
>>>  platforms/ibm-fsp/lxvpd.c                        |  375 ++++---
>>>  platforms/ibm-fsp/lxvpd.h                        |   35 +-
>>>  35 files changed, 3913 insertions(+), 2138 deletions(-)
>>>  create mode 100644 core/pci-slot.c
>>>  create mode 100644 core/pcie-slot.c
>>>  create mode 100644 doc/opal-api/opal-get-device-tree-118.txt
>>>  create mode 100644 doc/opal-api/opal-pci-get-power-state-120.txt
>>>  create mode 100644 doc/opal-api/opal-pci-get-presence-state-119.txt
>>>  create mode 100644 doc/opal-api/opal-pci-set-power-state-121.txt
>>>  delete mode 100644 doc/pci-slot-properties.txt
>>>  create mode 100644 doc/pci-slot.txt
>>>  create mode 100644 include/pci-slot.h
>>>  create mode 100644 platforms/ibm-fsp/apollo-pci.c
>>>  create mode 100644 platforms/ibm-fsp/firenze-pci.c
>>>
>>
>> Thanks! After a few revisions and everything, I just merged the series
>> to master as of 8c2f3fe.
>
>As discussed on IRC, something here seems to break slot names on
>OpenPOWER platforms - and I eagerly await your patch :)
>

Here's the fix as we talked on IRC:

https://patchwork.ozlabs.org/patch/637828/

Thanks,
Gavin

>-- 
>Stewart Smith
>OPAL Architect, IBM.



More information about the Skiboot mailing list