From: Ira Weiny <ira.weiny@intel.com>
To: Smita Koralahalli <Smita.KoralahalliChannabasappa@amd.com>
Cc: Dan Williams <dan.j.williams@intel.com>,
Steven Rostedt <rostedt@goodmis.org>,
Alison Schofield <alison.schofield@intel.com>,
"Vishal Verma" <vishal.l.verma@intel.com>,
Ben Widawsky <bwidawsk@kernel.org>,
Jonathan Cameron <Jonathan.Cameron@huawei.com>,
Davidlohr Bueso <dave@stgolabs.net>,
<linux-kernel@vger.kernel.org>, <linux-cxl@vger.kernel.org>,
<yazen.ghannam@amd.com>
Subject: Re: [RFC V2 PATCH 02/11] cxl/mem: Implement Get Event Records command
Date: Thu, 20 Oct 2022 22:11:57 -0700 [thread overview]
Message-ID: <Y1IqHTlyD3L7CS9a@iweiny-desk3> (raw)
In-Reply-To: <e29a0dfc-b8b0-ace7-0db9-d63ea6e635c3@amd.com>
On Thu, Oct 20, 2022 at 04:50:30PM -0500, Smita Koralahalli wrote:
> Hi Ira,
>
> On 10/10/22 5:41 PM, ira.weiny@intel.com wrote:
> > From: Ira Weiny <ira.weiny@intel.com>
> >
> >
[snip]
> > +
> > +/**
> > + * cxl_mem_get_event_records - Get Event Records from the device
> > + * @cxlds: The device data for the operation
> > + *
> > + * Retrieve all event records available on the device and report them as trace
> > + * events.
> > + *
> > + * See CXL rev 3.0 @8.2.9.2.2 Get Event Records
> > + */
> > +void cxl_mem_get_event_records(struct cxl_dev_state *cxlds)
> > +{
> > + enum cxl_event_log_type log_type;
> > +
> > + dev_dbg(cxlds->dev, "Reading event logs\n");
> > +
> > + for (log_type = CXL_EVENT_TYPE_INFO;
> > + log_type < CXL_EVENT_TYPE_MAX; log_type++)
>
> Why should we loop through each event log here?
The idea was to clear all the event logs. I think this made more sense before
the addition of the optional dynamic capacity log.
>
> What if the event
> record doesn't exist in the event log?
An empty log does not cause any issue. The query will simply return 0 records
which is valid.
>
> I got some Mailbox error messages like this while bootup..
> [ 346.387010] cxl_pci 0000:7f:00.0: Sending command
> [ 346.387181] cxl_pci 0000:7f:00.0: Doorbell wait took 0ms
> [ 346.387197] cxl_pci 0000:7f:00.0: Mailbox operation had an error: cmd
> input was invalid
> [ 346.387205] cxl_pci 0000:7f:00.0: Event log 'Warning': Failed to query
> event records : -6
> ..
>
> Can we just read the "Event Status" field from Event Status Register
> (Device Status Registers Capability Offset + 00h) 8.2.8.3.1 in CXL Spec,
> determine if the records exist and just query those event logs?
Likely the hardware does not have the dynamic capacity log and so the code is
asking for something invalid. I did not think of that when I added that new
log. Checking status register looks to be the proper solution.
I'll throw in some testing in QEMU for this. I'll also have to implement the
status register in QEMU to fully test.
Thanks for the testing! :-D
Ira
>
> Thanks,
> Smita
>
> > + cxl_mem_get_records_log(cxlds, log_type);
> > +}
> > +EXPORT_SYMBOL_NS_GPL(cxl_mem_get_event_records, CXL);
> > +
> > /**
> > * cxl_mem_get_partition_info - Get partition info
> > * @cxlds: The device data for the operation
next prev parent reply other threads:[~2022-10-21 5:12 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-10 22:41 [RFC V2 PATCH 00/11] CXL: Process event logs ira.weiny
2022-10-10 22:41 ` [RFC V2 PATCH 01/11] cxl/mbox: Add debug of hardware error code ira.weiny
2022-10-11 10:41 ` Jonathan Cameron
2022-10-14 16:29 ` Davidlohr Bueso
2022-10-14 16:31 ` Davidlohr Bueso
2022-10-14 17:00 ` Ira Weiny
2022-10-10 22:41 ` [RFC V2 PATCH 02/11] cxl/mem: Implement Get Event Records command ira.weiny
2022-10-11 12:39 ` Jonathan Cameron
2022-10-14 19:21 ` Ira Weiny
2022-10-15 11:28 ` Steven Rostedt
2022-10-16 21:43 ` Ira Weiny
2022-10-20 21:50 ` Smita Koralahalli
2022-10-21 5:11 ` Ira Weiny [this message]
2022-10-10 22:41 ` [RFC V2 PATCH 03/11] cxl/mem: Implement Clear " ira.weiny
2022-10-10 22:41 ` [RFC V2 PATCH 04/11] cxl/mem: Clear events on driver load ira.weiny
2022-10-11 12:42 ` Jonathan Cameron
2022-10-10 22:41 ` [RFC V2 PATCH 05/11] cxl/mem: Trace General Media Event Record ira.weiny
2022-10-11 12:57 ` Jonathan Cameron
2022-10-14 23:33 ` Ira Weiny
2022-10-17 16:37 ` Jonathan Cameron
2022-10-17 17:21 ` Steven Rostedt
2022-10-18 9:46 ` Jonathan Cameron
2022-10-21 5:13 ` Ira Weiny
2022-10-15 11:30 ` Steven Rostedt
2022-10-10 22:41 ` [RFC V2 PATCH 06/11] cxl/mem: Trace DRAM " ira.weiny
2022-10-11 13:47 ` Jonathan Cameron
2022-10-14 23:45 ` Ira Weiny
2022-10-15 11:31 ` Steven Rostedt
2022-10-10 22:41 ` [RFC V2 PATCH 07/11] cxl/mem: Trace Memory Module " ira.weiny
2022-10-11 13:54 ` Jonathan Cameron
2022-10-15 11:32 ` Steven Rostedt
2022-10-10 22:41 ` [RFC V2 PATCH 08/11] cxl/test: Add generic mock events ira.weiny
2022-10-10 22:41 ` [RFC V2 PATCH 09/11] cxl/test: Add specific events ira.weiny
2022-10-10 22:41 ` [RFC V2 PATCH 10/11] cxl/test: Simulate event log overflow ira.weiny
2022-10-10 22:41 ` [RFC V2 PATCH 11/11] cxl/mem: Wire up event interrupts ira.weiny
2022-10-12 18:01 ` Davidlohr Bueso
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=Y1IqHTlyD3L7CS9a@iweiny-desk3 \
--to=ira.weiny@intel.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=Smita.KoralahalliChannabasappa@amd.com \
--cc=alison.schofield@intel.com \
--cc=bwidawsk@kernel.org \
--cc=dan.j.williams@intel.com \
--cc=dave@stgolabs.net \
--cc=linux-cxl@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rostedt@goodmis.org \
--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