Skip to content

Commit

Permalink
cxl/pci: Remove Component Register base address from struct cxl_dev_s…
Browse files Browse the repository at this point in the history
…tate

The Component Register base address @component_reg_phys is no longer
used after the rework of the Component Register setup which now uses
struct member @reg_map instead. Remove the base address.

Signed-off-by: Terry Bowman <terry.bowman@amd.com>
Signed-off-by: Robert Richter <rrichter@amd.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Link: https://lore.kernel.org/r/20231018171713.1883517-9-rrichter@amd.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
  • Loading branch information
Robert Richter authored and Dan Williams committed Oct 28, 2023
1 parent 8ce520f commit f611d98
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 8 deletions.
2 changes: 0 additions & 2 deletions drivers/cxl/cxlmem.h
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,6 @@ enum cxl_devtype {
* @dpa_res: Overall DPA resource tree for the device
* @pmem_res: Active Persistent memory capacity configuration
* @ram_res: Active Volatile memory capacity configuration
* @component_reg_phys: register base of component registers
* @serial: PCIe Device Serial Number
* @type: Generic Memory Class device or Vendor Specific Memory device
*/
Expand All @@ -420,7 +419,6 @@ struct cxl_dev_state {
struct resource dpa_res;
struct resource pmem_res;
struct resource ram_res;
resource_size_t component_reg_phys;
u64 serial;
enum cxl_devtype type;
};
Expand Down
3 changes: 0 additions & 3 deletions drivers/cxl/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -834,16 +834,13 @@ static int cxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
* If the component registers can't be found, the cxl_pci driver may
* still be useful for management functions so don't return an error.
*/
cxlds->component_reg_phys = CXL_RESOURCE_NONE;
rc = cxl_pci_setup_regs(pdev, CXL_REGLOC_RBI_COMPONENT,
&cxlds->reg_map);
if (rc)
dev_warn(&pdev->dev, "No component registers (%d)\n", rc);
else if (!cxlds->reg_map.component_map.ras.valid)
dev_dbg(&pdev->dev, "RAS registers not found\n");

cxlds->component_reg_phys = cxlds->reg_map.resource;

rc = cxl_map_component_regs(&cxlds->reg_map, &cxlds->regs.component,
BIT(CXL_CM_CAP_CAP_ID_RAS));
if (rc)
Expand Down
4 changes: 1 addition & 3 deletions tools/testing/cxl/test/mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -1421,10 +1421,8 @@ static int cxl_mock_mem_probe(struct platform_device *pdev)

cxlds = &mds->cxlds;
cxlds->serial = pdev->id;
if (is_rcd(pdev)) {
if (is_rcd(pdev))
cxlds->rcd = true;
cxlds->component_reg_phys = CXL_RESOURCE_NONE;
}

rc = cxl_enumerate_cmds(mds);
if (rc)
Expand Down

0 comments on commit f611d98

Please sign in to comment.