From: Georgi Vlaev <g-vlaev@ti.com>
To: Nishanth Menon <nm@ti.com>
Cc: Tero Kristo <kristo@kernel.org>,
Santosh Shilimkar <ssantosh@kernel.org>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>, <devicetree@vger.kernel.org>,
Vibhore Vardhan <vibhore@ti.com>,
Vignesh Raghavendra <vigneshr@ti.com>,
Roger Quadros <rogerq@kernel.org>
Subject: Re: [PATCH v4 3/5] firmware: ti_sci: Allocate memory for the LPM modes
Date: Mon, 21 Nov 2022 23:45:35 +0200 [thread overview]
Message-ID: <2558a8fd-68c0-1a3e-61d1-57d032024f5f@ti.com> (raw)
In-Reply-To: <20221121184435.btehz6dzliz3lizk@scuba>
Hi Nishanth,
On 11/21/22 20:44, Nishanth Menon wrote:
> On 20:13-20221116, Georgi Vlaev wrote:
> [...]
>
>> +static int ti_sci_init_suspend(struct platform_device *pdev,
>> + struct ti_sci_info *info)
>> +{
>> + struct device *dev = &pdev->dev;
>> + int ret;
>> +
>> + dma_set_mask_and_coherent(dev, DMA_BIT_MASK(64));
>> + info->ctx_mem_buf = dma_alloc_coherent(info->dev, LPM_CTX_MEM_SIZE,
>> + &info->ctx_mem_addr,
>> + GFP_KERNEL);
>> + if (!info->ctx_mem_buf) {
>> + dev_err(info->dev, "Failed to allocate LPM context memory\n");
>> + return -ENOMEM;
>> + }
>> +
>> + /*
>> + * Attempt to call prepare_sleep, this will be NAK'd if suspend is not
>> + * supported by firmware in use, in which case we will not attempt to
>> + * init suspend.
>> + */
>> + ret = ti_sci_cmd_prepare_sleep(&info->handle, 0,
>> + (u32)(info->ctx_mem_addr & 0xffffffff),
>> + (u32)((u64)info->ctx_mem_addr >> 32), 0);
>> +
>> + if (ret)
>> + goto err;
>> +
>> + return 0;
>> +err:
>> + dma_free_coherent(info->dev, LPM_CTX_MEM_SIZE,
>> + info->ctx_mem_buf,
>> + info->ctx_mem_addr);
>> + return ret;
>> +}
>> +
>> /* Description for K2G */
>> static const struct ti_sci_desc ti_sci_pmmc_k2g_desc = {
>> .default_host_id = 2,
>> @@ -3639,6 +3682,14 @@ static int ti_sci_probe(struct platform_device *pdev)
>> }
>> }
>>
>> + ret = ti_sci_init_suspend(pdev, info);
>> + if (ret)
>> + dev_warn(dev,
>> + "ti_sci_init_suspend failed, mem suspend will be non-functional.\n");
>> +
>> + /* Suspend is an optional feature, reset return value and continue. */
>> + ret = 0;
>
> We end up getting this warning on all platforms with TISCI - even if
> LPM sequence is capable or not - what does the message mean? firmware is
> not capable of supporting sleep or it is a firmware capable of
> supporting, but failed to allocate LPM context memory?
>
> If it is optional (since it is probing to see if it has functionality),
> then do we need a dev_warn - maybe a softer of form?
>
Yeah, I agree, the message looks confusing. In both cases we can't enter suspend-to-ram,
but we consider that an optional feature, so a softer message will be more appropriate.
> [...]
>
--
Regards,
Georgi
next prev parent reply other threads:[~2022-11-21 21:46 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-16 18:13 [PATCH v4 0/5] firmware: ti_sci: Introduce system suspend support Georgi Vlaev
2022-11-16 18:13 ` [PATCH v4 1/5] dt-bindings: ti, sci: Add lpm region and firmware-name Georgi Vlaev
2022-11-18 12:59 ` Krzysztof Kozlowski
2022-11-21 22:26 ` Georgi Vlaev
2022-11-16 18:13 ` [PATCH v4 2/5] firmware: ti_sci: Introduce Power Management Ops Georgi Vlaev
2022-11-16 18:13 ` [PATCH v4 3/5] firmware: ti_sci: Allocate memory for the LPM modes Georgi Vlaev
2022-11-21 18:44 ` Nishanth Menon
2022-11-21 21:45 ` Georgi Vlaev [this message]
2022-11-21 18:56 ` Nishanth Menon
2022-11-21 22:03 ` Georgi Vlaev
2022-11-16 18:13 ` [PATCH v4 4/5] firmware: ti_sci: Use dt provided fw name and address to load at suspend time Georgi Vlaev
2022-11-16 18:13 ` [PATCH v4 5/5] firmware: ti_sci: Introduce prepare system suspend call Georgi Vlaev
2022-11-23 12:58 ` Roger Quadros
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=2558a8fd-68c0-1a3e-61d1-57d032024f5f@ti.com \
--to=g-vlaev@ti.com \
--cc=devicetree@vger.kernel.org \
--cc=kristo@kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nm@ti.com \
--cc=robh+dt@kernel.org \
--cc=rogerq@kernel.org \
--cc=ssantosh@kernel.org \
--cc=vibhore@ti.com \
--cc=vigneshr@ti.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;
as well as URLs for NNTP newsgroup(s).