2020-07-28 05:02:49

by Can Guo

[permalink] [raw]
Subject: [PATCH v7 3/8] scsi: ufs-qcom: Remove testbus dump in ufs_qcom_dump_dbg_regs

Dumping testbus registers is heavy enough to cause stability issues
sometime, just remove them as of now.

Signed-off-by: Can Guo <[email protected]>
---
drivers/scsi/ufs/ufs-qcom.c | 32 --------------------------------
1 file changed, 32 deletions(-)

diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c
index 7da27ee..96e0999 100644
--- a/drivers/scsi/ufs/ufs-qcom.c
+++ b/drivers/scsi/ufs/ufs-qcom.c
@@ -1620,44 +1620,12 @@ int ufs_qcom_testbus_config(struct ufs_qcom_host *host)
return 0;
}

-static void ufs_qcom_testbus_read(struct ufs_hba *hba)
-{
- ufshcd_dump_regs(hba, UFS_TEST_BUS, 4, "UFS_TEST_BUS ");
-}
-
-static void ufs_qcom_print_unipro_testbus(struct ufs_hba *hba)
-{
- struct ufs_qcom_host *host = ufshcd_get_variant(hba);
- u32 *testbus = NULL;
- int i, nminor = 256, testbus_len = nminor * sizeof(u32);
-
- testbus = kmalloc(testbus_len, GFP_KERNEL);
- if (!testbus)
- return;
-
- host->testbus.select_major = TSTBUS_UNIPRO;
- for (i = 0; i < nminor; i++) {
- host->testbus.select_minor = i;
- ufs_qcom_testbus_config(host);
- testbus[i] = ufshcd_readl(hba, UFS_TEST_BUS);
- }
- print_hex_dump(KERN_ERR, "UNIPRO_TEST_BUS ", DUMP_PREFIX_OFFSET,
- 16, 4, testbus, testbus_len, false);
- kfree(testbus);
-}
-
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);
}

/**
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.


2020-07-28 05:33:07

by hongwus

[permalink] [raw]
Subject: Re: [PATCH v7 3/8] scsi: ufs-qcom: Remove testbus dump in ufs_qcom_dump_dbg_regs

On 2020-07-28 13:00, Can Guo wrote:
> Dumping testbus registers is heavy enough to cause stability issues
> sometime, just remove them as of now.
>
> Signed-off-by: Can Guo <[email protected]>
> ---
> drivers/scsi/ufs/ufs-qcom.c | 32 --------------------------------
> 1 file changed, 32 deletions(-)
>
> diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c
> index 7da27ee..96e0999 100644
> --- a/drivers/scsi/ufs/ufs-qcom.c
> +++ b/drivers/scsi/ufs/ufs-qcom.c
> @@ -1620,44 +1620,12 @@ int ufs_qcom_testbus_config(struct
> ufs_qcom_host *host)
> return 0;
> }
>
> -static void ufs_qcom_testbus_read(struct ufs_hba *hba)
> -{
> - ufshcd_dump_regs(hba, UFS_TEST_BUS, 4, "UFS_TEST_BUS ");
> -}
> -
> -static void ufs_qcom_print_unipro_testbus(struct ufs_hba *hba)
> -{
> - struct ufs_qcom_host *host = ufshcd_get_variant(hba);
> - u32 *testbus = NULL;
> - int i, nminor = 256, testbus_len = nminor * sizeof(u32);
> -
> - testbus = kmalloc(testbus_len, GFP_KERNEL);
> - if (!testbus)
> - return;
> -
> - host->testbus.select_major = TSTBUS_UNIPRO;
> - for (i = 0; i < nminor; i++) {
> - host->testbus.select_minor = i;
> - ufs_qcom_testbus_config(host);
> - testbus[i] = ufshcd_readl(hba, UFS_TEST_BUS);
> - }
> - print_hex_dump(KERN_ERR, "UNIPRO_TEST_BUS ", DUMP_PREFIX_OFFSET,
> - 16, 4, testbus, testbus_len, false);
> - kfree(testbus);
> -}
> -
> 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);
> }
>
> /**

Reviewed-by: Hongwu Su <[email protected]>

2020-07-28 07:56:40

by Avri Altman

[permalink] [raw]
Subject: RE: [PATCH v7 3/8] scsi: ufs-qcom: Remove testbus dump in ufs_qcom_dump_dbg_regs

>
> Dumping testbus registers is heavy enough to cause stability issues
> sometime, just remove them as of now.
>
> Signed-off-by: Can Guo <[email protected]>
Reviewed-by: Avri Altman <[email protected]>