From: Thomas Gleixner <tglx@linutronix.de>
To: David Laight <David.Laight@ACULAB.COM>,
Jason Gunthorpe <jgg@nvidia.com>,
Bjorn Helgaas <bhelgaas@google.com>,
Christoph Hellwig <hch@infradead.org>,
"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>
Subject: RE: PCIe cycle sequence when updating the msi-x table
Date: Mon, 10 Apr 2023 08:50:20 +0200 [thread overview]
Message-ID: <875ya4temr.ffs@tglx> (raw)
In-Reply-To: <ed0017284c324cf68f05a20ac86b7b35@AcuMS.aculab.com>
On Fri, Apr 07 2023 at 22:06, David Laight wrote:
> From: Thomas Gleixner
>> Sent: 07 April 2023 20:56
>> So the devices gets:
>>
>> 1) write to control register with MASKBIT set
>> 2) write to LOWER_ADDRESS
>> 3) write to UPPER_ADDRESS
>> 4) write to ENTRY_DATA
>> 5) write to control register with MASKBIT cleared
>>
>> #1 disables the vector and the device is not allowed to use the msg data
>> from the table entry until the mask bit is cleared again.
>>
>> If the device gets that wrong then that's a bug in the device and not a
>> kernel problem.
>
> Maybe, but the kernel isn't making it easy for a device
> state-engine that has to do four separate reads of an
> internal 32-bit memory area.
> Adding a short delay between #4 and #5 is likely to avoid
> some very hard to debug issues if the hardware reads the
> values 'mask last', if it reads them 'mask first' you need
> a short delay between #1 and #2.
Whatever order this reads does not matter. The point is:
"Mask Bit - When this bit is Set, the Function is prohibited from
sending a message using this MSI-X Table entry."
So you cannot make this read order dependent at all.
> Anything fpga based is likely to be using a 32bit memory
> block for the MSI-X data (possibly even 16bit).
It's trivial enough to latch the message on unmask into a shadow
register set and let the state engine work from there.
And no, we are not adding random delays to that code just because.
Thanks,
tglx
next prev parent reply other threads:[~2023-04-10 6:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-07 16:17 PCIe cycle sequence when updating the msi-x table David Laight
2023-04-07 19:55 ` Thomas Gleixner
2023-04-07 22:06 ` David Laight
2023-04-10 6:50 ` Thomas Gleixner [this message]
2023-04-10 12:16 ` David Laight
2023-04-10 17:25 ` Thomas Gleixner
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=875ya4temr.ffs@tglx \
--to=tglx@linutronix.de \
--cc=David.Laight@ACULAB.COM \
--cc=bhelgaas@google.com \
--cc=hch@infradead.org \
--cc=jgg@nvidia.com \
--cc=linux-pci@vger.kernel.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