All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cornelia Huck <cohuck@redhat.com>
To: "Eugenio Pérez" <eperezma@redhat.com>,
	virtio-dev@lists.oasis-open.org,
	virtio-comment@lists.oasis-open.org, mst@redhat.com,
	jasowang@redhat.com
Cc: amikheev@nvidia.com, stefanha@redhat.com, shahafs@nvidia.com,
	oren@nvidia.com, pasic@linux.ibm.com, bodong@nvidia.com,
	"Dr . David Alan Gilbert" <dgilbert@redhat.com>,
	parav@nvidia.com, mgurtovoy@nvidia.com
Subject: [virtio-dev] Re: [PATCH v3 1/2] content: Explain better the status clearing bits
Date: Fri, 12 Nov 2021 11:34:57 +0100	[thread overview]
Message-ID: <87sfw1oe5q.fsf@redhat.com> (raw)
In-Reply-To: <20211111185812.2326093-2-eperezma@redhat.com>

On Thu, Nov 11 2021, Eugenio Pérez <eperezma@redhat.com> wrote:

> The spec tells that "The driver MUST NOT clear a device status bit", but
> a device using PCI transport reset a virtio device writing 0 to device

I think MMIO uses that mechanism as well?

> status. In some way, that is to clear all its bits.
>
> Instead of add an exception, tell explicitely the status bits that
> the driver cannot clear anytime in a normal operation, so conformant
> device and drivers keeps being conformant.
>
> Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
> ---
>  content.tex | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/content.tex b/content.tex
> index 5d112af..2aa3006 100644
> --- a/content.tex
> +++ b/content.tex
> @@ -60,9 +60,10 @@ \section{\field{Device Status} Field}\label{sec:Basic Facilities of a Virtio Dev
>  initialization sequence specified in
>  \ref{sec:General Initialization And Device Operation / Device
>  Initialization}.
> -The driver MUST NOT clear a
> -\field{device status} bit.  If the driver sets the FAILED bit,
> -the driver MUST later reset the device before attempting to re-initialize.
> +The driver MUST NOT clear ACKNOWLEDGE, DRIVER, DRIVER_OK, FEATURES_OK or
> +DEVICE_NEEDS_RESET bits of \field{device status}, except if resetting the whole
> +device.  If the driver sets the FAILED bit, the driver MUST later reset the
> +device before attempting to re-initialize.

I think we need to distinguish "driver wants to clear a status bit" from
"driver is initiating a reset, and that transport implements that by
writing 0 to the device status". So, what about

"The driver MUST NOT clear a \field{device status} bit, except when
setting \field{device status} to 0 as a transport-specific way to
intitiate a reset."

If we introduce driver-clearable bits later, we can simply make that
"The driver MUST NOT clear a \field{device status} bit other than
NEW_BIT, ..."


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


  parent reply	other threads:[~2021-11-12 10:35 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-11 18:58 [PATCH v3 0/2] virtio: introduce STOP status bit Eugenio Pérez
2021-11-11 18:58 ` [PATCH v3 1/2] content: Explain better the status clearing bits Eugenio Pérez
2021-11-12  3:46   ` Jason Wang
2021-11-12 11:41     ` Eugenio Perez Martin
2021-11-12 10:34   ` Cornelia Huck [this message]
2021-11-12 11:41     ` [virtio-dev] " Eugenio Perez Martin
2021-11-11 18:58 ` [PATCH v3 2/2] virtio: introduce STOP status bit Eugenio Pérez
2021-11-12  4:18   ` Jason Wang
2021-11-12 10:50     ` Eugenio Perez Martin
2021-11-15  4:08       ` Jason Wang
2021-11-15 18:16         ` Eugenio Perez Martin
2021-11-16  6:56           ` Jason Wang
2021-11-16 14:50             ` Eugenio Perez Martin
2021-11-17  3:27               ` Jason Wang
2021-11-17  8:08                 ` Eugenio Perez Martin
2021-11-18  3:27                   ` Jason Wang
2021-11-18 15:59   ` Stefan Hajnoczi
2021-11-18 19:58     ` Eugenio Perez Martin
2021-11-23 12:16       ` Stefan Hajnoczi
2021-11-23 17:00         ` [virtio-dev] " Eugenio Perez Martin
2021-11-24 11:20           ` Stefan Hajnoczi
2021-11-24 16:41             ` Eugenio Perez Martin
2021-11-29 10:32               ` Stefan Hajnoczi
2021-11-25  2:57             ` Jason Wang
2021-11-29 10:29               ` Stefan Hajnoczi
2021-11-29 16:55                 ` Eugenio Perez Martin
2021-12-01 10:21                   ` Stefan Hajnoczi
2021-12-02  8:30                     ` Eugenio Perez Martin
2021-12-02  2:40                   ` Jason Wang
2021-12-02  9:44                     ` Stefan Hajnoczi
2021-12-03  2:09                       ` Jason Wang
2021-11-18 14:45 ` [PATCH v3 0/2] " Stefan Hajnoczi
2021-11-18 16:49   ` Eugenio Perez Martin
2021-11-23 11:33     ` Stefan Hajnoczi
2021-11-23 16:19       ` Eugenio Perez Martin
2021-11-24 15:26         ` Stefan Hajnoczi
2021-11-24 16:58           ` Eugenio Perez Martin
2021-11-25  3:05         ` Jason Wang
2021-11-25  7:24           ` Eugenio Perez Martin
2021-11-25  7:38             ` Jason Wang
2021-11-25  9:01               ` Eugenio Perez Martin
2021-11-25  9:10                 ` Eugenio Perez Martin
     [not found]                 ` <CACGkMEvD+Z7cYszhMzBsnEaC0K0kfnHxzFDEfjT_qLOFiMR-XA@mail.gmail.com>
2021-11-26  8:26                   ` Eugenio Perez Martin

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=87sfw1oe5q.fsf@redhat.com \
    --to=cohuck@redhat.com \
    --cc=amikheev@nvidia.com \
    --cc=bodong@nvidia.com \
    --cc=dgilbert@redhat.com \
    --cc=eperezma@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=mgurtovoy@nvidia.com \
    --cc=mst@redhat.com \
    --cc=oren@nvidia.com \
    --cc=parav@nvidia.com \
    --cc=pasic@linux.ibm.com \
    --cc=shahafs@nvidia.com \
    --cc=stefanha@redhat.com \
    --cc=virtio-comment@lists.oasis-open.org \
    --cc=virtio-dev@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.