From: Cornelia Huck <cohuck@redhat.com>
To: Jason Wang <jasowang@redhat.com>
Cc: virtio@lists.oasis-open.org, virtio-comment@lists.oasis-open.org,
Halil Pasic <pasic@linux.ibm.com>
Subject: [virtio] Re: [PATCH] ccw: clarify device reset
Date: Tue, 12 Oct 2021 13:16:45 +0200 [thread overview]
Message-ID: <87sfx6wl0i.fsf@redhat.com> (raw)
In-Reply-To: <CACGkMEtb8P76pu0VM+B-Dt1BMi1edxv18BmAN0S6Z6_vHLHKSA@mail.gmail.com>
On Tue, Oct 12 2021, Jason Wang <jasowang@redhat.com> wrote:
> On Mon, Oct 11, 2021 at 7:38 PM Cornelia Huck <cohuck@redhat.com> wrote:
>>
>> Unlike other transports, a reset triggered by the driver is actually
>> complete once the command has been completed. Make this behaviour
>> and the requirements more explicit.
>>
>> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
>> ---
>>
>> We have discussed this before while talking about reset behaviour,
>> but I don't remember sending an actual patch.
>>
>> If this looks good, I'll open an issue.
>>
>> ---
>> conformance.tex | 2 ++
>> content.tex | 22 +++++++++++++++++++++-
>> 2 files changed, 23 insertions(+), 1 deletion(-)
>>
>> @@ -2775,8 +2775,28 @@ \subsubsection{Guest->Host Notification}\label{sec:Virtio Transport Options / Vi
>> \subsubsection{Resetting Devices}\label{sec:Virtio Transport Options / Virtio over channel I/O / Device Operation / Resetting Devices}
>>
>> In order to reset a device, a driver sends the
>> -CCW_CMD_VDEV_RESET command.
>> +CCW_CMD_VDEV_RESET command. This command does not carry any payload.
>>
>> +The device signals completion of the reset operation by making the subchannel
>> +status pending to indicate successful completion of the channel command.
>
> Not familiar with ccw, but I wonder what's the meaning of "making the
> subchannel status pending"?
Hm, I was wondering whether I'm striking the balance between assuming
the reader knows the details of how channel I/O works and explaining the
basic flow...
Slightly simplified, if a device/control unit has finished processing a
channel program (whether successfully or not), it places some status in
the control blocks for the subchannel that serves as its communication
conduit, one of the values being "status pending". The driver may
collect the subchannel status at any time, but "status pending" in
particular means that an interrupt becomes pending. A system may run
with interrupts disabled, while still polling for pending interrupts, so
I did not want to write that the device generates an interrupt. Not sure
if this is now too hard to understand for someone not that familiar with
the matter, though.
>
>> +Notably, the command not only triggers the reset operation, but the reset
>> +operation is already completed when the operation concludes successfully.
>> +
>> +\devicenormative{\paragraph}{Resetting Devices}{Virtio Transport Options / Virtio over channel I/O / Device Operation / Resetting Devices}
>> +
>> +Before making the subchannel status pending to indicate successful completion
>> +of the reset command, the device MUST reinitialize \field{device status} to
>> +zero.
>
> Is the ordering of reinitialization and interrupt guaranteed by the transport?
It is definitely how it should be, i.e. the device performing the reset
and only then making the subchannel status pending. I had thought this
was self-evident, and QEMU also works like that, but maybe it really
needed some clarification. (I assume the zCX thingy also does it like
that, but I cannot check that myself.)
>
>> +
>> +The device MUST NOT send notifications or interact with the queues after
>> +it signaled successful completion of the reset command.
>> +
>> +\drivernormative{\paragraph}{Resetting Devices}{Virtio Transport Options / Virtio over channel I/O / Device Operation / Resetting Devices}
>> +
>> +The driver MAY consider the reset operation to be complete already after
>> +successful completion of the channel command, although it MAY also verify
>> +reset completion by reading \field{device status} via CCW_CMD_READ_STATUS
>> +afterwards.
>
> I wonder if it's better to say
>
> The driver MUST consider the reset operation to be complete by either ... or ...
We currently say that the driver SHOULD consider reset complete when it
reads back a zero status. For ccw, completion of the command is required
before the driver can issue another command (such as to check the device
status). What I wanted to say here is that the driver is already free to
consider the reset complete if the command was successful, but that it
can read back the status _after_ the reset command is through to satisfy
the generic SHOULD statement.
---------------------------------------------------------------------
To unsubscribe from this mail list, you must leave the OASIS TC that
generates this mail. Follow this link to all your TCs in OASIS at:
https://www.oasis-open.org/apps/org/workgroup/portal/my_workgroups.php
next prev parent reply other threads:[~2021-10-12 11:16 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-11 11:38 [PATCH] ccw: clarify device reset Cornelia Huck
2021-10-12 2:54 ` Jason Wang
2021-10-12 11:16 ` Cornelia Huck [this message]
2021-10-13 6:20 ` Jason Wang
2021-10-13 7:01 ` [virtio] " Cornelia Huck
2021-10-21 16:23 ` Cornelia Huck
2021-10-21 23:35 ` Halil Pasic
2021-10-25 1:29 ` Jason Wang
2021-10-25 7:36 ` Cornelia Huck
2021-10-25 7:34 ` Cornelia Huck
2021-10-27 7:58 ` Halil Pasic
2021-10-27 8:02 ` Jason Wang
2021-10-27 9:16 ` Cornelia Huck
2021-10-27 22:25 ` Halil Pasic
2021-10-28 6:55 ` [virtio-comment] " Cornelia Huck
2021-11-26 12:07 ` Cornelia Huck
2021-11-26 17:11 ` Halil Pasic
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=87sfx6wl0i.fsf@redhat.com \
--to=cohuck@redhat.com \
--cc=jasowang@redhat.com \
--cc=pasic@linux.ibm.com \
--cc=virtio-comment@lists.oasis-open.org \
--cc=virtio@lists.oasis-open.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.