Re: [PATCH 01/26] cxl/mbox: Flag support for Dynamic Capacity Devices (DCD)

From: Ira Weiny
Date: Tue Apr 02 2024 - 18:30:47 EST


Dave Jiang wrote:
>
>
> On 3/24/24 4:18 PM, ira.weiny@xxxxxxxxx wrote:
> > From: Navneet Singh <navneet.singh@xxxxxxxxx>
> >
> > Per the CXL 3.1 specification software must check the Command Effects
> > Log (CEL) to know if a device supports dynamic capacity (DC). If the
> > device does support DC the specifics of the DC Regions (0-7) are read
> > through the mailbox.
> >
> > Flag DC Device (DCD) commands in a device if they are supported.
> > Subsequent patches will key off these bits to configure DCD.
> >
> > Signed-off-by: Navneet Singh <navneet.singh@xxxxxxxxx>
> > Co-developed-by: Ira Weiny <ira.weiny@xxxxxxxxx>
> > Signed-off-by: Ira Weiny <ira.weiny@xxxxxxxxx>
>
> Reviewed-by: Dave Jiang <dave.jiang@xxxxxxxxx>
>
> small formatting nit below
>
> > ---
> > Changes for v1
> > [iweiny: update to latest master]
> > [iweiny: update commit message]
> > [iweiny: Based on the fix:
> > https://lore.kernel.org/all/20230903-cxl-cel-fix-v1-1-e260c9467be3@xxxxxxxxx/
> > [jonathan: remove unneeded format change]
> > [jonathan: don't split security code in mbox.c]
> > ---
> > drivers/cxl/core/mbox.c | 33 +++++++++++++++++++++++++++++++++
> > drivers/cxl/cxlmem.h | 15 +++++++++++++++
> > 2 files changed, 48 insertions(+)
> >
> > diff --git a/drivers/cxl/core/mbox.c b/drivers/cxl/core/mbox.c
> > index 9adda4795eb7..ed4131c6f50b 100644
> > --- a/drivers/cxl/core/mbox.c
> > +++ b/drivers/cxl/core/mbox.c
> > @@ -161,6 +161,34 @@ static void cxl_set_security_cmd_enabled(struct cxl_security_state *security,
> > }
> > }
> >
> > +static bool cxl_is_dcd_command(u16 opcode)
> > +{
> > +#define CXL_MBOX_OP_DCD_CMDS 0x48
> > +
> > + return (opcode >> 8) == CXL_MBOX_OP_DCD_CMDS;
> > +}
> > +
> > +static void cxl_set_dcd_cmd_enabled(struct cxl_memdev_state *mds,
> > + u16 opcode)
>
> This seems misaligned.

Fixed,
Ira