Re: [PATCH v4 4/4] cxl/hdm: Restore commit_end when decoder enumeration fails
Jonathan Cameron <[email protected]>
| Newsgroups | org.kernel.vger.linux-cxl |
|---|---|
| Message-ID | <20260722021712.0107f7fc@jic23-huawei> |
On Mon, 20 Jul 2026 18:59:40 -0700 Alison Schofield <[email protected]> wrote: > commit_end tracks the highest committed decoder on a port. It gets > advanced before decoder enumeration is complete, so a later failure > leaves it pointing at a decoder that was never added. The next probe > then rejects decoder0 as out of order and enumeration fails. > > Reset commit_end to the none committed baseline once the decoders are > torn down, so a subsequent probe rebuilds it from scratch. Register > the reset before the decoders are added so that on unwind it runs > after every decoder has been unregistered. This prevents commit_end > from dropping below the highest committed decoder still registered and > exposing an inconsistent value to a concurrent reader. > > Protect the commit_end advance in the DVSEC emulation path against > concurrent readers, matching the register-programmed path. > > Fixes: 176baefb2eb5 ("cxl/hdm: Commit decoder state to hardware") > Fixes: b777e9bec960 ("cxl/hdm: Emulate HDM decoder from DVSEC range registers") > Signed-off-by: Alison Schofield <[email protected]> Reviewed-by: Jonathan Cameron <[email protected]>