All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [stable request 3.4-3.18] sb_edac: Fix erroneous bytes->gigabytes conversion
       [not found] <CAHTgTXUzBAq=fz5Btu6ZCoNixSg=FLPX6AwzH0BVMincLmaoRg@mail.gmail.com>
@ 2015-04-26 10:50 ` Greg KH
  2015-05-21 23:30   ` [PATCH 3.14] " Vinson Lee
  2015-05-22  0:29   ` [stable request 3.4-3.18] " Vinson Lee
  2015-06-15  3:34 ` Zefan Li
  1 sibling, 2 replies; 4+ messages in thread
From: Greg KH @ 2015-04-26 10:50 UTC (permalink / raw)
  To: Vinson Lee
  Cc: stable, Mauro Carvalho Chehab, Doug Thompson, Borislav Petkov,
	linux-edac, Jim Snow, Lukasz Anaczkowski

On Fri, Apr 10, 2015 at 06:00:26PM -0700, Vinson Lee wrote:
> Please consider upstream 3.19 commit
> 8c009100295597f23978c224aec5751a365bc965 "sb_edac: Fix erroneous
> bytes->gigabytes conversion" for stable trees 3.4 - 3.18.
> 
> This patch addresses an issue introduced with 3.4 commit
> 5b889e379f340f43b1252abde5d37a7084c846b9 "Fix sb_edac compilation with
> 32 bits kernels".
> 
> commit 8c009100295597f23978c224aec5751a365bc965
> Author: Jim Snow <jim.m.snow@intel.com>
> Date:   Tue Nov 18 14:51:09 2014 +0100
> 
>     sb_edac: Fix erroneous bytes->gigabytes conversion
> 
>     Signed-off-by: Jim Snow <jim.snow@intel.com>
>     Signed-off-by: Lukasz Anaczkowski <lukasz.anaczkowski@intel.com>
>     Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

