[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YpfJYujerG2hM4vU@iweiny-desk3>
Date: Wed, 1 Jun 2022 13:17:38 -0700
From: Ira Weiny <ira.weiny@...el.com>
To: Lukas Wunner <lukas@...ner.de>
Cc: Jonathan Cameron <Jonathan.Cameron@...wei.com>,
Dan Williams <dan.j.williams@...el.com>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Christoph Hellwig <hch@...radead.org>,
Alison Schofield <alison.schofield@...el.com>,
Vishal Verma <vishal.l.verma@...el.com>,
Ben Widawsky <ben.widawsky@...el.com>,
linux-kernel@...r.kernel.org, linux-cxl@...r.kernel.org,
linux-pci@...r.kernel.org
Subject: Re: [PATCH V8 03/10] PCI: Create PCI library functions in support of
DOE mailboxes.
On Wed, Jun 01, 2022 at 07:56:47PM +0200, Lukas Wunner wrote:
> On Wed, Jun 01, 2022 at 10:16:15AM -0700, Ira Weiny wrote:
> > On Wed, Jun 01, 2022 at 09:18:08AM +0200, Lukas Wunner wrote:
> > > You only need to re-check the Data Object Ready bit on the last-but-one
> > > dword in case the function was reset concurrently. Per sec. 6.30.2,
> > > "An FLR to a Function must result in the aborting of any DOE transfer
> > > in progress."
> >
> > I think I disagree. Even if we do that and an FLR comes before the last read
> > the last read could be 0's.
>
> PCIe r6.0, Table 7-316 says:
>
> "If there is no additional data object ready for transfer, the
> DOE instance must clear this bit after the entire data object has been
> transferred, as indicated by software writing to the DOE Read Data
> Mailbox Register after reading the final DW of the data object."
>
> Remember that you *read* a dword from the mailbox and then acknowledge
> reception to the mailbox by *writing* a dword to the mailbox.
>
> So you check that the Data Object Ready bit is set before acknowledging
> the final dword with a register write. That's race-free.
Ok.
>
> (I realize me talking about the "last-but-one dword" above was quite
> unclear, sorry about that.)
>
Ah yes. Ok, I'll put in a check before the final write.
Ira
Powered by blists - more mailing lists