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

Ira Weiny
2024-04-02T22:30:30Z

Dave Jiang wrote:
>
>
> On 3/24/24 4:18 PM, ira.weiny@intel.com wrote:
> > From: Navneet Singh <navneet.singh@intel.com>
> >
> > 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@intel.com>
> > Co-developed-by: Ira Weiny <ira.weiny@intel.com>
> > Signed-off-by: Ira Weiny <ira.weiny@intel.com>
>
> Reviewed-by: Dave Jiang <dave.jiang@intel.com>
>
> 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@intel.com/
> > [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