* EDAC, skx_edac: Fix logical channel intermediate decoding bug
@ 2018-10-09 17:20 Luck, Tony
0 siblings, 0 replies; 2+ messages in thread
From: Luck, Tony @ 2018-10-09 17:20 UTC (permalink / raw)
To: Borislav Petkov
Cc: Qiuxu Zhuo, Tony Luck, Aristeu Rozanski, Mauro Carvalho Chehab,
linux-edac
From: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
The code "lchan = (lchan << 1) | ~lchan" for logical channel
intermediate decoding is wrong. The wrong intermediate decoding
result is {0xffffffff, 0xfffffffe}.
Fix it by replacing '~' with '!'. The correct intermediate
decoding result is {0x1, 0x2}.
Cc: stable@vger.kernel.org
Signed-off-by: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
---
drivers/edac/skx_edac.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/edac/skx_edac.c b/drivers/edac/skx_edac.c
index fae095162c01..45c5a8931a58 100644
--- a/drivers/edac/skx_edac.c
+++ b/drivers/edac/skx_edac.c
@@ -668,7 +668,7 @@ static bool skx_sad_decode(struct decoded_addr *res)
break;
case 2:
lchan = (addr >> shift) % 2;
- lchan = (lchan << 1) | ~lchan;
+ lchan = (lchan << 1) | !lchan;
break;
case 3:
lchan = ((addr >> shift) % 2) << 1;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* EDAC, skx_edac: Fix logical channel intermediate decoding bug
@ 2018-10-09 17:38 Borislav Petkov
0 siblings, 0 replies; 2+ messages in thread
From: Borislav Petkov @ 2018-10-09 17:38 UTC (permalink / raw)
To: Tony Luck; +Cc: Qiuxu Zhuo, Aristeu Rozanski, Mauro Carvalho Chehab, linux-edac
On Tue, Oct 09, 2018 at 10:20:25AM -0700, Tony Luck wrote:
> From: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
>
> The code "lchan = (lchan << 1) | ~lchan" for logical channel
> intermediate decoding is wrong. The wrong intermediate decoding
> result is {0xffffffff, 0xfffffffe}.
>
> Fix it by replacing '~' with '!'. The correct intermediate
> decoding result is {0x1, 0x2}.
>
> Cc: stable@vger.kernel.org
> Signed-off-by: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
> Signed-off-by: Tony Luck <tony.luck@intel.com>
> ---
> drivers/edac/skx_edac.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/edac/skx_edac.c b/drivers/edac/skx_edac.c
> index fae095162c01..45c5a8931a58 100644
> --- a/drivers/edac/skx_edac.c
> +++ b/drivers/edac/skx_edac.c
> @@ -668,7 +668,7 @@ static bool skx_sad_decode(struct decoded_addr *res)
> break;
> case 2:
> lchan = (addr >> shift) % 2;
> - lchan = (lchan << 1) | ~lchan;
> + lchan = (lchan << 1) | !lchan;
> break;
> case 3:
> lchan = ((addr >> shift) % 2) << 1;
> --
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-10-09 17:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-09 17:20 EDAC, skx_edac: Fix logical channel intermediate decoding bug Luck, Tony
2018-10-09 17:38 Borislav Petkov
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.