lkml.org 
[lkml]   [2022]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 03/11] cxl/mem: Implement Clear Event Records command
On Wed, Nov 16, 2022 at 03:45:43PM +0000, Jonathan Cameron wrote:
> On Wed, 16 Nov 2022 15:24:26 +0000
> Jonathan Cameron <Jonathan.Cameron@Huawei.com> wrote:
>

[snip]

> >
> >
> > > + */
> > > +struct cxl_mbox_clear_event_payload {
> > > + u8 event_log; /* enum cxl_event_log_type */
> > > + u8 clear_flags;
> > > + u8 nr_recs; /* 1 for this struct */
> > Nope :) Delete the comments so they can't be wrong if this changes in future!
> Ah. You only use one. So should hard code that in the array size below.

No it can can send up to CXL_GET_EVENT_NR_RECORDS at a time : 'nr_rec'.


rc = cxl_clear_event_record(cxlds, type, &payload, nr_rec);


static int cxl_clear_event_record(struct cxl_dev_state *cxlds,
enum cxl_event_log_type log,
struct cxl_get_event_payload *get_pl, u16 nr)
{
struct cxl_mbox_clear_event_payload payload = {
.event_log = log,
.nr_recs = nr,
^^^^^^^^^^^^^^
Here...

};
int i;

for (i = 0; i < nr; i++) {
payload.handle[i] = get_pl->record[i].hdr.handle;
dev_dbg(cxlds->dev, "Event log '%s': Clearning %u\n",
cxl_event_log_type_str(log),
le16_to_cpu(payload.handle[i]));
}
...

Ira

\
 
 \ /
  Last update: 2022-11-17 02:14    [W:0.077 / U:0.688 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site