RE: [PATCH v2] scsi: ufs: mcq: Limit the amount of inflight requests

From: Avri Altman
Date: Thu Apr 20 2023 - 06:00:33 EST


> Hi Avri,
>
> https://git-scm.com/docs/git-format-patch#_base_tree_information]
>
> url: https://github.com/intel-lab-lkp/linux/commits/Avri-Altman/scsi-ufs-
> mcq-Limit-the-amount-of-inflight-requests/20230331-155149
> base: https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next
> patch link: https://lore.kernel.org/r/20230331074650.75-1-
> avri.altman%40wdc.com
> patch subject: [PATCH v2] scsi: ufs: mcq: Limit the amount of inflight requests
> config: parisc-randconfig-m031-20230329 (https://download.01.org/0day-
> ci/archive/20230401/202304011340.ltlHYazS-lkp@xxxxxxxxx/config)
> compiler: hppa-linux-gcc (GCC) 12.1.0
>
> If you fix the issue, kindly add following tag where applicable
> | Reported-by: kernel test robot <lkp@xxxxxxxxx>
> | Reported-by: Dan Carpenter <error27@xxxxxxxxx>
> | Link: https://lore.kernel.org/r/202304011340.ltlHYazS-lkp@xxxxxxxxx/
>
> New smatch warnings:
> drivers/ufs/core/ufshcd.c:8473 ufshcd_alloc_mcq() warn: missing error code
> 'ret'
>
> Old smatch warnings:
> drivers/ufs/core/ufshcd.c:5412 ufshcd_uic_cmd_compl() error: we previously
> assumed 'hba->active_uic_cmd' could be null (see line 5400)
> drivers/ufs/core/ufshcd.c:2350 ufshcd_hba_capabilities() warn: missing error
> code? 'err'
>
> vim +/ret +8473 drivers/ufs/core/ufshcd.c
>
> 57b1c0ef89ac9d drivers/ufs/core/ufshcd.c Asutosh Das 2023-01-13 8457
> static int ufshcd_alloc_mcq(struct ufs_hba *hba)
> 57b1c0ef89ac9d drivers/ufs/core/ufshcd.c Asutosh Das 2023-01-13 8458 {
> 7224c806876e46 drivers/ufs/core/ufshcd.c Asutosh Das 2023-01-13 8459
> int ret;
> 7224c806876e46 drivers/ufs/core/ufshcd.c Asutosh Das 2023-01-13 8460
> int old_nutrs = hba->nutrs;
> 7224c806876e46 drivers/ufs/core/ufshcd.c Asutosh Das 2023-01-13 8461
> 7224c806876e46 drivers/ufs/core/ufshcd.c Asutosh Das 2023-01-13 8462
> ret = ufshcd_mcq_decide_queue_depth(hba);
> 7224c806876e46 drivers/ufs/core/ufshcd.c Asutosh Das 2023-01-13 8463
> if (ret < 0)
> 7224c806876e46 drivers/ufs/core/ufshcd.c Asutosh Das 2023-01-13 8464
> return ret;
> 7224c806876e46 drivers/ufs/core/ufshcd.c Asutosh Das 2023-01-13 8465
> 7224c806876e46 drivers/ufs/core/ufshcd.c Asutosh Das 2023-01-13 8466
> hba->nutrs = ret;
> 7224c806876e46 drivers/ufs/core/ufshcd.c Asutosh Das 2023-01-13 8467
> ret = ufshcd_mcq_init(hba);
> 4682abfae2eb3a drivers/ufs/core/ufshcd.c Asutosh Das 2023-01-13 8468
> if (ret)
> 4682abfae2eb3a drivers/ufs/core/ufshcd.c Asutosh Das 2023-01-13 8469
> goto err;
> 4682abfae2eb3a drivers/ufs/core/ufshcd.c Asutosh Das 2023-01-13 8470
> 2580a95e61d461 drivers/ufs/core/ufshcd.c Avri Altman 2023-03-31 8471
> if (hba->nutrs * hba->nr_hw_queues > SZ_64K - 1) {
> 2580a95e61d461 drivers/ufs/core/ufshcd.c Avri Altman 2023-03-31 8472
> dev_info(hba->dev, "there can be at most 64K inflight requests\n");
> 2580a95e61d461 drivers/ufs/core/ufshcd.c Avri Altman 2023-03-31 @8473
> goto err;
>
> ret = -EINVAL;
Thanks.

Avri

>
> 2580a95e61d461 drivers/ufs/core/ufshcd.c Avri Altman 2023-03-31 8474
> }
> 2580a95e61d461 drivers/ufs/core/ufshcd.c Avri Altman 2023-03-31 8475
> 4682abfae2eb3a drivers/ufs/core/ufshcd.c Asutosh Das 2023-01-13 8476
> /*
> 4682abfae2eb3a drivers/ufs/core/ufshcd.c Asutosh Das 2023-01-13 8477
> * Previously allocated memory for nutrs may not be enough in MCQ mode.
> 4682abfae2eb3a drivers/ufs/core/ufshcd.c Asutosh Das 2023-01-13 8478
> * Number of supported tags in MCQ mode may be larger than SDB mode.
> 6ccf44fe4cd7c4 drivers/scsi/ufs/ufshcd.c Seungwon Jeon 2013-06-26 8479
> */
> 4682abfae2eb3a drivers/ufs/core/ufshcd.c Asutosh Das 2023-01-13 8480
> if (hba->nutrs != old_nutrs) {
> 4682abfae2eb3a drivers/ufs/core/ufshcd.c Asutosh Das 2023-01-13 8481
> ufshcd_release_sdb_queue(hba, old_nutrs);
> 4682abfae2eb3a drivers/ufs/core/ufshcd.c Asutosh Das 2023-01-13 8482
> ret = ufshcd_memory_alloc(hba);
> 4682abfae2eb3a drivers/ufs/core/ufshcd.c Asutosh Das 2023-01-13 8483
> if (ret)
> 4682abfae2eb3a drivers/ufs/core/ufshcd.c Asutosh Das 2023-01-13 8484
> goto err;
> 4682abfae2eb3a drivers/ufs/core/ufshcd.c Asutosh Das 2023-01-13 8485
> ufshcd_host_memory_configure(hba);
> 7224c806876e46 drivers/ufs/core/ufshcd.c Asutosh Das 2023-01-13 8486
> }
> 7224c806876e46 drivers/ufs/core/ufshcd.c Asutosh Das 2023-01-13 8487
> 4682abfae2eb3a drivers/ufs/core/ufshcd.c Asutosh Das 2023-01-13 8488
> ret = ufshcd_mcq_memory_alloc(hba);
> 4682abfae2eb3a drivers/ufs/core/ufshcd.c Asutosh Das 2023-01-13 8489
> if (ret)
> 4682abfae2eb3a drivers/ufs/core/ufshcd.c Asutosh Das 2023-01-13 8490
> goto err;
> 4682abfae2eb3a drivers/ufs/core/ufshcd.c Asutosh Das 2023-01-13 8491
> 7224c806876e46 drivers/ufs/core/ufshcd.c Asutosh Das 2023-01-13 8492
> return 0;
> 4682abfae2eb3a drivers/ufs/core/ufshcd.c Asutosh Das 2023-01-13 8493
> err:
> 4682abfae2eb3a drivers/ufs/core/ufshcd.c Asutosh Das 2023-01-13 8494
> hba->nutrs = old_nutrs;
> 4682abfae2eb3a drivers/ufs/core/ufshcd.c Asutosh Das 2023-01-13 8495
> return ret;
> 57b1c0ef89ac9d drivers/ufs/core/ufshcd.c Asutosh Das 2023-01-13 8496 }
>
> --
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests