Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
From: Varadarajan Narayanan <quic_varada@quicinc.com>
To: Konrad Dybcio <konrad.dybcio@linaro.org>
Cc: <robh@kernel.org>, <krzk+dt@kernel.org>, <conor+dt@kernel.org>,
	<andersson@kernel.org>, <mturquette@baylibre.com>,
	<sboyd@kernel.org>, <ilia.lin@kernel.org>, <rafael@kernel.org>,
	<viresh.kumar@linaro.org>, <ulf.hansson@linaro.org>,
	<quic_sibis@quicinc.com>, <quic_rjendra@quicinc.com>,
	<danila@jiaxyga.com>, <neil.armstrong@linaro.org>,
	<otto.pflueger@abscue.de>, <abel.vesa@linaro.org>,
	<luca@z3ntu.xyz>, <geert+renesas@glider.be>,
	<stephan.gerhold@kernkonzept.com>,
	<linux-arm-msm@vger.kernel.org>, <devicetree@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <linux-pm@vger.kernel.org>,
	<linux-clk@vger.kernel.org>
Subject: Re: [PATCH v6 1/9] soc: qcom: cpr3: Fix 'acc_desc' usage
Date: Wed, 10 Jul 2024 16:40:31 +0530	[thread overview]
Message-ID: <Zo5sJ1Uk7wAzWflg@hu-varada-blr.qualcomm.com> (raw)
In-Reply-To: <325a45b7-bb02-4a32-8590-6abc14ad9619@linaro.org>

On Wed, Jul 10, 2024 at 01:05:12PM +0200, Konrad Dybcio wrote:
> On 10.07.2024 8:10 AM, Varadarajan Narayanan wrote:
> > cpr3 code assumes that 'acc_desc' is available for SoCs
> > implementing CPR version 4 or less. However, IPQ9574 SoC
> > implements CPRv4 without ACC. This causes NULL pointer accesses
> > resulting in crashes. Hence, check if 'acc_desc' is populated
> > before using it.
> >
> > Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com>
> > ---
>
> Does it not work if you drop this patch?
>
> In v15, drv->tcsr is left NULL (from kzalloc), unless data->acc_desc
> is present

