]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
IB/hfi1: Remove state transition log message and opa_lstate_name()
authorMaher Sanalla <msanalla@nvidia.com>
Mon, 3 Feb 2025 12:48:06 +0000 (14:48 +0200)
committerLeon Romanovsky <leon@kernel.org>
Thu, 6 Feb 2025 08:41:01 +0000 (03:41 -0500)
Remove the state transition log message from the hfi1 driver, as
the IB core now logs the same information when handling a cache
update event.

While at it, replace the hfi1-specific opa_lstate_name() function with
the ib_verbs equivalent function, ib_port_state_to_str(), for converting
IB port state to a string.

Signed-off-by: Maher Sanalla <msanalla@nvidia.com>
Link: https://patch.msgid.link/64e48bef00630e33f4b8c830cb7d9a69aedc34dc.1738586601.git.leon@kernel.org
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/hw/hfi1/chip.c
drivers/infiniband/hw/hfi1/chip.h
drivers/infiniband/hw/hfi1/driver.c
drivers/infiniband/hw/hfi1/mad.c

index a442eca498b8dee17361ac1ce25898a66ed58504..368b6be3226f45de07f07c4523e7dcaa9051dbac 100644 (file)
@@ -12882,22 +12882,6 @@ u32 chip_to_opa_pstate(struct hfi1_devdata *dd, u32 chip_pstate)
        }
 }
 
-/* return the OPA port logical state name */
-const char *opa_lstate_name(u32 lstate)
-{
-       static const char * const port_logical_names[] = {
-               "PORT_NOP",
-               "PORT_DOWN",
-               "PORT_INIT",
-               "PORT_ARMED",
-               "PORT_ACTIVE",
-               "PORT_ACTIVE_DEFER",
-       };
-       if (lstate < ARRAY_SIZE(port_logical_names))
-               return port_logical_names[lstate];
-       return "unknown";
-}
-
 /* return the OPA port physical state name */
 const char *opa_pstate_name(u32 pstate)
 {
@@ -12956,8 +12940,6 @@ static void update_statusp(struct hfi1_pportdata *ppd, u32 state)
                        break;
                }
        }
-       dd_dev_info(ppd->dd, "logical state changed to %s (0x%x)\n",
-                   opa_lstate_name(state), state);
 }
 
 /**
index 8841db16bde7e771bd18acba33169e3b8e400cf6..6992f6d4025593d1f903c48bad50a573a47e45bd 100644 (file)
@@ -771,7 +771,6 @@ int is_bx(struct hfi1_devdata *dd);
 bool is_urg_masked(struct hfi1_ctxtdata *rcd);
 u32 read_physical_state(struct hfi1_devdata *dd);
 u32 chip_to_opa_pstate(struct hfi1_devdata *dd, u32 chip_pstate);
-const char *opa_lstate_name(u32 lstate);
 const char *opa_pstate_name(u32 pstate);
 u32 driver_pstate(struct hfi1_pportdata *ppd);
 u32 driver_lstate(struct hfi1_pportdata *ppd);
index 37a6794885d386bd5e8fd8c67ea8c0e05faed99d..50826e7cdb7e761b3042564a378c941e1beb2f4e 100644 (file)
@@ -968,7 +968,7 @@ static bool __set_armed_to_active(struct hfi1_packet *packet)
                if (hwstate != IB_PORT_ACTIVE) {
                        dd_dev_info(packet->rcd->dd,
                                    "Unexpected link state %s\n",
-                                   opa_lstate_name(hwstate));
+                                   ib_port_state_to_str(hwstate));
                        return false;
                }
 
index a9883295f4af17ff20209637951f186ca77228ee..b39f63ce6dfcd160331aedb626246f56a3f4e307 100644 (file)
@@ -1160,8 +1160,8 @@ static int port_states_transition_allowed(struct hfi1_pportdata *ppd,
        if (ret == HFI_TRANSITION_DISALLOWED ||
            ret == HFI_TRANSITION_UNDEFINED) {
                pr_warn("invalid logical state transition %s -> %s\n",
-                       opa_lstate_name(logical_old),
-                       opa_lstate_name(logical_new));
+                       ib_port_state_to_str(logical_old),
+                       ib_port_state_to_str(logical_new));
                return ret;
        }