linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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,
	james.quinlan@broadcom.com, Jonathan.Cameron@Huawei.com,
	f.fainelli@gmail.com, etienne.carriere@linaro.org,
	vincent.guittot@linaro.org, souvik.chakravarty@arm.com,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Igor Skalkin <igor.skalkin@opensynergy.com>,
	virtualization@lists.linux-foundation.org
Subject: Re: [PATCH v7 14/16] firmware: arm_scmi: Add atomic mode support to virtio transport
Date: Tue, 18 Jan 2022 15:20:42 +0100	[thread overview]
Message-ID: <25455ab7-344c-10ec-318f-0681b88776ca@opensynergy.com> (raw)
In-Reply-To: <20211220213042.GL6207@e120937-lin>

On 20.12.21 22:30, Cristian Marussi wrote:
> On Fri, Dec 10, 2021 at 01:12:18PM +0100, Peter Hilber wrote:
>> On 29.11.21 20:11, Cristian Marussi wrote:
<snip>
>>> @@ -65,12 +69,22 @@ struct scmi_vio_channel {
>>>   * @input: SDU used for (delayed) responses and notifications
>>>   * @list: List which scmi_vio_msg may be part of
>>>   * @rx_len: Input SDU size in bytes, once input has been received
>>> + * @poll_idx: Last used index registered for polling purposes if this message
>>> + *	      transaction reply was configured for polling.
>>> + *	      Note that virtqueue used index is an unsigned 16-bit.
>>> + * @poll_lock: Protect access to @poll_idx.
>>>   */
>>>  struct scmi_vio_msg {
>>>  	struct scmi_msg_payld *request;
>>>  	struct scmi_msg_payld *input;
>>>  	struct list_head list;
>>>  	unsigned int rx_len;
>>> +#ifdef CONFIG_ARM_SCMI_TRANSPORT_VIRTIO_ATOMIC_ENABLE
>>> +#define VIO_MSG_POLL_DONE	0xffffffffUL
>>
>> virtqueue_enable_cb_prepare() returns an "opaque unsigned value", so
>> this special value should not be used for .poll_idx.
>>
> 
> Yes you are right, but looking at comments in virtqueue_enable_cb_prepare()
> and virtqueue_poll()
> 
> /**
>  * virtqueue_enable_cb_prepare - restart callbacks after disable_cb
>  *
>  * This re-enables callbacks; it returns current queue state
>  * in an opaque unsigned value. This value should be later tested by
>  * virtqueue_poll, to detect a possible race between the driver
>  * checking for more work, and enabling callbacks.
> 
> 
> /**
>  * virtqueue_poll - query pending used buffers
>  * @_vq: the struct virtqueue we're talking about.
>  * @last_used_idx: virtqueue state (from call to virtqueue_enable_cb_prepare).
> 
> ... it seems to me that is exactly how I'm using it, and moreover I
> don't see any other way via the VirtIO API to grab that last_used_idx
> that I need for virtqueu_poll.
> 

I meant to say that the VIO_MSG_POLL_DONE special value should best not be put
into the .poll_idx (since the special value might in theory overlap with an
opaque value). Another variable could hold the special states VIO_MSG_POLL_DONE
and VIO_MSG_NOT_POLLED.

  reply	other threads:[~2022-01-18 14:32 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-29 19:11 [PATCH v7 00/16] Introduce atomic support for SCMI transports Cristian Marussi
2021-11-29 19:11 ` [PATCH v7 01/16] firmware: arm_scmi: Perform earlier cinfo lookup call in do_xfer Cristian Marussi
2021-11-29 19:11 ` [PATCH v7 02/16] firmware: arm_scmi: Set polling timeout to max_rx_timeout_ms Cristian Marussi
2021-12-03 20:13   ` Florian Fainelli
2021-12-13 11:06   ` Sudeep Holla
2021-11-29 19:11 ` [PATCH v7 03/16] firmware: arm_scmi: Refactor message response path Cristian Marussi
2021-11-29 19:11 ` [PATCH v7 04/16] include: trace: Add new scmi_xfer_response_wait event Cristian Marussi
2021-12-03 20:16   ` Florian Fainelli
2021-11-29 19:11 ` [PATCH v7 05/16] firmware: arm_scmi: Use new trace event scmi_xfer_response_wait Cristian Marussi
2021-12-03 20:16   ` Florian Fainelli
2021-11-29 19:11 ` [PATCH v7 06/16] firmware: arm_scmi: Add configurable polling mode for transports Cristian Marussi
2021-12-13 11:25   ` Sudeep Holla
2021-12-14 10:49     ` Cristian Marussi
2021-11-29 19:11 ` [PATCH v7 07/16] firmware: arm_scmi: Make smc transport use common completions Cristian Marussi
2021-11-29 19:11 ` [PATCH v7 08/16] firmware: arm_scmi: Add sync_cmds_atomic_replies transport flag Cristian Marussi
2021-12-13 11:54   ` Sudeep Holla
2021-12-14 10:52     ` Cristian Marussi
2021-11-29 19:11 ` [PATCH v7 09/16] firmware: arm_scmi: Make smc support atomic sync commands replies Cristian Marussi
2021-11-29 19:11 ` [PATCH v7 10/16] firmware: arm_scmi: Make optee " Cristian Marussi
2021-11-29 19:11 ` [PATCH v7 11/16] firmware: arm_scmi: Add support for atomic transports Cristian Marussi
2021-11-29 19:11 ` [PATCH v7 12/16] firmware: arm_scmi: Add atomic mode support to smc transport Cristian Marussi
2021-12-13 11:42   ` Sudeep Holla
2021-12-14 10:54     ` Cristian Marussi
2021-11-29 19:11 ` [PATCH v7 13/16] firmware: arm_scmi: Add new parameter to mark_txdone Cristian Marussi
2021-12-03 20:17   ` Florian Fainelli
2021-11-29 19:11 ` [PATCH v7 14/16] firmware: arm_scmi: Add atomic mode support to virtio transport Cristian Marussi
2021-12-10 12:12   ` Peter Hilber
2021-12-20 21:30     ` Cristian Marussi
2022-01-18 14:20       ` Peter Hilber [this message]
2021-12-13 11:34   ` Sudeep Holla
2021-12-14 10:56     ` Cristian Marussi
2021-11-29 19:11 ` [PATCH v7 15/16] firmware: arm_scmi: Add atomic support to clock protocol Cristian Marussi
2021-12-03 20:16   ` Florian Fainelli
2021-11-29 19:11 ` [PATCH v7 16/16] clk: scmi: Support atomic clock enable/disable API Cristian Marussi
2021-12-03  2:06   ` Stephen Boyd
2021-12-03 20:17   ` Florian Fainelli
2021-12-10 10:52   ` Vincent Guittot
2021-12-10 13:30     ` Cristian Marussi
2021-12-10 14:27       ` Vincent Guittot
2021-12-10 19:36         ` Cristian Marussi
2021-12-13 17:52 ` [PATCH v7 00/16] (subset) Introduce atomic support for SCMI transports Sudeep Holla

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=25455ab7-344c-10ec-318f-0681b88776ca@opensynergy.com \
    --to=peter.hilber@opensynergy.com \
    --cc=Jonathan.Cameron@Huawei.com \
    --cc=cristian.marussi@arm.com \
    --cc=etienne.carriere@linaro.org \
    --cc=f.fainelli@gmail.com \
    --cc=igor.skalkin@opensynergy.com \
    --cc=james.quinlan@broadcom.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=souvik.chakravarty@arm.com \
    --cc=sudeep.holla@arm.com \
    --cc=vincent.guittot@linaro.org \
    --cc=virtualization@lists.linux-foundation.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;
as well as URLs for NNTP newsgroup(s).