staging/rdma/hfi1: Report physical state changes per device instead of globally
authorDean Luick <dean.luick@intel.com>
Wed, 3 Feb 2016 22:35:31 +0000 (14:35 -0800)
committerDoug Ledford <dledford@redhat.com>
Fri, 11 Mar 2016 01:37:56 +0000 (20:37 -0500)
Make physical state change reporting be per-device, not global
to reduce excessive reports of "physical state changed"

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Dean Luick <dean.luick@intel.com>
Signed-off-by: Jubin John <jubin.john@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/staging/rdma/hfi1/chip.c
drivers/staging/rdma/hfi1/hfi.h

index a67483e2ee96e40c825667bd5c4df4682704d0d2..5b8fb021e0ae4af1ce220348ae2a801f77328784 100644 (file)
@@ -12201,18 +12201,17 @@ static int wait_logical_linkstate(struct hfi1_pportdata *ppd, u32 state,
 
 u8 hfi1_ibphys_portstate(struct hfi1_pportdata *ppd)
 {
-       static u32 remembered_state = 0xff;
        u32 pstate;
        u32 ib_pstate;
 
        pstate = read_physical_state(ppd->dd);
        ib_pstate = chip_to_opa_pstate(ppd->dd, pstate);
-       if (remembered_state != ib_pstate) {
+       if (ppd->last_pstate != ib_pstate) {
                dd_dev_info(ppd->dd,
                        "%s: physical state changed to %s (0x%x), phy 0x%x\n",
                        __func__, opa_pstate_name(ib_pstate), ib_pstate,
                        pstate);
-               remembered_state = ib_pstate;
+               ppd->last_pstate = ib_pstate;
        }
        return ib_pstate;
 }
@@ -14019,6 +14018,7 @@ struct hfi1_devdata *hfi1_init_dd(struct pci_dev *pdev,
                /* start in offline */
                ppd->host_link_state = HLS_DN_OFFLINE;
                init_vl_arb_caches(ppd);
+               ppd->last_pstate = 0xff; /* invalid value */
        }
 
        dd->link_default = HLS_DN_POLL;
index f3c1e6722dd482f5b82e95dc013a94ad646d6de3..da429915e5dbc0a4c21c882b8d3bbea86a890941 100644 (file)
@@ -663,6 +663,7 @@ struct hfi1_pportdata {
        u8 link_enabled;        /* link enabled? */
        u8 linkinit_reason;
        u8 local_tx_rate;       /* rate given to 8051 firmware */
+       u8 last_pstate;         /* info only */
 
        /* placeholders for IB MAD packet settings */
        u8 overrun_threshold;