]> git.itanic.dy.fi Git - linux-stable/commit
cxl: Move cxl_await_media_ready() to before capacity info retrieval
authorDave Jiang <dave.jiang@intel.com>
Thu, 18 May 2023 23:38:20 +0000 (16:38 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 May 2023 13:17:27 +0000 (14:17 +0100)
commit84b54b5e2d89d22d5aaa0bfd6e03425678c85f71
tree3cd5cdfd2303b03d8ca1da706402c352f8c558fd
parent9eb6f0935415b8174883fe0c59a5cb9c4e422d48
cxl: Move cxl_await_media_ready() to before capacity info retrieval

commit e764f12208b99ac7892c4e3f6bf88d71ca71036f upstream.

Move cxl_await_media_ready() to cxl_pci probe before driver starts issuing
IDENTIFY and retrieving memory device information to ensure that the
device is ready to provide the information. Allow cxl_pci_probe() to succeed
even if media is not ready. Cache the media failure in cxlds and don't ask
the device for any media information.

The rationale for proceeding in the !media_ready case is to allow for
mailbox operations to interrogate and/or remediate the device. After
media is repaired then rebinding the cxl_pci driver is expected to
restart the capacity scan.

Suggested-by: Dan Williams <dan.j.williams@intel.com>
Fixes: b39cb1052a5c ("cxl/mem: Register CXL memX devices")
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Link: https://lore.kernel.org/r/168445310026.3251520.8124296540679268206.stgit@djiang5-mobl3
[djbw: fixup cxl_test]
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/cxl/core/mbox.c
drivers/cxl/cxlmem.h
drivers/cxl/mem.c
drivers/cxl/pci.c
drivers/cxl/port.c
tools/testing/cxl/test/mem.c