mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nitin Rawat <quic_nitirawa@quicinc.com>
To: Aishwarya <aishwarya.tcv@arm.com>
Cc: <James.Bottomley@HansenPartnership.com>, <andersson@kernel.org>,
	<bvanassche@acm.org>, <dmitry.baryshkov@oss.qualcomm.com>,
	<kishon@kernel.org>, <konrad.dybcio@oss.qualcomm.com>,
	<linux-arm-msm@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-phy@lists.infradead.org>, <linux-scsi@vger.kernel.org>,
	<manivannan.sadhasivam@linaro.org>, <martin.petersen@oracle.com>,
	<neil.armstrong@linaro.org>, <quic_cang@quicinc.com>,
	<quic_rdwivedi@quicinc.com>, <vkoul@kernel.org>,
	<broonie@kernel.org>
Subject: Re: [PATCH V6 10/10] scsi: ufs: qcom : Refactor phy_power_on/off calls
Date: Sat, 21 Jun 2025 22:45:57 +0530	[thread overview]
Message-ID: <7e362ee3-a237-4583-97fe-69ffc0d1d90d@quicinc.com> (raw)
In-Reply-To: <20250620214408.11028-1-aishwarya.tcv@arm.com>

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



On 6/21/2025 3:14 AM, Aishwarya wrote:
> Hi Nitin,
> 
> To clarify — the defconfig kernel does boot successfully on our Arm64
> Qualcomm platforms (RB5 and DB845C). However, starting from
> next-20250613, we are seeing the following three test failures in the
> `bootrr` baseline test in our CI environment:
> 
>    - baseline.bootrr.scsi-disk-device0-probed
>    - dmesg.alert
>    - dmesg.emerg
> 

Hi Aishwarya,

Thanks for testing and reporting this issue. Can you please
test with the attached fix and let me know if it helps.

Regards,
Nitin

