All of lore.kernel.org
 help / color / mirror / Atom feed
* [hare-scsi-devel:reserved-tags.v7 26/31] drivers/scsi/hisi_sas/hisi_sas_main.c:1203:18: error: storage size of 'lun' isn't known
@ 2021-02-22 16:58 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-02-22 16:58 UTC (permalink / raw)
  To: kbuild-all

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git reserved-tags.v7
head:   56f43659bdb8145b5c47adbcf1bcc2993838acf4
commit: 34b6b13da1f6d21a66ea903fe5bc3bc132b1181e [26/31] scsi: libsas,hisi_sas,mvsas,pm8001: Allocate Scsi_cmd for slow task
config: parisc-randconfig-r016-20210222 (attached as .config)
compiler: hppa-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git/commit/?id=34b6b13da1f6d21a66ea903fe5bc3bc132b1181e
        git remote add hare-scsi-devel https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git
        git fetch --no-tags hare-scsi-devel reserved-tags.v7
        git checkout 34b6b13da1f6d21a66ea903fe5bc3bc132b1181e
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=parisc 

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

All error/warnings (new ones prefixed by >>):

   drivers/scsi/hisi_sas/hisi_sas_main.c: In function 'hisi_sas_exec_internal_tmf_task':
>> drivers/scsi/hisi_sas/hisi_sas_main.c:1203:18: error: storage size of 'lun' isn't known
    1203 |   struct scsilun lun;
         |                  ^~~
