lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <34aa5237-75fb-4cd1-9b90-f0a3f73753f8@acm.org>
Date: Thu, 6 Mar 2025 09:05:15 -0800
From: Bart Van Assche <bvanassche@....org>
To: Manish Pandey <quic_mapa@...cinc.com>,
 Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>,
 "James E.J. Bottomley" <James.Bottomley@...senPartnership.com>,
 "Martin K. Petersen" <martin.petersen@...cle.com>
Cc: linux-arm-msm@...r.kernel.org, linux-scsi@...r.kernel.org,
 linux-kernel@...r.kernel.org, quic_nitirawa@...cinc.com,
 quic_cang@...cinc.com, quic_nguyenb@...cinc.com
Subject: Re: [PATCH V2 3/3] scsi: ufs-qcom: Add support for testbus registers

On 3/5/25 4:03 AM, Manish Pandey wrote:
> This patch introduces support for dumping testbus registers,
> enhancing the debugging capabilities for UFS-QCOM drivers.
> 
> Signed-off-by: Manish Pandey <quic_mapa@...cinc.com>
> ---
>   drivers/ufs/host/ufs-qcom.c | 73 +++++++++++++++++++++++++++++++++++++
>   1 file changed, 73 insertions(+)
> 
> diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
> index 7daee416eb8b..c8f95519b580 100644
> --- a/drivers/ufs/host/ufs-qcom.c
> +++ b/drivers/ufs/host/ufs-qcom.c
> @@ -1566,6 +1566,75 @@ int ufs_qcom_testbus_config(struct ufs_qcom_host *host)
>   	return 0;
>   }
>   
> +static void ufs_qcom_dump_testbus(struct ufs_hba *hba)
> +{
> +	struct ufs_qcom_host *host = ufshcd_get_variant(hba);
> +	u32 *testbus = NULL;
> +	int i, j, nminor = 0, testbus_len = 0;
> +	char *prefix;

Shouldn't the declarations be ordered from longest to shortest for new
code?

Has it been considered to annotate the 'testbus' declaration with __free
and to remove the kfree(testbus) call? See also <linux/cleanup.h>

> +		switch (j) {
> +		case TSTBUS_UAWM:
> +			prefix = "TSTBUS_UAWM ";
> +			break;
> +		case TSTBUS_UARM:
> +			prefix = "TSTBUS_UARM ";
> +			break;
> +		case TSTBUS_TXUC:
> +			prefix = "TSTBUS_TXUC ";
> +			break;
> +		case TSTBUS_RXUC:
> +			prefix = "TSTBUS_RXUC ";
> +			break;
> +		case TSTBUS_DFC:
> +			prefix = "TSTBUS_DFC ";
> +			break;
> +		case TSTBUS_TRLUT:
> +			prefix = "TSTBUS_TRLUT ";
> +			break;
> +		case TSTBUS_TMRLUT:
> +			prefix = "TSTBUS_TMRLUT ";
> +			break;
> +		case TSTBUS_OCSC:
> +			prefix = "TSTBUS_OCSC ";
> +			break;
> +		case TSTBUS_UTP_HCI:
> +			prefix = "TSTBUS_UTP_HCI ";
> +			break;
> +		case TSTBUS_COMBINED:
> +			prefix = "TSTBUS_COMBINED ";
> +			break;
> +		case TSTBUS_WRAPPER:
> +			prefix = "TSTBUS_WRAPPER ";
> +			break;
> +		case TSTBUS_UNIPRO:
> +			nminor = 256;
> +			prefix = "TSTBUS_UNIPRO ";
> +			break;
> +		default:
> +			break;
> +		}

Has it been considered to convert the above switch-statement into an
array lookup?

> @@ -1682,6 +1751,10 @@ static void ufs_qcom_dump_dbg_regs(struct ufs_hba *hba)
>   			ufs_qcom_dump_mcq_hci_regs(hba);
>   			usleep_range(1000, 1100);
>   		}
> +		ufshcd_dump_regs(hba, UFS_TEST_BUS, 4, "UFS_TEST_BUS ");
> +		usleep_range(1000, 1100);
> +		ufs_qcom_dump_testbus(hba);
> +		usleep_range(1000, 1100);
>   	}
>   }

Please add a comment that explains why the usleep_range() calls are
present.

Thanks,

Bart.



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