All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-next:master 9989/10077] drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
@ 2021-08-25  8:59 kernel test robot
  2021-08-25 11:53   ` kernel test robot
  0 siblings, 1 reply; 4+ messages in thread
From: kernel test robot @ 2021-08-25  8:59 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 25186 bytes --]

CC: kbuild-all(a)lists.01.org
CC: Linux Memory Management List <linux-mm@kvack.org>
TO: James Smart <jsmart2021@gmail.com>
CC: "Martin K. Petersen" <martin.petersen@oracle.com>
CC: Justin Tee <justin.tee@broadcom.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   372b2891c15acbf7b90d948b08ac174bde77102c
commit: 85a964c39cadef8f0798cb49292fac6062e664b4 [9989/10077] scsi: lpfc: Add EDC ELS support
:::::: branch date: 23 hours ago
:::::: commit date: 29 hours ago
config: arm64-randconfig-s031-20210824 (attached as .config)
compiler: aarch64-linux-gcc (GCC) 11.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.3-348-gf0e6938b-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=85a964c39cadef8f0798cb49292fac6062e664b4
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout 85a964c39cadef8f0798cb49292fac6062e664b4
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arm64 SHELL=/bin/bash drivers/scsi/lpfc/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


sparse warnings: (new ones prefixed by >>)
   drivers/scsi/lpfc/lpfc_els.c:4565:38: sparse: sparse: cast to restricted __be32
   drivers/scsi/lpfc/lpfc_els.c:4565:38: sparse: sparse: cast to restricted __be32
   drivers/scsi/lpfc/lpfc_els.c:4565:38: sparse: sparse: cast to restricted __be32
   drivers/scsi/lpfc/lpfc_els.c:4565:38: sparse: sparse: cast to restricted __be32
   drivers/scsi/lpfc/lpfc_els.c:4565:38: sparse: sparse: cast to restricted __be32
   drivers/scsi/lpfc/lpfc_els.c:4565:38: sparse: sparse: cast to restricted __be32
   drivers/scsi/lpfc/lpfc_els.c:11118:33: sparse: sparse: cast to restricted __be32
   drivers/scsi/lpfc/lpfc_els.c:11118:33: sparse: sparse: cast to restricted __be32
   drivers/scsi/lpfc/lpfc_els.c:11118:33: sparse: sparse: cast to restricted __be32
   drivers/scsi/lpfc/lpfc_els.c:11118:33: sparse: sparse: cast to restricted __be32
   drivers/scsi/lpfc/lpfc_els.c:11118:33: sparse: sparse: cast to restricted __be32
   drivers/scsi/lpfc/lpfc_els.c:11118:33: sparse: sparse: cast to restricted __be32
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: too many warnings

vim +3984 drivers/scsi/lpfc/lpfc_els.c

85a964c39cadef James Smart 2021-08-16  3842  
85a964c39cadef James Smart 2021-08-16  3843  DECLARE_ENUM2STR_LOOKUP(lpfc_get_tlv_dtag_nm, fc_ls_tlv_dtag,
85a964c39cadef James Smart 2021-08-16  3844  			FC_LS_TLV_DTAG_INIT);
85a964c39cadef James Smart 2021-08-16  3845  
85a964c39cadef James Smart 2021-08-16  3846  /**
85a964c39cadef James Smart 2021-08-16  3847   * lpfc_cmpl_els_edc - Completion callback function for EDC
85a964c39cadef James Smart 2021-08-16  3848   * @phba: pointer to lpfc hba data structure.
85a964c39cadef James Smart 2021-08-16  3849   * @cmdiocb: pointer to lpfc command iocb data structure.
85a964c39cadef James Smart 2021-08-16  3850   * @rspiocb: pointer to lpfc response iocb data structure.
85a964c39cadef James Smart 2021-08-16  3851   *
85a964c39cadef James Smart 2021-08-16  3852   * This routine is the completion callback function for issuing the Exchange
85a964c39cadef James Smart 2021-08-16  3853   * Diagnostic Capabilities (EDC) command. The driver issues an EDC to
85a964c39cadef James Smart 2021-08-16  3854   * notify the FPort of its Congestion and Link Fault capabilities.  This
85a964c39cadef James Smart 2021-08-16  3855   * routine parses the FPort's response and decides on the least common
85a964c39cadef James Smart 2021-08-16  3856   * values applicable to both FPort and NPort for Warnings and Alarms that
85a964c39cadef James Smart 2021-08-16  3857   * are communicated via hardware signals.
85a964c39cadef James Smart 2021-08-16  3858   **/
85a964c39cadef James Smart 2021-08-16  3859  static void
85a964c39cadef James Smart 2021-08-16  3860  lpfc_cmpl_els_edc(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
85a964c39cadef James Smart 2021-08-16  3861  		  struct lpfc_iocbq *rspiocb)
85a964c39cadef James Smart 2021-08-16  3862  {
85a964c39cadef James Smart 2021-08-16  3863  	IOCB_t *irsp;
85a964c39cadef James Smart 2021-08-16  3864  	struct fc_els_edc_resp *edc_rsp;
85a964c39cadef James Smart 2021-08-16  3865  	struct fc_tlv_desc *tlv;
85a964c39cadef James Smart 2021-08-16  3866  	struct fc_diag_cg_sig_desc *pcgd;
85a964c39cadef James Smart 2021-08-16  3867  	struct fc_diag_lnkflt_desc *plnkflt;
85a964c39cadef James Smart 2021-08-16  3868  	struct lpfc_dmabuf *pcmd, *prsp;
85a964c39cadef James Smart 2021-08-16  3869  	const char *dtag_nm;
85a964c39cadef James Smart 2021-08-16  3870  	u32 *pdata, dtag;
85a964c39cadef James Smart 2021-08-16  3871  	int desc_cnt = 0, bytes_remain;
85a964c39cadef James Smart 2021-08-16  3872  	bool rcv_cap_desc = false;
85a964c39cadef James Smart 2021-08-16  3873  	struct lpfc_nodelist *ndlp;
85a964c39cadef James Smart 2021-08-16  3874  
85a964c39cadef James Smart 2021-08-16  3875  	irsp = &rspiocb->iocb;
85a964c39cadef James Smart 2021-08-16  3876  	ndlp = cmdiocb->context1;
85a964c39cadef James Smart 2021-08-16  3877  
85a964c39cadef James Smart 2021-08-16  3878  	lpfc_debugfs_disc_trc(phba->pport, LPFC_DISC_TRC_ELS_CMD,
85a964c39cadef James Smart 2021-08-16  3879  			      "EDC cmpl:    status:x%x/x%x did:x%x",
85a964c39cadef James Smart 2021-08-16  3880  			      irsp->ulpStatus, irsp->un.ulpWord[4],
85a964c39cadef James Smart 2021-08-16  3881  			      irsp->un.elsreq64.remoteID);
85a964c39cadef James Smart 2021-08-16  3882  
85a964c39cadef James Smart 2021-08-16  3883  	/* ELS cmd tag <ulpIoTag> completes */
85a964c39cadef James Smart 2021-08-16  3884  	lpfc_printf_log(phba, KERN_INFO, LOG_ELS | LOG_CGN_MGMT,
85a964c39cadef James Smart 2021-08-16  3885  			"4201 EDC cmd tag x%x completes Data: x%x x%x x%x\n",
85a964c39cadef James Smart 2021-08-16  3886  			irsp->ulpIoTag, irsp->ulpStatus,
85a964c39cadef James Smart 2021-08-16  3887  			irsp->un.ulpWord[4], irsp->ulpTimeout);
85a964c39cadef James Smart 2021-08-16  3888  
85a964c39cadef James Smart 2021-08-16  3889  	pcmd = (struct lpfc_dmabuf *)cmdiocb->context2;
85a964c39cadef James Smart 2021-08-16  3890  	if (!pcmd)
85a964c39cadef James Smart 2021-08-16  3891  		goto out;
85a964c39cadef James Smart 2021-08-16  3892  
85a964c39cadef James Smart 2021-08-16  3893  	pdata = (u32 *)pcmd->virt;
85a964c39cadef James Smart 2021-08-16  3894  	if (!pdata)
85a964c39cadef James Smart 2021-08-16  3895  		goto out;
85a964c39cadef James Smart 2021-08-16  3896  
85a964c39cadef James Smart 2021-08-16  3897  	/* Need to clear signal values, send features MB and RDF with FPIN. */
85a964c39cadef James Smart 2021-08-16  3898  	if (irsp->ulpStatus)
85a964c39cadef James Smart 2021-08-16  3899  		goto out;
85a964c39cadef James Smart 2021-08-16  3900  
85a964c39cadef James Smart 2021-08-16  3901  	prsp = list_get_first(&pcmd->list, struct lpfc_dmabuf, list);
85a964c39cadef James Smart 2021-08-16  3902  	if (!prsp)
85a964c39cadef James Smart 2021-08-16  3903  		goto out;
85a964c39cadef James Smart 2021-08-16  3904  
85a964c39cadef James Smart 2021-08-16  3905  	edc_rsp = prsp->virt;
85a964c39cadef James Smart 2021-08-16  3906  	if (!edc_rsp)
85a964c39cadef James Smart 2021-08-16  3907  		goto out;
85a964c39cadef James Smart 2021-08-16  3908  
85a964c39cadef James Smart 2021-08-16  3909  	/* ELS cmd tag <ulpIoTag> completes */
85a964c39cadef James Smart 2021-08-16  3910  	lpfc_printf_log(phba, KERN_INFO, LOG_ELS | LOG_CGN_MGMT,
85a964c39cadef James Smart 2021-08-16  3911  			"4676 Fabric EDC Rsp: "
85a964c39cadef James Smart 2021-08-16  3912  			"0x%02x, 0x%08x\n",
85a964c39cadef James Smart 2021-08-16  3913  			edc_rsp->acc_hdr.la_cmd,
85a964c39cadef James Smart 2021-08-16  3914  			be32_to_cpu(edc_rsp->desc_list_len));
85a964c39cadef James Smart 2021-08-16  3915  
85a964c39cadef James Smart 2021-08-16  3916  	/*
85a964c39cadef James Smart 2021-08-16  3917  	 * Payload length in bytes is the response descriptor list
85a964c39cadef James Smart 2021-08-16  3918  	 * length minus the 12 bytes of Link Service Request
85a964c39cadef James Smart 2021-08-16  3919  	 * Information descriptor in the reply.
85a964c39cadef James Smart 2021-08-16  3920  	 */
85a964c39cadef James Smart 2021-08-16  3921  	bytes_remain = be32_to_cpu(edc_rsp->desc_list_len) -
85a964c39cadef James Smart 2021-08-16  3922  				   sizeof(struct fc_els_lsri_desc);
85a964c39cadef James Smart 2021-08-16  3923  	if (bytes_remain <= 0)
85a964c39cadef James Smart 2021-08-16  3924  		goto out;
85a964c39cadef James Smart 2021-08-16  3925  
85a964c39cadef James Smart 2021-08-16  3926  	tlv = edc_rsp->desc;
85a964c39cadef James Smart 2021-08-16  3927  
85a964c39cadef James Smart 2021-08-16  3928  	/*
85a964c39cadef James Smart 2021-08-16  3929  	 * cycle through EDC diagnostic descriptors to find the
85a964c39cadef James Smart 2021-08-16  3930  	 * congestion signaling capability descriptor
85a964c39cadef James Smart 2021-08-16  3931  	 */
85a964c39cadef James Smart 2021-08-16  3932  	while (bytes_remain) {
85a964c39cadef James Smart 2021-08-16  3933  		if (bytes_remain < FC_TLV_DESC_HDR_SZ) {
85a964c39cadef James Smart 2021-08-16  3934  			lpfc_printf_log(phba, KERN_WARNING, LOG_CGN_MGMT,
85a964c39cadef James Smart 2021-08-16  3935  					"6461 Truncated TLV hdr on "
85a964c39cadef James Smart 2021-08-16  3936  					"Diagnostic descriptor[%d]\n",
85a964c39cadef James Smart 2021-08-16  3937  					desc_cnt);
85a964c39cadef James Smart 2021-08-16  3938  			goto out;
85a964c39cadef James Smart 2021-08-16  3939  		}
85a964c39cadef James Smart 2021-08-16  3940  
85a964c39cadef James Smart 2021-08-16  3941  		dtag = be32_to_cpu(tlv->desc_tag);
85a964c39cadef James Smart 2021-08-16  3942  		switch (dtag) {
85a964c39cadef James Smart 2021-08-16  3943  		case ELS_DTAG_LNK_FAULT_CAP:
85a964c39cadef James Smart 2021-08-16  3944  			if (bytes_remain < FC_TLV_DESC_SZ_FROM_LENGTH(tlv) ||
85a964c39cadef James Smart 2021-08-16  3945  			    FC_TLV_DESC_SZ_FROM_LENGTH(tlv) !=
85a964c39cadef James Smart 2021-08-16  3946  					sizeof(struct fc_diag_lnkflt_desc)) {
85a964c39cadef James Smart 2021-08-16  3947  				lpfc_printf_log(
85a964c39cadef James Smart 2021-08-16  3948  					phba, KERN_WARNING, LOG_CGN_MGMT,
85a964c39cadef James Smart 2021-08-16  3949  					"6462 Truncated Link Fault Diagnostic "
85a964c39cadef James Smart 2021-08-16  3950  					"descriptor[%d]: %d vs 0x%zx 0x%zx\n",
85a964c39cadef James Smart 2021-08-16  3951  					desc_cnt, bytes_remain,
85a964c39cadef James Smart 2021-08-16  3952  					FC_TLV_DESC_SZ_FROM_LENGTH(tlv),
85a964c39cadef James Smart 2021-08-16  3953  					sizeof(struct fc_diag_cg_sig_desc));
85a964c39cadef James Smart 2021-08-16  3954  				goto out;
85a964c39cadef James Smart 2021-08-16  3955  			}
85a964c39cadef James Smart 2021-08-16  3956  			plnkflt = (struct fc_diag_lnkflt_desc *)tlv;
85a964c39cadef James Smart 2021-08-16  3957  			lpfc_printf_log(
85a964c39cadef James Smart 2021-08-16  3958  				phba, KERN_INFO, LOG_ELS | LOG_CGN_MGMT,
85a964c39cadef James Smart 2021-08-16  3959  				"4617 Link Fault Desc Data: 0x%08x 0x%08x "
85a964c39cadef James Smart 2021-08-16  3960  				"0x%08x 0x%08x 0x%08x\n",
85a964c39cadef James Smart 2021-08-16  3961  				be32_to_cpu(plnkflt->desc_tag),
85a964c39cadef James Smart 2021-08-16  3962  				be32_to_cpu(plnkflt->desc_len),
85a964c39cadef James Smart 2021-08-16  3963  				be32_to_cpu(
85a964c39cadef James Smart 2021-08-16  3964  					plnkflt->degrade_activate_threshold),
85a964c39cadef James Smart 2021-08-16  3965  				be32_to_cpu(
85a964c39cadef James Smart 2021-08-16  3966  					plnkflt->degrade_deactivate_threshold),
85a964c39cadef James Smart 2021-08-16  3967  				be32_to_cpu(plnkflt->fec_degrade_interval));
85a964c39cadef James Smart 2021-08-16  3968  			break;
85a964c39cadef James Smart 2021-08-16  3969  		case ELS_DTAG_CG_SIGNAL_CAP:
85a964c39cadef James Smart 2021-08-16  3970  			if (bytes_remain < FC_TLV_DESC_SZ_FROM_LENGTH(tlv) ||
85a964c39cadef James Smart 2021-08-16  3971  			    FC_TLV_DESC_SZ_FROM_LENGTH(tlv) !=
85a964c39cadef James Smart 2021-08-16  3972  					sizeof(struct fc_diag_cg_sig_desc)) {
85a964c39cadef James Smart 2021-08-16  3973  				lpfc_printf_log(
85a964c39cadef James Smart 2021-08-16  3974  					phba, KERN_WARNING, LOG_CGN_MGMT,
85a964c39cadef James Smart 2021-08-16  3975  					"6463 Truncated Cgn Signal Diagnostic "
85a964c39cadef James Smart 2021-08-16  3976  					"descriptor[%d]: %d vs 0x%zx 0x%zx\n",
85a964c39cadef James Smart 2021-08-16  3977  					desc_cnt, bytes_remain,
85a964c39cadef James Smart 2021-08-16  3978  					FC_TLV_DESC_SZ_FROM_LENGTH(tlv),
85a964c39cadef James Smart 2021-08-16  3979  					sizeof(struct fc_diag_cg_sig_desc));
85a964c39cadef James Smart 2021-08-16  3980  				goto out;
85a964c39cadef James Smart 2021-08-16  3981  			}
85a964c39cadef James Smart 2021-08-16  3982  
85a964c39cadef James Smart 2021-08-16  3983  			pcgd = (struct fc_diag_cg_sig_desc *)tlv;
85a964c39cadef James Smart 2021-08-16 @3984  			lpfc_printf_log(
85a964c39cadef James Smart 2021-08-16  3985  				phba, KERN_INFO, LOG_ELS | LOG_CGN_MGMT,
85a964c39cadef James Smart 2021-08-16  3986  				"4616 CGN Desc Data: 0x%08x 0x%08x "
85a964c39cadef James Smart 2021-08-16  3987  				"0x%08x 0x%04x 0x%04x 0x%08x 0x%04x 0x%04x\n",
85a964c39cadef James Smart 2021-08-16  3988  				be32_to_cpu(pcgd->desc_tag),
85a964c39cadef James Smart 2021-08-16  3989  				be32_to_cpu(pcgd->desc_len),
85a964c39cadef James Smart 2021-08-16  3990  				be32_to_cpu(pcgd->xmt_signal_capability),
85a964c39cadef James Smart 2021-08-16  3991  				be32_to_cpu(pcgd->xmt_signal_frequency.count),
85a964c39cadef James Smart 2021-08-16  3992  				be32_to_cpu(pcgd->xmt_signal_frequency.units),
85a964c39cadef James Smart 2021-08-16  3993  				be32_to_cpu(pcgd->rcv_signal_capability),
85a964c39cadef James Smart 2021-08-16  3994  				be32_to_cpu(pcgd->rcv_signal_frequency.count),
85a964c39cadef James Smart 2021-08-16  3995  				be32_to_cpu(pcgd->rcv_signal_frequency.units));
85a964c39cadef James Smart 2021-08-16  3996  
85a964c39cadef James Smart 2021-08-16  3997  			/* Compare driver and Fport capabilities and choose
85a964c39cadef James Smart 2021-08-16  3998  			 * least common.
85a964c39cadef James Smart 2021-08-16  3999  			 */
85a964c39cadef James Smart 2021-08-16  4000  			lpfc_least_capable_settings(phba, pcgd);
85a964c39cadef James Smart 2021-08-16  4001  			rcv_cap_desc = true;
85a964c39cadef James Smart 2021-08-16  4002  			break;
85a964c39cadef James Smart 2021-08-16  4003  		default:
85a964c39cadef James Smart 2021-08-16  4004  			dtag_nm = lpfc_get_tlv_dtag_nm(dtag);
85a964c39cadef James Smart 2021-08-16  4005  			lpfc_printf_log(phba, KERN_WARNING, LOG_CGN_MGMT,
85a964c39cadef James Smart 2021-08-16  4006  					"4919 unknown Diagnostic "
85a964c39cadef James Smart 2021-08-16  4007  					"Descriptor[%d]: tag x%x (%s)\n",
85a964c39cadef James Smart 2021-08-16  4008  					desc_cnt, dtag, dtag_nm);
85a964c39cadef James Smart 2021-08-16  4009  		}
85a964c39cadef James Smart 2021-08-16  4010  
85a964c39cadef James Smart 2021-08-16  4011  		bytes_remain -= FC_TLV_DESC_SZ_FROM_LENGTH(tlv);
85a964c39cadef James Smart 2021-08-16  4012  		tlv = fc_tlv_next_desc(tlv);
85a964c39cadef James Smart 2021-08-16  4013  		desc_cnt++;
85a964c39cadef James Smart 2021-08-16  4014  	}
85a964c39cadef James Smart 2021-08-16  4015  
85a964c39cadef James Smart 2021-08-16  4016  out:
85a964c39cadef James Smart 2021-08-16  4017  	if (!rcv_cap_desc) {
85a964c39cadef James Smart 2021-08-16  4018  		phba->cgn_reg_fpin = LPFC_CGN_FPIN_ALARM | LPFC_CGN_FPIN_WARN;
85a964c39cadef James Smart 2021-08-16  4019  		phba->cgn_reg_signal = EDC_CG_SIG_NOTSUPPORTED;
85a964c39cadef James Smart 2021-08-16  4020  		phba->cgn_sig_freq = 0;
85a964c39cadef James Smart 2021-08-16  4021  		lpfc_printf_log(phba, KERN_WARNING, LOG_ELS | LOG_CGN_MGMT,
85a964c39cadef James Smart 2021-08-16  4022  				"4202 EDC rsp error - sending RDF "
85a964c39cadef James Smart 2021-08-16  4023  				"for FPIN only.\n");
85a964c39cadef James Smart 2021-08-16  4024  	}
85a964c39cadef James Smart 2021-08-16  4025  
85a964c39cadef James Smart 2021-08-16  4026  	lpfc_config_cgn_signal(phba);
85a964c39cadef James Smart 2021-08-16  4027  
85a964c39cadef James Smart 2021-08-16  4028  	/* Check to see if link went down during discovery */
85a964c39cadef James Smart 2021-08-16  4029  	lpfc_els_chk_latt(phba->pport);
85a964c39cadef James Smart 2021-08-16  4030  	lpfc_debugfs_disc_trc(phba->pport, LPFC_DISC_TRC_ELS_CMD,
85a964c39cadef James Smart 2021-08-16  4031  			      "EDC Cmpl:     did:x%x refcnt %d",
85a964c39cadef James Smart 2021-08-16  4032  			      ndlp->nlp_DID, kref_read(&ndlp->kref), 0);
85a964c39cadef James Smart 2021-08-16  4033  	lpfc_els_free_iocb(phba, cmdiocb);
85a964c39cadef James Smart 2021-08-16  4034  	lpfc_nlp_put(ndlp);
85a964c39cadef James Smart 2021-08-16  4035  }
85a964c39cadef James Smart 2021-08-16  4036  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 43442 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [linux-next:master 9989/10077] drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
  2021-08-25  8:59 [linux-next:master 9989/10077] drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16 kernel test robot
@ 2021-08-25 11:53   ` kernel test robot
  0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2021-08-25 11:53 UTC (permalink / raw)
  To: James Smart
  Cc: kbuild-all, Linux Memory Management List, Martin K. Petersen, Justin Tee

