From: Kevin Hilman <khilman@baylibre.com>
To: Dhruva Gole <d-gole@ti.com>,
Markus Schneider-Pargmann <msp@baylibre.com>
Cc: Nishanth Menon <nm@ti.com>, Tero Kristo <kristo@kernel.org>,
Santosh Shilimkar <ssantosh@kernel.org>,
Vibhore Vardhan <vibhore@ti.com>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, Dave Gerlach <d-gerlach@ti.com>,
Georgi Vlaev <g-vlaev@ti.com>, Akashdeep Kaur <a-kaur@ti.com>
Subject: Re: [PATCH v9 3/4] firmware: ti_sci: Introduce Power Management Ops
Date: Mon, 12 Aug 2024 14:16:45 -0700 [thread overview]
Message-ID: <7hcymdphky.fsf@baylibre.com> (raw)
In-Reply-To: <20240812054717.6lzkt3lxclzec3zy@lcpd911>
Dhruva Gole <d-gole@ti.com> writes:
> On Aug 09, 2024 at 15:53:46 +0200, Markus Schneider-Pargmann wrote:
>> From: Dave Gerlach <d-gerlach@ti.com>
>>
>> Introduce power management ops supported by the TISCI
>> Low Power Mode API [1].
>>
>> 1) TISCI_MSG_LPM_WAKE_REASON
>> Get which wake up source woke the SoC from Low Power Mode.
>> The wake up source IDs will be common for all K3 platforms.
>>
>> 2) TISCI_MSG_LPM_SET_DEVICE_CONSTRAINT
>> Set LPM constraint on behalf of a device. By setting a constraint, the
>> device ensures that it will not be powered off or reset in the selected
>> mode.
>>
>> 3) TISCI_MSG_LPM_SET_LATENCY_CONSTRAINT
>> Set LPM resume latency constraint. By setting a constraint, the host
>> ensures that the resume time from selected mode will be less than the
>> constraint value.
>>
>> [1] https://software-dl.ti.com/tisci/esd/latest/2_tisci_msgs/pm/lpm.html
>>
>> Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
>> [g-vlaev@ti.com: LPM_WAKE_REASON and IO_ISOLATION support]
>> Signed-off-by: Georgi Vlaev <g-vlaev@ti.com>
>> [a-kaur@ti.com: SET_DEVICE_CONSTRAINT support]
>> Signed-off-by: Akashdeep Kaur <a-kaur@ti.com>
>> [vibhore@ti.com: SET_LATENCY_CONSTRAINT support]
>> Signed-off-by: Vibhore Vardhan <vibhore@ti.com>
>> Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>
>> ---
> [...]
>> diff --git a/drivers/firmware/ti_sci.h b/drivers/firmware/ti_sci.h
>> index 8efe4d0e61fb..9dd40b6711d4 100644
>> --- a/drivers/firmware/ti_sci.h
>> +++ b/drivers/firmware/ti_sci.h
>> @@ -38,7 +38,10 @@
>>
>> /* Low Power Mode Requests */
>> #define TI_SCI_MSG_PREPARE_SLEEP 0x0300
>> +#define TI_SCI_MSG_LPM_WAKE_REASON 0x0306
>> #define TI_SCI_MSG_SET_IO_ISOLATION 0x0307
>> +#define TI_SCI_MSG_LPM_SET_DEVICE_CONSTRAINT 0x0309
>> +#define TI_SCI_MSG_LPM_SET_LATENCY_CONSTRAINT 0x030A
>>
>> /* Resource Management Requests */
>> #define TI_SCI_MSG_GET_RESOURCE_RANGE 0x1500
>> @@ -610,6 +613,73 @@ struct ti_sci_msg_req_set_io_isolation {
>> u8 state;
>> } __packed;
>>
>> +/**
>> + * struct ti_sci_msg_resp_lpm_wake_reason - Response for TI_SCI_MSG_LPM_WAKE_REASON.
>> + *
>> + * @hdr: Generic header.
>> + * @wake_source: The wake up source that woke soc from LPM.
>> + * @wake_timestamp: Timestamp at which soc woke.
>> + *
>> + * Response to a generic message with message type TI_SCI_MSG_LPM_WAKE_REASON,
>> + * used to query the wake up source from low power mode.
>> + */
>> +struct ti_sci_msg_resp_lpm_wake_reason {
>> + struct ti_sci_msg_hdr hdr;
>> + u32 wake_source;
>> + u64 wake_timestamp;
>> +} __packed;
>> +
>
> It looks like we forgot to update the parameters in this API.
> See [1]:
>
> struct tisci_msg_lpm_wake_reason_req
>
> We're missing here the wake_pin, mode and 2 rsvd fields as well.
>
> [1] https://software-dl.ti.com/tisci/esd/latest/2_tisci_msgs/pm/lpm.html#tisci-msg-lpm-wake-reason
>
The docs mention how to interpret the pin, but not the mode. This
driver should translate this mode number to some human-readable state
for better debug messages.
Kevin
next prev parent reply other threads:[~2024-08-12 21:18 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-09 13:53 [PATCH v9 0/4] firmware: ti_sci: Introduce system suspend support Markus Schneider-Pargmann
2024-08-09 13:53 ` [PATCH v9 1/4] firmware: ti_sci: Add support for querying the firmware caps Markus Schneider-Pargmann
2024-08-09 13:53 ` [PATCH v9 2/4] firmware: ti_sci: Add system suspend and resume call Markus Schneider-Pargmann
2024-08-09 13:53 ` [PATCH v9 3/4] firmware: ti_sci: Introduce Power Management Ops Markus Schneider-Pargmann
2024-08-12 5:47 ` Dhruva Gole
2024-08-12 21:16 ` Kevin Hilman [this message]
2024-08-13 3:49 ` Dhruva Gole
2024-08-13 11:21 ` a0230503
2024-08-13 22:19 ` Kevin Hilman
2024-08-09 13:53 ` [PATCH v9 4/4] firmware: ti_sci: add CPU latency constraint management Markus Schneider-Pargmann
2024-08-12 10:11 ` Dhruva Gole
2024-08-12 20:51 ` Kevin Hilman
2024-08-12 5:43 ` [PATCH v9 0/4] firmware: ti_sci: Introduce system suspend support Dhruva Gole
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=7hcymdphky.fsf@baylibre.com \
--to=khilman@baylibre.com \
--cc=a-kaur@ti.com \
--cc=d-gerlach@ti.com \
--cc=d-gole@ti.com \
--cc=g-vlaev@ti.com \
--cc=kristo@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=msp@baylibre.com \
--cc=nm@ti.com \
--cc=ssantosh@kernel.org \
--cc=vibhore@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).