[Skiboot] [PATCH 087/110] Remove remnants of OPAL_PCI_GET_PHB_DIAG_DATA

Andrew Donnellan ajd at linux.ibm.com
Fri May 31 16:48:01 AEST 2019


On 31/5/19 4:13 pm, Stewart Smith wrote:
> Never present in a public OPAL release, and only kernels prior to 3.11
> would ever attempt to call it.
> 
> Signed-off-by: Stewart Smith <stewart at linux.ibm.com>

Reviewed-by: Andrew Donnellan <ajd at linux.ibm.com>

> ---
>   core/pci-opal.c                               | 22 ------------------
>   doc/opal-api/index.rst                        | 23 ++++++++++++++++++-
>   .../opal-pci-get-phb-diag-data2-64.rst        | 11 ---------
>   hw/npu.c                                      |  1 -
>   hw/npu2-opencapi.c                            |  1 -
>   hw/npu2.c                                     |  1 -
>   hw/p7ioc-phb.c                                |  1 -
>   hw/phb3.c                                     |  1 -
>   hw/phb4.c                                     |  1 -
>   include/pci.h                                 |  2 --
>   10 files changed, 22 insertions(+), 42 deletions(-)
> 
> diff --git a/core/pci-opal.c b/core/pci-opal.c
> index 043d9483c026..94afc6df9a8b 100644
> --- a/core/pci-opal.c
> +++ b/core/pci-opal.c
> @@ -807,28 +807,6 @@ static int64_t opal_pci_set_power_state(uint64_t async_token,
>   }
>   opal_call(OPAL_PCI_SET_POWER_STATE, opal_pci_set_power_state, 3);
>   
> -static int64_t opal_pci_get_phb_diag_data(uint64_t phb_id,
> -					  void *diag_buffer,
> -					  uint64_t diag_buffer_len)
> -{
> -	struct phb *phb = pci_get_phb(phb_id);
> -	int64_t rc;
> -
> -	if (!opal_addr_valid(diag_buffer))
> -		return OPAL_PARAMETER;
> -
> -	if (!phb)
> -		return OPAL_PARAMETER;
> -	if (!phb->ops->get_diag_data)
> -		return OPAL_UNSUPPORTED;
> -	phb_lock(phb);
> -	rc = phb->ops->get_diag_data(phb, diag_buffer, diag_buffer_len);
> -	phb_unlock(phb);
> -
> -	return rc;
> -}
> -opal_call(OPAL_PCI_GET_PHB_DIAG_DATA, opal_pci_get_phb_diag_data, 3);
> -
>   static int64_t opal_pci_get_phb_diag_data2(uint64_t phb_id,
>   					   void *diag_buffer,
>   					   uint64_t diag_buffer_len)
> diff --git a/doc/opal-api/index.rst b/doc/opal-api/index.rst
> index d0e6483fceb1..00ec72f4f74a 100644
> --- a/doc/opal-api/index.rst
> +++ b/doc/opal-api/index.rst
> @@ -118,7 +118,10 @@ The OPAL API is the interface between an Operating System and OPAL.
>   +---------------------------------------------+--------------+------------------------+----------+-----------------+
>   | :ref:`OPAL_PCI_GET_HUB_DIAG_DATA`           |  50          | v1.0 (Initial Release) | POWER8   |                 |
>   +---------------------------------------------+--------------+------------------------+----------+-----------------+
> -| :ref:`OPAL_PCI_GET_PHB_DIAG_DATA`           |  51          | v1.0 (Initial Release) | POWER8   |                 |
> +| :ref:`OPAL_PCI_GET_PHB_DIAG_DATA`           |  51          | N/A                    |          | Only            |
> +|                                             |              |                        |          | implemented     |
> +|                                             |              |                        |          | prior to public |
> +|                                             |              |                        |          | release.        |
>   +---------------------------------------------+--------------+------------------------+----------+-----------------+
>   | :ref:`OPAL_PCI_FENCE_PHB`                   |  52          | v1.0 (Initial Release) | POWER8   |                 |
>   +---------------------------------------------+--------------+------------------------+----------+-----------------+
> @@ -397,6 +400,10 @@ removed and no longer supported.
>   +---------------------------------------------+-------+-----------------------+-----------------------+
>   | :ref:`OPAL_PCI_GET_XIVE_REISSUE`            |  36   | Never                 |                       |
>   +---------------------------------------------+-------+-----------------------+-----------------------+
> +| :ref:`OPAL_PCI_GET_PHB_DIAG_DATA`           |  51   | pre-v1.0              | pre-v1.0, with last   |
> +|                                             |       |                       | remnants removed in   |
> +|                                             |       |                       | :ref:`skiboot-6.4`    |
> ++---------------------------------------------+-------+-----------------------+-----------------------+
>   | :ref:`OPAL_GET_XIVE_SOURCE`                 |  38   | v1.0 Initial Release  | :ref:`skiboot-6.4`    |
>   +---------------------------------------------+-------+-----------------------+-----------------------+
>   | :ref:`OPAL_WRITE_OPPANEL`                   |  43   | pre-v1.0              | pre-v1.0              |
> @@ -457,6 +464,20 @@ A remnant of something prior to OPALv3. Never implemented in skiboot and never
>   used by anyone. Returend :ref:`OPAL_UNSUPPORTED` until :ref:`skiboot-6.4`, where
>   it was removed.
>   
> +.. _OPAL_PCI_GET_PHB_DIAG_DATA:
> +
> +OPAL_PCI_GET_PHB_DIAG_DATA
> +==========================
> +
> +This call was introduced and functionally removed (all backends for it were)
> +before the first public opal release. It has not been used since Linux 3.11-rc1.
> +Considering the state of EEH in such old kernels and firmware, removing the
> +remnants of this call is considered safe. If for some bizarre reason such an
> +old kernel is run on :ref:`skiboot-6.4` or later, an :ref:`OPAL_PARAMETER` error
> +will be returned instead of :ref:`OPAL_UNSUPPORTED`.
> +
> +It is replaced by :ref:`OPAL_PCI_GET_PHB_DIAG_DATA2` instead.
> +
>   .. _OPAL_GET_XIVE_SOURCE:
>   
>   OPAL_GET_XIVE_SOURCE
> diff --git a/doc/opal-api/opal-pci-get-phb-diag-data2-64.rst b/doc/opal-api/opal-pci-get-phb-diag-data2-64.rst
> index 7a2f98322ea6..ac98bc2a7a45 100644
> --- a/doc/opal-api/opal-pci-get-phb-diag-data2-64.rst
> +++ b/doc/opal-api/opal-pci-get-phb-diag-data2-64.rst
> @@ -1,14 +1,3 @@
> -.. _OPAL_PCI_GET_PHB_DIAG_DATA:
> -
> -OPAL_PCI_GET_PHB_DIAG_DATA
> -==========================
> -
> -.. note:: This call is deprecated. It has not been used since Linux 3.11-rc1.
> -	  Use :ref:`OPAL_PCI_GET_PHB_DIAG_DATA2` instead.
> -
> -.. note:: This call may be removed in the future.
> -
> -
>   .. _OPAL_PCI_GET_PHB_DIAG_DATA2:
>   
>   OPAL_PCI_GET_PHB_DIAG_DATA2
> diff --git a/hw/npu.c b/hw/npu.c
> index 2c3f19e51ad1..2de07470989e 100644
> --- a/hw/npu.c
> +++ b/hw/npu.c
> @@ -1015,7 +1015,6 @@ static const struct phb_ops npu_ops = {
>   	.eeh_freeze_set		= NULL,
>   	.next_error		= npu_eeh_next_error,
>   	.err_inject		= npu_err_inject,
> -	.get_diag_data		= NULL,
>   	.get_diag_data2		= NULL,
>   	.set_capi_mode		= NULL,
>   	.set_capp_recovery	= NULL,
> diff --git a/hw/npu2-opencapi.c b/hw/npu2-opencapi.c
> index 7a90cfac40ff..d6d899675f07 100644
> --- a/hw/npu2-opencapi.c
> +++ b/hw/npu2-opencapi.c
> @@ -1817,7 +1817,6 @@ static const struct phb_ops npu2_opencapi_ops = {
>   	.eeh_freeze_set		= NULL,
>   	.next_error		= npu2_opencapi_eeh_next_error,
>   	.err_inject		= NULL,
> -	.get_diag_data		= NULL,
>   	.get_diag_data2		= NULL,
>   	.set_capi_mode		= NULL,
>   	.set_capp_recovery	= NULL,
> diff --git a/hw/npu2.c b/hw/npu2.c
> index 97139dd8baed..b0116e829ec7 100644
> --- a/hw/npu2.c
> +++ b/hw/npu2.c
> @@ -1385,7 +1385,6 @@ static const struct phb_ops npu_ops = {
>   	.eeh_freeze_set		= NULL,
>   	.next_error		= npu2_eeh_next_error,
>   	.err_inject		= NULL,
> -	.get_diag_data		= NULL,
>   	.get_diag_data2		= NULL,
>   	.set_capi_mode		= NULL,
>   	.set_capp_recovery	= NULL,
> diff --git a/hw/p7ioc-phb.c b/hw/p7ioc-phb.c
> index 97730a0be989..ac011039a73b 100644
> --- a/hw/p7ioc-phb.c
> +++ b/hw/p7ioc-phb.c
> @@ -2304,7 +2304,6 @@ static const struct phb_ops p7ioc_phb_ops = {
>   	.eeh_freeze_clear	= p7ioc_eeh_freeze_clear,
>   	.eeh_freeze_set		= p7ioc_eeh_freeze_set,
>   	.err_inject		= p7ioc_err_inject,
> -	.get_diag_data		= NULL,
>   	.get_diag_data2		= p7ioc_get_diag_data,
>   	.next_error		= p7ioc_eeh_next_error,
>   	.phb_mmio_enable	= p7ioc_phb_mmio_enable,
> diff --git a/hw/phb3.c b/hw/phb3.c
> index ee98fd51dd79..3042c3e69cbf 100644
> --- a/hw/phb3.c
> +++ b/hw/phb3.c
> @@ -3793,7 +3793,6 @@ static const struct phb_ops phb3_ops = {
>   	.eeh_freeze_set		= phb3_eeh_freeze_set,
>   	.next_error		= phb3_eeh_next_error,
>   	.err_inject		= phb3_err_inject,
> -	.get_diag_data		= NULL,
>   	.get_diag_data2		= phb3_get_diag_data,
>   	.set_capi_mode		= phb3_set_capi_mode,
>   	.set_capp_recovery	= phb3_set_capp_recovery,
> diff --git a/hw/phb4.c b/hw/phb4.c
> index 3ae96f2eb941..f29729b957ee 100644
> --- a/hw/phb4.c
> +++ b/hw/phb4.c
> @@ -4797,7 +4797,6 @@ static const struct phb_ops phb4_ops = {
>   	.eeh_freeze_set		= phb4_eeh_freeze_set,
>   	.next_error		= phb4_eeh_next_error,
>   	.err_inject		= phb4_err_inject,
> -	.get_diag_data		= NULL,
>   	.get_diag_data2		= phb4_get_diag_data,
>   	.tce_kill		= phb4_tce_kill,
>   	.set_capi_mode		= phb4_set_capi_mode,
> diff --git a/include/pci.h b/include/pci.h
> index b63b1193a806..2b7a3c2893d5 100644
> --- a/include/pci.h
> +++ b/include/pci.h
> @@ -268,8 +268,6 @@ struct phb_ops {
>   	int64_t (*err_inject)(struct phb *phb, uint64_t pe_number,
>   			      uint32_t type, uint32_t func, uint64_t addr,
>   			      uint64_t mask);
> -	int64_t (*get_diag_data)(struct phb *phb, void *diag_buffer,
> -				 uint64_t diag_buffer_len);
>   	int64_t (*get_diag_data2)(struct phb *phb, void *diag_buffer,
>   				  uint64_t diag_buffer_len);
>   	int64_t (*next_error)(struct phb *phb, uint64_t *first_frozen_pe,
> 

-- 
Andrew Donnellan              OzLabs, ADL Canberra
ajd at linux.ibm.com             IBM Australia Limited



More information about the Skiboot mailing list