diff mbox series

[069/110] Remove unused OPAL_PCI_EEH_FREEZE_STATUS2

Message ID 20190531061351.22973-70-stewart@linux.ibm.com
State Accepted
Headers show
Series Big documentation cleanup/expansion | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success Successfully applied on branch master (76f7316bc8fc8a18fdbfcbc0e1fe1bb992d2a7d7)
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot fail Test snowpatch/job/snowpatch-skiboot on branch master
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot-dco success Signed-off-by present

Commit Message

Stewart Smith May 31, 2019, 6:13 a.m. UTC
This call was introduced all the way back at the end of 2012, before
OPAL was public. The #define for the OPAL call was introduced to the
Linux kernel in June 2013, and the call was never used in any kernel
tree ever (as far as we can find).

Thus, it's quite safe to remove this completely unused and completely
untested OPAL call.

Fixes: https://github.com/open-power/skiboot/issues/99
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
---
 core/pci-opal.c                               | 31 -------------------
 doc/opal-api/index.rst                        |  5 ++-
 .../opal-pci-eeh-freeze-status-23.rst         | 21 +++++++++++++
 3 files changed, 25 insertions(+), 32 deletions(-)
diff mbox series

Patch

diff --git a/core/pci-opal.c b/core/pci-opal.c
index 08883949e629..b0e61b639f39 100644
--- a/core/pci-opal.c
+++ b/core/pci-opal.c
@@ -929,37 +929,6 @@  static int64_t opal_pci_next_error(uint64_t phb_id, uint64_t *first_frozen_pe,
 }
 opal_call(OPAL_PCI_NEXT_ERROR, opal_pci_next_error, 4);
 
-static int64_t opal_pci_eeh_freeze_status2(uint64_t phb_id, uint64_t pe_number,
-					   uint8_t *freeze_state,
-					   uint16_t *pci_error_type,
-					   uint16_t *severity,
-					   uint64_t *phb_status)
-{
-	struct phb *phb = pci_get_phb(phb_id);
-	int64_t rc;
-
-	if (!opal_addr_valid(freeze_state) || !opal_addr_valid(pci_error_type)
-		|| !opal_addr_valid(severity) || !opal_addr_valid(phb_status))
-		return OPAL_PARAMETER;
-
-	if (!phb)
-		return OPAL_PARAMETER;
-	if (!phb->ops->eeh_freeze_status)
-		return OPAL_UNSUPPORTED;
-	phb_lock(phb);
-
-	if (phb_status)
-		prlog(PR_ERR, "PHB#%04llx: %s: deprecated PHB status\n",
-				phb_id, __func__);
-
-	rc = phb->ops->eeh_freeze_status(phb, pe_number, freeze_state,
-					 pci_error_type, severity);
-	phb_unlock(phb);
-
-	return rc;
-}
-opal_call(OPAL_PCI_EEH_FREEZE_STATUS2, opal_pci_eeh_freeze_status2, 6);
-
 static int64_t opal_pci_set_phb_capi_mode(uint64_t phb_id, uint64_t mode, uint64_t pe_number)
 {
 	struct phb *phb = pci_get_phb(phb_id);
diff --git a/doc/opal-api/index.rst b/doc/opal-api/index.rst
index 0da4b643371c..aa775b5fe712 100644
--- a/doc/opal-api/index.rst
+++ b/doc/opal-api/index.rst
@@ -134,7 +134,8 @@  The OPAL API is the interface between an Operating System and OPAL.
 +---------------------------------------------+--------------+------------------------+----------+-----------------+
 | :ref:`OPAL_PCI_NEXT_ERROR`                  |  60          | v1.0 (Initial Release) | POWER8   |                 |
 +---------------------------------------------+--------------+------------------------+----------+-----------------+
-| :ref:`OPAL_PCI_EEH_FREEZE_STATUS2`          |  61          | v1.0 (Initial Release) | POWER8   |                 |
+| :ref:`OPAL_PCI_EEH_FREEZE_STATUS2`          |  61          | v1.0 (Initial Release) | POWER8   | Removed, never  |
+|                                             |              |                        |          | used!           |
 +---------------------------------------------+--------------+------------------------+----------+-----------------+
 | :ref:`OPAL_PCI_POLL`                        |  62          | v1.0 (Initial Release) | POWER8   |                 |
 +---------------------------------------------+--------------+------------------------+----------+-----------------+
@@ -396,6 +397,8 @@  removed and no longer supported.
 +---------------------------------------------+-------+-----------------------+-----------------------+
 | :ref:`OPAL_PCI_SET_PHB_TCE_MEMORY`          |  12   | pre-v1.0              | :ref:`skiboot-5.2.0`  |
 +---------------------------------------------+-------+-----------------------+-----------------------+
+| :ref:`OPAL_PCI_EEH_FREEZE_STATUS2`          |  61   | v1.0 Initial Release  | :ref:`skiboot-6.4`    |
++---------------------------------------------+-------+-----------------------+-----------------------+
 
 .. _OPAL_GET_COMPLETION_TOKEN_STATUS:
 
diff --git a/doc/opal-api/opal-pci-eeh-freeze-status-23.rst b/doc/opal-api/opal-pci-eeh-freeze-status-23.rst
index 035dc14e35b6..94b7245b47a9 100644
--- a/doc/opal-api/opal-pci-eeh-freeze-status-23.rst
+++ b/doc/opal-api/opal-pci-eeh-freeze-status-23.rst
@@ -36,6 +36,9 @@  OPAL_PCI_EEH_FREEZE_STATUS
 	  and this was safe. Supplying a pointer was previously *unsafe*.
 	  Always pass NULL.
 
+.. note:: There once was a :ref:`OPAL_PCI_EEH_FREEZE_STATUS2` call, but it
+	  was introduced in firmware and never used by any OS, so it has since
+	  been removed from OPAL.
 
 Returns
 -------
@@ -48,3 +51,21 @@  Returns
      Hardware prohibited getting status, OPAL maybe marked it as broken.
 :ref:`OPAL_SUCCESS`
      Retreived status.
+
+.. _OPAL_PCI_EEH_FREEZE_STATUS2:
+
+OPAL_PCI_EEH_FREEZE_STATUS2
+===========================
+
+.. code-block:: c
+
+   #define OPAL_PCI_EEH_FREEZE_STATUS2		61
+
+Use :ref:`OPAL_PCI_EEH_FREEZE_STATUS` instead of this (removed) call.
+
+While you'd think that a call introduced in the first public OPAL release would
+have been used somewhere, it seems that all existing code has only ever used
+:ref:`OPAL_PCI_EEH_FREEZE_STATUS` over :ref:`OPAL_PCI_EEH_FREEZE_STATUS2`.
+
+This call has been removed as of :ref:`skiboot-6.4` as it has literally never
+been used.