Discussion of the implementations of VIRTIO specification
 help / color / mirror / Atom feed
From: Cornelia Huck <cohuck@redhat.com>
To: Srivatsa Vaddagiri <svaddagi@qti.qualcomm.com>,
	"Michael S. Tsirkin" <mst@redhat.com>
Cc: "jasowang@redhat.com" <jasowang@redhat.com>,
	"virtio-dev@lists.oasis-open.org"
	<virtio-dev@lists.oasis-open.org>,
	Trilok Soni <tsoni@quicinc.com>,
	Pratik Patel <pratikp@quicinc.com>
Subject: Re: [virtio-dev] Re: [PATCH v1] virtio-mmio: Specify wait needed in driver during reset
Date: Thu, 29 Jul 2021 17:21:46 +0200	[thread overview]
Message-ID: <875ywt2lit.fsf@redhat.com> (raw)
In-Reply-To: <BY5PR02MB70731E359EB50CD2E3827239F9E99@BY5PR02MB7073.namprd02.prod.outlook.com>

On Tue, Jul 27 2021, Srivatsa Vaddagiri <svaddagi@qti.qualcomm.com> wrote:

>> > > What about resets before FEATURES_OK? How are these handled?
>> >
>> > From device perspective, it's reset logic will always be same, independent of
>> > when reset was performed by driver (before or after feature negotiation). A
>> > driver that does not wait for reset completion will see undefined behavior
>> > after
>> > reset until it discovers that feature negotiation has failed?
>>
>> Hmm. that doesn't sound too good. Makes using
>> feature negotiation for this kind of useless ...
>> Device can actually detect a read from status, right?
>> Maybe if it sees status was not read it can just
>> stay in reset state and not exit it?
>
> Thinking on those lines, I am wondering if we can avoid the feature bit
> all together based on that logic.
>
> 1) Driver writes 0 to status register - device initiates reset sequence
> 2) Driver reads status - return 0x40 (VIRTIO_CONFIG_S_NEEDS_RESET)
>    if reset sequence is in progress, otherwise return 0

I don't think we can have the device return NEEDS_RESET in that case;
that status is supposed to indicate "that the device has experienced an
error from which it can’t recover" -- which is not the case here,
especially since the driver has already initiated a reset.

> 3) Driver writes status (ACKNOWLEDGE Bit) - if this happened before reset
>    sequence completed and before we returned 0 for status read, then reject
>    further initialization by setting VIRTIO_CONFIG_S_NEEDS_RESET (until next
>    reset that is)
>
> This should let device detect if we have a driver polling on reset completion or
> not?


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


  reply	other threads:[~2021-07-29 15:21 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-23 14:55 [PATCH v1] virtio-mmio: Specify wait needed in driver during reset Srivatsa Vaddagiri
2021-07-26 11:03 ` [virtio-dev] " Cornelia Huck
2021-07-26 11:25   ` Srivatsa Vaddagiri
2021-07-26 11:36     ` [virtio-dev] " Cornelia Huck
2021-07-26 13:19       ` Michael S. Tsirkin
2021-07-26 14:09         ` [virtio-dev] " Cornelia Huck
2021-07-26 14:17         ` Srivatsa Vaddagiri
2021-07-26 19:03           ` Michael S. Tsirkin
2021-07-27  9:52             ` [virtio-dev] " Srivatsa Vaddagiri
2021-07-29 15:21               ` Cornelia Huck [this message]
2021-07-30  3:49                 ` Srivatsa Vaddagiri
2021-08-02  6:06             ` Jason Wang
2021-08-11 10:05               ` [virtio-dev] " Srivatsa Vaddagiri
2021-08-16  2:09                 ` Jason Wang
2021-08-16  5:35                   ` Michael S. Tsirkin
     [not found]                     ` <20210816063550.GD5604@quicinc.com>
2021-08-16 11:48                       ` Michael S. Tsirkin
2021-08-16 13:34                         ` Srivatsa Vaddagiri
2021-08-16 14:37                           ` Michael S. Tsirkin
2021-08-16 14:58                             ` Srivatsa Vaddagiri
2021-08-17  5:45                         ` Jason Wang
2021-08-17  7:51                           ` Michael S. Tsirkin
2021-08-17  8:15                             ` Jason Wang
2021-08-17 10:03                             ` Srivatsa Vaddagiri
2021-08-17 12:48                               ` Srivatsa Vaddagiri
2021-08-18  2:57                                 ` Jason Wang
2021-08-18  2:54                               ` Jason Wang
2021-08-18  5:15                                 ` Srivatsa Vaddagiri
2021-08-18  5:40                                   ` Jason Wang
2021-08-18  5:51                                     ` Srivatsa Vaddagiri
2021-08-18  6:04                                       ` Jason Wang
2021-08-18  6:13                                         ` Srivatsa Vaddagiri
2021-08-24 16:57                                           ` Srivatsa Vaddagiri
2021-08-20  3:56                     ` Jason Wang
2021-08-20 11:15                       ` Michael S. Tsirkin
2021-07-26 13:18   ` Michael S. Tsirkin
2021-07-26 14:13     ` [virtio-dev] " Cornelia Huck

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=875ywt2lit.fsf@redhat.com \
    --to=cohuck@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=mst@redhat.com \
    --cc=pratikp@quicinc.com \
    --cc=svaddagi@qti.qualcomm.com \
    --cc=tsoni@quicinc.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox