lkml.org 
[lkml]   [2022]   [Nov]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 3/9] platform/x86/intel/sdsi: Support different GUIDs
From
Date
On Wed, 2022-11-02 at 12:44 +0200, Andy Shevchenko wrote:
> On Tue, Nov 01, 2022 at 12:10:17PM -0700, David E. Box wrote:
> > Newer versions of Intel On Demand hardware may have an expanded list of
> > registers to support new features. The register layout is identified by a
> > unique GUID that's read during driver probe. Add support for handling
> > different GUIDs and add support for current GUIDs [1].
> > [1] https://github.com/intel/intel-sdsi/blob/master/os-interface.rst
>
> Link: tag?

Ack

>
> ...
>
> > #define SDSI_MIN_SIZE_DWORDS 276
> > -#define SDSI_SIZE_CONTROL 8
> > #define SDSI_SIZE_MAILBOX 1024
> > -#define SDSI_SIZE_REGS 72
> > +#define SDSI_SIZE_REGS 80
> > #define SDSI_SIZE_CMD sizeof(u64)
> > +#define SDSI_SIZE_MAILBOX 1024
>
> Why do you need this second time?

typo

>
> ...
>
> > +static int sdsi_get_layout(struct sdsi_priv *priv, struct disc_table
> > *table)
> > +{
> > + switch (table->guid) {
> > + case SDSI_GUID_V1:
> > + priv->control_size = 8;
> > + priv->registers_size = 72;
> > + break;
> > + case SDSI_GUID_V2:
> > + priv->control_size = 16;
> > + priv->registers_size = 80;
>
> Maybe it makes sense to use previously defined constants here instead of
> magics?

The constant is used for the file size, which since is static is set to the max.
But I'll add defines for these.

>
> > + break;
> > + default:
> > + dev_err(priv->dev, "Unrecognized GUID 0x%x\n", table->guid);
> > + return -EINVAL;
> > + }
> > + return 0;
> > +}

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