From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Sender: List-Post: List-Help: List-Unsubscribe: List-Subscribe: Received: from lists.oasis-open.org (oasis-open.org [10.110.1.242]) by lists.oasis-open.org (Postfix) with ESMTP id CA38E986488 for ; Wed, 18 Aug 2021 05:51:10 +0000 (UTC) Date: Wed, 18 Aug 2021 11:21:02 +0530 From: Srivatsa Vaddagiri Message-ID: <20210818055102.GD9207@quicinc.com> Reply-To: Srivatsa Vaddagiri References: <2723b42a-f5d0-9c49-bf5c-302fbd4c947f@redhat.com> <20210816013138-mutt-send-email-mst@kernel.org> <20210816063550.GD5604@quicinc.com> <20210816074558-mutt-send-email-mst@kernel.org> <20210817034312-mutt-send-email-mst@kernel.org> <20210817100333.GA9207@quicinc.com> <20210818051544.GC9207@quicinc.com> MIME-Version: 1.0 In-Reply-To: Subject: Re: [virtio-dev] Re: [PATCH v1] virtio-mmio: Specify wait needed in driver during reset Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline To: Jason Wang Cc: "Michael S. Tsirkin" , Srivatsa Vaddagiri , Cornelia Huck , "virtio-dev@lists.oasis-open.org" , Trilok Soni , Pratik Patel List-ID: * Jason Wang [2021-08-18 13:40:45]: > > Hmm ..are you suggesting that we read the Version register as part of reset code > > and do the wait part only for v3 device? > > We only need to read the version once (see virtio_mmio_probe()). So it Ok sorry saw that now. > could be something like > > if (vm_dev->version == 0x3) { > while (readl(vm_dev->base + VIRTIO_MMIO_STATUS)) > msleep(1); > } > > > Otherwise we have the same issue as > > feature bit with version change also. > > > > Can't the driver do the same with feature register also? Do poll if > > WAIT_FOR_RESET_COMPLETION feature bit is set, which can happen before feature > > negotiation is complete. > > The possible issue is that the feature negotiation is not done at that time. Fine let me take a stab at the next version which will have this: * Introduce a status bit for device to indicate "reset in progress". This could be adopted by other transports also (for ex PCI). * For v3 MMIO devices, driver, after initiating reset, should wait until status = 0 or device indicates "failure". What the driver does when it sees failure can be implementation defined (it can give up or try reset few more times) - vatsa -- Qualcomm Innovation Center, Inc. is submitting the attached "feedback" as a non-member to the virtio-dev mailing list for consideration and inclusion. --------------------------------------------------------------------- To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org