From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Bjorn Andersson <andersson@kernel.org>,
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 3/6] firmware: qcom: scm: Handle various probe ordering for qcom_scm_assign_mem()
Date: Wed, 20 Nov 2024 15:19:00 +0100 [thread overview]
Message-ID: <a5343627-a325-465e-b744-747d4c1b2cae@linaro.org> (raw)
In-Reply-To: <CAMRc=Me=Eu6+SpdguKurWgQDrpuo4qTCwWO6GfzS=YuA9vUzOw@mail.gmail.com>
On 20/11/2024 15:07, Bartosz Golaszewski 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;
>> +
>
> Should we be returning -EPROBE_DEFER from functions that are not
> necessarily limited to being used in probe()? For instance ath10k uses
> it in a workqueue job. I think this is why this driver is probed in
> subsys_initcall() rather than module_initcall().
Uh, good point. To my understanding, every resource like function can do
it, e.g. clk_get. Whether drivers call it in probe() or somewhere else -
e.g. some startup call like there is plenty in the ASoC or DMA
device_alloc_chan_resources() - is responsibility of the
driver/consumer, not the provider of that resource.
With such explanation returning EPROBE_DEFER is ok, just like returning
anything else (e.g. EINVAL).
Now about this function: it is not exactly "get a resource" one, but
still the caller might want to call it again later, which is implied by
EPROBE_DEFER. Maybe this should be EAGAIN instead? Just like
power-supply is doing in power_supply_get_property().
Best regards,
Krzysztof
next prev parent reply other threads:[~2024-11-20 14:19 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-19 18:33 [PATCH 0/6] firmware: qcom: scm: Fixes for concurrency Krzysztof Kozlowski
2024-11-19 18:33 ` [PATCH 1/6] firmware: qcom: scm: Fix missing read barrier in qcom_scm_is_available() Krzysztof Kozlowski
2024-11-20 10:51 ` Bartosz Golaszewski
2024-11-19 18:33 ` [PATCH 2/6] firmware: qcom: scm: Fix missing read barrier in qcom_scm_get_tzmem_pool() Krzysztof Kozlowski
2024-11-19 18:45 ` Krzysztof Kozlowski
2024-11-19 18:33 ` [PATCH 3/6] firmware: qcom: scm: Handle various probe ordering for qcom_scm_assign_mem() Krzysztof Kozlowski
2024-11-20 14:07 ` Bartosz Golaszewski
2024-11-20 14:19 ` Krzysztof Kozlowski [this message]
2024-11-20 14:21 ` Krzysztof Kozlowski
2024-11-27 4:45 ` Bjorn Andersson
2024-11-19 18:33 ` [PATCH RFC/RFT 4/6] firmware: qcom: scm: Cleanup global '__scm' on probe failures Krzysztof Kozlowski
2024-11-19 19:37 ` Krzysztof Kozlowski
2024-11-28 20:25 ` Konrad Dybcio
2024-11-19 18:33 ` [PATCH 5/6] firmware: qcom: scm: smc: Handle missing SCM device Krzysztof Kozlowski
2024-11-19 18:33 ` [PATCH 6/6] firmware: qcom: scm: smc: Narrow 'mempool' variable scope Krzysztof Kozlowski
2024-11-20 11:06 ` Bartosz Golaszewski
2024-11-20 11:13 ` [PATCH 0/6] firmware: qcom: scm: Fixes for concurrency Dmitry Baryshkov
2024-11-20 16:20 ` neil.armstrong
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=a5343627-a325-465e-b744-747d4c1b2cae@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=brgl@bgdev.pl \
--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