lkml.org 
[lkml]   [2023]   [Feb]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/5] platform/x86/intel/ifs: Implement Array BIST test
On Wed, Feb 01, 2023 at 07:19:15PM +0100, Greg KH wrote:
> It shouldn't be that hard, lots of people use them today.
>
> Try and see!


Extract from the first of our in-field-scan tests:

while (activate.start <= activate.stop) {

... trigger scan ...

if (status.chunk_num == activate.start) {
... check for too many retries on same chunk ...
} else {
activate.start = status.chunk_num;
}
}

using <linux/bitfield.h> becomes:

while (FIELD_GET(GENMASK(7, 0), activate) <= FIELD_GET(GENMASK(15, 8), activate) {


if (FIELD_GET(GENMASK(7, 0), status) == FIELD_GET(GENMASK(7, 0), activate) {
...
} else {
activate &= ~GENMASK(7, 0);
activate |= FIELD_PREP(GENMASK(7, 0), FIELD_GET(GENMASK(7, 0), status));
}
}

While I can make that more legible with some helper #defines for the
fields, it becomes more difficult to write, and no easier to read (since
I then have to chase down what the macros are doing).

If this were in some performance critical path, I might worry about
whether the generated code was good enough. But this code path isn't
remotely critical to anyone. The test takes up to 200 usec, so saving
a handful of cycles in the surrounding code will be in the noise.

-Tony

\
 
 \ /
  Last update: 2023-03-27 00:06    [W:0.087 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site