tree:
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: f8550c0d35df3d027724b250a8c5888dfb2fa749
commit: c6adba150191762a7e58644f9e522d9d6d945e1c [5939/7024] scsi: lpfc: Rework remote
port lock handling
config: i386-randconfig-a002-20201119 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
#
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commi...
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 c6adba150191762a7e58644f9e522d9d6d945e1c
# save the attached .config to linux build tree
make W=1 ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
drivers/scsi/lpfc/lpfc_els.c: In function 'lpfc_issue_els_plogi':
> drivers/scsi/lpfc/lpfc_els.c:2059:20: warning: variable
'shost' set but not used [-Wunused-but-set-variable]
2059 | struct
Scsi_Host *shost;
| ^~~~~
drivers/scsi/lpfc/lpfc_els.c: In function 'lpfc_els_unsol_buffer':
drivers/scsi/lpfc/lpfc_els.c:8511:21: warning: variable 'shost' set but not
used [-Wunused-but-set-variable]
8511 | struct Scsi_Host *shost;
| ^~~~~
drivers/scsi/lpfc/lpfc_els.c: In function 'lpfc_retry_pport_discovery':
drivers/scsi/lpfc/lpfc_els.c:9331:21: warning: variable 'shost' set but not
used [-Wunused-but-set-variable]
9331 | struct Scsi_Host *shost;
| ^~~~~
--
drivers/scsi/lpfc/lpfc_hbadisc.c: In function 'lpfc_rport_invalid':
> drivers/scsi/lpfc/lpfc_hbadisc.c:87:21: warning: variable
'vport' set but not used [-Wunused-but-set-variable]
87 | struct
lpfc_vport *vport;
| ^~~~~
drivers/scsi/lpfc/lpfc_hbadisc.c: In function 'lpfc_nlp_get':
> drivers/scsi/lpfc/lpfc_hbadisc.c:6195:19: warning: variable
'phba' set but not used [-Wunused-but-set-variable]
6195 | struct
lpfc_hba *phba;
| ^~~~
--
drivers/scsi/lpfc/lpfc_init.c: In function 'lpfc_sli4_async_fip_evt':
> drivers/scsi/lpfc/lpfc_init.c:5649:21: warning: variable
'shost' set but not used [-Wunused-but-set-variable]
5649 | struct
Scsi_Host *shost;
| ^~~~~
vim +/shost +2059 drivers/scsi/lpfc/lpfc_els.c
dea3101e0a5c897 James Bottomley 2005-04-17 2033
e59058c44025d71 James Smart 2008-08-24 2034 /**
3621a710a7dbb2d James Smart 2009-04-06 2035 * lpfc_issue_els_plogi - Issue an plogi
iocb command for a vport
e59058c44025d71 James Smart 2008-08-24 2036 * @vport: pointer to a host virtual
N_Port data structure.
e59058c44025d71 James Smart 2008-08-24 2037 * @did: destination port identifier.
e59058c44025d71 James Smart 2008-08-24 2038 * @retry: number of retries to the
command IOCB.
e59058c44025d71 James Smart 2008-08-24 2039 *
e59058c44025d71 James Smart 2008-08-24 2040 * This routine issues a Port Login
(PLOGI) command to a remote N_Port
e59058c44025d71 James Smart 2008-08-24 2041 * (with the @did) for a @vport. Before
issuing a PLOGI to a remote N_Port,
e59058c44025d71 James Smart 2008-08-24 2042 * the ndlp with the remote N_Port DID
must exist on the @vport's ndlp list.
e59058c44025d71 James Smart 2008-08-24 2043 * This routine constructs the proper
feilds of the PLOGI IOCB and invokes
e59058c44025d71 James Smart 2008-08-24 2044 * the lpfc_sli_issue_iocb() routine to
send out PLOGI ELS command.
e59058c44025d71 James Smart 2008-08-24 2045 *
e59058c44025d71 James Smart 2008-08-24 2046 * Note that, in lpfc_prep_els_iocb()
routine, the reference count of ndlp
e59058c44025d71 James Smart 2008-08-24 2047 * will be incremented by 1 for holding
the ndlp and the reference to ndlp
e59058c44025d71 James Smart 2008-08-24 2048 * will be stored into the context1
field of the IOCB for the completion
e59058c44025d71 James Smart 2008-08-24 2049 * callback function to the PLOGI ELS
command.
e59058c44025d71 James Smart 2008-08-24 2050 *
e59058c44025d71 James Smart 2008-08-24 2051 * Return code
e59058c44025d71 James Smart 2008-08-24 2052 * 0 - Successfully issued a plogi for
@vport
e59058c44025d71 James Smart 2008-08-24 2053 * 1 - failed to issue a plogi for
@vport
e59058c44025d71 James Smart 2008-08-24 2054 **/
dea3101e0a5c897 James Bottomley 2005-04-17 2055 int
2e0fef85e098f67 James Smart 2007-06-17 2056 lpfc_issue_els_plogi(struct lpfc_vport
*vport, uint32_t did, uint8_t retry)
dea3101e0a5c897 James Bottomley 2005-04-17 2057 {
2e0fef85e098f67 James Smart 2007-06-17 2058 struct lpfc_hba *phba =
vport->phba;
8db1c2b3e7fa1b1 Dick Kennedy 2017-08-23 @2059 struct Scsi_Host *shost;
dea3101e0a5c897 James Bottomley 2005-04-17 2060 struct serv_parm *sp;
98c9ea5c026ee47 James Smart 2007-10-27 2061 struct lpfc_nodelist *ndlp;
dea3101e0a5c897 James Bottomley 2005-04-17 2062 struct lpfc_iocbq *elsiocb;
dea3101e0a5c897 James Bottomley 2005-04-17 2063 uint8_t *pcmd;
dea3101e0a5c897 James Bottomley 2005-04-17 2064 uint16_t cmdsize;
92d7f7b0cde3ad2 James Smart 2007-06-17 2065 int ret;
dea3101e0a5c897 James Bottomley 2005-04-17 2066
98c9ea5c026ee47 James Smart 2007-10-27 2067 ndlp = lpfc_findnode_did(vport, did);
dea16bdae2f1ab6 James Smart 2018-11-29 2068
dea16bdae2f1ab6 James Smart 2018-11-29 2069 if (ndlp) {
dea16bdae2f1ab6 James Smart 2018-11-29 2070 /* Defer the processing of the issue
PLOGI until after the
dea16bdae2f1ab6 James Smart 2018-11-29 2071 * outstanding UNREG_RPI mbox command
completes, unless we
dea16bdae2f1ab6 James Smart 2018-11-29 2072 * are going offline. This logic does
not apply for Fabric DIDs
dea16bdae2f1ab6 James Smart 2018-11-29 2073 */
dea16bdae2f1ab6 James Smart 2018-11-29 2074 if ((ndlp->nlp_flag &
NLP_UNREG_INP) &&
dea16bdae2f1ab6 James Smart 2018-11-29 2075 ((ndlp->nlp_DID &
Fabric_DID_MASK) != Fabric_DID_MASK) &&
dea16bdae2f1ab6 James Smart 2018-11-29 2076 !(vport->fc_flag &
FC_OFFLINE_MODE)) {
dea16bdae2f1ab6 James Smart 2018-11-29 2077 lpfc_printf_vlog(vport, KERN_INFO,
LOG_DISCOVERY,
dea16bdae2f1ab6 James Smart 2018-11-29 2078 "4110 Issue PLOGI x%x
deferred "
32350664497279f James Smart 2019-08-14 2079 "on NPort x%x rpi x%x Data:
x%px\n",
dea16bdae2f1ab6 James Smart 2018-11-29 2080 ndlp->nlp_defer_did,
ndlp->nlp_DID,
dea16bdae2f1ab6 James Smart 2018-11-29 2081 ndlp->nlp_rpi, ndlp);
dea16bdae2f1ab6 James Smart 2018-11-29 2082
dea16bdae2f1ab6 James Smart 2018-11-29 2083 /* We can only defer 1st PLOGI */
dea16bdae2f1ab6 James Smart 2018-11-29 2084 if (ndlp->nlp_defer_did ==
NLP_EVT_NOTHING_PENDING)
dea16bdae2f1ab6 James Smart 2018-11-29 2085 ndlp->nlp_defer_did = did;
dea16bdae2f1ab6 James Smart 2018-11-29 2086 return 0;
dea16bdae2f1ab6 James Smart 2018-11-29 2087 }
dea16bdae2f1ab6 James Smart 2018-11-29 2088 }
98c9ea5c026ee47 James Smart 2007-10-27 2089
e47c9093531d340 James Smart 2008-02-08 2090 /* If ndlp is not NULL, we will bump
the reference count on it */
dea3101e0a5c897 James Bottomley 2005-04-17 2091 cmdsize = (sizeof(uint32_t) +
sizeof(struct serv_parm));
98c9ea5c026ee47 James Smart 2007-10-27 2092 elsiocb = lpfc_prep_els_iocb(vport, 1,
cmdsize, retry, ndlp, did,
c9f8735beadfba4 Jamie Wellnitz 2006-02-28 2093 ELS_CMD_PLOGI);
c9f8735beadfba4 Jamie Wellnitz 2006-02-28 2094 if (!elsiocb)
c9f8735beadfba4 Jamie Wellnitz 2006-02-28 2095 return 1;
dea3101e0a5c897 James Bottomley 2005-04-17 2096
8db1c2b3e7fa1b1 Dick Kennedy 2017-08-23 2097 shost = lpfc_shost_from_vport(vport);
c6adba150191762 James Smart 2020-11-15 2098 spin_lock_irq(&ndlp->lock);
8db1c2b3e7fa1b1 Dick Kennedy 2017-08-23 2099 ndlp->nlp_flag &=
~NLP_FCP_PRLI_RJT;
c6adba150191762 James Smart 2020-11-15 2100 spin_unlock_irq(&ndlp->lock);
8db1c2b3e7fa1b1 Dick Kennedy 2017-08-23 2101
dea3101e0a5c897 James Bottomley 2005-04-17 2102 pcmd = (uint8_t *) (((struct
lpfc_dmabuf *) elsiocb->context2)->virt);
dea3101e0a5c897 James Bottomley 2005-04-17 2103
dea3101e0a5c897 James Bottomley 2005-04-17 2104 /* For PLOGI request, remainder of
payload is service parameters */
dea3101e0a5c897 James Bottomley 2005-04-17 2105 *((uint32_t *) (pcmd)) =
ELS_CMD_PLOGI;
dea3101e0a5c897 James Bottomley 2005-04-17 2106 pcmd += sizeof(uint32_t);
2e0fef85e098f67 James Smart 2007-06-17 2107 memcpy(pcmd, &vport->fc_sparam,
sizeof(struct serv_parm));
dea3101e0a5c897 James Bottomley 2005-04-17 2108 sp = (struct serv_parm *) pcmd;
dea3101e0a5c897 James Bottomley 2005-04-17 2109
5ac6b303834aa74 James Smart 2010-10-22 2110 /*
5ac6b303834aa74 James Smart 2010-10-22 2111 * If we are a N-port connected to a
Fabric, fix-up paramm's so logins
5ac6b303834aa74 James Smart 2010-10-22 2112 * to device on remote loops work.
5ac6b303834aa74 James Smart 2010-10-22 2113 */
5ac6b303834aa74 James Smart 2010-10-22 2114 if ((vport->fc_flag & FC_FABRIC)
&& !(vport->fc_flag & FC_PUBLIC_LOOP))
5ac6b303834aa74 James Smart 2010-10-22 2115 sp->cmn.altBbCredit = 1;
5ac6b303834aa74 James Smart 2010-10-22 2116
dea3101e0a5c897 James Bottomley 2005-04-17 2117 if (sp->cmn.fcphLow < FC_PH_4_3)
dea3101e0a5c897 James Bottomley 2005-04-17 2118 sp->cmn.fcphLow = FC_PH_4_3;
dea3101e0a5c897 James Bottomley 2005-04-17 2119
dea3101e0a5c897 James Bottomley 2005-04-17 2120 if (sp->cmn.fcphHigh < FC_PH3)
dea3101e0a5c897 James Bottomley 2005-04-17 2121 sp->cmn.fcphHigh = FC_PH3;
dea3101e0a5c897 James Bottomley 2005-04-17 2122
e0165f20447c8ca James Smart 2016-12-19 2123 sp->cmn.valid_vendor_ver_level = 0;
8c258641e01cfcc James Smart 2017-02-12 2124 memset(sp->un.vendorVersion, 0,
sizeof(sp->un.vendorVersion));
44fd7fe3dd2ce9d James Smart 2017-08-23 2125 sp->cmn.bbRcvSizeMsb &= 0xF;
e0165f20447c8ca James Smart 2016-12-19 2126
858c9f6c19c6f9b James Smart 2007-06-17 2127 lpfc_debugfs_disc_trc(vport,
LPFC_DISC_TRC_ELS_CMD,
858c9f6c19c6f9b James Smart 2007-06-17 2128 "Issue PLOGI: did:x%x",
858c9f6c19c6f9b James Smart 2007-06-17 2129 did, 0, 0);
858c9f6c19c6f9b James Smart 2007-06-17 2130
8c258641e01cfcc James Smart 2017-02-12 2131 /* If our firmware supports this
feature, convey that
8c258641e01cfcc James Smart 2017-02-12 2132 * information to the target using the
vendor specific field.
8c258641e01cfcc James Smart 2017-02-12 2133 */
8c258641e01cfcc James Smart 2017-02-12 2134 if (phba->sli.sli_flag &
LPFC_SLI_SUPPRESS_RSP) {
8c258641e01cfcc James Smart 2017-02-12 2135 sp->cmn.valid_vendor_ver_level =
1;
8c258641e01cfcc James Smart 2017-02-12 2136 sp->un.vv.vid =
cpu_to_be32(LPFC_VV_EMLX_ID);
8c258641e01cfcc James Smart 2017-02-12 2137 sp->un.vv.flags =
cpu_to_be32(LPFC_VV_SUPPRESS_RSP);
8c258641e01cfcc James Smart 2017-02-12 2138 }
8c258641e01cfcc James Smart 2017-02-12 2139
dea3101e0a5c897 James Bottomley 2005-04-17 2140 phba->fc_stat.elsXmitPLOGI++;
dea3101e0a5c897 James Bottomley 2005-04-17 2141 elsiocb->iocb_cmpl =
lpfc_cmpl_els_plogi;
4430f7fd09ecb03 James Smart 2020-11-15 2142
4430f7fd09ecb03 James Smart 2020-11-15 2143 lpfc_debugfs_disc_trc(vport,
LPFC_DISC_TRC_ELS_CMD,
4430f7fd09ecb03 James Smart 2020-11-15 2144 "Issue PLOGI: did:x%x
refcnt %d",
4430f7fd09ecb03 James Smart 2020-11-15 2145 did,
kref_read(&ndlp->kref), 0);
4430f7fd09ecb03 James Smart 2020-11-15 2146 elsiocb->context1 =
lpfc_nlp_get(ndlp);
4430f7fd09ecb03 James Smart 2020-11-15 2147 if (!elsiocb->context1)
4430f7fd09ecb03 James Smart 2020-11-15 2148 goto io_err;
4430f7fd09ecb03 James Smart 2020-11-15 2149
3772a99175f5378 James Smart 2009-05-22 2150 ret = lpfc_sli_issue_iocb(phba,
LPFC_ELS_RING, elsiocb, 0);
4430f7fd09ecb03 James Smart 2020-11-15 2151 if (ret) {
4430f7fd09ecb03 James Smart 2020-11-15 2152 lpfc_nlp_put(ndlp);
4430f7fd09ecb03 James Smart 2020-11-15 2153 goto io_err;
4430f7fd09ecb03 James Smart 2020-11-15 2154 }
4430f7fd09ecb03 James Smart 2020-11-15 2155 return 0;
92d7f7b0cde3ad2 James Smart 2007-06-17 2156
4430f7fd09ecb03 James Smart 2020-11-15 2157 io_err:
dea3101e0a5c897 James Bottomley 2005-04-17 2158 lpfc_els_free_iocb(phba, elsiocb);
c9f8735beadfba4 Jamie Wellnitz 2006-02-28 2159 return 1;
dea3101e0a5c897 James Bottomley 2005-04-17 2160 }
dea3101e0a5c897 James Bottomley 2005-04-17 2161
:::::: The code at line 2059 was first introduced by commit
:::::: 8db1c2b3e7fa1b1a75a8dddc77bf516acfc03e8a scsi: lpfc: Fix handling of FCP and NVME
FC4 types in Pt2Pt topology
:::::: TO: Dick Kennedy <dick.kennedy(a)broadcom.com>
:::::: CC: Martin K. Petersen <martin.petersen(a)oracle.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org