[Skiboot] [PATCH v4 0/8] Enable fast-reboot support for CAPI-2

Vaibhav Jain vaibhav at linux.ibm.com
Sun Jan 13 16:37:07 AEDT 2019


Presently enabling CAPP for a CAPI-2 adapter disables fast-reset [1]. This
was needed as CAPP uses PHB to interact with the CAPI adapter and we need
to explicitly enable special mode on the PHB to allow CAPP traffic to flow.
Without gracefully shutting down CAPP, PEC/PHB and CAPP will be forced to
go in a fence loop during fast-reboot. This happens as CAPP, when it sees
PHB link down raise CAPP FIR(31:PHB Link Down) and goes into recovery. PEC
on the other hand when it sees CAPP error raises NFIR(24:cxa_pe_capp_error)
and again raises a fence.

To break this fence loop, this patch-set issues a CRESET to the PHB
attached to the CAPP during fast-reset. During this CRESET we execute a h/w
sequence to disable CAPP and reset the PEC/PHB registers. We also leverage
the Opal syncers framework to drive Opal creset state machine during
fast-reboot. At a very high level following flow is executed to disable CAPP:

1. Issue CRESET on the PHB
2. During CRESET disable CAPP
3. Once CRESET completes let fast-reboot continue.

The structure of patch-set is as follows (remains mostly same as previous
patchset):

First 4 patches are re-factoring/modification patches that implement necessary
infrastructure needed for forcing a creset at kernel shutdown. We start with
slight modification of opal-syncers framework followed by a patch that
introduces a new pci_slot_op named 'completed_sm_run()' that makes it easier to
detect when pci reset state machine is completed. We then introduce a new struct
named 'capp' as a member of 'struct phb4'. The fourth patch refactors the
phb4_set_capi_mode() function to use newly introduced 'struct capp'

With above infrastructure in place subsequent 4 patches implements a sequence
needed to perform various h/w routines to disable CAPP when pci creset is
triggered during kernel shutdown.

Credits:
This patchset is based earlier work by "Andrew Donnellan" to implemented
support for CAPI-1 fast-reboot [2].

References:
[1]: 53c4553d('capp: Disable fast-reboot when capp is enabled')
[2]: ddb880fe('fast-reboot: remove CAPI check')

Vaibhav Jain (8):
  opal: Update opal_del_host_sync_notifier() to accept 'void *data'
  core/pci: Introduce a new pci_slot_op named completed_sm_run()
  capp/phb: Introduce 'struct capp' to hold capp related info in 'struct
    phb'
  phb4/capp: Update and re-factor phb4_set_capi_mode()
  capp/phb4: Force CAPP to PCIe mode during kernel shutdown
  capp/phb4: Introduce PHB4 flag, PHB4_CAPP_DISABLE to disable CAPP
  phb4/capp: Implement sequence to disable CAPP and enable fast-reset
  capp/phb4: Prevent HMI from getting triggered when disabling CAPP

 core/opal.c             |   7 +-
 core/pci-slot.c         |   6 +-
 hw/capp.c               |  12 ++
 hw/phb4.c               | 333 +++++++++++++++++++++++++++++++++++-----
 include/capp.h          |  12 ++
 include/chip.h          |   1 -
 include/opal-internal.h |   2 +-
 include/pci-slot.h      |   1 +
 include/phb4.h          |   4 +
 9 files changed, 336 insertions(+), 42 deletions(-)

Change-log:

v4:
* Fixed a possible memory leak in case capp ucode load fails during
  'struct capp' init. [Fred]
* capp_xscom_read()/write() now return OPAL_PARAMETER instead of
  OPAL_UNSUPPORTED in case of an capp == NULL.

v3:
* Addressed various review comments from Christophe and Andrew.
* Move the new struct named 'capp' as member of 'struct phb4' instead of 
  'struct phb'.
* Moved the hunks around that were breaking bisection.
* Introduced new helpers named capp_xscom_read()/write()
* Added review sign-offs from previous patchsets to patch descriptions.

v2:
* Addressed various review comments from Stewart, Fred, Andrew and Vasant.
* Introduced a new struct named 'capp' as member of 'struct phb' to hold CAPP
  related info.
* Re-ordered the patches.
-- 
2.20.1



More information about the Skiboot mailing list