From: Peter Hilber <peter.hilber@opensynergy.com>
To: Cristian Marussi <cristian.marussi@arm.com>
Cc: <linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>, <sudeep.holla@arm.com>,
<lukasz.luba@arm.com>, <james.quinlan@broadcom.com>,
<Jonathan.Cameron@Huawei.com>, <egranata@google.com>,
<jbhayana@google.com>, <mikhail.golubev@opensynergy.com>,
<Igor.Skalkin@opensynergy.com>
Subject: Re: [PATCH v2 4/6] firmware: arm_scmi: add SCMIv3.0 Sensors timestamped reads
Date: Tue, 10 Nov 2020 18:14:44 +0100 [thread overview]
Message-ID: <0c9edbcb-2a7c-d564-f0be-2f48f64e1854@opensynergy.com> (raw)
In-Reply-To: <20201110170429.GD42652@e120937-lin>
On 10.11.20 18:04, Cristian Marussi wrote:
> Hi Peter
>
> thanks for the review.
>
> On Tue, Nov 10, 2020 at 05:01:26PM +0100, Peter Hilber wrote:
>> On 26.10.20 21:10, Cristian Marussi wrote:
>>> Add new .reading_get_timestamped() method to sensor_ops to support SCMIv3.0
>>> timestamped reads.
>>>
>>> Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
>>> ---
>>> drivers/firmware/arm_scmi/sensors.c | 134 ++++++++++++++++++++++++++--
>>> include/linux/scmi_protocol.h | 22 +++++
>>> 2 files changed, 151 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/drivers/firmware/arm_scmi/sensors.c b/drivers/firmware/arm_scmi/sensors.c
>>> index 5a18f8c84bef..bdb0ed0df683 100644
>>> --- a/drivers/firmware/arm_scmi/sensors.c
>>> +++ b/drivers/firmware/arm_scmi/sensors.c
>>> @@ -156,6 +156,27 @@ struct scmi_msg_sensor_reading_get {
>>> #define SENSOR_READ_ASYNC BIT(0)
>>> };
>>>
>>> +struct scmi_resp_sensor_reading_get {
>>> + __le64 readings;
>>> +};
>>> +
>>> +struct scmi_resp_sensor_reading_complete {
>>> + __le32 id;
>>> + __le64 readings;
>>> +};
>>
>> In my understanding the id field is not present in the spec. The
>> implementation seems to have introduced it already before this patch.
>>
>
> Well, it is indeed defined in 4.7.3.1 "SENSOR_READING_COMPLETE" both in
> SCMI V3.0 and in V2.0: it is the async delayed response and this 'id'
> represents the sensor_id: in fact it is used only the in the async path
> in the reading funcs; the sync version uses directly sensor_reading_le.
> (which has no id n it)
You are right, sorry for the noise.
>>> +/**
>>> + * scmi_sensor_reading_get - Read scalar sensor value
>>> + * @handle: Platform handle
>>> + * @sensor_id: Sensor ID
>>> + * @value: The 64bit value sensor reading
>>> + *
>>> + * This function returns a single 64 bit reading value representing the sensor
>>> + * value; if the platform SCMI Protocol implementation and the sensor support
>>> + * multiple axis and timestamped-reads, this just returns the first axis while
>>> + * dropping the timestamp value.
>>> + * Use instead the @scmi_sensor_reading_get_timestamped to retrieve the array of
>>> + * timestamped multi-axis values.
>>> + *
>>> + * Return: 0 on Success
>>> + */
>>> static int scmi_sensor_reading_get(const struct scmi_handle *handle,
>>> u32 sensor_id, u64 *value)
>>> {
>>> @@ -593,18 +629,105 @@ static int scmi_sensor_reading_get(const struct scmi_handle *handle,
>>
>> How about changing the scmi_xfer_get_init() rx_size to 0 (in the
>> immediately preceding, not shown lines)? An SCMI platform might not
>> expect to just have room for the first reading, excluding the timestamp.
>>
>
> Ah right, because this is the old v2.0 interface which I kept unchanged but
> now internally the same v3.0 SENSOR_READING_GET message on a v3.0 platform
> could return multiple per-axis timestamped values even if I just return
> the first u64 without timestamp. Is this that you mean ?
Yes.
Best regards,
Peter
next prev parent reply other threads:[~2020-11-10 17:14 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-26 20:10 [PATCH v2 0/6] SCMIv3.0 Sensor Extensions Cristian Marussi
2020-10-26 20:10 ` [PATCH v2 1/6] firmware: arm_scmi: rework scmi_sensors_protocol_init Cristian Marussi
2020-10-26 20:10 ` [PATCH v2 2/6] firmware: arm_scmi: add SCMIv3.0 Sensors descriptors extensions Cristian Marussi
2020-11-10 16:00 ` Mailing Lists
2020-11-10 17:21 ` Cristian Marussi
2020-11-10 17:50 ` Peter Hilber
2020-11-10 19:19 ` Cristian Marussi
2020-10-26 20:10 ` [PATCH v2 3/6] hwmon: scmi: update hwmon internal scale data type Cristian Marussi
2020-10-26 20:10 ` [PATCH v2 4/6] firmware: arm_scmi: add SCMIv3.0 Sensors timestamped reads Cristian Marussi
2020-11-10 16:01 ` Peter Hilber
2020-11-10 17:04 ` Cristian Marussi
2020-11-10 17:14 ` Peter Hilber [this message]
2020-10-26 20:10 ` [PATCH v2 5/6] firmware: arm_scmi: add SCMIv3.0 Sensor configuration support Cristian Marussi
2020-10-26 20:10 ` [PATCH v2 6/6] firmware: arm_scmi: add SCMIv3.0 Sensor notifications Cristian Marussi
2020-11-10 16:01 ` Peter Hilber
2020-11-10 17:09 ` Cristian Marussi
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=0c9edbcb-2a7c-d564-f0be-2f48f64e1854@opensynergy.com \
--to=peter.hilber@opensynergy.com \
--cc=Igor.Skalkin@opensynergy.com \
--cc=Jonathan.Cameron@Huawei.com \
--cc=cristian.marussi@arm.com \
--cc=egranata@google.com \
--cc=james.quinlan@broadcom.com \
--cc=jbhayana@google.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lukasz.luba@arm.com \
--cc=mikhail.golubev@opensynergy.com \
--cc=sudeep.holla@arm.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®