From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Subject: Re: [virtio-dev] Re: [PATCH v1] virtio-mmio: Specify wait needed in driver during reset From: Srivatsa Vaddagiri Date: Fri, 30 Jul 2021 03:49:59 +0000 Message-ID: References: <87h7gh5od5.fsf@redhat.com> <87eebl5msn.fsf@redhat.com> <20210726091851-mutt-send-email-mst@kernel.org> <20210726141737-mutt-send-email-mst@kernel.org> ,<875ywt2lit.fsf@redhat.com> In-Reply-To: <875ywt2lit.fsf@redhat.com> MIME-Version: 1.0 Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_BY5PR02MB7073DBD36ACEDCF540162808F9EC9BY5PR02MB7073namp_" To: Cornelia Huck , "Michael S. Tsirkin" Cc: "jasowang@redhat.com" , "virtio-dev@lists.oasis-open.org" , Trilok Soni , Pratik Patel List-ID: --_000_BY5PR02MB7073DBD36ACEDCF540162808F9EC9BY5PR02MB7073namp_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable > > 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. In that case, how about introducing a new status bit, RESET_IN_PROGRESS (bi= t 4 or some other unused bit) and return that to indicate reset is not complete? Its not clear otherwise what the device is supposed to return in such case. --- Qualcomm Innovation Center, Inc. is submitting the attached "feedback" as a non-member to the virtio-dev mailing list for consideration and inclusion. --_000_BY5PR02MB7073DBD36ACEDCF540162808F9EC9BY5PR02MB7073namp_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
> > Thinking on those lines, I am wondering if we can avoid the featu= re bit
> > all together based on that logic.
> >
> > 1) Driver writes 0 to status register - device initiates res= et sequence
> > 2) Driver reads status - return 0x40 (VIRTIO_CONFIG_S_NEEDS_= RESET)
> >    if reset sequence is in progress, otherwise ret= urn 0
>
> I don't think we can have the device return NEEDS_RESET in that c= ase;
> that status is supposed to indicate "that the device has exp= erienced an
> error from which it can't recover" -- which is not the case = here,
> especially since the driver has already initiated a reset.

In that case, how about introducing a new status bit, RESET_IN_PROGRES= S (bit 4 or
some other unused bit) and return that to indicate reset is not comple= te?

Its not clear otherwise what the device is supposed to return in such = case.

---

Qualcomm Innovation Center, Inc. is submitting the attached "feed= back" as a
non-member to the virtio-dev mailing list for consideration and inclu= sion.


--_000_BY5PR02MB7073DBD36ACEDCF540162808F9EC9BY5PR02MB7073namp_--