From: Dan Williams <dan.j.williams@intel.com>
To: Ira Weiny <ira.weiny@intel.com>,
Dan Williams <dan.j.williams@intel.com>,
Jonathan Cameron <jonathan.cameron@huawei.com>,
Smita Koralahalli <Smita.KoralahalliChannabasappa@amd.com>,
Shiju Jose <shiju.jose@huawei.com>
Cc: Dan Carpenter <dan.carpenter@linaro.org>,
Yazen Ghannam <yazen.ghannam@amd.com>,
Davidlohr Bueso <dave@stgolabs.net>,
Dave Jiang <dave.jiang@intel.com>,
Alison Schofield <alison.schofield@intel.com>,
"Vishal Verma" <vishal.l.verma@intel.com>,
Ard Biesheuvel <ardb@kernel.org>, <linux-efi@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <linux-cxl@vger.kernel.org>,
Ira Weiny <ira.weiny@intel.com>
Subject: Re: [PATCH 3/4] cxl/pci: Register for and process CPER events
Date: Fri, 1 Mar 2024 13:49:50 -0800 [thread overview]
Message-ID: <65e24d7df3521_3651e29492@dwillia2-mobl3.amr.corp.intel.com.notmuch> (raw)
In-Reply-To: <20240228-cxl-cper3-v1-3-6aa3f1343c6c@intel.com>
Ira Weiny wrote:
> If the firmware has configured CXL event support to be firmware first
> the OS can process those events through CPER records. The CXL layer has
> unique DPA to HPA knowledge and standard event trace parsing in place.
>
> CPER records contain Bus, Device, Function information which can be used
> to identify the PCI device which is sending the event.
>
> Add a CXL CPER callback to process events through the CXL trace
> subsystem.
>
> Future patches will provide additional region information such as HPA.
>
> Signed-off-by: Ira Weiny <ira.weiny@intel.com>
>
> ---
> Changes:
> [iweiny: Add back in after the revert in 6.8]
> ---
> drivers/cxl/pci.c | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 68 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/cxl/pci.c b/drivers/cxl/pci.c
> index 2ff361e756d6..6cf8336d1b33 100644
> --- a/drivers/cxl/pci.c
> +++ b/drivers/cxl/pci.c
> @@ -974,6 +974,73 @@ static struct pci_driver cxl_pci_driver = {
> },
> };
>
> -module_pci_driver(cxl_pci_driver);
> +#define CXL_EVENT_HDR_FLAGS_REC_SEVERITY GENMASK(1, 0)
> +static void cxl_cper_event_call(enum cxl_event_type ev_type,
> + struct cxl_cper_event_rec *rec)
> +{
> + struct cper_cxl_event_devid *device_id = &rec->hdr.device_id;
> + struct pci_dev *pdev __free(pci_dev_put) = NULL;
> + enum cxl_event_log_type log_type;
> + struct cxl_dev_state *cxlds;
> + unsigned int devfn;
> + u32 hdr_flags;
> +
> + pr_debug("CPER event for device %u:%u:%u.%u\n",
> + device_id->segment_num, device_id->bus_num,
> + device_id->device_num, device_id->func_num);
> +
> + devfn = PCI_DEVFN(device_id->device_num, device_id->func_num);
> + pdev = pci_get_domain_bus_and_slot(device_id->segment_num,
> + device_id->bus_num, devfn);
> + if (!pdev) {
> + pr_err("CPER event device %u:%u:%u.%u not found\n",
> + device_id->segment_num, device_id->bus_num,
> + device_id->device_num, device_id->func_num);
> + return;
> + }
> +
> + dev_dbg(&pdev->dev, "Found device %u:%u.%u\n", device_id->bus_num,
> + device_id->device_num, device_id->func_num);
These print statements are excessive. The dev_dbg() already encodes the
device BDF into the device name. The pr_err() is not actionable and
somewhat redundant with the default cper_estatus_print_section() print.
I would just delete all of them.
next prev parent reply other threads:[~2024-03-01 21:49 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-29 7:13 [PATCH 0/4] efi/cxl-cper: Report CXL CPER events through tracing Ira Weiny
2024-02-29 7:13 ` [PATCH 1/4] cxl/event: Add missing include files Ira Weiny
2024-03-01 20:19 ` Dan Williams
2024-03-01 21:53 ` Ira Weiny
2024-02-29 7:13 ` [PATCH 2/4] acpi/ghes: Process CXL Component Events Ira Weiny
2024-03-01 20:51 ` Dan Williams
2024-03-01 22:05 ` Ira Weiny
2024-02-29 7:13 ` [PATCH 3/4] cxl/pci: Register for and process CPER events Ira Weiny
2024-03-01 21:49 ` Dan Williams [this message]
2024-02-29 7:13 ` [PATCH 4/4] ras/events: Trace CXL CPER events even without the CXL stack loaded Ira Weiny
2024-03-01 21:59 ` Dan Williams
2024-03-01 22:19 ` Ira Weiny
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=65e24d7df3521_3651e29492@dwillia2-mobl3.amr.corp.intel.com.notmuch \
--to=dan.j.williams@intel.com \
--cc=Smita.KoralahalliChannabasappa@amd.com \
--cc=alison.schofield@intel.com \
--cc=ardb@kernel.org \
--cc=dan.carpenter@linaro.org \
--cc=dave.jiang@intel.com \
--cc=dave@stgolabs.net \
--cc=ira.weiny@intel.com \
--cc=jonathan.cameron@huawei.com \
--cc=linux-cxl@vger.kernel.org \
--cc=linux-efi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=shiju.jose@huawei.com \
--cc=vishal.l.verma@intel.com \
--cc=yazen.ghannam@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®