[Skiboot] [PATCH v11 21/23] core/opal: Use PCI slot and new APIs for slot states

Stewart Smith stewart at linux.vnet.ibm.com
Wed Jun 8 17:14:57 AEST 2016


Gavin Shan <gwshan at linux.vnet.ibm.com> writes:
> diff --git a/doc/opal-api/opal-pci-get-power-state-120.txt b/doc/opal-api/opal-pci-get-power-state-120.txt
> new file mode 100644
> index 0000000..0ad2b58
> --- /dev/null
> +++ b/doc/opal-api/opal-pci-get-power-state-120.txt
> @@ -0,0 +1,17 @@
> +OPAL_PCI_GET_POWER_STATE
> +---------------------------
> +
> +Get PCI slot power state
> +
> +Parameters:
> +	uint64_t id: PCI slot ID
> +	uint64_t data: memory buffer pointer for power state
> +
> +Calling:
> +
> +Retrieve PCI slot's power state. The retrieved power state is stored
> +in buffer pointed by @data.
> +
> +Return Codes:
> +
> +OPAL_SUCCESS - PCI slot's power state is retrieved successfully

also OPAL_PARAMETR at least if pci slot ID is invalid?

> diff --git a/doc/opal-api/opal-pci-get-presence-state-119.txt b/doc/opal-api/opal-pci-get-presence-state-119.txt
> new file mode 100644
> index 0000000..3cf5159
> --- /dev/null
> +++ b/doc/opal-api/opal-pci-get-presence-state-119.txt
> @@ -0,0 +1,20 @@
> +OPAL_PCI_GET_PRESENCE_STATE
> +---------------------------
> +
> +Get PCI slot presence state
> +
> +Parameters:
> +	uint64_t id: PCI slot ID
> +	uint64_t data: memory buffer pointer for presence state
> +
> +Calling:
> +
> +Retrieve PCI slot's presence state. The detected presence means there are
> +adapters inserted to the PCI slot. Otherwise, the PCI slot is regarded as
> +an empty one. The typical use is to ensure there are adapters existing
> +before probing the PCI slot in PCI hot add path. The retrieved presence
> +state is stored in buffer pointed by @data.
> +
> +Return Codes:
> +
> +OPAL_SUCCESS - PCI slot's presence state is retrieved successfully

also OPAL_PARAMETR at least if pci slot ID is invalid?


> diff --git a/doc/opal-api/opal-pci-set-power-state-121.txt b/doc/opal-api/opal-pci-set-power-state-121.txt
> new file mode 100644
> index 0000000..ef19aff
> --- /dev/null
> +++ b/doc/opal-api/opal-pci-set-power-state-121.txt
> @@ -0,0 +1,26 @@
> +OPAL_PCI_SET_POWER_STATE
> +---------------------------
> +
> +Set PCI slot power state
> +
> +Parameters:
> +	uint64_t id: PCI slot ID
> +	uint64_t data: memory buffer pointer for power state

Why a pointer and not just directly what we want to set it to?

Please also list out what the states are.

> +Calling:
> +
> +Set PCI slot's power state. The power state is stored in buffer pointed
> +by @data. The typical use is to hot add or remove adapters behind the
> +indicated PCI slot (by @id) in PCI hotplug path.
> +
> +User will receive an asychronous message after calling the API. The message
> +contains the API completion status: event (Power off or on), device node's
> +phandle identifying the PCI slot, errcode (e.g. OPAL_SUCCESS). The API returns
> +OPAL_ASYNC_COMPLETION for the case.

then the call should also take a token so that a caller can wait for the
async call to complete and get the result of the operation.

> +Return Codes:
> +
> +OPAL_SUCCESS - PCI hotplug on the slot is completed successfully
> +OPAL_ASYNC_COMPLETION - PCI hotplug needs further message to confirm
> +OPAL_UNSUPPORTED - PCI hotplug isn't supported on the slot
> +OPAL_PARAMETER - Parameter error

... meaning invalid slot ID or invalid power state.


-- 
Stewart Smith
OPAL Architect, IBM.



More information about the Skiboot mailing list