Re: [PATCH v2 1/1] cxl/core: Fix initialization of mbox_cmd.size_out in get event

From: Dan Williams
Date: Thu Apr 04 2024 - 13:36:06 EST


Jonathan Cameron wrote:
[..]
> >
> > Fix looks correct, but I am concerned it is a band-aid for a more
> > general problem. For example, if I am not mistaken, we have a similar
> > bug in cxl_mem_get_poison().
> >
> > So perhaps a convention to always define @mbox_cmd immediately before
> > cxl_internal_send_cmd() like this:
>
> Makes sense to me. These aren't hot paths, so safe code is worth the
> possible extra writes.

Yeah, the before and after size wise is small:

text data bss dec hex filename
15407 2129 49 17585 44b1 drivers/cxl/core/mbox.o

text data bss dec hex filename
15461 2129 49 17639 44e7 drivers/cxl/core/mbox.o

..which I think is worth the peace of mind, and it matches what is
currently done in cxl_xfer_log()

I will send a follow on with this since this patch is already in
cxl-fixes.