tree:
https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git
reserved-tags.v3
head: 7e846b812c89291eaaf342f3a37944fefc17473b
commit: 7e846b812c89291eaaf342f3a37944fefc17473b [41/41] pm8001: use block-layer tags for
ccb allocation
config: x86_64-allyesconfig (attached as .config)
compiler: clang version 11.0.0 (
https://github.com/llvm/llvm-project
1ccde533425a4ba9d379510206ad680ff9702129)
reproduce:
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
git checkout 7e846b812c89291eaaf342f3a37944fefc17473b
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
> drivers/scsi/pm8001/pm8001_sas.c:1202:40: warning: variable
'tag' is uninitialized when used here [-Wuninitialized]
tmf_task.tag_of_task_to_be_managed = tag;
^~~
drivers/scsi/pm8001/pm8001_sas.c:1168:9: note: initialize the variable 'tag' to
silence this warning
u32 tag;
^
= 0
1 warning generated.
vim +/tag +1202 drivers/scsi/pm8001/pm8001_sas.c
dbf9bfe615717d jack wang 2009-10-14 1163
32877947b7a806 Weitao Hou 2019-05-20 1164 /* mandatory SAM-3, still need free
task/ccb info, abort the specified task */
dbf9bfe615717d jack wang 2009-10-14 1165 int pm8001_abort_task(struct sas_task
*task)
dbf9bfe615717d jack wang 2009-10-14 1166 {
dbf9bfe615717d jack wang 2009-10-14 1167 unsigned long flags;
1db49906d8fa87 Viswas G 2017-10-18 1168 u32 tag;
dbf9bfe615717d jack wang 2009-10-14 1169 struct domain_device *dev ;
1db49906d8fa87 Viswas G 2017-10-18 1170 struct pm8001_hba_info *pm8001_ha;
dbf9bfe615717d jack wang 2009-10-14 1171 struct scsi_lun lun;
dbf9bfe615717d jack wang 2009-10-14 1172 struct pm8001_device *pm8001_dev;
dbf9bfe615717d jack wang 2009-10-14 1173 struct pm8001_tmf_task tmf_task;
869ddbdcae3b4f Viswas G 2017-10-18 1174 int rc = TMF_RESP_FUNC_FAILED, ret;
869ddbdcae3b4f Viswas G 2017-10-18 1175 u32 phy_id;
869ddbdcae3b4f Viswas G 2017-10-18 1176 struct sas_task_slow slow_task;
dbf9bfe615717d jack wang 2009-10-14 1177 if (unlikely(!task ||
!task->lldd_task || !task->dev))
1db49906d8fa87 Viswas G 2017-10-18 1178 return TMF_RESP_FUNC_FAILED;
1db49906d8fa87 Viswas G 2017-10-18 1179 dev = task->dev;
1db49906d8fa87 Viswas G 2017-10-18 1180 pm8001_dev = dev->lldd_dev;
1db49906d8fa87 Viswas G 2017-10-18 1181 pm8001_ha = pm8001_find_ha_by_dev(dev);
869ddbdcae3b4f Viswas G 2017-10-18 1182 phy_id = pm8001_dev->attached_phy;
7e846b812c8929 Hannes Reinecke 2020-04-14 1183 if (task->tag == -1) {
1db49906d8fa87 Viswas G 2017-10-18 1184 pm8001_printk("no tag for
task:%p\n", task);
1db49906d8fa87 Viswas G 2017-10-18 1185 return TMF_RESP_FUNC_FAILED;
1db49906d8fa87 Viswas G 2017-10-18 1186 }
dbf9bfe615717d jack wang 2009-10-14 1187
spin_lock_irqsave(&task->task_state_lock, flags);
dbf9bfe615717d jack wang 2009-10-14 1188 if (task->task_state_flags &
SAS_TASK_STATE_DONE) {
dbf9bfe615717d jack wang 2009-10-14 1189
spin_unlock_irqrestore(&task->task_state_lock, flags);
1db49906d8fa87 Viswas G 2017-10-18 1190 return TMF_RESP_FUNC_COMPLETE;
dbf9bfe615717d jack wang 2009-10-14 1191 }
869ddbdcae3b4f Viswas G 2017-10-18 1192 task->task_state_flags |=
SAS_TASK_STATE_ABORTED;
869ddbdcae3b4f Viswas G 2017-10-18 1193 if (task->slow_task == NULL) {
869ddbdcae3b4f Viswas G 2017-10-18 1194
init_completion(&slow_task.completion);
869ddbdcae3b4f Viswas G 2017-10-18 1195 task->slow_task = &slow_task;
dbf9bfe615717d jack wang 2009-10-14 1196 }
dbf9bfe615717d jack wang 2009-10-14 1197
spin_unlock_irqrestore(&task->task_state_lock, flags);
dbf9bfe615717d jack wang 2009-10-14 1198 if (task->task_proto &
SAS_PROTOCOL_SSP) {
dbf9bfe615717d jack wang 2009-10-14 1199 struct scsi_cmnd *cmnd =
task->uldd_task;
dbf9bfe615717d jack wang 2009-10-14 1200 int_to_scsilun(cmnd->device->lun,
&lun);
dbf9bfe615717d jack wang 2009-10-14 1201 tmf_task.tmf = TMF_ABORT_TASK;
dbf9bfe615717d jack wang 2009-10-14 @1202 tmf_task.tag_of_task_to_be_managed =
tag;
8f1d49faadc4e1 Hannes Reinecke 2020-04-29 1203 rc = pm8001_exec_internal_tmf_task(dev,
lun.scsi_lun,
8f1d49faadc4e1 Hannes Reinecke 2020-04-29 1204 &tmf_task);
8f1d49faadc4e1 Hannes Reinecke 2020-04-29 1205 if (rc == TMF_RESP_FUNC_SUCC)
97ee20886cfd25 jack_wang 2009-11-05 1206
pm8001_exec_internal_task_abort(pm8001_ha, pm8001_dev,
7f3f003ba62f8d John Garry 2020-03-11 1207 lun.scsi_lun, 0, tag);
dbf9bfe615717d jack wang 2009-10-14 1208 } else if (task->task_proto &
SAS_PROTOCOL_SATA ||
dbf9bfe615717d jack wang 2009-10-14 1209 task->task_proto &
SAS_PROTOCOL_STP) {
7f3f003ba62f8d John Garry 2020-03-11 1210 memset(lun.scsi_lun, 0,
sizeof(lun.scsi_lun));
869ddbdcae3b4f Viswas G 2017-10-18 1211 if (pm8001_ha->chip_id == chip_8006)
{
869ddbdcae3b4f Viswas G 2017-10-18 1212
DECLARE_COMPLETION_ONSTACK(completion_reset);
869ddbdcae3b4f Viswas G 2017-10-18 1213
DECLARE_COMPLETION_ONSTACK(completion);
869ddbdcae3b4f Viswas G 2017-10-18 1214 struct pm8001_phy *phy =
pm8001_ha->phy + phy_id;
869ddbdcae3b4f Viswas G 2017-10-18 1215
869ddbdcae3b4f Viswas G 2017-10-18 1216 /* 1. Set Device state as Recovery */
869ddbdcae3b4f Viswas G 2017-10-18 1217 pm8001_dev->setds_completion =
&completion;
869ddbdcae3b4f Viswas G 2017-10-18 1218
PM8001_CHIP_DISP->set_dev_state_req(pm8001_ha,
869ddbdcae3b4f Viswas G 2017-10-18 1219 pm8001_dev, 0x03);
869ddbdcae3b4f Viswas G 2017-10-18 1220 wait_for_completion(&completion);
869ddbdcae3b4f Viswas G 2017-10-18 1221
869ddbdcae3b4f Viswas G 2017-10-18 1222 /* 2. Send Phy Control Hard Reset */
869ddbdcae3b4f Viswas G 2017-10-18 1223 reinit_completion(&completion);
51c1c5f6ed64c2 peter chang 2019-11-14 1224 phy->port_reset_status =
PORT_RESET_TMO;
869ddbdcae3b4f Viswas G 2017-10-18 1225 phy->reset_success = false;
869ddbdcae3b4f Viswas G 2017-10-18 1226 phy->enable_completion =
&completion;
869ddbdcae3b4f Viswas G 2017-10-18 1227 phy->reset_completion =
&completion_reset;
869ddbdcae3b4f Viswas G 2017-10-18 1228 ret =
PM8001_CHIP_DISP->phy_ctl_req(pm8001_ha, phy_id,
869ddbdcae3b4f Viswas G 2017-10-18 1229 PHY_HARD_RESET);
51c1c5f6ed64c2 peter chang 2019-11-14 1230 if (ret) {
51c1c5f6ed64c2 peter chang 2019-11-14 1231 phy->enable_completion = NULL;
51c1c5f6ed64c2 peter chang 2019-11-14 1232 phy->reset_completion = NULL;
869ddbdcae3b4f Viswas G 2017-10-18 1233 goto out;
51c1c5f6ed64c2 peter chang 2019-11-14 1234 }
51c1c5f6ed64c2 peter chang 2019-11-14 1235
51c1c5f6ed64c2 peter chang 2019-11-14 1236 /* In the case of the reset
timeout/fail we still
51c1c5f6ed64c2 peter chang 2019-11-14 1237 * abort the command at the firmware.
The assumption
51c1c5f6ed64c2 peter chang 2019-11-14 1238 * here is that the drive is off doing
something so
51c1c5f6ed64c2 peter chang 2019-11-14 1239 * that it's not processing
requests, and we want to
51c1c5f6ed64c2 peter chang 2019-11-14 1240 * avoid getting a completion for this
and either
51c1c5f6ed64c2 peter chang 2019-11-14 1241 * leaking the task in libsas or
losing the race and
51c1c5f6ed64c2 peter chang 2019-11-14 1242 * getting a double free.
51c1c5f6ed64c2 peter chang 2019-11-14 1243 */
869ddbdcae3b4f Viswas G 2017-10-18 1244 PM8001_MSG_DBG(pm8001_ha,
869ddbdcae3b4f Viswas G 2017-10-18 1245 pm8001_printk("Waiting for local
phy ctl\n"));
51c1c5f6ed64c2 peter chang 2019-11-14 1246 ret =
wait_for_completion_timeout(&completion,
51c1c5f6ed64c2 peter chang 2019-11-14 1247 PM8001_TASK_TIMEOUT * HZ);
51c1c5f6ed64c2 peter chang 2019-11-14 1248 if (!ret || !phy->reset_success) {
51c1c5f6ed64c2 peter chang 2019-11-14 1249 phy->enable_completion = NULL;
51c1c5f6ed64c2 peter chang 2019-11-14 1250 phy->reset_completion = NULL;
51c1c5f6ed64c2 peter chang 2019-11-14 1251 } else {
51c1c5f6ed64c2 peter chang 2019-11-14 1252 /* 3. Wait for Port Reset complete
or
51c1c5f6ed64c2 peter chang 2019-11-14 1253 * Port reset TMO
51c1c5f6ed64c2 peter chang 2019-11-14 1254 */
869ddbdcae3b4f Viswas G 2017-10-18 1255 PM8001_MSG_DBG(pm8001_ha,
869ddbdcae3b4f Viswas G 2017-10-18 1256 pm8001_printk("Waiting for Port
reset\n"));
51c1c5f6ed64c2 peter chang 2019-11-14 1257 ret = wait_for_completion_timeout(
51c1c5f6ed64c2 peter chang 2019-11-14 1258 &completion_reset,
51c1c5f6ed64c2 peter chang 2019-11-14 1259 PM8001_TASK_TIMEOUT * HZ);
51c1c5f6ed64c2 peter chang 2019-11-14 1260 if (!ret)
51c1c5f6ed64c2 peter chang 2019-11-14 1261 phy->reset_completion = NULL;
51c1c5f6ed64c2 peter chang 2019-11-14 1262 WARN_ON(phy->port_reset_status ==
51c1c5f6ed64c2 peter chang 2019-11-14 1263 PORT_RESET_TMO);
51c1c5f6ed64c2 peter chang 2019-11-14 1264 if (phy->port_reset_status ==
PORT_RESET_TMO) {
196ba6629cf95e Deepak Ukey 2019-07-09 1265 pm8001_dev_gone_notify(dev);
869ddbdcae3b4f Viswas G 2017-10-18 1266 goto out;
196ba6629cf95e Deepak Ukey 2019-07-09 1267 }
51c1c5f6ed64c2 peter chang 2019-11-14 1268 }
869ddbdcae3b4f Viswas G 2017-10-18 1269
869ddbdcae3b4f Viswas G 2017-10-18 1270 /*
869ddbdcae3b4f Viswas G 2017-10-18 1271 * 4. SATA Abort ALL
869ddbdcae3b4f Viswas G 2017-10-18 1272 * we wait for the task to be aborted
so that the task
869ddbdcae3b4f Viswas G 2017-10-18 1273 * is removed from the ccb. on success
the caller is
869ddbdcae3b4f Viswas G 2017-10-18 1274 * going to free the task.
869ddbdcae3b4f Viswas G 2017-10-18 1275 */
869ddbdcae3b4f Viswas G 2017-10-18 1276 ret =
pm8001_exec_internal_task_abort(pm8001_ha,
7f3f003ba62f8d John Garry 2020-03-11 1277 pm8001_dev, lun.scsi_lun, 1, tag);
869ddbdcae3b4f Viswas G 2017-10-18 1278 if (ret)
869ddbdcae3b4f Viswas G 2017-10-18 1279 goto out;
869ddbdcae3b4f Viswas G 2017-10-18 1280 ret = wait_for_completion_timeout(
869ddbdcae3b4f Viswas G 2017-10-18 1281
&task->slow_task->completion,
869ddbdcae3b4f Viswas G 2017-10-18 1282 PM8001_TASK_TIMEOUT * HZ);
869ddbdcae3b4f Viswas G 2017-10-18 1283 if (!ret)
869ddbdcae3b4f Viswas G 2017-10-18 1284 goto out;
869ddbdcae3b4f Viswas G 2017-10-18 1285
869ddbdcae3b4f Viswas G 2017-10-18 1286 /* 5. Set Device State as Operational
*/
869ddbdcae3b4f Viswas G 2017-10-18 1287 reinit_completion(&completion);
869ddbdcae3b4f Viswas G 2017-10-18 1288 pm8001_dev->setds_completion =
&completion;
869ddbdcae3b4f Viswas G 2017-10-18 1289
PM8001_CHIP_DISP->set_dev_state_req(pm8001_ha,
869ddbdcae3b4f Viswas G 2017-10-18 1290 pm8001_dev, 0x01);
869ddbdcae3b4f Viswas G 2017-10-18 1291 wait_for_completion(&completion);
869ddbdcae3b4f Viswas G 2017-10-18 1292 } else {
869ddbdcae3b4f Viswas G 2017-10-18 1293 rc =
pm8001_exec_internal_task_abort(pm8001_ha,
7f3f003ba62f8d John Garry 2020-03-11 1294 pm8001_dev, lun.scsi_lun, 0, tag);
dbf9bfe615717d jack wang 2009-10-14 1295 }
869ddbdcae3b4f Viswas G 2017-10-18 1296 rc = TMF_RESP_FUNC_COMPLETE;
dbf9bfe615717d jack wang 2009-10-14 1297 } else if (task->task_proto &
SAS_PROTOCOL_SMP) {
dbf9bfe615717d jack wang 2009-10-14 1298 /* SMP */
7f3f003ba62f8d John Garry 2020-03-11 1299
7f3f003ba62f8d John Garry 2020-03-11 1300 int_to_scsilun(0, &lun);
dbf9bfe615717d jack wang 2009-10-14 1301 rc =
pm8001_exec_internal_task_abort(pm8001_ha, pm8001_dev,
7f3f003ba62f8d John Garry 2020-03-11 1302 lun.scsi_lun, 0, tag);
dbf9bfe615717d jack wang 2009-10-14 1303
dbf9bfe615717d jack wang 2009-10-14 1304 }
dbf9bfe615717d jack wang 2009-10-14 1305 out:
869ddbdcae3b4f Viswas G 2017-10-18 1306
spin_lock_irqsave(&task->task_state_lock, flags);
869ddbdcae3b4f Viswas G 2017-10-18 1307 if (task->slow_task ==
&slow_task)
869ddbdcae3b4f Viswas G 2017-10-18 1308 task->slow_task = NULL;
869ddbdcae3b4f Viswas G 2017-10-18 1309
spin_unlock_irqrestore(&task->task_state_lock, flags);
dbf9bfe615717d jack wang 2009-10-14 1310 if (rc != TMF_RESP_FUNC_COMPLETE)
dbf9bfe615717d jack wang 2009-10-14 1311 pm8001_printk("rc= %d\n",
rc);
dbf9bfe615717d jack wang 2009-10-14 1312 return rc;
dbf9bfe615717d jack wang 2009-10-14 1313 }
dbf9bfe615717d jack wang 2009-10-14 1314
:::::: The code at line 1202 was first introduced by commit
:::::: dbf9bfe615717d1145f263c0049fe2328e6ed395 [SCSI] pm8001: add SAS/SATA HBA driver
:::::: TO: jack wang <jack_wang(a)usish.com>
:::::: CC: James Bottomley <James.Bottomley(a)suse.de>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org