mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
To: Yuvaraj Ranganathan <quic_yrangana@quicinc.com>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konradybcio@kernel.org>
Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1] soc: qcom: ice: Prevent UFS probe deferral on ICE probe failure
Date: Thu, 5 Dec 2024 18:24:52 +0100	[thread overview]
Message-ID: <5255398f-cc9d-4f85-8433-d6a4183dc449@oss.qualcomm.com> (raw)
In-Reply-To: <20241203024005.391654-1-quic_yrangana@quicinc.com>

On 3.12.2024 3:40 AM, Yuvaraj Ranganathan wrote:
> When the ICE key programming interface is unavailable, the ice create
> function fails, causing the probe to set NULL as the driver data. As a 
> result, when the UFS driver reads the ICE driver data and encounters a 
> NULL, leading to the deferral of the UFS probe and preventing the device
> from booting to the shell.
> 
> To address this issue, modify the behavior to return an "operation not
> supported" error when the ICE key programming interface is unavailable.
> Additionally, mark this error in a global variable. When the UFS driver
> attempts to read the ICE driver data, it will check for this error and
> return it, rather than deferring the probe.
> 
> Signed-off-by: Yuvaraj Ranganathan <quic_yrangana@quicinc.com>
> ---
>  drivers/soc/qcom/ice.c | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/soc/qcom/ice.c b/drivers/soc/qcom/ice.c
> index 393d2d1d275f..160916cb8fb0 100644
> --- a/drivers/soc/qcom/ice.c
> +++ b/drivers/soc/qcom/ice.c
> @@ -41,6 +41,8 @@
>  #define qcom_ice_readl(engine, reg)	\
>  	readl((engine)->base + (reg))
>  
> +static bool qcom_ice_create_error;

So you could drop this..

> +
>  struct qcom_ice {
>  	struct device *dev;
>  	void __iomem *base;
> @@ -215,7 +217,7 @@ static struct qcom_ice *qcom_ice_create(struct device *dev,
>  
>  	if (!qcom_scm_ice_available()) {
>  		dev_warn(dev, "ICE SCM interface not found\n");
> -		return NULL;
> +		return ERR_PTR(-EOPNOTSUPP);
>  	}
>  
>  	engine = devm_kzalloc(dev, sizeof(*engine), GFP_KERNEL);
> @@ -303,6 +305,9 @@ struct qcom_ice *of_qcom_ice_get(struct device *dev)
>  		return ERR_PTR(-EPROBE_DEFER);
>  	}
>  
> +	if (qcom_ice_create_error)
> +		return ERR_PTR(-EOPNOTSUPP);
> +
>  	ice = platform_get_drvdata(pdev);
>  	if (!ice) {

..and check for || IS_ERR(ice) here

if I'm reading things right

Konrad

  reply	other threads:[~2024-12-05 17:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-03  2:40 Yuvaraj Ranganathan
2024-12-05 17:24 ` Konrad Dybcio [this message]
2024-12-23  9:20   ` Yuvaraj Ranganathan
2024-12-23 11:53     ` Konrad Dybcio
2024-12-26 21:39 ` Bjorn Andersson

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=5255398f-cc9d-4f85-8433-d6a4183dc449@oss.qualcomm.com \
    --to=konrad.dybcio@oss.qualcomm.com \
    --cc=andersson@kernel.org \
    --cc=konradybcio@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=quic_yrangana@quicinc.com \
    /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®