>> drivers/scsi/hisi_sas/hisi_sas_main.c:1206:7: warning: the address of 'dev_is_sata' will always evaluate as 'true' [-Waddress]
    1206 |   if (!dev_is_sata) {
         |       ^
>> drivers/scsi/hisi_sas/hisi_sas_main.c:1207:35: error: invalid initializer
    1207 |    struct sas_ssp_task ssp_task = parameter;
         |                                   ^~~~~~~~~
   drivers/scsi/hisi_sas/hisi_sas_main.c:1203:18: warning: unused variable 'lun' [-Wunused-variable]
    1203 |   struct scsilun lun;
         |                  ^~~


vim +1203 drivers/scsi/hisi_sas/hisi_sas_main.c

  1187	
  1188	#define TASK_TIMEOUT 20
  1189	#define TASK_RETRY 3
  1190	#define INTERNAL_ABORT_TIMEOUT 6
  1191	static int hisi_sas_exec_internal_tmf_task(struct domain_device *device,
  1192						   void *parameter, u32 para_len,
  1193						   struct hisi_sas_tmf_task *tmf)
  1194	{
  1195		struct hisi_sas_device *sas_dev = device->lldd_dev;
  1196		struct hisi_hba *hisi_hba = sas_dev->hisi_hba;
  1197		struct sas_ha_struct *sha = &hisi_hba->sha;
  1198		struct device *dev = hisi_hba->dev;
  1199		struct sas_task *task;
  1200		int res, retry;
  1201	
  1202		for (retry = 0; retry < TASK_RETRY; retry++) {
> 1203			struct scsilun lun;
  1204	
  1205			int_to_scsilun(0, &lun);
> 1206			if (!dev_is_sata) {
> 1207				struct sas_ssp_task ssp_task = parameter;
  1208	
  1209				memcpy(lun.scsi_lun, ssp_task.LUN, 8);
  1210			}
  1211			task = sas_alloc_slow_task(sha, device, &lun, GFP_KERNEL);
  1212			if (!task)
  1213				return -ENOMEM;
  1214	
  1215			task->dev = device;
  1216			task->task_proto = device->tproto;
  1217	
  1218			if (dev_is_sata(device)) {
  1219				task->ata_task.device_control_reg_update = 1;
  1220				memcpy(&task->ata_task.fis, parameter, para_len);
  1221			} else {
  1222				memcpy(&task->ssp_task, parameter, para_len);
  1223			}
  1224			task->task_done = hisi_sas_task_done;
  1225	
  1226			task->slow_task->timer.function = hisi_sas_tmf_timedout;
  1227			task->slow_task->timer.expires = jiffies + TASK_TIMEOUT * HZ;
  1228			add_timer(&task->slow_task->timer);
  1229	
  1230			res = hisi_sas_task_exec(task, GFP_KERNEL, 1, tmf);
  1231	
  1232			if (res) {
  1233				del_timer(&task->slow_task->timer);
  1234				dev_err(dev, "abort tmf: executing internal task failed: %d\n",
  1235					res);
  1236				goto ex_err;
  1237			}
  1238	
  1239			wait_for_completion(&task->slow_task->completion);
  1240			res = TMF_RESP_FUNC_FAILED;
  1241			/* Even TMF timed out, return direct. */
  1242			if ((task->task_state_flags & SAS_TASK_STATE_ABORTED)) {
  1243				if (!(task->task_state_flags & SAS_TASK_STATE_DONE)) {
  1244					struct hisi_sas_slot *slot = task->lldd_task;
  1245	
  1246					dev_err(dev, "abort tmf: TMF task timeout and not done\n");
  1247					if (slot) {
  1248						struct hisi_sas_cq *cq =
  1249						       &hisi_hba->cq[slot->dlvry_queue];
  1250						/*
  1251						 * sync irq to avoid free'ing task
  1252						 * before using task in IO completion
  1253						 */
  1254						synchronize_irq(cq->irq_no);
  1255						slot->task = NULL;
  1256					}
  1257	
  1258					goto ex_err;
  1259				} else
  1260					dev_err(dev, "abort tmf: TMF task timeout\n");
  1261			}
  1262	
  1263			if (task->task_status.resp == SAS_TASK_COMPLETE &&
  1264			     task->task_status.stat == TMF_RESP_FUNC_COMPLETE) {
  1265				res = TMF_RESP_FUNC_COMPLETE;
  1266				break;
  1267			}
  1268	
  1269			if (task->task_status.resp == SAS_TASK_COMPLETE &&
  1270				task->task_status.stat == TMF_RESP_FUNC_SUCC) {
  1271				res = TMF_RESP_FUNC_SUCC;
  1272				break;
  1273			}
  1274	
  1275			if (task->task_status.resp == SAS_TASK_COMPLETE &&
  1276			      task->task_status.stat == SAS_DATA_UNDERRUN) {
  1277				/* no error, but return the number of bytes of
  1278				 * underrun
  1279				 */
  1280				dev_warn(dev, "abort tmf: task to dev %016llx resp: 0x%x sts 0x%x underrun\n",
  1281					 SAS_ADDR(device->sas_addr),
  1282					 task->task_status.resp,
  1283					 task->task_status.stat);
  1284				res = task->task_status.residual;
  1285				break;
  1286			}
  1287	
  1288			if (task->task_status.resp == SAS_TASK_COMPLETE &&
  1289				task->task_status.stat == SAS_DATA_OVERRUN) {
  1290				dev_warn(dev, "abort tmf: blocked task error\n");
  1291				res = -EMSGSIZE;
  1292				break;
  1293			}
  1294	
  1295			if (task->task_status.resp == SAS_TASK_COMPLETE &&
  1296			    task->task_status.stat == SAS_OPEN_REJECT) {
  1297				dev_warn(dev, "abort tmf: open reject failed\n");
  1298				res = -EIO;
  1299			} else {
  1300				dev_warn(dev, "abort tmf: task to dev %016llx resp: 0x%x status 0x%x\n",
  1301					 SAS_ADDR(device->sas_addr),
  1302					 task->task_status.resp,
  1303					 task->task_status.stat);
  1304			}
  1305			sas_free_task(task);
  1306			task = NULL;
  1307		}
  1308	ex_err:
  1309		if (retry == TASK_RETRY)
  1310			dev_warn(dev, "abort tmf: executing internal task failed!\n");
  1311		sas_free_task(task);
  1312		return res;
  1313	}
  1314	

---
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: 23578 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-02-22 16:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-22 16:58 [hare-scsi-devel:reserved-tags.v7 26/31] drivers/scsi/hisi_sas/hisi_sas_main.c:1203:18: error: storage size of 'lun' isn't known 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.