It doesn't apply cleanly to 3.10 or 3.14-stable, can you provide a
working backport?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 3.14] sb_edac: Fix erroneous bytes->gigabytes conversion
  2015-04-26 10:50 ` [stable request 3.4-3.18] sb_edac: Fix erroneous bytes->gigabytes conversion Greg KH
@ 2015-05-21 23:30   ` Vinson Lee
  2015-05-22  0:29   ` [stable request 3.4-3.18] " Vinson Lee
  1 sibling, 0 replies; 4+ messages in thread
From: Vinson Lee @ 2015-05-21 23:30 UTC (permalink / raw)
  To: stable
  Cc: Mauro Carvalho Chehab, Doug Thompson, Borislav Petkov,
	linux-edac, Jim Snow, Lukasz Anaczkowski, Jim Snow, Vinson Lee

From: Jim Snow <jim.m.snow@intel.com>

commit 8c009100295597f23978c224aec5751a365bc965 upstream.

Signed-off-by: Jim Snow <jim.snow@intel.com>
Signed-off-by: Lukasz Anaczkowski <lukasz.anaczkowski@intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
[ vlee: Backported to 3.14. Adjusted context. ]
Signed-off-by: Vinson Lee <vlee@twitter.com>
---
 drivers/edac/sb_edac.c | 38 ++++++++++++++++++++------------------
 1 file changed, 20 insertions(+), 18 deletions(-)

diff --git a/drivers/edac/sb_edac.c b/drivers/edac/sb_edac.c
index c611bcc..3e623ab 100644
--- a/drivers/edac/sb_edac.c
+++ b/drivers/edac/sb_edac.c
@@ -765,7 +765,7 @@ static void get_memory_layout(const struct mem_ctl_info *mci)
 	u32 reg;
 	u64 limit, prv = 0;
 	u64 tmp_mb;
-	u32 mb, kb;
+	u32 gb, mb;
 	u32 rir_way;
 
 	/*
@@ -775,15 +775,17 @@ static void get_memory_layout(const struct mem_ctl_info *mci)
 	pvt->tolm = pvt->info.get_tolm(pvt);
 	tmp_mb = (1 + pvt->tolm) >> 20;
 
-	mb = div_u64_rem(tmp_mb, 1000, &kb);
-	edac_dbg(0, "TOLM: %u.%03u GB (0x%016Lx)\n", mb, kb, (u64)pvt->tolm);
+	gb = div_u64_rem(tmp_mb, 1024, &mb);
+	edac_dbg(0, "TOLM: %u.%03u GB (0x%016Lx)\n",
+		gb, (mb*1000)/1024, (u64)pvt->tolm);
 
 	/* Address range is already 45:25 */
 	pvt->tohm = pvt->info.get_tohm(pvt);
 	tmp_mb = (1 + pvt->tohm) >> 20;
 
-	mb = div_u64_rem(tmp_mb, 1000, &kb);
-	edac_dbg(0, "TOHM: %u.%03u GB (0x%016Lx)\n", mb, kb, (u64)pvt->tohm);
+	gb = div_u64_rem(tmp_mb, 1024, &mb);
+	edac_dbg(0, "TOHM: %u.%03u GB (0x%016Lx)\n",
+		gb, (mb*1000)/1024, (u64)pvt->tohm);
 
 	/*
 	 * Step 2) Get SAD range and SAD Interleave list
@@ -805,11 +807,11 @@ static void get_memory_layout(const struct mem_ctl_info *mci)
 			break;
 
 		tmp_mb = (limit + 1) >> 20;
-		mb = div_u64_rem(tmp_mb, 1000, &kb);
+		gb = div_u64_rem(tmp_mb, 1024, &mb);
 		edac_dbg(0, "SAD#%d %s up to %u.%03u GB (0x%016Lx) Interleave: %s reg=0x%08x\n",
 			 n_sads,
 			 get_dram_attr(reg),
-			 mb, kb,
+			 gb, (mb*1000)/1024,
 			 ((u64)tmp_mb) << 20L,
 			 INTERLEAVE_MODE(reg) ? "8:6" : "[8:6]XOR[18:16]",
 			 reg);
@@ -840,9 +842,9 @@ static void get_memory_layout(const struct mem_ctl_info *mci)
 			break;
 		tmp_mb = (limit + 1) >> 20;
 
-		mb = div_u64_rem(tmp_mb, 1000, &kb);
+		gb = div_u64_rem(tmp_mb, 1024, &mb);
 		edac_dbg(0, "TAD#%d: up to %u.%03u GB (0x%016Lx), socket interleave %d, memory interleave %d, TGT: %d, %d, %d, %d, reg=0x%08x\n",
-			 n_tads, mb, kb,
+			 n_tads, gb, (mb*1000)/1024,
 			 ((u64)tmp_mb) << 20L,
 			 (u32)TAD_SOCK(reg),
 			 (u32)TAD_CH(reg),
@@ -865,10 +867,10 @@ static void get_memory_layout(const struct mem_ctl_info *mci)
 					      tad_ch_nilv_offset[j],
 					      &reg);
 			tmp_mb = TAD_OFFSET(reg) >> 20;
-			mb = div_u64_rem(tmp_mb, 1000, &kb);
+			gb = div_u64_rem(tmp_mb, 1024, &mb);
 			edac_dbg(0, "TAD CH#%d, offset #%d: %u.%03u GB (0x%016Lx), reg=0x%08x\n",
 				 i, j,
-				 mb, kb,
+				 gb, (mb*1000)/1024,
 				 ((u64)tmp_mb) << 20L,
 				 reg);
 		}
@@ -890,10 +892,10 @@ static void get_memory_layout(const struct mem_ctl_info *mci)
 
 			tmp_mb = RIR_LIMIT(reg) >> 20;
 			rir_way = 1 << RIR_WAY(reg);
-			mb = div_u64_rem(tmp_mb, 1000, &kb);
+			gb = div_u64_rem(tmp_mb, 1024, &mb);
 			edac_dbg(0, "CH#%d RIR#%d, limit: %u.%03u GB (0x%016Lx), way: %d, reg=0x%08x\n",
 				 i, j,
-				 mb, kb,
+				 gb, (mb*1000)/1024,
 				 ((u64)tmp_mb) << 20L,
 				 rir_way,
 				 reg);
@@ -904,10 +906,10 @@ static void get_memory_layout(const struct mem_ctl_info *mci)
 						      &reg);
 				tmp_mb = RIR_OFFSET(reg) << 6;
 
-				mb = div_u64_rem(tmp_mb, 1000, &kb);
+				gb = div_u64_rem(tmp_mb, 1024, &mb);
 				edac_dbg(0, "CH#%d RIR#%d INTL#%d, offset %u.%03u GB (0x%016Lx), tgt: %d, reg=0x%08x\n",
 					 i, j, k,
-					 mb, kb,
+					 gb, (mb*1000)/1024,
 					 ((u64)tmp_mb) << 20L,
 					 (u32)RIR_RNK_TGT(reg),
 					 reg);
@@ -945,7 +947,7 @@ static int get_memory_error_data(struct mem_ctl_info *mci,
 	u8			ch_way, sck_way, pkg, sad_ha = 0;
 	u32			tad_offset;
 	u32			rir_way;
-	u32			mb, kb;
+	u32			mb, gb;
 	u64			ch_addr, offset, limit = 0, prv = 0;
 
 
@@ -1183,10 +1185,10 @@ static int get_memory_error_data(struct mem_ctl_info *mci,
 			continue;
 
 		limit = RIR_LIMIT(reg);
-		mb = div_u64_rem(limit >> 20, 1000, &kb);
+		gb = div_u64_rem(limit >> 20, 1024, &mb);
 		edac_dbg(0, "RIR#%d, limit: %u.%03u GB (0x%016Lx), way: %d\n",
 			 n_rir,
-			 mb, kb,
+			 gb, (mb*1000)/1024,
 			 limit,
 			 1 << RIR_WAY(reg));
 		if  (ch_addr <= limit)
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [stable request 3.4-3.18] sb_edac: Fix erroneous bytes->gigabytes conversion
  2015-04-26 10:50 ` [stable request 3.4-3.18] sb_edac: Fix erroneous bytes->gigabytes conversion Greg KH
  2015-05-21 23:30   ` [PATCH 3.14] " Vinson Lee
@ 2015-05-22  0:29   ` Vinson Lee
  1 sibling, 0 replies; 4+ messages in thread
