mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Bjorn Andersson <andersson@kernel.org>
Cc: Konrad Dybcio <konradybcio@kernel.org>,
	Mukesh Ojha <quic_mojha@quicinc.com>,
	Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
	Stephan Gerhold <stephan.gerhold@linaro.org>,
	Bartosz Golaszewski <bartosz.golaszewski@linaro.org>,
	Kuldeep Singh <quic_kuldsing@quicinc.com>,
	Elliot Berman <quic_eberman@quicinc.com>,
	Andrew Halaney <ahalaney@redhat.com>,
	Avaneesh Kumar Dwivedi <quic_akdwived@quicinc.com>,
	Andy Gross <andy.gross@linaro.org>,
	linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 3/6] firmware: qcom: scm: Handle various probe ordering for qcom_scm_assign_mem()
Date: Wed, 8 Jan 2025 12:12:51 +0100	[thread overview]
Message-ID: <b0db7570-5606-401f-bf1a-dd1076d2dc52@linaro.org> (raw)
In-Reply-To: <o5oz3scbvsvutv43uqgh74xzfxituzieaa57o6mzomdyr3qixo@2j4ogsbu255o>

On 07/01/2025 01:42, Bjorn Andersson wrote:
>>
>> diff --git a/drivers/firmware/qcom/qcom_scm.c b/drivers/firmware/qcom/qcom_scm.c
>> index 5d91b8e22844608f35432f1ba9c08d477d4ff762..93212c8f20ad65ecc44804b00f4b93e3eaaf8d95 100644
>> --- a/drivers/firmware/qcom/qcom_scm.c
>> +++ b/drivers/firmware/qcom/qcom_scm.c
>> @@ -1075,6 +1075,9 @@ int qcom_scm_assign_mem(phys_addr_t mem_addr, size_t mem_sz,
>>  	int ret, i, b;
>>  	u64 srcvm_bits = *srcvm;
>>  
>> +	if (!qcom_scm_is_available())
>> +		return -EPROBE_DEFER;
> 
> This API is generally called from places other than probe, making the
> return of EPROBE_DEFER undesirable. While not pretty, a client depending
> on the scm driver to be probed is expected to call
> qcom_scm_is_available().
> 
> qcom_rmtfs_mem_probe() does this right before calling
> qcom_scm_assign_mem(), am I misunderstanding the case you're describing?

I tried to reproduce my NULL ptr but now I cannot and indeed if every
path is protected with qcom_scm_is_available() everything should be fine.

Let's skip this patch then.

Best regards,
Krzysztof

  reply	other threads:[~2025-01-08 11:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-09 14:27 [PATCH v2 0/6] firmware: qcom: scm: Fixes for concurrency Krzysztof Kozlowski
2024-12-09 14:27 ` [PATCH v2 1/6] firmware: qcom: scm: Fix missing read barrier in qcom_scm_is_available() Krzysztof Kozlowski
2024-12-09 14:27 ` [PATCH v2 2/6] firmware: qcom: scm: Fix missing read barrier in qcom_scm_get_tzmem_pool() Krzysztof Kozlowski
2024-12-09 14:27 ` [PATCH v2 3/6] firmware: qcom: scm: Handle various probe ordering for qcom_scm_assign_mem() Krzysztof Kozlowski
2024-12-09 20:25   ` Bartosz Golaszewski
2025-01-07  0:42   ` Bjorn Andersson
2025-01-08 11:12     ` Krzysztof Kozlowski [this message]
2024-12-09 14:27 ` [PATCH v2 4/6] firmware: qcom: scm: Cleanup global '__scm' on probe failures Krzysztof Kozlowski
2024-12-09 14:27 ` [PATCH v2 5/6] firmware: qcom: scm: smc: Handle missing SCM device Krzysztof Kozlowski
2024-12-09 15:14   ` Bartosz Golaszewski
2024-12-09 14:27 ` [PATCH v2 6/6] firmware: qcom: scm: smc: Narrow 'mempool' variable scope Krzysztof Kozlowski
2025-01-07 16:38 ` (subset) [PATCH v2 0/6] firmware: qcom: scm: Fixes for concurrency 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=b0db7570-5606-401f-bf1a-dd1076d2dc52@linaro.org \
    --to=krzysztof.kozlowski@linaro.org \
    --cc=ahalaney@redhat.com \
    --cc=andersson@kernel.org \
    --cc=andy.gross@linaro.org \
    --cc=bartosz.golaszewski@linaro.org \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=konradybcio@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=quic_akdwived@quicinc.com \
    --cc=quic_eberman@quicinc.com \
    --cc=quic_kuldsing@quicinc.com \
    --cc=quic_mojha@quicinc.com \
    --cc=stephan.gerhold@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

all inboxes | Powered by JetHome®