[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <SN6PR04MB4640F4CEAB7F5FFA51648B6CFC720@SN6PR04MB4640.namprd04.prod.outlook.com>
Date: Mon, 27 Jul 2020 13:05:47 +0000
From: Avri Altman <Avri.Altman@....com>
To: Can Guo <cang@...eaurora.org>,
"asutoshd@...eaurora.org" <asutoshd@...eaurora.org>,
"nguyenb@...eaurora.org" <nguyenb@...eaurora.org>,
"hongwus@...eaurora.org" <hongwus@...eaurora.org>,
"rnayak@...eaurora.org" <rnayak@...eaurora.org>,
"sh425.lee@...sung.com" <sh425.lee@...sung.com>,
"linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
"kernel-team@...roid.com" <kernel-team@...roid.com>,
"saravanak@...gle.com" <saravanak@...gle.com>,
"salyzyn@...gle.com" <salyzyn@...gle.com>
CC: Andy Gross <agross@...nel.org>,
Bjorn Andersson <bjorn.andersson@...aro.org>,
Alim Akhtar <alim.akhtar@...sung.com>,
"James E.J. Bottomley" <jejb@...ux.ibm.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
"open list:ARM/QUALCOMM SUPPORT" <linux-arm-msm@...r.kernel.org>,
open list <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH v6 3/8] scsi: ufs-qcom: Fix schedule while atomic error in
ufs_qcom_dump_dbg_regs
> Dumping testbus registers needs to sleep a bit intermittently as there are
> too many of them. Skip them for those contexts where sleep is not allowed.
>
> Signed-off-by: Can Guo <cang@...eaurora.org>
> ---
> drivers/scsi/ufs/ufs-qcom.c | 15 +++++++++------
> 1 file changed, 9 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c
> index 7da27ee..7831b2b 100644
> --- a/drivers/scsi/ufs/ufs-qcom.c
> +++ b/drivers/scsi/ufs/ufs-qcom.c
> @@ -1651,13 +1651,16 @@ static void ufs_qcom_dump_dbg_regs(struct
> ufs_hba *hba)
> ufshcd_dump_regs(hba, REG_UFS_SYS1CLK_1US, 16 * 4,
> "HCI Vendor Specific Registers ");
>
> - /* sleep a bit intermittently as we are dumping too much data */
> ufs_qcom_print_hw_debug_reg_all(hba, NULL,
> ufs_qcom_dump_regs_wrapper);
> - udelay(1000);
> - ufs_qcom_testbus_read(hba);
> - udelay(1000);
> - ufs_qcom_print_unipro_testbus(hba);
> - udelay(1000);
> +
> + if (in_task()) {
> + /* sleep a bit intermittently as we are dumping too much data */
> + usleep_range(1000, 1100);
> + ufs_qcom_testbus_read(hba);
> + usleep_range(1000, 1100);
> + ufs_qcom_print_unipro_testbus(hba);
> + usleep_range(1000, 1100);
> + }
> }
How about moving the intermittent sleep out of the check if preemption is disabled?
And maybe then you need to switch back to uedlay?
Powered by blists - more mailing lists