]> git.baikalelectronics.ru Git - kernel.git/commit
cxl: Wait Memory_Info_Valid before access memory related info
authorDave Jiang <dave.jiang@intel.com>
Thu, 18 May 2023 21:54:34 +0000 (14:54 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 May 2023 13:03:32 +0000 (14:03 +0100)
commit5aeee1d02a233e9f36d130506b66b3e86b0d125e
treee78e25bcdec8844902a906deeb71c287e2c24f68
parentc95bab4912cb369f1d9f3a15a4243a9da976e4fa
cxl: Wait Memory_Info_Valid before access memory related info

commit ce17ad0d54985e2595a3e615fda31df61808a08c upstream.

The Memory_Info_Valid bit (CXL 3.0 8.1.3.8.2) indicates that the CXL
Range Size High and Size Low registers are valid. The bit must be set
within 1 second of reset deassertion to the device. Check valid bit
before we check the Memory_Active bit when waiting for
cxl_await_media_ready() to ensure that the memory info is valid for
consumption. Also ensures both DVSEC ranges 1 and 2 are ready if DVSEC
Capability indicates they are both supported.

Fixes: 348bfb5d34fc ("cxl/pci: Implement wait for media active")
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Link: https://lore.kernel.org/r/168444687469.3134781.11033518965387297327.stgit@djiang5-mobl3
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/cxl/core/pci.c
drivers/cxl/cxlpci.h