Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[SCSI] bfa: Support Power on Hours display and diag temp sensor fixes

- Add Power On Hours display support during sfpshow
- Fix to properly set the diag temperature sensor status variable.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>

authored by

Krishna Gudipati and committed by
James Bottomley
4a49b044 1a1297c6

+42 -5
+29
drivers/scsi/bfa/bfa_defs.h
··· 918 918 u8 ext_status_ctl[2]; 919 919 }; 920 920 921 + /* 922 + * Diagnostic: Data Fields -- Address A2h 923 + * General Use Fields: User Writable Table - Features's Control Registers 924 + * Total 32 bytes 925 + */ 926 + struct sfp_usr_eeprom_s { 927 + u8 rsvd1[2]; /* 128-129 */ 928 + u8 ewrap; /* 130 */ 929 + u8 rsvd2[2]; /* */ 930 + u8 owrap; /* 133 */ 931 + u8 rsvd3[2]; /* */ 932 + u8 prbs; /* 136: PRBS 7 generator */ 933 + u8 rsvd4[2]; /* */ 934 + u8 tx_eqz_16; /* 139: TX Equalizer (16xFC) */ 935 + u8 tx_eqz_8; /* 140: TX Equalizer (8xFC) */ 936 + u8 rsvd5[2]; /* */ 937 + u8 rx_emp_16; /* 143: RX Emphasis (16xFC) */ 938 + u8 rx_emp_8; /* 144: RX Emphasis (8xFC) */ 939 + u8 rsvd6[2]; /* */ 940 + u8 tx_eye_adj; /* 147: TX eye Threshold Adjust */ 941 + u8 rsvd7[3]; /* */ 942 + u8 tx_eye_qctl; /* 151: TX eye Quality Control */ 943 + u8 tx_eye_qres; /* 152: TX eye Quality Result */ 944 + u8 rsvd8[2]; /* */ 945 + u8 poh[3]; /* 155-157: Power On Hours */ 946 + u8 rsvd9[2]; /* */ 947 + }; 948 + 921 949 struct sfp_mem_s { 922 950 struct sfp_srlid_base_s srlid_base; 923 951 struct sfp_srlid_ext_s srlid_ext; 924 952 struct sfp_diag_base_s diag_base; 925 953 struct sfp_diag_ext_s diag_ext; 954 + struct sfp_usr_eeprom_s usr_eeprom; 926 955 }; 927 956 928 957 /*
+4
drivers/scsi/bfa/bfa_defs_svc.h
··· 258 258 u32 hwsm_lrr_rx; /* No. of times LRR rx-ed by HWSM */ 259 259 u32 hwsm_lr_rx; /* No. of times LR rx-ed by HWSM */ 260 260 u32 bbsc_lr; /* LKSM LR tx for credit recovery */ 261 + u32 rsvd; 261 262 }; 262 263 263 264 struct bfa_fw_port_snsm_stats_s { ··· 271 270 u32 sync_lost; /* Sync loss count */ 272 271 u32 sig_lost; /* Signal loss count */ 273 272 u32 asn8g_attempts; /* SNSM HWSM at 8Gbps attempts */ 273 + u32 adapt_success; /* SNSM adaptation success */ 274 + u32 adapt_fails; /* SNSM adaptation failures */ 275 + u32 adapt_ign_fails; /* SNSM adaptation failures ignored */ 274 276 }; 275 277 276 278 struct bfa_fw_port_physm_stats_s {
+9 -5
drivers/scsi/bfa/bfa_ioc.c
··· 4687 4687 diag->tsensor.temp->temp = be16_to_cpu(rsp->temp); 4688 4688 diag->tsensor.temp->ts_junc = rsp->ts_junc; 4689 4689 diag->tsensor.temp->ts_brd = rsp->ts_brd; 4690 - diag->tsensor.temp->status = BFA_STATUS_OK; 4691 4690 4692 4691 if (rsp->ts_brd) { 4692 + /* tsensor.temp->status is brd_temp status */ 4693 + diag->tsensor.temp->status = rsp->status; 4693 4694 if (rsp->status == BFA_STATUS_OK) { 4694 4695 diag->tsensor.temp->brd_temp = 4695 4696 be16_to_cpu(rsp->brd_temp); 4696 - } else { 4697 - bfa_trc(diag, rsp->status); 4697 + } else 4698 4698 diag->tsensor.temp->brd_temp = 0; 4699 - diag->tsensor.temp->status = BFA_STATUS_DEVBUSY; 4700 - } 4701 4699 } 4700 + 4701 + bfa_trc(diag, rsp->status); 4702 4702 bfa_trc(diag, rsp->ts_junc); 4703 4703 bfa_trc(diag, rsp->temp); 4704 4704 bfa_trc(diag, rsp->ts_brd); 4705 4705 bfa_trc(diag, rsp->brd_temp); 4706 + 4707 + /* tsensor status is always good bcos we always have junction temp */ 4708 + diag->tsensor.status = BFA_STATUS_OK; 4706 4709 diag->tsensor.cbfn(diag->tsensor.cbarg, diag->tsensor.status); 4707 4710 diag->tsensor.lock = 0; 4708 4711 } ··· 4934 4931 diag->tsensor.temp = result; 4935 4932 diag->tsensor.cbfn = cbfn; 4936 4933 diag->tsensor.cbarg = cbarg; 4934 + diag->tsensor.status = BFA_STATUS_OK; 4937 4935 4938 4936 /* Send msg to fw */ 4939 4937 diag_tempsensor_send(diag);