@@ -921,7 +921,7 @@ static void cxl_initialize_cdat_callbacks(struct cxl_dev_state *cxlds)
cxlds->cdat_read_table = cxl_cdat_read_table;
}
-static int read_cdat_data(struct cxl_dev_state *cxlds)
+static int __read_cdat_data(struct cxl_dev_state *cxlds)
{
struct device *dev = cxlds->dev;
size_t cdat_length;
@@ -943,6 +943,21 @@ static int read_cdat_data(struct cxl_dev_state *cxlds)
return ret;
}
+static void read_cdat_data(struct cxl_dev_state *cxlds)
+{
+ int retries = 5;
+ int rc;
+
+ while (retries--) {
+ rc = __read_cdat_data(cxlds);
+ if (!rc)
+ break;
+ dev_err(cxlds->dev,
+ "CDAT data read error rc=%d (retries %d)\n",
+ rc, retries);
+ }
+}
+
static int cxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
{
struct cxl_register_map map;
@@ -1016,9 +1031,7 @@ static int cxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
cxl_initialize_cdat_callbacks(cxlds);
/* Cache the data early to ensure is_visible() works */
- rc = read_cdat_data(cxlds);
- if (rc)
- dev_err(&pdev->dev, "CDAT data read error (%d)\n", rc);
+ read_cdat_data(cxlds);
rc = cxl_dvsec_ranges(cxlds);
if (rc)