cxl/ras: Pass the PCI device's struct device to match_memdev_by_parent()
Dave Jiang
maintainerPATCH 1/1 cxl/ras: Pass the PCI device's struct device to match_memdev_by_parent()
cxl_cper_handle_prot_err() hands bus_find_device() the 'struct pci_dev' where match_memdev_by_parent() expects the embedded 'struct device'. The comparison never matches. The lookup always fails and CXL endpoint protocol errors reported via CPER are dropped without a trace event, leaving only the root port, downstream and upstream cases reporting.
Pass &pdev->dev, and rename the callback parameter to match what it is.
--- drivers/cxl/core/ras.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/cxl/core/ras.c +3 -3
@@ -70,9 +70,9 @@ cxl_cper_trace_uncorr_prot_err(struct cxl_memdev *cxlmd,trace_cxl_aer_uncorrectable_error (cxlmd, status, fe, hl); } -static int match_memdev_by_parent (struct device *dev,const void *uport) +static int match_memdev_by_parent (struct device *dev,const void *parent) { -if (is_cxl_memdev (dev) && dev->parent == uport) +if (is_cxl_memdev (dev) && dev->parent == parent)return 1 ;return 0 ; }
@@ -108,7 +108,7 @@ static void cxl_cper_handle_prot_err(struct cxl_cper_prot_err_work_data *data)return ; struct device *mem_dev __free(put_device) = bus_find_device( - &cxl_bus_type,NULL , pdev, match_memdev_by_parent); + &cxl_bus_type,NULL , &pdev->dev, match_memdev_by_parent);if (!mem_dev)return ;
base-commit: 751627a8c5cde68e0b396126449749e8bfbe592d
Signature · 1 line
2.54.0
Quoted 32 lines · Dave Jiang
cxl_cper_handle_prot_err()handsbus_find_device()the 'structpci_dev' wherematch_memdev_by_parent()expects the embedded 'struct device'. The comparison never matches. The lookup always fails and CXL endpoint protocol errors reported via CPER are dropped without a trace event, leaving only the root port, downstream and upstream cases reporting.Pass
&pdev->dev, and rename the callback parameter to match what it is.Fixes 3c70ec71abda ("cxl/ras: Fix CPER handler device confusion")Signed-off-by Dave Jiang <[email protected]>--- drivers/cxl/core/ras.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/cxl/core/ras.c +2
-2@@ -70,9 +70,9 @@ cxl_cper_trace_uncorr_prot_err(struct cxl_memdev *cxlmd,trace_cxl_aer_uncorrectable_error (cxlmd, status, fe, hl); } -static int match_memdev_by_parent (struct device *dev,const void *uport) +static int match_memdev_by_parent (struct device *dev,const void *parent) { -if (is_cxl_memdev (dev) && dev->parent == uport) +if (is_cxl_memdev (dev) && dev->parent == parent)return 1 ;return 0 ; }
drivers/cxl/core/ras.c static void cxl_cper_handle_prot_err(struct cxl_cper_prot_err_work_data *data) · line 114
Quoted 8 lines
drivers/cxl/core/ras.c +1
-1@@ -108,7 +108,7 @@ static void cxl_cper_handle_prot_err(struct cxl_cper_prot_err_work_data *data)return ; struct device *mem_dev __free(put_device) = bus_find_device( - &cxl_bus_type,NULL , pdev, match_memdev_by_parent); + &cxl_bus_type,NULL , &pdev->dev, match_memdev_by_parent);if (!mem_dev)return ;
Looks good. Feel free to add my RB:
-Terry
Quoted 1 line
base-commit:
751627a8c5cde68e0b396126449749e8bfbe592d
Quoted 10 lines · Dave Jiang
cxl_cper_handle_prot_err()handsbus_find_device()the 'structpci_dev' wherematch_memdev_by_parent()expects the embedded 'struct device'. The comparison never matches. The lookup always fails and CXL endpoint protocol errors reported via CPER are dropped without a trace event, leaving only the root port, downstream and upstream cases reporting.Pass
&pdev->dev, and rename the callback parameter to match what it is.Fixes 3c70ec71abda ("cxl/ras: Fix CPER handler device confusion")Signed-off-by Dave Jiang <[email protected]>
Quoted 10 lines · Dave Jiang
cxl_cper_handle_prot_err()handsbus_find_device()the 'structpci_dev' wherematch_memdev_by_parent()expects the embedded 'struct device'. The comparison never matches. The lookup always fails and CXL endpoint protocol errors reported via CPER are dropped without a trace event, leaving only the root port, downstream and upstream cases reporting.Pass
&pdev->dev, and rename the callback parameter to match what it is.Fixes 3c70ec71abda ("cxl/ras: Fix CPER handler device confusion")Signed-off-by Dave Jiang <[email protected]>
Applied to cxl/next977eaad352ba
Quoted 31 lines
--- drivers/cxl/core/ras.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/cxl/core/ras.c +3
-3@@ -70,9 +70,9 @@ cxl_cper_trace_uncorr_prot_err(struct cxl_memdev *cxlmd,trace_cxl_aer_uncorrectable_error (cxlmd, status, fe, hl); } -static int match_memdev_by_parent (struct device *dev,const void *uport) +static int match_memdev_by_parent (struct device *dev,const void *parent) { -if (is_cxl_memdev (dev) && dev->parent == uport) +if (is_cxl_memdev (dev) && dev->parent == parent)return 1 ;return 0 ; }@@ -108,7 +108,7 @@ static void cxl_cper_handle_prot_err(struct cxl_cper_prot_err_work_data *data)return ; struct device *mem_dev __free(put_device) = bus_find_device( - &cxl_bus_type,NULL , pdev, match_memdev_by_parent); + &cxl_bus_type,NULL , &pdev->dev, match_memdev_by_parent);if (!mem_dev)return ;base-commit:
751627a8c5cde68e0b396126449749e8bfbe592d