[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220601175647.GA21509@wunner.de>
Date: Wed, 1 Jun 2022 19:56:47 +0200
From: Lukas Wunner <lukas@...ner.de>
To: Ira Weiny <ira.weiny@...el.com>
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 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.
(I realize me talking about the "last-but-one dword" above was quite
unclear, sorry about that.)
Thanks,
Lukas
Powered by blists - more mailing lists