> Test suite:
>    https://github.com/kernelci/bootrr/tree/main
> 
> These failures are due to kernel alerts seen in the boot logs. A relevant
> snippet is shown below:
> 
>    kern  :alert : Unable to handle kernel NULL pointer dereference at
>    virtual address 0000000000000000
>    kern  :alert : Mem abort info:
>    kern  :alert :   ESR = 0x0000000096000004
>    kern  :alert :   EC = 0x25: DABT (current EL), IL = 32 bits
>    kern  :alert :   SET = 0, FnV = 0
>    kern  :alert :   EA = 0, S1PTW = 0
>    kern  :alert :   FSC = 0x04: level 0 translation fault
>    kern  :alert : Data abort info:
>    kern  :alert :   ISV = 0, ISS = 0x00000004, ISS2 = 0x00000000
>    kern  :alert :   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
>    kern  :alert :   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
>    kern  :alert : user pgtable: 4k pages, 48-bit VAs, pgdp=0000000109c41000
>    kern  :alert : [0000000000000000] pgd=0000000000000000
>    <LAVA_SIGNAL_TESTCASE TEST_CASE_ID=alert RESULT=fail UNITS=lines
>    MEASUREMENT=13>
> 
>    kern  :emerg : Internal error: Oops: 0000000096000004 [#1] SMP
>    kern  :emerg : Code: a90157f3 aa0003f3 f90013f6 f9405c15 (f94002b6)
>    <LAVA_SIGNAL_TESTCASE TEST_CASE_ID=emerg RESULT=fail UNITS=lines
>    MEASUREMENT=2>
> 
> Please let me know if you need full logs or further details to help
> with debugging.
> 
> Thanks,
> Aishwarya

[-- Attachment #2: 0001-scsi-ufs-qcom-Fix-NULL-pointer-dereference-in-ufs_qc.patch --]
[-- Type: text/plain, Size: 3029 bytes --]

From 3f6abf0f5a1ad6dba975824c97c94a77babb9d38 Mon Sep 17 00:00:00 2001
From: Nitin Rawat <quic_nitirawa@quicinc.com>
Date: Sat, 21 Jun 2025 21:40:42 +0530
Subject: [PATCH V1] scsi: ufs: qcom : Fix NULL pointer dereference in
 ufs_qcom_setup_clocks

Fix a NULL pointer dereference in ufs_qcom_setup_clocks due to an
uninitialized 'host' variable. The variable 'phy' is now assigned
after confirming 'host' is not NULL.

Call Stack:

[    6.448070] Unable to handle kernel NULL pointer dereference at
virtual address 0000000000000000
[    6.448449] ufs_qcom_setup_clocks+0x28/0x148 ufs_qcom (P)
[    6.448466] ufshcd_setup_clocks (drivers/ufs/core/ufshcd-priv.h:142)
[    6.448477] ufshcd_init (drivers/ufs/core/ufshcd.c:9468)
[    6.448485] ufshcd_pltfrm_init (drivers/ufs/host/ufshcd-pltfrm.c:504)
[    6.448495] ufs_qcom_probe+0x28/0x68 ufs_qcom
[    6.448508] platform_probe (drivers/base/platform.c:1404)
[    6.448519] really_probe (drivers/base/dd.c:579 drivers/base/dd.c:657)
[    6.448526] __driver_probe_device (drivers/base/dd.c:799)
[    6.448532] driver_probe_device (drivers/base/dd.c:829)
[    6.448539] __driver_attach (drivers/base/dd.c:1216)
[    6.448545] bus_for_each_dev (drivers/base/bus.c:370)
[    6.448556] driver_attach (drivers/base/dd.c:1234)
[    6.448567] bus_add_driver (drivers/base/bus.c:678)
[    6.448577] driver_register (drivers/base/driver.c:249)
[    6.448584] __platform_driver_register (drivers/base/platform.c:868)
[    6.448592] ufs_qcom_pltform_init+0x28/0xff8 ufs_qcom
[    6.448605] do_one_initcall (init/main.c:1274)
[    6.448615] do_init_module (kernel/module/main.c:3041)
[    6.448626] load_module (kernel/module/main.c:3511)
[    6.448635] init_module_from_file (kernel/module/main.c:3704)
[    6.448644] __arm64_sys_finit_module (kernel/module/main.c:3715.

Fixes: 77d2fa54a945 ("scsi: ufs: qcom : Refactor phy_power_on/off calls")
Reported-by: Aishwarya <aishwarya.tcv@arm.com>
Closes: https://lore.kernel.org/lkml/20250620214408.11028-1-aishwarya.tcv@arm.com/
Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Closes: https://lkml.org/lkml/2025/6/21/107
Co-developed-by: Ram Kumar Dwivedi <quic_rdwivedi@quicinc.com>
Signed-off-by: Ram Kumar Dwivedi <quic_rdwivedi@quicinc.com>
Signed-off-by: Nitin Rawat <quic_nitirawa@quicinc.com>
---
 drivers/ufs/host/ufs-qcom.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
index ba4b2880279c..318dca7fe3d7 100644
--- a/drivers/ufs/host/ufs-qcom.c
+++ b/drivers/ufs/host/ufs-qcom.c
@@ -1124,7 +1124,7 @@ static int ufs_qcom_setup_clocks(struct ufs_hba *hba, bool on,
 				 enum ufs_notify_change_status status)
 {
 	struct ufs_qcom_host *host = ufshcd_get_variant(hba);
-	struct phy *phy = host->generic_phy;
+	struct phy *phy;
 	int err;

 	/*
@@ -1135,6 +1135,8 @@ static int ufs_qcom_setup_clocks(struct ufs_hba *hba, bool on,
 	if (!host)
 		return 0;

+	phy = host->generic_phy;
+
 	switch (status) {
 	case PRE_CHANGE:
 		if (on) {
--
2.48.1


  reply	other threads:[~2025-06-21 17:16 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-26 15:38 [PATCH V6 00/10] Refactor ufs phy powerup sequence Nitin Rawat
2025-05-26 15:38 ` [PATCH V6 01/10] scsi: ufs: qcom: Prevent calling phy_exit before phy_init Nitin Rawat
2025-06-22 19:23   ` Abel Vesa
2025-05-26 15:38 ` [PATCH V6 02/10] scsi: ufs: qcom: add a new phy calibrate API call Nitin Rawat
2025-06-22 19:24   ` Abel Vesa
2025-05-26 15:38 ` [PATCH V6 03/10] phy: qcom-qmp-ufs: Rename qmp_ufs_enable and qmp_ufs_power_on Nitin Rawat
2025-05-26 15:38 ` [PATCH V6 04/10] phy: qcom-qmp-ufs: Refactor phy_power_on and phy_calibrate callbacks Nitin Rawat
2025-05-26 15:38 ` [PATCH V6 05/10] phy: qcom-qmp-ufs: Refactor UFS PHY reset Nitin Rawat
2025-05-26 15:38 ` [PATCH V6 06/10] phy: qcom-qmp-ufs: Remove qmp_ufs_com_init() Nitin Rawat
2025-05-26 15:38 ` [PATCH V6 07/10] phy: qcom-qmp-ufs: Rename qmp_ufs_power_off Nitin Rawat
2025-05-26 15:38 ` [PATCH V6 08/10] phy: qcom-qmp-ufs: Remove qmp_ufs_exit() and Inline qmp_ufs_com_exit() Nitin Rawat
2025-05-26 15:38 ` [PATCH V6 09/10] phy: qcom-qmp-ufs: refactor qmp_ufs_power_off Nitin Rawat
2025-05-26 15:38 ` [PATCH V6 10/10] scsi: ufs: qcom : Refactor phy_power_on/off calls Nitin Rawat
2025-06-19 13:53   ` Aishwarya
2025-06-20 14:25     ` Nitin Rawat
2025-06-20 21:44       ` Aishwarya
2025-06-21 17:15         ` Nitin Rawat [this message]
     [not found]           ` <CGME20250626072554eucas1p2ae35c30a96ab1ca61b6a3d6a970708ee@eucas1p2.samsung.com>
2025-06-26  7:25             ` Marek Szyprowski
2025-05-28  2:15 ` [PATCH V6 00/10] Refactor ufs phy powerup sequence Martin K. Petersen
2025-06-04  7:37   ` Nitin Rawat
2025-06-10  1:44     ` Martin K. Petersen
2025-06-15 16:52 ` (subset) " Vinod Koul

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7e362ee3-a237-4583-97fe-69ffc0d1d90d@quicinc.com \
    --to=quic_nitirawa@quicinc.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=aishwarya.tcv@arm.com \
    --cc=andersson@kernel.org \
    --cc=broonie@kernel.org \
    --cc=bvanassche@acm.org \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=kishon@kernel.org \
    --cc=konrad.dybcio@oss.qualcomm.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=martin.petersen@oracle.com \
    --cc=neil.armstrong@linaro.org \
    --cc=quic_cang@quicinc.com \
    --cc=quic_rdwivedi@quicinc.com \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®