qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Klaus Jensen <its@irrelevant.dk>
To: Lukasz Maniak <lukasz.maniak@linux.intel.com>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org,
	Keith Busch <kbusch@kernel.org>,
	Klaus Jensen <k.jensen@samsung.com>,
	lukasz.gieryk@linux.intel.com
Subject: Re: [PATCH] hw/nvme: clean up CC register write logic
Date: Wed, 25 May 2022 09:35:02 +0200	[thread overview]
Message-ID: <Yo3cJsbCPST0zKcW@apples> (raw)
In-Reply-To: <YoYziE8v2reg5kQ7@kpiekosz-mobl.ger.corp.intel.com>

[-- Attachment #1: Type: text/plain, Size: 1506 bytes --]

On May 19 14:11, Lukasz Maniak wrote:
> On Tue, May 17, 2022 at 01:16:05PM +0200, Klaus Jensen wrote:
> > From: Klaus Jensen <k.jensen@samsung.com>
> > 
> > The SRIOV series exposed an issued with how CC register writes are
> > handled and how CSTS is set in response to that. Specifically, after
> > applying the SRIOV series, the controller could end up in a state with
> > CC.EN set to '1' but with CSTS.RDY cleared to '0', causing drivers to
> > expect CSTS.RDY to transition to '1' but timing out.
> > 
> > Clean this up.
> > 
> > Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
> > ---
> > 
> > Note, this applies on top of nvme-next with v8 of Lukasz's sriov series.
> > 
> >  hw/nvme/ctrl.c | 35 +++++++++++------------------------
> >  1 file changed, 11 insertions(+), 24 deletions(-)
> > 
> > diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c
> > index 658584d417fe..47d971b2404c 100644
> > --- a/hw/nvme/ctrl.c
> > +++ b/hw/nvme/ctrl.c
> > @@ -6190,9 +6190,8 @@ static void nvme_ctrl_reset(NvmeCtrl *n, NvmeResetType rst)
> >  
> >      if (pci_is_vf(pci_dev)) {
> >          sctrl = nvme_sctrl(n);
> > +
> >          stl_le_p(&n->bar.csts, sctrl->scs ? 0 : NVME_CSTS_FAILED);
> > -    } else {
> > -        stl_le_p(&n->bar.csts, 0);
> 
> Are you sure the registers do not need to be cleared for a reset type that
> does not involve a CC register i.e. FLR?
> Will these registers be zeroed out elsewhere during FLR?
> 

Indeed you are right. Posting a v2.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

      reply	other threads:[~2022-05-25  7:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-17 11:16 [PATCH] hw/nvme: clean up CC register write logic Klaus Jensen
2022-05-19 12:11 ` Lukasz Maniak
2022-05-25  7:35   ` Klaus Jensen [this message]

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=Yo3cJsbCPST0zKcW@apples \
    --to=its@irrelevant.dk \
    --cc=k.jensen@samsung.com \
    --cc=kbusch@kernel.org \
    --cc=lukasz.gieryk@linux.intel.com \
    --cc=lukasz.maniak@linux.intel.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).