From: Vinson Lee @ 2015-05-22  0:29 UTC (permalink / raw)
  To: Greg KH
  Cc: stable, Mauro Carvalho Chehab, Doug Thompson, Borislav Petkov,
	linux-edac, Jim Snow, Lukasz Anaczkowski, Jiri Slaby

On Sun, Apr 26, 2015 at 3:50 AM, Greg KH <greg@kroah.com> wrote:
> On Fri, Apr 10, 2015 at 06:00:26PM -0700, Vinson Lee wrote:
>> Please consider upstream 3.19 commit
>> 8c009100295597f23978c224aec5751a365bc965 "sb_edac: Fix erroneous
>> bytes->gigabytes conversion" for stable trees 3.4 - 3.18.
>>
>> This patch addresses an issue introduced with 3.4 commit
>> 5b889e379f340f43b1252abde5d37a7084c846b9 "Fix sb_edac compilation with
>> 32 bits kernels".
>>
>> commit 8c009100295597f23978c224aec5751a365bc965
>> Author: Jim Snow <jim.m.snow@intel.com>
>> Date:   Tue Nov 18 14:51:09 2014 +0100
>>
>>     sb_edac: Fix erroneous bytes->gigabytes conversion
>>
>>     Signed-off-by: Jim Snow <jim.snow@intel.com>
>>     Signed-off-by: Lukasz Anaczkowski <lukasz.anaczkowski@intel.com>
>>     Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
>
> It doesn't apply cleanly to 3.10 or 3.14-stable, can you provide a
> working backport?
>
> thanks,
>
> greg k-h
> --
> To unsubscribe from this list: send the line "unsubscribe linux-edac" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


For the stable 3.10 tree, please use the 3.12.41 commit
0fd2dc596b4cbfe1cafc157c2b4ea30dbb95bece backported by Jiri Slaby. It
applies cleanly to 3.10.79.

Cheers,
Vinson

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [stable request 3.4-3.18] sb_edac: Fix erroneous bytes->gigabytes conversion
       [not found] <CAHTgTXUzBAq=fz5Btu6ZCoNixSg=FLPX6AwzH0BVMincLmaoRg@mail.gmail.com>
  2015-04-26 10:50 ` [stable request 3.4-3.18] sb_edac: Fix erroneous bytes->gigabytes conversion Greg KH
@ 2015-06-15  3:34 ` Zefan Li
  1 sibling, 0 replies; 4+ messages in thread
From: Zefan Li @ 2015-06-15  3:34 UTC (permalink / raw)
  To: Vinson Lee
  Cc: stable, Mauro Carvalho Chehab, Doug Thompson, Borislav Petkov,
	linux-edac, Jim Snow, Lukasz Anaczkowski

On 2015/4/11 9:00, Vinson Lee wrote:
> Please consider upstream 3.19 commit
> 8c009100295597f23978c224aec5751a365bc965 "sb_edac: Fix erroneous
> bytes->gigabytes conversion" for stable trees 3.4 - 3.18.
> 

Queued up for 3.4. Thanks!

> This patch addresses an issue introduced with 3.4 commit
> 5b889e379f340f43b1252abde5d37a7084c846b9 "Fix sb_edac compilation with
> 32 bits kernels".
> 
> commit 8c009100295597f23978c224aec5751a365bc965
> Author: Jim Snow <jim.m.snow@intel.com>
> Date:   Tue Nov 18 14:51:09 2014 +0100
> 
>     sb_edac: Fix erroneous bytes->gigabytes conversion
> 
>     Signed-off-by: Jim Snow <jim.snow@intel.com>
>     Signed-off-by: Lukasz Anaczkowski <lukasz.anaczkowski@intel.com>
>     Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-06-15  3:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CAHTgTXUzBAq=fz5Btu6ZCoNixSg=FLPX6AwzH0BVMincLmaoRg@mail.gmail.com>
2015-04-26 10:50 ` [stable request 3.4-3.18] sb_edac: Fix erroneous bytes->gigabytes conversion Greg KH
2015-05-21 23:30   ` [PATCH 3.14] " Vinson Lee
2015-05-22  0:29   ` [stable request 3.4-3.18] " Vinson Lee
2015-06-15  3:34 ` Zefan Li

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.