All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] EDAC/octeon: enlarge the L2C error message buffer
@ 2026-11-14 12:15 Aibing Chen
  2026-12-05 11:32 ` Thomas Bogendoerfer
  0 siblings, 1 reply; 4+ messages in thread
From: Aibing Chen @ 2026-11-14 12:15 UTC (permalink / raw)
  To: Thomas Bogendoerfer, Borislav Petkov, Tony Luck
  Cc: linux-edac, linux-mips, linux-kernel

_octeon_l2c_poll_oct2() builds an error message by prefixing buf1 with a
short description.  buf1 holds up to 63 characters and the longest
prefix is 33 characters ("Tag Single bit error (corrected):"), so the
message needs up to 97 bytes, but buf2 is only 80 bytes.

Building with W=1 reports a -Wformat-truncation warning for each of the
six snprintf() calls, e.g. for "L2D Double bit error (detected):%s" the
compiler notes that the output can reach 97 bytes including the
terminator, into a destination of size 80.  The printed message then
loses the syndrome, type and way information that buf1 carries.

Size buf2 for the worst case.

Signed-off-by: Aibing Chen <chenaibing@cmss.chinamobile.com>
---
 drivers/edac/octeon_edac-l2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/edac/octeon_edac-l2c.c b/drivers/edac/octeon_edac-l2c.c
index e6b1595a3..5eca6e204 100644
--- a/drivers/edac/octeon_edac-l2c.c
+++ b/drivers/edac/octeon_edac-l2c.c
@@ -62,7 +62,7 @@ static void _octeon_l2c_poll_oct2(struct edac_device_ctl_info *l2c, int tad)
 	union cvmx_l2c_err_tdtx err_tdtx, err_tdtx_reset;
 	union cvmx_l2c_err_ttgx err_ttgx, err_ttgx_reset;
 	char buf1[64];
-	char buf2[80];
+	char buf2[128];
 
 	err_tdtx_reset.u64 = 0;
 	err_tdtx.u64 = cvmx_read_csr(CVMX_L2C_ERR_TDTX(tad));



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

* Re: [PATCH] EDAC/octeon: enlarge the L2C error message buffer
  2026-11-14 12:15 [PATCH] EDAC/octeon: enlarge the L2C error message buffer Aibing Chen
@ 2026-12-05 11:32 ` Thomas Bogendoerfer
  2026-12-05 18:19   ` Borislav Petkov
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Bogendoerfer @ 2026-12-05 11:32 UTC (permalink / raw)
  To: Aibing Chen
  Cc: Borislav Petkov, Tony Luck, linux-edac, linux-mips, linux-kernel

On Sat, Nov 14, 2026 at 08:15:15PM +0800, Aibing Chen wrote:
> _octeon_l2c_poll_oct2() builds an error message by prefixing buf1 with a
> short description.  buf1 holds up to 63 characters and the longest
> prefix is 33 characters ("Tag Single bit error (corrected):"), so the
> message needs up to 97 bytes, but buf2 is only 80 bytes.
> 
> Building with W=1 reports a -Wformat-truncation warning for each of the
> six snprintf() calls, e.g. for "L2D Double bit error (detected):%s" the
> compiler notes that the output can reach 97 bytes including the
> terminator, into a destination of size 80.  The printed message then
> loses the syndrome, type and way information that buf1 carries.
> 
> Size buf2 for the worst case.
> 
> Signed-off-by: Aibing Chen <chenaibing@cmss.chinamobile.com>
> ---
>  drivers/edac/octeon_edac-l2c.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/edac/octeon_edac-l2c.c b/drivers/edac/octeon_edac-l2c.c
> index e6b1595a3..5eca6e204 100644
> --- a/drivers/edac/octeon_edac-l2c.c
> +++ b/drivers/edac/octeon_edac-l2c.c
> @@ -62,7 +62,7 @@ static void _octeon_l2c_poll_oct2(struct edac_device_ctl_info *l2c, int tad)
>  	union cvmx_l2c_err_tdtx err_tdtx, err_tdtx_reset;
>  	union cvmx_l2c_err_ttgx err_ttgx, err_ttgx_reset;
>  	char buf1[64];
> -	char buf2[80];
> +	char buf2[128];
>  
>  	err_tdtx_reset.u64 = 0;
>  	err_tdtx.u64 = cvmx_read_csr(CVMX_L2C_ERR_TDTX(tad));

applied to mips-next

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]

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

* Re: [PATCH] EDAC/octeon: enlarge the L2C error message buffer
  2026-12-05 11:32 ` Thomas Bogendoerfer
@ 2026-12-05 18:19   ` Borislav Petkov
  2026-12-05 19:56     ` Thomas Bogendoerfer
  0 siblings, 1 reply; 4+ messages in thread
From: Borislav Petkov @ 2026-12-05 18:19 UTC (permalink / raw)
  To: Thomas Bogendoerfer
  Cc: Aibing Chen, Tony Luck, linux-edac, linux-mips, linux-kernel

On Sat, Dec 05, 2026 at 12:32:39PM +0100, Thomas Bogendoerfer wrote:
> applied to mips-next

Please unapply it:

https://lore.kernel.org/all/20261202211435.GAaxCKO984UgP1llg5@fat_crate.local

And for the future, it is enough if you ack the EDAC patch but not take it
through your tree so that we avoid cross-tree interactions. I.e., imagine
we're doing some tree-wide changes in EDAC-land and so on.

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

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

* Re: [PATCH] EDAC/octeon: enlarge the L2C error message buffer
  2026-12-05 18:19   ` Borislav Petkov
@ 2026-12-05 19:56     ` Thomas Bogendoerfer
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Bogendoerfer @ 2026-12-05 19:56 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: Aibing Chen, Tony Luck, linux-edac, linux-mips, linux-kernel

On Sat, Dec 05, 2026 at 10:19:24AM -0800, Borislav Petkov wrote:
> On Sat, Dec 05, 2026 at 12:32:39PM +0100, Thomas Bogendoerfer wrote:
> > applied to mips-next
> 
> Please unapply it:

I've reverted it.

> https://lore.kernel.org/all/20261202211435.GAaxCKO984UgP1llg5@fat_crate.local
> 
> And for the future, it is enough if you ack the EDAC patch but not take it
> through your tree so that we avoid cross-tree interactions. I.e., imagine
> we're doing some tree-wide changes in EDAC-land and so on.

noted, 

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]

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

end of thread, other threads:[~2026-12-05 19:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-14 12:15 [PATCH] EDAC/octeon: enlarge the L2C error message buffer Aibing Chen
2026-12-05 11:32 ` Thomas Bogendoerfer
2026-12-05 18:19   ` Borislav Petkov
2026-12-05 19:56     ` Thomas Bogendoerfer

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.