[-- Attachment #1: Type: text/plain, Size: 25025 bytes --]

tree: 
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   372b2891c15acbf7b90d948b08ac174bde77102c
commit: 85a964c39cadef8f0798cb49292fac6062e664b4 [9989/10077] scsi: 
lpfc: Add EDC ELS support
:::::: branch date: 23 hours ago
:::::: commit date: 29 hours ago
config: arm64-randconfig-s031-20210824 (attached as .config)
compiler: aarch64-linux-gcc (GCC) 11.2.0
reproduce:
         wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross 
-O ~/bin/make.cross
         chmod +x ~/bin/make.cross
         # apt-get install sparse
         # sparse version: v0.6.3-348-gf0e6938b-dirty
         # 
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=85a964c39cadef8f0798cb49292fac6062e664b4
         git remote add linux-next 
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
         git fetch --no-tags linux-next master
         git checkout 85a964c39cadef8f0798cb49292fac6062e664b4
         # save the attached .config to linux build tree
         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross 
C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arm64 
SHELL=/bin/bash drivers/scsi/lpfc/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


sparse warnings: (new ones prefixed by >>)
    drivers/scsi/lpfc/lpfc_els.c:4565:38: sparse: sparse: cast to 
restricted __be32
    drivers/scsi/lpfc/lpfc_els.c:4565:38: sparse: sparse: cast to 
restricted __be32
    drivers/scsi/lpfc/lpfc_els.c:4565:38: sparse: sparse: cast to 
restricted __be32
    drivers/scsi/lpfc/lpfc_els.c:4565:38: sparse: sparse: cast to 
restricted __be32
    drivers/scsi/lpfc/lpfc_els.c:4565:38: sparse: sparse: cast to 
restricted __be32
    drivers/scsi/lpfc/lpfc_els.c:4565:38: sparse: sparse: cast to 
restricted __be32
    drivers/scsi/lpfc/lpfc_els.c:11118:33: sparse: sparse: cast to 
restricted __be32
    drivers/scsi/lpfc/lpfc_els.c:11118:33: sparse: sparse: cast to 
restricted __be32
    drivers/scsi/lpfc/lpfc_els.c:11118:33: sparse: sparse: cast to 
restricted __be32
    drivers/scsi/lpfc/lpfc_els.c:11118:33: sparse: sparse: cast to 
restricted __be32
    drivers/scsi/lpfc/lpfc_els.c:11118:33: sparse: sparse: cast to 
restricted __be32
    drivers/scsi/lpfc/lpfc_els.c:11118:33: sparse: sparse: cast to 
restricted __be32
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: too many warnings

vim +3984 drivers/scsi/lpfc/lpfc_els.c

85a964c39cadef James Smart 2021-08-16  3842
85a964c39cadef James Smart 2021-08-16  3843 
DECLARE_ENUM2STR_LOOKUP(lpfc_get_tlv_dtag_nm, fc_ls_tlv_dtag,
85a964c39cadef James Smart 2021-08-16  3844  			FC_LS_TLV_DTAG_INIT);
85a964c39cadef James Smart 2021-08-16  3845
85a964c39cadef James Smart 2021-08-16  3846  /**
85a964c39cadef James Smart 2021-08-16  3847   * lpfc_cmpl_els_edc - 
Completion callback function for EDC
85a964c39cadef James Smart 2021-08-16  3848   * @phba: pointer to lpfc 
hba data structure.
85a964c39cadef James Smart 2021-08-16  3849   * @cmdiocb: pointer to 
lpfc command iocb data structure.
85a964c39cadef James Smart 2021-08-16  3850   * @rspiocb: pointer to 
lpfc response iocb data structure.
85a964c39cadef James Smart 2021-08-16  3851   *
85a964c39cadef James Smart 2021-08-16  3852   * This routine is the 
completion callback function for issuing the Exchange
85a964c39cadef James Smart 2021-08-16  3853   * Diagnostic Capabilities 
(EDC) command. The driver issues an EDC to
85a964c39cadef James Smart 2021-08-16  3854   * notify the FPort of its 
Congestion and Link Fault capabilities.  This
85a964c39cadef James Smart 2021-08-16  3855   * routine parses the 
FPort's response and decides on the least common
85a964c39cadef James Smart 2021-08-16  3856   * values applicable to 
both FPort and NPort for Warnings and Alarms that
85a964c39cadef James Smart 2021-08-16  3857   * are communicated via 
hardware signals.
85a964c39cadef James Smart 2021-08-16  3858   **/
85a964c39cadef James Smart 2021-08-16  3859  static void
85a964c39cadef James Smart 2021-08-16  3860  lpfc_cmpl_els_edc(struct 
lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
85a964c39cadef James Smart 2021-08-16  3861  		  struct lpfc_iocbq *rspiocb)
85a964c39cadef James Smart 2021-08-16  3862  {
85a964c39cadef James Smart 2021-08-16  3863  	IOCB_t *irsp;
85a964c39cadef James Smart 2021-08-16  3864  	struct fc_els_edc_resp 
*edc_rsp;
85a964c39cadef James Smart 2021-08-16  3865  	struct fc_tlv_desc *tlv;
85a964c39cadef James Smart 2021-08-16  3866  	struct fc_diag_cg_sig_desc 
*pcgd;
85a964c39cadef James Smart 2021-08-16  3867  	struct fc_diag_lnkflt_desc 
*plnkflt;
85a964c39cadef James Smart 2021-08-16  3868  	struct lpfc_dmabuf *pcmd, 
*prsp;
85a964c39cadef James Smart 2021-08-16  3869  	const char *dtag_nm;
85a964c39cadef James Smart 2021-08-16  3870  	u32 *pdata, dtag;
85a964c39cadef James Smart 2021-08-16  3871  	int desc_cnt = 0, 
bytes_remain;
85a964c39cadef James Smart 2021-08-16  3872  	bool rcv_cap_desc = false;
85a964c39cadef James Smart 2021-08-16  3873  	struct lpfc_nodelist *ndlp;
85a964c39cadef James Smart 2021-08-16  3874
85a964c39cadef James Smart 2021-08-16  3875  	irsp = &rspiocb->iocb;
85a964c39cadef James Smart 2021-08-16  3876  	ndlp = cmdiocb->context1;
85a964c39cadef James Smart 2021-08-16  3877
85a964c39cadef James Smart 2021-08-16  3878 
lpfc_debugfs_disc_trc(phba->pport, LPFC_DISC_TRC_ELS_CMD,
85a964c39cadef James Smart 2021-08-16  3879  			      "EDC cmpl: 
status:x%x/x%x did:x%x",
85a964c39cadef James Smart 2021-08-16  3880  			      irsp->ulpStatus, 
irsp->un.ulpWord[4],
85a964c39cadef James Smart 2021-08-16  3881  			 
irsp->un.elsreq64.remoteID);
85a964c39cadef James Smart 2021-08-16  3882
85a964c39cadef James Smart 2021-08-16  3883  	/* ELS cmd tag <ulpIoTag> 
completes */
85a964c39cadef James Smart 2021-08-16  3884  	lpfc_printf_log(phba, 
KERN_INFO, LOG_ELS | LOG_CGN_MGMT,
85a964c39cadef James Smart 2021-08-16  3885  			"4201 EDC cmd tag x%x 
completes Data: x%x x%x x%x\n",
85a964c39cadef James Smart 2021-08-16  3886  			irsp->ulpIoTag, 
irsp->ulpStatus,
85a964c39cadef James Smart 2021-08-16  3887  			irsp->un.ulpWord[4], 
irsp->ulpTimeout);
85a964c39cadef James Smart 2021-08-16  3888
85a964c39cadef James Smart 2021-08-16  3889  	pcmd = (struct lpfc_dmabuf 
*)cmdiocb->context2;
85a964c39cadef James Smart 2021-08-16  3890  	if (!pcmd)
85a964c39cadef James Smart 2021-08-16  3891  		goto out;
85a964c39cadef James Smart 2021-08-16  3892
85a964c39cadef James Smart 2021-08-16  3893  	pdata = (u32 *)pcmd->virt;
85a964c39cadef James Smart 2021-08-16  3894  	if (!pdata)
85a964c39cadef James Smart 2021-08-16  3895  		goto out;
85a964c39cadef James Smart 2021-08-16  3896
85a964c39cadef James Smart 2021-08-16  3897  	/* Need to clear signal 
values, send features MB and RDF with FPIN. */
85a964c39cadef James Smart 2021-08-16  3898  	if (irsp->ulpStatus)
85a964c39cadef James Smart 2021-08-16  3899  		goto out;
85a964c39cadef James Smart 2021-08-16  3900
85a964c39cadef James Smart 2021-08-16  3901  	prsp = 
list_get_first(&pcmd->list, struct lpfc_dmabuf, list);
85a964c39cadef James Smart 2021-08-16  3902  	if (!prsp)
85a964c39cadef James Smart 2021-08-16  3903  		goto out;
85a964c39cadef James Smart 2021-08-16  3904
85a964c39cadef James Smart 2021-08-16  3905  	edc_rsp = prsp->virt;
85a964c39cadef James Smart 2021-08-16  3906  	if (!edc_rsp)
85a964c39cadef James Smart 2021-08-16  3907  		goto out;
85a964c39cadef James Smart 2021-08-16  3908
85a964c39cadef James Smart 2021-08-16  3909  	/* ELS cmd tag <ulpIoTag> 
completes */
85a964c39cadef James Smart 2021-08-16  3910  	lpfc_printf_log(phba, 
KERN_INFO, LOG_ELS | LOG_CGN_MGMT,
85a964c39cadef James Smart 2021-08-16  3911  			"4676 Fabric EDC Rsp: "
85a964c39cadef James Smart 2021-08-16  3912  			"0x%02x, 0x%08x\n",
85a964c39cadef James Smart 2021-08-16  3913  			edc_rsp->acc_hdr.la_cmd,
85a964c39cadef James Smart 2021-08-16  3914  		 
be32_to_cpu(edc_rsp->desc_list_len));
85a964c39cadef James Smart 2021-08-16  3915
85a964c39cadef James Smart 2021-08-16  3916  	/*
85a964c39cadef James Smart 2021-08-16  3917  	 * Payload length in bytes 
is the response descriptor list
85a964c39cadef James Smart 2021-08-16  3918  	 * length minus the 12 
bytes of Link Service Request
85a964c39cadef James Smart 2021-08-16  3919  	 * Information descriptor 
in the reply.
85a964c39cadef James Smart 2021-08-16  3920  	 */
85a964c39cadef James Smart 2021-08-16  3921  	bytes_remain = 
be32_to_cpu(edc_rsp->desc_list_len) -
85a964c39cadef James Smart 2021-08-16  3922  				   sizeof(struct 
fc_els_lsri_desc);
85a964c39cadef James Smart 2021-08-16  3923  	if (bytes_remain <= 0)
85a964c39cadef James Smart 2021-08-16  3924  		goto out;
85a964c39cadef James Smart 2021-08-16  3925
85a964c39cadef James Smart 2021-08-16  3926  	tlv = edc_rsp->desc;
85a964c39cadef James Smart 2021-08-16  3927
85a964c39cadef James Smart 2021-08-16  3928  	/*
85a964c39cadef James Smart 2021-08-16  3929  	 * cycle through EDC 
diagnostic descriptors to find the
85a964c39cadef James Smart 2021-08-16  3930  	 * congestion signaling 
capability descriptor
85a964c39cadef James Smart 2021-08-16  3931  	 */
85a964c39cadef James Smart 2021-08-16  3932  	while (bytes_remain) {
85a964c39cadef James Smart 2021-08-16  3933  		if (bytes_remain < 
FC_TLV_DESC_HDR_SZ) {
85a964c39cadef James Smart 2021-08-16  3934  			lpfc_printf_log(phba, 
KERN_WARNING, LOG_CGN_MGMT,
85a964c39cadef James Smart 2021-08-16  3935  					"6461 Truncated TLV 
hdr on "
85a964c39cadef James Smart 2021-08-16  3936  					"Diagnostic 
descriptor[%d]\n",
85a964c39cadef James Smart 2021-08-16  3937  					desc_cnt);
85a964c39cadef James Smart 2021-08-16  3938  			goto out;
85a964c39cadef James Smart 2021-08-16  3939  		}
85a964c39cadef James Smart 2021-08-16  3940
85a964c39cadef James Smart 2021-08-16  3941  		dtag = 
be32_to_cpu(tlv->desc_tag);
85a964c39cadef James Smart 2021-08-16  3942  		switch (dtag) {
85a964c39cadef James Smart 2021-08-16  3943  		case ELS_DTAG_LNK_FAULT_CAP:
85a964c39cadef James Smart 2021-08-16  3944  			if (bytes_remain < 
FC_TLV_DESC_SZ_FROM_LENGTH(tlv) ||
85a964c39cadef James Smart 2021-08-16  3945  			 
FC_TLV_DESC_SZ_FROM_LENGTH(tlv) !=
85a964c39cadef James Smart 2021-08-16  3946  					sizeof(struct 
fc_diag_lnkflt_desc)) {
85a964c39cadef James Smart 2021-08-16  3947  				lpfc_printf_log(
85a964c39cadef James Smart 2021-08-16  3948  					phba, KERN_WARNING, 
LOG_CGN_MGMT,
85a964c39cadef James Smart 2021-08-16  3949  					"6462 Truncated Link 
Fault Diagnostic "
85a964c39cadef James Smart 2021-08-16  3950  					"descriptor[%d]: %d vs 
0x%zx 0x%zx\n",
85a964c39cadef James Smart 2021-08-16  3951  					desc_cnt, bytes_remain,
85a964c39cadef James Smart 2021-08-16  3952  				 
FC_TLV_DESC_SZ_FROM_LENGTH(tlv),
85a964c39cadef James Smart 2021-08-16  3953  					sizeof(struct 
fc_diag_cg_sig_desc));
85a964c39cadef James Smart 2021-08-16  3954  				goto out;
85a964c39cadef James Smart 2021-08-16  3955  			}
85a964c39cadef James Smart 2021-08-16  3956  			plnkflt = (struct 
fc_diag_lnkflt_desc *)tlv;
85a964c39cadef James Smart 2021-08-16  3957  			lpfc_printf_log(
85a964c39cadef James Smart 2021-08-16  3958  				phba, KERN_INFO, 
LOG_ELS | LOG_CGN_MGMT,
85a964c39cadef James Smart 2021-08-16  3959  				"4617 Link Fault Desc 
Data: 0x%08x 0x%08x "
85a964c39cadef James Smart 2021-08-16  3960  				"0x%08x 0x%08x 0x%08x\n",
85a964c39cadef James Smart 2021-08-16  3961  			 
be32_to_cpu(plnkflt->desc_tag),
85a964c39cadef James Smart 2021-08-16  3962  			 
be32_to_cpu(plnkflt->desc_len),
85a964c39cadef James Smart 2021-08-16  3963  				be32_to_cpu(
85a964c39cadef James Smart 2021-08-16  3964  				 
plnkflt->degrade_activate_threshold),
85a964c39cadef James Smart 2021-08-16  3965  				be32_to_cpu(
85a964c39cadef James Smart 2021-08-16  3966  				 
plnkflt->degrade_deactivate_threshold),
85a964c39cadef James Smart 2021-08-16  3967  			 
be32_to_cpu(plnkflt->fec_degrade_interval));
85a964c39cadef James Smart 2021-08-16  3968  			break;
85a964c39cadef James Smart 2021-08-16  3969  		case ELS_DTAG_CG_SIGNAL_CAP:
85a964c39cadef James Smart 2021-08-16  3970  			if (bytes_remain < 
FC_TLV_DESC_SZ_FROM_LENGTH(tlv) ||
85a964c39cadef James Smart 2021-08-16  3971  			 
FC_TLV_DESC_SZ_FROM_LENGTH(tlv) !=
85a964c39cadef James Smart 2021-08-16  3972  					sizeof(struct 
fc_diag_cg_sig_desc)) {
85a964c39cadef James Smart 2021-08-16  3973  				lpfc_printf_log(
85a964c39cadef James Smart 2021-08-16  3974  					phba, KERN_WARNING, 
LOG_CGN_MGMT,
85a964c39cadef James Smart 2021-08-16  3975  					"6463 Truncated Cgn 
Signal Diagnostic "
85a964c39cadef James Smart 2021-08-16  3976  					"descriptor[%d]: %d vs 
0x%zx 0x%zx\n",
85a964c39cadef James Smart 2021-08-16  3977  					desc_cnt, bytes_remain,
85a964c39cadef James Smart 2021-08-16  3978  				 
FC_TLV_DESC_SZ_FROM_LENGTH(tlv),
85a964c39cadef James Smart 2021-08-16  3979  					sizeof(struct 
fc_diag_cg_sig_desc));
85a964c39cadef James Smart 2021-08-16  3980  				goto out;
85a964c39cadef James Smart 2021-08-16  3981  			}
85a964c39cadef James Smart 2021-08-16  3982
85a964c39cadef James Smart 2021-08-16  3983  			pcgd = (struct 
fc_diag_cg_sig_desc *)tlv;
85a964c39cadef James Smart 2021-08-16 @3984  			lpfc_printf_log(
85a964c39cadef James Smart 2021-08-16  3985  				phba, KERN_INFO, 
LOG_ELS | LOG_CGN_MGMT,
85a964c39cadef James Smart 2021-08-16  3986  				"4616 CGN Desc Data: 
0x%08x 0x%08x "
85a964c39cadef James Smart 2021-08-16  3987  				"0x%08x 0x%04x 0x%04x 
0x%08x 0x%04x 0x%04x\n",
85a964c39cadef James Smart 2021-08-16  3988  			 
be32_to_cpu(pcgd->desc_tag),
85a964c39cadef James Smart 2021-08-16  3989  			 
be32_to_cpu(pcgd->desc_len),
85a964c39cadef James Smart 2021-08-16  3990  			 
be32_to_cpu(pcgd->xmt_signal_capability),
85a964c39cadef James Smart 2021-08-16  3991  			 
be32_to_cpu(pcgd->xmt_signal_frequency.count),
85a964c39cadef James Smart 2021-08-16  3992  			 
be32_to_cpu(pcgd->xmt_signal_frequency.units),
85a964c39cadef James Smart 2021-08-16  3993  			 
be32_to_cpu(pcgd->rcv_signal_capability),
85a964c39cadef James Smart 2021-08-16  3994  			 
be32_to_cpu(pcgd->rcv_signal_frequency.count),
85a964c39cadef James Smart 2021-08-16  3995  			 
be32_to_cpu(pcgd->rcv_signal_frequency.units));
85a964c39cadef James Smart 2021-08-16  3996
85a964c39cadef James Smart 2021-08-16  3997  			/* Compare driver and 
Fport capabilities and choose
85a964c39cadef James Smart 2021-08-16  3998  			 * least common.
85a964c39cadef James Smart 2021-08-16  3999  			 */
85a964c39cadef James Smart 2021-08-16  4000  		 
lpfc_least_capable_settings(phba, pcgd);
85a964c39cadef James Smart 2021-08-16  4001  			rcv_cap_desc = true;
85a964c39cadef James Smart 2021-08-16  4002  			break;
85a964c39cadef James Smart 2021-08-16  4003  		default:
85a964c39cadef James Smart 2021-08-16  4004  			dtag_nm = 
lpfc_get_tlv_dtag_nm(dtag);
85a964c39cadef James Smart 2021-08-16  4005  			lpfc_printf_log(phba, 
KERN_WARNING, LOG_CGN_MGMT,
85a964c39cadef James Smart 2021-08-16  4006  					"4919 unknown Diagnostic "
85a964c39cadef James Smart 2021-08-16  4007  					"Descriptor[%d]: tag 
x%x (%s)\n",
85a964c39cadef James Smart 2021-08-16  4008  					desc_cnt, dtag, dtag_nm);
85a964c39cadef James Smart 2021-08-16  4009  		}
85a964c39cadef James Smart 2021-08-16  4010
85a964c39cadef James Smart 2021-08-16  4011  		bytes_remain -= 
FC_TLV_DESC_SZ_FROM_LENGTH(tlv);
85a964c39cadef James Smart 2021-08-16  4012  		tlv = fc_tlv_next_desc(tlv);
85a964c39cadef James Smart 2021-08-16  4013  		desc_cnt++;
85a964c39cadef James Smart 2021-08-16  4014  	}
85a964c39cadef James Smart 2021-08-16  4015
85a964c39cadef James Smart 2021-08-16  4016  out:
85a964c39cadef James Smart 2021-08-16  4017  	if (!rcv_cap_desc) {
85a964c39cadef James Smart 2021-08-16  4018  		phba->cgn_reg_fpin = 
LPFC_CGN_FPIN_ALARM | LPFC_CGN_FPIN_WARN;
85a964c39cadef James Smart 2021-08-16  4019  		phba->cgn_reg_signal = 
EDC_CG_SIG_NOTSUPPORTED;
85a964c39cadef James Smart 2021-08-16  4020  		phba->cgn_sig_freq = 0;
85a964c39cadef James Smart 2021-08-16  4021  		lpfc_printf_log(phba, 
KERN_WARNING, LOG_ELS | LOG_CGN_MGMT,
85a964c39cadef James Smart 2021-08-16  4022  				"4202 EDC rsp error - 
sending RDF "
85a964c39cadef James Smart 2021-08-16  4023  				"for FPIN only.\n");
85a964c39cadef James Smart 2021-08-16  4024  	}
85a964c39cadef James Smart 2021-08-16  4025
85a964c39cadef James Smart 2021-08-16  4026  	lpfc_config_cgn_signal(phba);
85a964c39cadef James Smart 2021-08-16  4027
85a964c39cadef James Smart 2021-08-16  4028  	/* Check to see if link 
went down during discovery */
85a964c39cadef James Smart 2021-08-16  4029 
lpfc_els_chk_latt(phba->pport);
85a964c39cadef James Smart 2021-08-16  4030 
lpfc_debugfs_disc_trc(phba->pport, LPFC_DISC_TRC_ELS_CMD,
85a964c39cadef James Smart 2021-08-16  4031  			      "EDC Cmpl: 
did:x%x refcnt %d",
85a964c39cadef James Smart 2021-08-16  4032  			      ndlp->nlp_DID, 
kref_read(&ndlp->kref), 0);
85a964c39cadef James Smart 2021-08-16  4033  	lpfc_els_free_iocb(phba, 
cmdiocb);
85a964c39cadef James Smart 2021-08-16  4034  	lpfc_nlp_put(ndlp);
85a964c39cadef James Smart 2021-08-16  4035  }
85a964c39cadef James Smart 2021-08-16  4036

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org


_______________________________________________
kbuild mailing list -- kbuild@lists.01.org
To unsubscribe send an email to kbuild-leave@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 43442 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [linux-next:master 9989/10077] drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
@ 2021-08-25 11:53   ` kernel test robot
  0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2021-08-25 11:53 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 25566 bytes --]

tree: 
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   372b2891c15acbf7b90d948b08ac174bde77102c
commit: 85a964c39cadef8f0798cb49292fac6062e664b4 [9989/10077] scsi: 
lpfc: Add EDC ELS support
:::::: branch date: 23 hours ago
:::::: commit date: 29 hours ago
config: arm64-randconfig-s031-20210824 (attached as .config)
compiler: aarch64-linux-gcc (GCC) 11.2.0
reproduce:
         wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross 
-O ~/bin/make.cross
         chmod +x ~/bin/make.cross
         # apt-get install sparse
         # sparse version: v0.6.3-348-gf0e6938b-dirty
         # 
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=85a964c39cadef8f0798cb49292fac6062e664b4
         git remote add linux-next 
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
         git fetch --no-tags linux-next master
         git checkout 85a964c39cadef8f0798cb49292fac6062e664b4
         # save the attached .config to linux build tree
         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross 
C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arm64 
SHELL=/bin/bash drivers/scsi/lpfc/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


sparse warnings: (new ones prefixed by >>)
    drivers/scsi/lpfc/lpfc_els.c:4565:38: sparse: sparse: cast to 
restricted __be32
    drivers/scsi/lpfc/lpfc_els.c:4565:38: sparse: sparse: cast to 
restricted __be32
    drivers/scsi/lpfc/lpfc_els.c:4565:38: sparse: sparse: cast to 
restricted __be32
    drivers/scsi/lpfc/lpfc_els.c:4565:38: sparse: sparse: cast to 
restricted __be32
    drivers/scsi/lpfc/lpfc_els.c:4565:38: sparse: sparse: cast to 
restricted __be32
    drivers/scsi/lpfc/lpfc_els.c:4565:38: sparse: sparse: cast to 
restricted __be32
    drivers/scsi/lpfc/lpfc_els.c:11118:33: sparse: sparse: cast to 
restricted __be32
    drivers/scsi/lpfc/lpfc_els.c:11118:33: sparse: sparse: cast to 
restricted __be32
    drivers/scsi/lpfc/lpfc_els.c:11118:33: sparse: sparse: cast to 
restricted __be32
    drivers/scsi/lpfc/lpfc_els.c:11118:33: sparse: sparse: cast to 
restricted __be32
    drivers/scsi/lpfc/lpfc_els.c:11118:33: sparse: sparse: cast to 
restricted __be32
    drivers/scsi/lpfc/lpfc_els.c:11118:33: sparse: sparse: cast to 
restricted __be32
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
 >> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from 
restricted __be16
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to 
restricted __be32
    drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: too many warnings

vim +3984 drivers/scsi/lpfc/lpfc_els.c

85a964c39cadef James Smart 2021-08-16  3842
85a964c39cadef James Smart 2021-08-16  3843 
DECLARE_ENUM2STR_LOOKUP(lpfc_get_tlv_dtag_nm, fc_ls_tlv_dtag,
85a964c39cadef James Smart 2021-08-16  3844  			FC_LS_TLV_DTAG_INIT);
85a964c39cadef James Smart 2021-08-16  3845
85a964c39cadef James Smart 2021-08-16  3846  /**
85a964c39cadef James Smart 2021-08-16  3847   * lpfc_cmpl_els_edc - 
Completion callback function for EDC
85a964c39cadef James Smart 2021-08-16  3848   * @phba: pointer to lpfc 
hba data structure.
85a964c39cadef James Smart 2021-08-16  3849   * @cmdiocb: pointer to 
lpfc command iocb data structure.
85a964c39cadef James Smart 2021-08-16  3850   * @rspiocb: pointer to 
lpfc response iocb data structure.
85a964c39cadef James Smart 2021-08-16  3851   *
85a964c39cadef James Smart 2021-08-16  3852   * This routine is the 
completion callback function for issuing the Exchange
85a964c39cadef James Smart 2021-08-16  3853   * Diagnostic Capabilities 
(EDC) command. The driver issues an EDC to
85a964c39cadef James Smart 2021-08-16  3854   * notify the FPort of its 
Congestion and Link Fault capabilities.  This
85a964c39cadef James Smart 2021-08-16  3855   * routine parses the 
FPort's response and decides on the least common
85a964c39cadef James Smart 2021-08-16  3856   * values applicable to 
both FPort and NPort for Warnings and Alarms that
85a964c39cadef James Smart 2021-08-16  3857   * are communicated via 
hardware signals.
85a964c39cadef James Smart 2021-08-16  3858   **/
85a964c39cadef James Smart 2021-08-16  3859  static void
85a964c39cadef James Smart 2021-08-16  3860  lpfc_cmpl_els_edc(struct 
lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
85a964c39cadef James Smart 2021-08-16  3861  		  struct lpfc_iocbq *rspiocb)
85a964c39cadef James Smart 2021-08-16  3862  {
85a964c39cadef James Smart 2021-08-16  3863  	IOCB_t *irsp;
85a964c39cadef James Smart 2021-08-16  3864  	struct fc_els_edc_resp 
*edc_rsp;
85a964c39cadef James Smart 2021-08-16  3865  	struct fc_tlv_desc *tlv;
85a964c39cadef James Smart 2021-08-16  3866  	struct fc_diag_cg_sig_desc 
*pcgd;
85a964c39cadef James Smart 2021-08-16  3867  	struct fc_diag_lnkflt_desc 
*plnkflt;
85a964c39cadef James Smart 2021-08-16  3868  	struct lpfc_dmabuf *pcmd, 
*prsp;
85a964c39cadef James Smart 2021-08-16  3869  	const char *dtag_nm;
85a964c39cadef James Smart 2021-08-16  3870  	u32 *pdata, dtag;
85a964c39cadef James Smart 2021-08-16  3871  	int desc_cnt = 0, 
bytes_remain;
85a964c39cadef James Smart 2021-08-16  3872  	bool rcv_cap_desc = false;
85a964c39cadef James Smart 2021-08-16  3873  	struct lpfc_nodelist *ndlp;
85a964c39cadef James Smart 2021-08-16  3874
85a964c39cadef James Smart 2021-08-16  3875  	irsp = &rspiocb->iocb;
85a964c39cadef James Smart 2021-08-16  3876  	ndlp = cmdiocb->context1;
85a964c39cadef James Smart 2021-08-16  3877
85a964c39cadef James Smart 2021-08-16  3878 
lpfc_debugfs_disc_trc(phba->pport, LPFC_DISC_TRC_ELS_CMD,
85a964c39cadef James Smart 2021-08-16  3879  			      "EDC cmpl: 
status:x%x/x%x did:x%x",
85a964c39cadef James Smart 2021-08-16  3880  			      irsp->ulpStatus, 
irsp->un.ulpWord[4],
85a964c39cadef James Smart 2021-08-16  3881  			 
irsp->un.elsreq64.remoteID);
85a964c39cadef James Smart 2021-08-16  3882
85a964c39cadef James Smart 2021-08-16  3883  	/* ELS cmd tag <ulpIoTag> 
completes */
85a964c39cadef James Smart 2021-08-16  3884  	lpfc_printf_log(phba, 
KERN_INFO, LOG_ELS | LOG_CGN_MGMT,
85a964c39cadef James Smart 2021-08-16  3885  			"4201 EDC cmd tag x%x 
completes Data: x%x x%x x%x\n",
85a964c39cadef James Smart 2021-08-16  3886  			irsp->ulpIoTag, 
irsp->ulpStatus,
85a964c39cadef James Smart 2021-08-16  3887  			irsp->un.ulpWord[4], 
irsp->ulpTimeout);
85a964c39cadef James Smart 2021-08-16  3888
85a964c39cadef James Smart 2021-08-16  3889  	pcmd = (struct lpfc_dmabuf 
*)cmdiocb->context2;
85a964c39cadef James Smart 2021-08-16  3890  	if (!pcmd)
85a964c39cadef James Smart 2021-08-16  3891  		goto out;
85a964c39cadef James Smart 2021-08-16  3892
85a964c39cadef James Smart 2021-08-16  3893  	pdata = (u32 *)pcmd->virt;
85a964c39cadef James Smart 2021-08-16  3894  	if (!pdata)
85a964c39cadef James Smart 2021-08-16  3895  		goto out;
85a964c39cadef James Smart 2021-08-16  3896
85a964c39cadef James Smart 2021-08-16  3897  	/* Need to clear signal 
values, send features MB and RDF with FPIN. */
85a964c39cadef James Smart 2021-08-16  3898  	if (irsp->ulpStatus)
85a964c39cadef James Smart 2021-08-16  3899  		goto out;
85a964c39cadef James Smart 2021-08-16  3900
85a964c39cadef James Smart 2021-08-16  3901  	prsp = 
list_get_first(&pcmd->list, struct lpfc_dmabuf, list);
85a964c39cadef James Smart 2021-08-16  3902  	if (!prsp)
85a964c39cadef James Smart 2021-08-16  3903  		goto out;
85a964c39cadef James Smart 2021-08-16  3904
85a964c39cadef James Smart 2021-08-16  3905  	edc_rsp = prsp->virt;
85a964c39cadef James Smart 2021-08-16  3906  	if (!edc_rsp)
85a964c39cadef James Smart 2021-08-16  3907  		goto out;
85a964c39cadef James Smart 2021-08-16  3908
85a964c39cadef James Smart 2021-08-16  3909  	/* ELS cmd tag <ulpIoTag> 
completes */
85a964c39cadef James Smart 2021-08-16  3910  	lpfc_printf_log(phba, 
KERN_INFO, LOG_ELS | LOG_CGN_MGMT,
85a964c39cadef James Smart 2021-08-16  3911  			"4676 Fabric EDC Rsp: "
85a964c39cadef James Smart 2021-08-16  3912  			"0x%02x, 0x%08x\n",
85a964c39cadef James Smart 2021-08-16  3913  			edc_rsp->acc_hdr.la_cmd,
85a964c39cadef James Smart 2021-08-16  3914  		 
be32_to_cpu(edc_rsp->desc_list_len));
85a964c39cadef James Smart 2021-08-16  3915
85a964c39cadef James Smart 2021-08-16  3916  	/*
85a964c39cadef James Smart 2021-08-16  3917  	 * Payload length in bytes 
is the response descriptor list
85a964c39cadef James Smart 2021-08-16  3918  	 * length minus the 12 
bytes of Link Service Request
85a964c39cadef James Smart 2021-08-16  3919  	 * Information descriptor 
in the reply.
85a964c39cadef James Smart 2021-08-16  3920  	 */
85a964c39cadef James Smart 2021-08-16  3921  	bytes_remain = 
be32_to_cpu(edc_rsp->desc_list_len) -
85a964c39cadef James Smart 2021-08-16  3922  				   sizeof(struct 
fc_els_lsri_desc);
85a964c39cadef James Smart 2021-08-16  3923  	if (bytes_remain <= 0)
85a964c39cadef James Smart 2021-08-16  3924  		goto out;
85a964c39cadef James Smart 2021-08-16  3925
85a964c39cadef James Smart 2021-08-16  3926  	tlv = edc_rsp->desc;
85a964c39cadef James Smart 2021-08-16  3927
85a964c39cadef James Smart 2021-08-16  3928  	/*
85a964c39cadef James Smart 2021-08-16  3929  	 * cycle through EDC 
diagnostic descriptors to find the
85a964c39cadef James Smart 2021-08-16  3930  	 * congestion signaling 
capability descriptor
85a964c39cadef James Smart 2021-08-16  3931  	 */
85a964c39cadef James Smart 2021-08-16  3932  	while (bytes_remain) {
85a964c39cadef James Smart 2021-08-16  3933  		if (bytes_remain < 
FC_TLV_DESC_HDR_SZ) {
85a964c39cadef James Smart 2021-08-16  3934  			lpfc_printf_log(phba, 
KERN_WARNING, LOG_CGN_MGMT,
85a964c39cadef James Smart 2021-08-16  3935  					"6461 Truncated TLV 
hdr on "
85a964c39cadef James Smart 2021-08-16  3936  					"Diagnostic 
descriptor[%d]\n",
85a964c39cadef James Smart 2021-08-16  3937  					desc_cnt);
85a964c39cadef James Smart 2021-08-16  3938  			goto out;
85a964c39cadef James Smart 2021-08-16  3939  		}
85a964c39cadef James Smart 2021-08-16  3940
85a964c39cadef James Smart 2021-08-16  3941  		dtag = 
be32_to_cpu(tlv->desc_tag);
85a964c39cadef James Smart 2021-08-16  3942  		switch (dtag) {
85a964c39cadef James Smart 2021-08-16  3943  		case ELS_DTAG_LNK_FAULT_CAP:
85a964c39cadef James Smart 2021-08-16  3944  			if (bytes_remain < 
FC_TLV_DESC_SZ_FROM_LENGTH(tlv) ||
85a964c39cadef James Smart 2021-08-16  3945  			 
FC_TLV_DESC_SZ_FROM_LENGTH(tlv) !=
85a964c39cadef James Smart 2021-08-16  3946  					sizeof(struct 
fc_diag_lnkflt_desc)) {
85a964c39cadef James Smart 2021-08-16  3947  				lpfc_printf_log(
85a964c39cadef James Smart 2021-08-16  3948  					phba, KERN_WARNING, 
LOG_CGN_MGMT,
85a964c39cadef James Smart 2021-08-16  3949  					"6462 Truncated Link 
Fault Diagnostic "
85a964c39cadef James Smart 2021-08-16  3950  					"descriptor[%d]: %d vs 
0x%zx 0x%zx\n",
85a964c39cadef James Smart 2021-08-16  3951  					desc_cnt, bytes_remain,
85a964c39cadef James Smart 2021-08-16  3952  				 
FC_TLV_DESC_SZ_FROM_LENGTH(tlv),
85a964c39cadef James Smart 2021-08-16  3953  					sizeof(struct 
fc_diag_cg_sig_desc));
85a964c39cadef James Smart 2021-08-16  3954  				goto out;
85a964c39cadef James Smart 2021-08-16  3955  			}
85a964c39cadef James Smart 2021-08-16  3956  			plnkflt = (struct 
fc_diag_lnkflt_desc *)tlv;
85a964c39cadef James Smart 2021-08-16  3957  			lpfc_printf_log(
85a964c39cadef James Smart 2021-08-16  3958  				phba, KERN_INFO, 
LOG_ELS | LOG_CGN_MGMT,
85a964c39cadef James Smart 2021-08-16  3959  				"4617 Link Fault Desc 
Data: 0x%08x 0x%08x "
85a964c39cadef James Smart 2021-08-16  3960  				"0x%08x 0x%08x 0x%08x\n",
85a964c39cadef James Smart 2021-08-16  3961  			 
be32_to_cpu(plnkflt->desc_tag),
85a964c39cadef James Smart 2021-08-16  3962  			 
be32_to_cpu(plnkflt->desc_len),
85a964c39cadef James Smart 2021-08-16  3963  				be32_to_cpu(
85a964c39cadef James Smart 2021-08-16  3964  				 
plnkflt->degrade_activate_threshold),
85a964c39cadef James Smart 2021-08-16  3965  				be32_to_cpu(
85a964c39cadef James Smart 2021-08-16  3966  				 
plnkflt->degrade_deactivate_threshold),
85a964c39cadef James Smart 2021-08-16  3967  			 
be32_to_cpu(plnkflt->fec_degrade_interval));
85a964c39cadef James Smart 2021-08-16  3968  			break;
85a964c39cadef James Smart 2021-08-16  3969  		case ELS_DTAG_CG_SIGNAL_CAP:
85a964c39cadef James Smart 2021-08-16  3970  			if (bytes_remain < 
FC_TLV_DESC_SZ_FROM_LENGTH(tlv) ||
85a964c39cadef James Smart 2021-08-16  3971  			 
FC_TLV_DESC_SZ_FROM_LENGTH(tlv) !=
85a964c39cadef James Smart 2021-08-16  3972  					sizeof(struct 
fc_diag_cg_sig_desc)) {
85a964c39cadef James Smart 2021-08-16  3973  				lpfc_printf_log(
85a964c39cadef James Smart 2021-08-16  3974  					phba, KERN_WARNING, 
LOG_CGN_MGMT,
85a964c39cadef James Smart 2021-08-16  3975  					"6463 Truncated Cgn 
Signal Diagnostic "
85a964c39cadef James Smart 2021-08-16  3976  					"descriptor[%d]: %d vs 
0x%zx 0x%zx\n",
85a964c39cadef James Smart 2021-08-16  3977  					desc_cnt, bytes_remain,
85a964c39cadef James Smart 2021-08-16  3978  				 
FC_TLV_DESC_SZ_FROM_LENGTH(tlv),
85a964c39cadef James Smart 2021-08-16  3979  					sizeof(struct 
fc_diag_cg_sig_desc));
85a964c39cadef James Smart 2021-08-16  3980  				goto out;
85a964c39cadef James Smart 2021-08-16  3981  			}
85a964c39cadef James Smart 2021-08-16  3982
85a964c39cadef James Smart 2021-08-16  3983  			pcgd = (struct 
fc_diag_cg_sig_desc *)tlv;
85a964c39cadef James Smart 2021-08-16 @3984  			lpfc_printf_log(
85a964c39cadef James Smart 2021-08-16  3985  				phba, KERN_INFO, 
LOG_ELS | LOG_CGN_MGMT,
85a964c39cadef James Smart 2021-08-16  3986  				"4616 CGN Desc Data: 
0x%08x 0x%08x "
85a964c39cadef James Smart 2021-08-16  3987  				"0x%08x 0x%04x 0x%04x 
0x%08x 0x%04x 0x%04x\n",
85a964c39cadef James Smart 2021-08-16  3988  			 
be32_to_cpu(pcgd->desc_tag),
85a964c39cadef James Smart 2021-08-16  3989  			 
be32_to_cpu(pcgd->desc_len),
85a964c39cadef James Smart 2021-08-16  3990  			 
be32_to_cpu(pcgd->xmt_signal_capability),
85a964c39cadef James Smart 2021-08-16  3991  			 
be32_to_cpu(pcgd->xmt_signal_frequency.count),
85a964c39cadef James Smart 2021-08-16  3992  			 
be32_to_cpu(pcgd->xmt_signal_frequency.units),
85a964c39cadef James Smart 2021-08-16  3993  			 
be32_to_cpu(pcgd->rcv_signal_capability),
85a964c39cadef James Smart 2021-08-16  3994  			 
be32_to_cpu(pcgd->rcv_signal_frequency.count),
85a964c39cadef James Smart 2021-08-16  3995  			 
be32_to_cpu(pcgd->rcv_signal_frequency.units));
85a964c39cadef James Smart 2021-08-16  3996
85a964c39cadef James Smart 2021-08-16  3997  			/* Compare driver and 
Fport capabilities and choose
85a964c39cadef James Smart 2021-08-16  3998  			 * least common.
85a964c39cadef James Smart 2021-08-16  3999  			 */
85a964c39cadef James Smart 2021-08-16  4000  		 
lpfc_least_capable_settings(phba, pcgd);
85a964c39cadef James Smart 2021-08-16  4001  			rcv_cap_desc = true;
85a964c39cadef James Smart 2021-08-16  4002  			break;
85a964c39cadef James Smart 2021-08-16  4003  		default:
85a964c39cadef James Smart 2021-08-16  4004  			dtag_nm = 
lpfc_get_tlv_dtag_nm(dtag);
85a964c39cadef James Smart 2021-08-16  4005  			lpfc_printf_log(phba, 
KERN_WARNING, LOG_CGN_MGMT,
85a964c39cadef James Smart 2021-08-16  4006  					"4919 unknown Diagnostic "
85a964c39cadef James Smart 2021-08-16  4007  					"Descriptor[%d]: tag 
x%x (%s)\n",
85a964c39cadef James Smart 2021-08-16  4008  					desc_cnt, dtag, dtag_nm);
85a964c39cadef James Smart 2021-08-16  4009  		}
85a964c39cadef James Smart 2021-08-16  4010
85a964c39cadef James Smart 2021-08-16  4011  		bytes_remain -= 
FC_TLV_DESC_SZ_FROM_LENGTH(tlv);
85a964c39cadef James Smart 2021-08-16  4012  		tlv = fc_tlv_next_desc(tlv);
85a964c39cadef James Smart 2021-08-16  4013  		desc_cnt++;
85a964c39cadef James Smart 2021-08-16  4014  	}
85a964c39cadef James Smart 2021-08-16  4015
85a964c39cadef James Smart 2021-08-16  4016  out:
85a964c39cadef James Smart 2021-08-16  4017  	if (!rcv_cap_desc) {
85a964c39cadef James Smart 2021-08-16  4018  		phba->cgn_reg_fpin = 
LPFC_CGN_FPIN_ALARM | LPFC_CGN_FPIN_WARN;
85a964c39cadef James Smart 2021-08-16  4019  		phba->cgn_reg_signal = 
EDC_CG_SIG_NOTSUPPORTED;
85a964c39cadef James Smart 2021-08-16  4020  		phba->cgn_sig_freq = 0;
85a964c39cadef James Smart 2021-08-16  4021  		lpfc_printf_log(phba, 
KERN_WARNING, LOG_ELS | LOG_CGN_MGMT,
85a964c39cadef James Smart 2021-08-16  4022  				"4202 EDC rsp error - 
sending RDF "
85a964c39cadef James Smart 2021-08-16  4023  				"for FPIN only.\n");
85a964c39cadef James Smart 2021-08-16  4024  	}
85a964c39cadef James Smart 2021-08-16  4025
85a964c39cadef James Smart 2021-08-16  4026  	lpfc_config_cgn_signal(phba);
85a964c39cadef James Smart 2021-08-16  4027
85a964c39cadef James Smart 2021-08-16  4028  	/* Check to see if link 
went down during discovery */
85a964c39cadef James Smart 2021-08-16  4029 
lpfc_els_chk_latt(phba->pport);
85a964c39cadef James Smart 2021-08-16  4030 
lpfc_debugfs_disc_trc(phba->pport, LPFC_DISC_TRC_ELS_CMD,
85a964c39cadef James Smart 2021-08-16  4031  			      "EDC Cmpl: 
did:x%x refcnt %d",
85a964c39cadef James Smart 2021-08-16  4032  			      ndlp->nlp_DID, 
kref_read(&ndlp->kref), 0);
85a964c39cadef James Smart 2021-08-16  4033  	lpfc_els_free_iocb(phba, 
cmdiocb);
85a964c39cadef James Smart 2021-08-16  4034  	lpfc_nlp_put(ndlp);
85a964c39cadef James Smart 2021-08-16  4035  }
85a964c39cadef James Smart 2021-08-16  4036

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org


_______________________________________________
kbuild mailing list -- kbuild(a)lists.01.org
To unsubscribe send an email to kbuild-leave(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 43442 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [linux-next:master 9989/10077] drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
@ 2021-08-25 10:50 kernel test robot
  0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2021-08-25 10:50 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 25186 bytes --]

CC: kbuild-all(a)lists.01.org
CC: Linux Memory Management List <linux-mm@kvack.org>
TO: James Smart <jsmart2021@gmail.com>
CC: "Martin K. Petersen" <martin.petersen@oracle.com>
CC: Justin Tee <justin.tee@broadcom.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   372b2891c15acbf7b90d948b08ac174bde77102c
commit: 85a964c39cadef8f0798cb49292fac6062e664b4 [9989/10077] scsi: lpfc: Add EDC ELS support
:::::: branch date: 25 hours ago
:::::: commit date: 31 hours ago
config: arm64-randconfig-s031-20210824 (attached as .config)
compiler: aarch64-linux-gcc (GCC) 11.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.3-348-gf0e6938b-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=85a964c39cadef8f0798cb49292fac6062e664b4
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout 85a964c39cadef8f0798cb49292fac6062e664b4
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arm64 SHELL=/bin/bash drivers/scsi/lpfc/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


sparse warnings: (new ones prefixed by >>)
   drivers/scsi/lpfc/lpfc_els.c:4565:38: sparse: sparse: cast to restricted __be32
   drivers/scsi/lpfc/lpfc_els.c:4565:38: sparse: sparse: cast to restricted __be32
   drivers/scsi/lpfc/lpfc_els.c:4565:38: sparse: sparse: cast to restricted __be32
   drivers/scsi/lpfc/lpfc_els.c:4565:38: sparse: sparse: cast to restricted __be32
   drivers/scsi/lpfc/lpfc_els.c:4565:38: sparse: sparse: cast to restricted __be32
   drivers/scsi/lpfc/lpfc_els.c:4565:38: sparse: sparse: cast to restricted __be32
   drivers/scsi/lpfc/lpfc_els.c:11118:33: sparse: sparse: cast to restricted __be32
   drivers/scsi/lpfc/lpfc_els.c:11118:33: sparse: sparse: cast to restricted __be32
   drivers/scsi/lpfc/lpfc_els.c:11118:33: sparse: sparse: cast to restricted __be32
   drivers/scsi/lpfc/lpfc_els.c:11118:33: sparse: sparse: cast to restricted __be32
   drivers/scsi/lpfc/lpfc_els.c:11118:33: sparse: sparse: cast to restricted __be32
   drivers/scsi/lpfc/lpfc_els.c:11118:33: sparse: sparse: cast to restricted __be32
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast to restricted __be32
   drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: too many warnings

vim +3984 drivers/scsi/lpfc/lpfc_els.c

85a964c39cadef James Smart 2021-08-16  3842  
85a964c39cadef James Smart 2021-08-16  3843  DECLARE_ENUM2STR_LOOKUP(lpfc_get_tlv_dtag_nm, fc_ls_tlv_dtag,
85a964c39cadef James Smart 2021-08-16  3844  			FC_LS_TLV_DTAG_INIT);
85a964c39cadef James Smart 2021-08-16  3845  
85a964c39cadef James Smart 2021-08-16  3846  /**
85a964c39cadef James Smart 2021-08-16  3847   * lpfc_cmpl_els_edc - Completion callback function for EDC
85a964c39cadef James Smart 2021-08-16  3848   * @phba: pointer to lpfc hba data structure.
85a964c39cadef James Smart 2021-08-16  3849   * @cmdiocb: pointer to lpfc command iocb data structure.
85a964c39cadef James Smart 2021-08-16  3850   * @rspiocb: pointer to lpfc response iocb data structure.
85a964c39cadef James Smart 2021-08-16  3851   *
85a964c39cadef James Smart 2021-08-16  3852   * This routine is the completion callback function for issuing the Exchange
85a964c39cadef James Smart 2021-08-16  3853   * Diagnostic Capabilities (EDC) command. The driver issues an EDC to
85a964c39cadef James Smart 2021-08-16  3854   * notify the FPort of its Congestion and Link Fault capabilities.  This
85a964c39cadef James Smart 2021-08-16  3855   * routine parses the FPort's response and decides on the least common
85a964c39cadef James Smart 2021-08-16  3856   * values applicable to both FPort and NPort for Warnings and Alarms that
85a964c39cadef James Smart 2021-08-16  3857   * are communicated via hardware signals.
85a964c39cadef James Smart 2021-08-16  3858   **/
85a964c39cadef James Smart 2021-08-16  3859  static void
85a964c39cadef James Smart 2021-08-16  3860  lpfc_cmpl_els_edc(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
85a964c39cadef James Smart 2021-08-16  3861  		  struct lpfc_iocbq *rspiocb)
85a964c39cadef James Smart 2021-08-16  3862  {
85a964c39cadef James Smart 2021-08-16  3863  	IOCB_t *irsp;
85a964c39cadef James Smart 2021-08-16  3864  	struct fc_els_edc_resp *edc_rsp;
85a964c39cadef James Smart 2021-08-16  3865  	struct fc_tlv_desc *tlv;
85a964c39cadef James Smart 2021-08-16  3866  	struct fc_diag_cg_sig_desc *pcgd;
85a964c39cadef James Smart 2021-08-16  3867  	struct fc_diag_lnkflt_desc *plnkflt;
85a964c39cadef James Smart 2021-08-16  3868  	struct lpfc_dmabuf *pcmd, *prsp;
85a964c39cadef James Smart 2021-08-16  3869  	const char *dtag_nm;
85a964c39cadef James Smart 2021-08-16  3870  	u32 *pdata, dtag;
85a964c39cadef James Smart 2021-08-16  3871  	int desc_cnt = 0, bytes_remain;
85a964c39cadef James Smart 2021-08-16  3872  	bool rcv_cap_desc = false;
85a964c39cadef James Smart 2021-08-16  3873  	struct lpfc_nodelist *ndlp;
85a964c39cadef James Smart 2021-08-16  3874  
85a964c39cadef James Smart 2021-08-16  3875  	irsp = &rspiocb->iocb;
85a964c39cadef James Smart 2021-08-16  3876  	ndlp = cmdiocb->context1;
85a964c39cadef James Smart 2021-08-16  3877  
85a964c39cadef James Smart 2021-08-16  3878  	lpfc_debugfs_disc_trc(phba->pport, LPFC_DISC_TRC_ELS_CMD,
85a964c39cadef James Smart 2021-08-16  3879  			      "EDC cmpl:    status:x%x/x%x did:x%x",
85a964c39cadef James Smart 2021-08-16  3880  			      irsp->ulpStatus, irsp->un.ulpWord[4],
85a964c39cadef James Smart 2021-08-16  3881  			      irsp->un.elsreq64.remoteID);
85a964c39cadef James Smart 2021-08-16  3882  
85a964c39cadef James Smart 2021-08-16  3883  	/* ELS cmd tag <ulpIoTag> completes */
85a964c39cadef James Smart 2021-08-16  3884  	lpfc_printf_log(phba, KERN_INFO, LOG_ELS | LOG_CGN_MGMT,
85a964c39cadef James Smart 2021-08-16  3885  			"4201 EDC cmd tag x%x completes Data: x%x x%x x%x\n",
85a964c39cadef James Smart 2021-08-16  3886  			irsp->ulpIoTag, irsp->ulpStatus,
85a964c39cadef James Smart 2021-08-16  3887  			irsp->un.ulpWord[4], irsp->ulpTimeout);
85a964c39cadef James Smart 2021-08-16  3888  
85a964c39cadef James Smart 2021-08-16  3889  	pcmd = (struct lpfc_dmabuf *)cmdiocb->context2;
85a964c39cadef James Smart 2021-08-16  3890  	if (!pcmd)
85a964c39cadef James Smart 2021-08-16  3891  		goto out;
85a964c39cadef James Smart 2021-08-16  3892  
85a964c39cadef James Smart 2021-08-16  3893  	pdata = (u32 *)pcmd->virt;
85a964c39cadef James Smart 2021-08-16  3894  	if (!pdata)
85a964c39cadef James Smart 2021-08-16  3895  		goto out;
85a964c39cadef James Smart 2021-08-16  3896  
85a964c39cadef James Smart 2021-08-16  3897  	/* Need to clear signal values, send features MB and RDF with FPIN. */
85a964c39cadef James Smart 2021-08-16  3898  	if (irsp->ulpStatus)
85a964c39cadef James Smart 2021-08-16  3899  		goto out;
85a964c39cadef James Smart 2021-08-16  3900  
85a964c39cadef James Smart 2021-08-16  3901  	prsp = list_get_first(&pcmd->list, struct lpfc_dmabuf, list);
85a964c39cadef James Smart 2021-08-16  3902  	if (!prsp)
85a964c39cadef James Smart 2021-08-16  3903  		goto out;
85a964c39cadef James Smart 2021-08-16  3904  
85a964c39cadef James Smart 2021-08-16  3905  	edc_rsp = prsp->virt;
85a964c39cadef James Smart 2021-08-16  3906  	if (!edc_rsp)
85a964c39cadef James Smart 2021-08-16  3907  		goto out;
85a964c39cadef James Smart 2021-08-16  3908  
85a964c39cadef James Smart 2021-08-16  3909  	/* ELS cmd tag <ulpIoTag> completes */
85a964c39cadef James Smart 2021-08-16  3910  	lpfc_printf_log(phba, KERN_INFO, LOG_ELS | LOG_CGN_MGMT,
85a964c39cadef James Smart 2021-08-16  3911  			"4676 Fabric EDC Rsp: "
85a964c39cadef James Smart 2021-08-16  3912  			"0x%02x, 0x%08x\n",
85a964c39cadef James Smart 2021-08-16  3913  			edc_rsp->acc_hdr.la_cmd,
85a964c39cadef James Smart 2021-08-16  3914  			be32_to_cpu(edc_rsp->desc_list_len));
85a964c39cadef James Smart 2021-08-16  3915  
85a964c39cadef James Smart 2021-08-16  3916  	/*
85a964c39cadef James Smart 2021-08-16  3917  	 * Payload length in bytes is the response descriptor list
85a964c39cadef James Smart 2021-08-16  3918  	 * length minus the 12 bytes of Link Service Request
85a964c39cadef James Smart 2021-08-16  3919  	 * Information descriptor in the reply.
85a964c39cadef James Smart 2021-08-16  3920  	 */
85a964c39cadef James Smart 2021-08-16  3921  	bytes_remain = be32_to_cpu(edc_rsp->desc_list_len) -
85a964c39cadef James Smart 2021-08-16  3922  				   sizeof(struct fc_els_lsri_desc);
85a964c39cadef James Smart 2021-08-16  3923  	if (bytes_remain <= 0)
85a964c39cadef James Smart 2021-08-16  3924  		goto out;
85a964c39cadef James Smart 2021-08-16  3925  
85a964c39cadef James Smart 2021-08-16  3926  	tlv = edc_rsp->desc;
85a964c39cadef James Smart 2021-08-16  3927  
85a964c39cadef James Smart 2021-08-16  3928  	/*
85a964c39cadef James Smart 2021-08-16  3929  	 * cycle through EDC diagnostic descriptors to find the
85a964c39cadef James Smart 2021-08-16  3930  	 * congestion signaling capability descriptor
85a964c39cadef James Smart 2021-08-16  3931  	 */
85a964c39cadef James Smart 2021-08-16  3932  	while (bytes_remain) {
85a964c39cadef James Smart 2021-08-16  3933  		if (bytes_remain < FC_TLV_DESC_HDR_SZ) {
85a964c39cadef James Smart 2021-08-16  3934  			lpfc_printf_log(phba, KERN_WARNING, LOG_CGN_MGMT,
85a964c39cadef James Smart 2021-08-16  3935  					"6461 Truncated TLV hdr on "
85a964c39cadef James Smart 2021-08-16  3936  					"Diagnostic descriptor[%d]\n",
85a964c39cadef James Smart 2021-08-16  3937  					desc_cnt);
85a964c39cadef James Smart 2021-08-16  3938  			goto out;
85a964c39cadef James Smart 2021-08-16  3939  		}
85a964c39cadef James Smart 2021-08-16  3940  
85a964c39cadef James Smart 2021-08-16  3941  		dtag = be32_to_cpu(tlv->desc_tag);
85a964c39cadef James Smart 2021-08-16  3942  		switch (dtag) {
85a964c39cadef James Smart 2021-08-16  3943  		case ELS_DTAG_LNK_FAULT_CAP:
85a964c39cadef James Smart 2021-08-16  3944  			if (bytes_remain < FC_TLV_DESC_SZ_FROM_LENGTH(tlv) ||
85a964c39cadef James Smart 2021-08-16  3945  			    FC_TLV_DESC_SZ_FROM_LENGTH(tlv) !=
85a964c39cadef James Smart 2021-08-16  3946  					sizeof(struct fc_diag_lnkflt_desc)) {
85a964c39cadef James Smart 2021-08-16  3947  				lpfc_printf_log(
85a964c39cadef James Smart 2021-08-16  3948  					phba, KERN_WARNING, LOG_CGN_MGMT,
85a964c39cadef James Smart 2021-08-16  3949  					"6462 Truncated Link Fault Diagnostic "
85a964c39cadef James Smart 2021-08-16  3950  					"descriptor[%d]: %d vs 0x%zx 0x%zx\n",
85a964c39cadef James Smart 2021-08-16  3951  					desc_cnt, bytes_remain,
85a964c39cadef James Smart 2021-08-16  3952  					FC_TLV_DESC_SZ_FROM_LENGTH(tlv),
85a964c39cadef James Smart 2021-08-16  3953  					sizeof(struct fc_diag_cg_sig_desc));
85a964c39cadef James Smart 2021-08-16  3954  				goto out;
85a964c39cadef James Smart 2021-08-16  3955  			}
85a964c39cadef James Smart 2021-08-16  3956  			plnkflt = (struct fc_diag_lnkflt_desc *)tlv;
85a964c39cadef James Smart 2021-08-16  3957  			lpfc_printf_log(
85a964c39cadef James Smart 2021-08-16  3958  				phba, KERN_INFO, LOG_ELS | LOG_CGN_MGMT,
85a964c39cadef James Smart 2021-08-16  3959  				"4617 Link Fault Desc Data: 0x%08x 0x%08x "
85a964c39cadef James Smart 2021-08-16  3960  				"0x%08x 0x%08x 0x%08x\n",
85a964c39cadef James Smart 2021-08-16  3961  				be32_to_cpu(plnkflt->desc_tag),
85a964c39cadef James Smart 2021-08-16  3962  				be32_to_cpu(plnkflt->desc_len),
85a964c39cadef James Smart 2021-08-16  3963  				be32_to_cpu(
85a964c39cadef James Smart 2021-08-16  3964  					plnkflt->degrade_activate_threshold),
85a964c39cadef James Smart 2021-08-16  3965  				be32_to_cpu(
85a964c39cadef James Smart 2021-08-16  3966  					plnkflt->degrade_deactivate_threshold),
85a964c39cadef James Smart 2021-08-16  3967  				be32_to_cpu(plnkflt->fec_degrade_interval));
85a964c39cadef James Smart 2021-08-16  3968  			break;
85a964c39cadef James Smart 2021-08-16  3969  		case ELS_DTAG_CG_SIGNAL_CAP:
85a964c39cadef James Smart 2021-08-16  3970  			if (bytes_remain < FC_TLV_DESC_SZ_FROM_LENGTH(tlv) ||
85a964c39cadef James Smart 2021-08-16  3971  			    FC_TLV_DESC_SZ_FROM_LENGTH(tlv) !=
85a964c39cadef James Smart 2021-08-16  3972  					sizeof(struct fc_diag_cg_sig_desc)) {
85a964c39cadef James Smart 2021-08-16  3973  				lpfc_printf_log(
85a964c39cadef James Smart 2021-08-16  3974  					phba, KERN_WARNING, LOG_CGN_MGMT,
85a964c39cadef James Smart 2021-08-16  3975  					"6463 Truncated Cgn Signal Diagnostic "
85a964c39cadef James Smart 2021-08-16  3976  					"descriptor[%d]: %d vs 0x%zx 0x%zx\n",
85a964c39cadef James Smart 2021-08-16  3977  					desc_cnt, bytes_remain,
85a964c39cadef James Smart 2021-08-16  3978  					FC_TLV_DESC_SZ_FROM_LENGTH(tlv),
85a964c39cadef James Smart 2021-08-16  3979  					sizeof(struct fc_diag_cg_sig_desc));
85a964c39cadef James Smart 2021-08-16  3980  				goto out;
85a964c39cadef James Smart 2021-08-16  3981  			}
85a964c39cadef James Smart 2021-08-16  3982  
85a964c39cadef James Smart 2021-08-16  3983  			pcgd = (struct fc_diag_cg_sig_desc *)tlv;
85a964c39cadef James Smart 2021-08-16 @3984  			lpfc_printf_log(
85a964c39cadef James Smart 2021-08-16  3985  				phba, KERN_INFO, LOG_ELS | LOG_CGN_MGMT,
85a964c39cadef James Smart 2021-08-16  3986  				"4616 CGN Desc Data: 0x%08x 0x%08x "
85a964c39cadef James Smart 2021-08-16  3987  				"0x%08x 0x%04x 0x%04x 0x%08x 0x%04x 0x%04x\n",
85a964c39cadef James Smart 2021-08-16  3988  				be32_to_cpu(pcgd->desc_tag),
85a964c39cadef James Smart 2021-08-16  3989  				be32_to_cpu(pcgd->desc_len),
85a964c39cadef James Smart 2021-08-16  3990  				be32_to_cpu(pcgd->xmt_signal_capability),
85a964c39cadef James Smart 2021-08-16  3991  				be32_to_cpu(pcgd->xmt_signal_frequency.count),
85a964c39cadef James Smart 2021-08-16  3992  				be32_to_cpu(pcgd->xmt_signal_frequency.units),
85a964c39cadef James Smart 2021-08-16  3993  				be32_to_cpu(pcgd->rcv_signal_capability),
85a964c39cadef James Smart 2021-08-16  3994  				be32_to_cpu(pcgd->rcv_signal_frequency.count),
85a964c39cadef James Smart 2021-08-16  3995  				be32_to_cpu(pcgd->rcv_signal_frequency.units));
85a964c39cadef James Smart 2021-08-16  3996  
85a964c39cadef James Smart 2021-08-16  3997  			/* Compare driver and Fport capabilities and choose
85a964c39cadef James Smart 2021-08-16  3998  			 * least common.
85a964c39cadef James Smart 2021-08-16  3999  			 */
85a964c39cadef James Smart 2021-08-16  4000  			lpfc_least_capable_settings(phba, pcgd);
85a964c39cadef James Smart 2021-08-16  4001  			rcv_cap_desc = true;
85a964c39cadef James Smart 2021-08-16  4002  			break;
85a964c39cadef James Smart 2021-08-16  4003  		default:
85a964c39cadef James Smart 2021-08-16  4004  			dtag_nm = lpfc_get_tlv_dtag_nm(dtag);
85a964c39cadef James Smart 2021-08-16  4005  			lpfc_printf_log(phba, KERN_WARNING, LOG_CGN_MGMT,
85a964c39cadef James Smart 2021-08-16  4006  					"4919 unknown Diagnostic "
85a964c39cadef James Smart 2021-08-16  4007  					"Descriptor[%d]: tag x%x (%s)\n",
85a964c39cadef James Smart 2021-08-16  4008  					desc_cnt, dtag, dtag_nm);
85a964c39cadef James Smart 2021-08-16  4009  		}
85a964c39cadef James Smart 2021-08-16  4010  
85a964c39cadef James Smart 2021-08-16  4011  		bytes_remain -= FC_TLV_DESC_SZ_FROM_LENGTH(tlv);
85a964c39cadef James Smart 2021-08-16  4012  		tlv = fc_tlv_next_desc(tlv);
85a964c39cadef James Smart 2021-08-16  4013  		desc_cnt++;
85a964c39cadef James Smart 2021-08-16  4014  	}
85a964c39cadef James Smart 2021-08-16  4015  
85a964c39cadef James Smart 2021-08-16  4016  out:
85a964c39cadef James Smart 2021-08-16  4017  	if (!rcv_cap_desc) {
85a964c39cadef James Smart 2021-08-16  4018  		phba->cgn_reg_fpin = LPFC_CGN_FPIN_ALARM | LPFC_CGN_FPIN_WARN;
85a964c39cadef James Smart 2021-08-16  4019  		phba->cgn_reg_signal = EDC_CG_SIG_NOTSUPPORTED;
85a964c39cadef James Smart 2021-08-16  4020  		phba->cgn_sig_freq = 0;
85a964c39cadef James Smart 2021-08-16  4021  		lpfc_printf_log(phba, KERN_WARNING, LOG_ELS | LOG_CGN_MGMT,
85a964c39cadef James Smart 2021-08-16  4022  				"4202 EDC rsp error - sending RDF "
85a964c39cadef James Smart 2021-08-16  4023  				"for FPIN only.\n");
85a964c39cadef James Smart 2021-08-16  4024  	}
85a964c39cadef James Smart 2021-08-16  4025  
85a964c39cadef James Smart 2021-08-16  4026  	lpfc_config_cgn_signal(phba);
85a964c39cadef James Smart 2021-08-16  4027  
85a964c39cadef James Smart 2021-08-16  4028  	/* Check to see if link went down during discovery */
85a964c39cadef James Smart 2021-08-16  4029  	lpfc_els_chk_latt(phba->pport);
85a964c39cadef James Smart 2021-08-16  4030  	lpfc_debugfs_disc_trc(phba->pport, LPFC_DISC_TRC_ELS_CMD,
85a964c39cadef James Smart 2021-08-16  4031  			      "EDC Cmpl:     did:x%x refcnt %d",
85a964c39cadef James Smart 2021-08-16  4032  			      ndlp->nlp_DID, kref_read(&ndlp->kref), 0);
85a964c39cadef James Smart 2021-08-16  4033  	lpfc_els_free_iocb(phba, cmdiocb);
85a964c39cadef James Smart 2021-08-16  4034  	lpfc_nlp_put(ndlp);
85a964c39cadef James Smart 2021-08-16  4035  }
85a964c39cadef James Smart 2021-08-16  4036  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 43442 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-08-25 11:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-25  8:59 [linux-next:master 9989/10077] drivers/scsi/lpfc/lpfc_els.c:3984:25: sparse: sparse: cast from restricted __be16 kernel test robot
2021-08-25 11:53 ` kernel test robot
2021-08-25 11:53   ` kernel test robot
2021-08-25 10:50 kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.