All of lore.kernel.org
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: "Jérémy Lefaure" <jeremy.lefaure@lse.epita.fr>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
	linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] edac, i5000, i5400: fix definition of nrecmemb register
Date: Thu, 29 Jun 2017 10:36:26 +0200	[thread overview]
Message-ID: <20170629083626.6xve6bfddyx7xajs@pd.tnic> (raw)
In-Reply-To: <20170629005729.8478-1-jeremy.lefaure@lse.epita.fr>

On Wed, Jun 28, 2017 at 08:57:29PM -0400, Jérémy Lefaure wrote:
> In i5000 and i5400 edac drivers, the register nrecmemb is defined as a
> 16 bits value which result in wrong shifts in the code:
>   CHECK   drivers/edac/i5000_edac.c
> drivers/edac/i5000_edac.c:485:15: warning: right shift by bigger than
> source value
> drivers/edac/i5000_edac.c:580:23: warning: right shift by bigger than
> source value
>   CC      drivers/edac/i5000_edac.o
>   CHECK   drivers/edac/i5400_edac.c
> drivers/edac/i5400_edac.c:391:36: warning: right shift by bigger than
> source value
> drivers/edac/i5400_edac.c:401:37: warning: right shift by bigger than
> source value
>   CC      drivers/edac/i5400_edac.o
> 
> In the datasheets ([1], section 3.9.22.20 and [2], section 3.9.22.21),
> this register is a 32 bits register. A u32 value for the register fixes
> the wrong shifts warnings and matches the datasheet.
> 
> This patch also fixes the mask to access to the CAS bits [27:16] in
> the i5000 edac driver.
> 
> [1]: https://www.intel.com/content/dam/doc/datasheet/5000p-5000v-5000z-chipset-memory-controller-hub-datasheet.pdf
> [2]: https://www.intel.se/content/dam/doc/datasheet/5400-chipset-memory-controller-hub-datasheet.pdf
> 
> Signed-off-by: Jérémy Lefaure <jeremy.lefaure@lse.epita.fr>
> ---
> 
> I have found this error thanks to the sparse tool. Please note that this patch
> hasn't been tested on real hardware.
> 
> v2:
> * fix mask in NREC_CAS macro (0xFFF instead of 0x1FFF)
> * fix bits description ("[27:16] instead of "[16 to 28]") in commit message
> 
> 
>  drivers/edac/i5000_edac.c | 6 +++---
>  drivers/edac/i5400_edac.c | 4 ++--
>  2 files changed, 5 insertions(+), 5 deletions(-)

Applied, thanks.

-- 
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.

WARNING: multiple messages have this Message-ID (diff)
From: Borislav Petkov <bp@alien8.de>
To: "Jérémy Lefaure" <jeremy.lefaure@lse.epita.fr>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
	linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [v2] edac, i5000, i5400: fix definition of nrecmemb register
Date: Thu, 29 Jun 2017 10:36:26 +0200	[thread overview]
Message-ID: <20170629083626.6xve6bfddyx7xajs@pd.tnic> (raw)

On Wed, Jun 28, 2017 at 08:57:29PM -0400, Jérémy Lefaure wrote:
> In i5000 and i5400 edac drivers, the register nrecmemb is defined as a
> 16 bits value which result in wrong shifts in the code:
>   CHECK   drivers/edac/i5000_edac.c
> drivers/edac/i5000_edac.c:485:15: warning: right shift by bigger than
> source value
> drivers/edac/i5000_edac.c:580:23: warning: right shift by bigger than
> source value
>   CC      drivers/edac/i5000_edac.o
>   CHECK   drivers/edac/i5400_edac.c
> drivers/edac/i5400_edac.c:391:36: warning: right shift by bigger than
> source value
> drivers/edac/i5400_edac.c:401:37: warning: right shift by bigger than
> source value
>   CC      drivers/edac/i5400_edac.o
> 
> In the datasheets ([1], section 3.9.22.20 and [2], section 3.9.22.21),
> this register is a 32 bits register. A u32 value for the register fixes
> the wrong shifts warnings and matches the datasheet.
> 
> This patch also fixes the mask to access to the CAS bits [27:16] in
> the i5000 edac driver.
> 
> [1]: https://www.intel.com/content/dam/doc/datasheet/5000p-5000v-5000z-chipset-memory-controller-hub-datasheet.pdf
> [2]: https://www.intel.se/content/dam/doc/datasheet/5400-chipset-memory-controller-hub-datasheet.pdf
> 
> Signed-off-by: Jérémy Lefaure <jeremy.lefaure@lse.epita.fr>
> ---
> 
> I have found this error thanks to the sparse tool. Please note that this patch
> hasn't been tested on real hardware.
> 
> v2:
> * fix mask in NREC_CAS macro (0xFFF instead of 0x1FFF)
> * fix bits description ("[27:16] instead of "[16 to 28]") in commit message
> 
> 
>  drivers/edac/i5000_edac.c | 6 +++---
>  drivers/edac/i5400_edac.c | 4 ++--
>  2 files changed, 5 insertions(+), 5 deletions(-)

Applied, thanks.

  reply	other threads:[~2017-06-29  8:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-12 17:47 [PATCH] edac, i5000, i5400: fix definition of nrecmemb register Jérémy Lefaure
2017-06-12 17:47 ` Jérémy Lefaure
2017-06-28 16:08 ` [PATCH] " Borislav Petkov
2017-06-28 16:08   ` Borislav Petkov
2017-06-29  0:54   ` [PATCH] " Jérémy Lefaure
2017-06-29  0:54     ` Jérémy Lefaure
2017-06-29  0:57 ` [PATCH v2] " Jérémy Lefaure
2017-06-29  0:57   ` [v2] " Jérémy Lefaure
2017-06-29  8:36   ` Borislav Petkov [this message]
2017-06-29  8:36     ` Borislav Petkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170629083626.6xve6bfddyx7xajs@pd.tnic \
    --to=bp@alien8.de \
    --cc=jeremy.lefaure@lse.epita.fr \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.