[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250423153307.000074a7@huawei.com>
Date: Wed, 23 Apr 2025 15:33:07 +0100
From: Jonathan Cameron <Jonathan.Cameron@...wei.com>
To: Terry Bowman <terry.bowman@....com>
CC: <linux-cxl@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-pci@...r.kernel.org>, <nifan.cxl@...il.com>, <dave@...olabs.net>,
<dave.jiang@...el.com>, <alison.schofield@...el.com>,
<vishal.l.verma@...el.com>, <dan.j.williams@...el.com>,
<bhelgaas@...gle.com>, <mahesh@...ux.ibm.com>, <ira.weiny@...el.com>,
<oohall@...il.com>, <Benjamin.Cheatham@....com>, <rrichter@....com>,
<nathan.fontenot@....com>, <Smita.KoralahalliChannabasappa@....com>,
<lukas@...ner.de>, <ming.li@...omail.com>,
<PradeepVineshReddy.Kodamati@....com>
Subject: Re: [PATCH v8 03/16] CXL/AER: Introduce Kfifo for forwarding CXL
errors
> +int cxl_create_prot_err_info(struct pci_dev *_pdev, int severity,
> + struct cxl_prot_error_info *err_info)
> +{
> + struct pci_dev *pdev __free(pci_dev_put) = pci_dev_get(_pdev);
> + struct cxl_dev_state *cxlds;
> +
> + if (!pdev || !err_info) {
> + pr_warn_once("Error: parameter is NULL");
> + return -ENODEV;
> + }
> +
> + if ((pci_pcie_type(pdev) != PCI_EXP_TYPE_ENDPOINT) &&
> + (pci_pcie_type(pdev) != PCI_EXP_TYPE_RC_END)) {
> + pci_warn_once(pdev, "Error: Unsupported device type (%X)", pci_pcie_type(pdev));
> + return -ENODEV;
> + }
> +
> + cxlds = pci_get_drvdata(pdev);
> + struct device *dev __free(put_device) = get_device(&cxlds->cxlmd->dev);
> +
> + if (!dev)
> + return -ENODEV;
> +
> + *err_info = (struct cxl_prot_error_info){ 0 };
> + err_info->ras_base = cxlds->regs.ras;
> + err_info->severity = severity;
> + err_info->pdev = pdev;
> + err_info->dev = dev;
I missed this before but might as well do...
*err_info = (struct cxl_prot_error_info) {
.ras_base = cxlds->regs.ras,
.severity = serverity,
...
};
> +
> + return 0;
> +}
Powered by blists - more mailing lists