It crashed for me with NULL pointer access.

	Unable to handle kernel NULL pointer dereference at virtual address 0000000000000010
	input: gpio-keys as /devices/platform/gpio-keys/input/input0
	Mem abort info:
	  ESR = 0x0000000096000004
	  EC = 0x25: DABT (current EL), IL = 32 bits
	  SET = 0, FnV = 0
	  EA = 0, S1PTW = 0
	clk: Disabling unused clocks
	  FSC = 0x04: level 0 translation fault
	Data abort info:
	  ISV = 0, ISS = 0x00000004, ISS2 = 0x00000000
	  CM = 0, WnR = 0, TnD = 0, TagAccess = 0
	PM: genpd: Disabling unused power domains
	  GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
	[0000000000000010] user address but active_mm is swapper
	Internal error: Oops: 0000000096000004 [#1] PREEMPT SMP
	Modules linked in:
	CPU: 0 UID: 0 PID: 74 Comm: sugov:0 Not tainted 6.10.0-rc6-next-20240703-00018-g3dfa5a2e6f31-dirty #13
	Hardware name: Qualcomm Technologies, Inc. IPQ9574/AP-AL02-C7 (DT)
	pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
	pc : cpr_commit_state+0x228/0x2a8
	lr : cpr_commit_state+0x10c/0x2a8
	sp : ffff800086163a90
	x29: ffff800086163a90 x28: 0000000000000000 x27: 0000000000000000
	x26: 0000000000000000 x25: ffff000006953080 x24: ffff000006913280
	x23: 00000000000fa3e8 x22: 00000000000fa3e8 x21: 00000000000fa3e8
	x20: 0000000000000003 x19: 00000000000fa3e8 x18: 0000000000000000
	x17: 63682d6963687820 x16: 0000000000000000 x15: ffff00003fc8fd00
	x14: 0000000000000000 x13: 0000000000000001 x12: ffff8000814e8c60
	x11: 0000000000000000 x10: 00000000000009b0 x9 : 0000000000000000
	x8 : ffff00003fc87f40 x7 : 0000000000000240 x6 : 0000000000000002
	x5 : 000000000000007f x4 : 0000000000000000 x3 : 0000000000000000
	x2 : 0000000000000000 x1 : 0000000000000000 x0 : 0000000000000000
	Call trace:
	 cpr_commit_state+0x228/0x2a8
	 cpr_set_performance_state+0x94/0xf4
	 _genpd_set_performance_state+0x190/0x1ac
	 genpd_set_performance_state.isra.0+0xbc/0xdc
	 genpd_dev_pm_set_performance_state+0x60/0xc0
	 dev_pm_domain_set_performance_state+0x24/0x3c
	 _set_opp+0xb4/0x51c
	 dev_pm_opp_set_opp+0x70/0xfc
	 _set_required_opps.isra.0+0x74/0xd4
	 _set_opp+0x90/0x51c
	 dev_pm_opp_set_rate+0x184/0x274
	 set_target+0x34/0x40
	 __cpufreq_driver_target+0x250/0x698
	 sugov_work+0x54/0x70
	 kthread_worker_fn+0xc4/0x174
	 kthread+0x110/0x114
	 ret_from_fork+0x10/0x20

Thanks
Varada

  reply	other threads:[~2024-07-10 11:10 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-10  6:10 [PATCH v6 0/9] Enable CPR for IPQ9574 Varadarajan Narayanan
2024-07-10  6:10 ` [PATCH v6 1/9] soc: qcom: cpr3: Fix 'acc_desc' usage Varadarajan Narayanan
2024-07-10 11:05   ` Konrad Dybcio
2024-07-10 11:10     ` Varadarajan Narayanan [this message]
2024-07-10  6:10 ` [PATCH v6 2/9] cpufreq: qcom-nvmem: Add support for IPQ9574 Varadarajan Narayanan
2024-07-10 11:05   ` Konrad Dybcio
2024-07-10  6:10 ` [PATCH v6 3/9] dt-bindings: power: rpmpd: Add IPQ9574 power domains Varadarajan Narayanan
2024-07-10  6:10 ` [PATCH v6 4/9] dt-bindings: soc: qcom: cpr3: Add bindings for IPQ9574 Varadarajan Narayanan
2024-07-10  6:10 ` [PATCH v6 5/9] pmdomain: qcom: rpmpd: Add IPQ9574 power domains Varadarajan Narayanan
2024-07-16 12:15   ` Konrad Dybcio
2024-07-17  9:14     ` Varadarajan Narayanan
2024-07-24  4:32       ` Varadarajan Narayanan
2024-07-24 17:26         ` Dmitry Baryshkov
2024-08-05 10:32           ` Ulf Hansson
2024-08-20  6:19             ` Varadarajan Narayanan
2024-07-10  6:10 ` [PATCH v6 6/9] dt-bindings: clock: Add CPR clock defines for IPQ9574 Varadarajan Narayanan
2024-07-10  6:11 ` [PATCH v6 7/9] clk: qcom: gcc-ipq9574: Add CPR clock definition Varadarajan Narayanan
2024-07-10  6:11 ` [PATCH v6 8/9] soc: qcom: cpr3: Add IPQ9574 definitions Varadarajan Narayanan
2024-07-10 11:12   ` Konrad Dybcio
2024-07-11  4:58     ` Varadarajan Narayanan
2024-07-10  6:11 ` [PATCH v6 9/9] arm64: dts: qcom: ipq9574: Enable CPR Varadarajan Narayanan

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=Zo5sJ1Uk7wAzWflg@hu-varada-blr.qualcomm.com \
    --to=quic_varada@quicinc.com \
    --cc=abel.vesa@linaro.org \
    --cc=andersson@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=danila@jiaxyga.com \
    --cc=devicetree@vger.kernel.org \
    --cc=geert+renesas@glider.be \
    --cc=ilia.lin@kernel.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=luca@z3ntu.xyz \
    --cc=mturquette@baylibre.com \
    --cc=neil.armstrong@linaro.org \
    --cc=otto.pflueger@abscue.de \
    --cc=quic_rjendra@quicinc.com \
    --cc=quic_sibis@quicinc.com \
    --cc=rafael@kernel.org \
    --cc=robh@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=stephan.gerhold@kernkonzept.com \
    --cc=ulf.hansson@linaro.org \
    --cc=viresh.kumar@linaro.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