<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/edac/edac_mc.c, branch linux-7.1.y</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=linux-7.1.y</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=linux-7.1.y'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2026-04-14T22:29:55+00:00</updated>
<entry>
<title>Merge tag 'edac_updates_for_v7.1_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras</title>
<updated>2026-04-14T22:29:55+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2026-04-14T22:29:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1834703b8426c92211fd92a0e552fd4ae84dcb71'/>
<id>urn:sha1:1834703b8426c92211fd92a0e552fd4ae84dcb71</id>
<content type='text'>
Pull EDAC updates from Borislav Petkov:

 - amd64_edac: Add support for AMD Zen 3 (family 19h, models 40h–4fh)

 - i10nm: Add GNR error information decoder support as an alternative to
   the firmware decoder

 - versalnet: Restructure the init/teardown logic for correct and more
   readable error handling. Also, fix two memory leaks and a resource
   leak

 - Convert several internal structs to use bounded flex arrays, enabling
   the kernel's runtime checker to catch out-of-bounds memory accesses

 - Mark various sysfs attribute tables read-only, preventing accidental
   modification at runtime

 - The usual fixes and cleanups across the subsystem

* tag 'edac_updates_for_v7.1_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras:
  EDAC/mc: Use kzalloc_flex()
  EDAC/ie31200: Make rpl_s_cfg static
  EDAC/i10nm: Fix spelling mistake "readd" -&gt; "read"
  EDAC/versalnet: Fix device_node leak in mc_probe()
  EDAC/versalnet: Fix memory leak in remove and probe error paths
  EDAC/amd64: Add support for family 19h, models 40h-4fh
  EDAC/i10nm: Add driver decoder for Granite Rapids server
  EDAC/sb: Use kzalloc_flex()
  EDAC/i7core: Use kzalloc_flex()
  EDAC/mpc85xx: Constify device sysfs attributes
  EDAC/device: Allow addition of const sysfs attributes
  EDAC/pci_sysfs: Constify instance sysfs attributes
  EDAC/device: Constify info sysfs attributes
  EDAC/device: Drop unnecessary and dangerous casts of attributes
  EDAC/device: Drop unused macro to_edacdev_attr()
  EDAC/altera: Drop unused field eccmgr_sysfs_attr
  EDAC/versalnet: Refactor memory controller initialization and cleanup
</content>
</entry>
<entry>
<title>EDAC/mc: Fix error path ordering in edac_mc_alloc()</title>
<updated>2026-04-05T15:49:19+00:00</updated>
<author>
<name>Borislav Petkov (AMD)</name>
<email>bp@alien8.de</email>
</author>
<published>2026-03-31T12:16:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=51520e03e70d6c73e33ee7cbe0319767d05764fe'/>
<id>urn:sha1:51520e03e70d6c73e33ee7cbe0319767d05764fe</id>
<content type='text'>
When the mci-&gt;pvt_info allocation in edac_mc_alloc() fails, the error path
will call put_device() which will end up calling the device's release
function.

However, the init ordering is wrong such that device_initialize() happens
*after* the failed allocation and thus the device itself and the release
function pointer are not initialized yet when they're called:

  MCE: In-kernel MCE decoding enabled.
  ------------[ cut here ]------------
  kobject: '(null)': is not initialized, yet kobject_put() is being called.
  WARNING: lib/kobject.c:734 at kobject_put, CPU#22: systemd-udevd
  CPU: 22 UID: 0 PID: 538 Comm: systemd-udevd Not tainted 7.0.0-rc1+ #2 PREEMPT(full)
  RIP: 0010:kobject_put
  Call Trace:
   &lt;TASK&gt;
   edac_mc_alloc+0xbe/0xe0 [edac_core]
   amd64_edac_init+0x7a4/0xff0 [amd64_edac]
   ? __pfx_amd64_edac_init+0x10/0x10 [amd64_edac]
   do_one_initcall
   ...

Reorder the calling sequence so that the device is initialized and thus the
release function pointer is properly set before it can be used.

This was found by Claude while reviewing another EDAC patch.

Fixes: 0bbb265f7089 ("EDAC/mc: Get rid of silly one-shot struct allocation in edac_mc_alloc()")
Reported-by: Claude Code:claude-opus-4.5
Signed-off-by: Borislav Petkov (AMD) &lt;bp@alien8.de&gt;
Reviewed-by: Qiuxu Zhuo &lt;qiuxu.zhuo@intel.com&gt;
Cc: stable@kernel.org
Link: https://patch.msgid.link/20260331121623.4871-1-bp@kernel.org
</content>
</entry>
<entry>
<title>EDAC/mc: Use kzalloc_flex()</title>
<updated>2026-03-31T17:15:21+00:00</updated>
<author>
<name>Rosen Penev</name>
<email>rosenp@gmail.com</email>
</author>
<published>2026-03-27T02:48:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=62ba6d66b22356a6a78fd015c37fd108710dfc32'/>
<id>urn:sha1:62ba6d66b22356a6a78fd015c37fd108710dfc32</id>
<content type='text'>
Convert struct mem_ctl_info to use flex array and use the new flex array
helpers to enable runtime bounds checking, including annotating the array
length member with __counted_by() for extra runtime analysis when requested.

Move memcpy() after the counter assignment so that it is initialized before
the first reference to the flex array, as the new attribute requires.

  [ bp: Heavily massage commit message. ]

Signed-off-by: Rosen Penev &lt;rosenp@gmail.com&gt;
Signed-off-by: Borislav Petkov (AMD) &lt;bp@alien8.de&gt;
Reviewed-by: Yazen Ghannam &lt;yazen.ghannam@amd.com&gt;
Reviewed-by: Qiuxu Zhuo &lt;qiuxu.zhuo@intel.com&gt;
Link: https://patch.msgid.link/20260327024828.7377-1-rosenp@gmail.com
</content>
</entry>
<entry>
<title>Convert more 'alloc_obj' cases to default GFP_KERNEL arguments</title>
<updated>2026-02-22T04:03:00+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2026-02-22T04:03:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=32a92f8c89326985e05dce8b22d3f0aa07a3e1bd'/>
<id>urn:sha1:32a92f8c89326985e05dce8b22d3f0aa07a3e1bd</id>
<content type='text'>
This converts some of the visually simpler cases that have been split
over multiple lines.  I only did the ones that are easy to verify the
resulting diff by having just that final GFP_KERNEL argument on the next
line.

Somebody should probably do a proper coccinelle script for this, but for
me the trivial script actually resulted in an assertion failure in the
middle of the script.  I probably had made it a bit _too_ trivial.

So after fighting that far a while I decided to just do some of the
syntactically simpler cases with variations of the previous 'sed'
scripts.

The more syntactically complex multi-line cases would mostly really want
whitespace cleanup anyway.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Convert 'alloc_obj' family to use the new default GFP_KERNEL argument</title>
<updated>2026-02-22T01:09:51+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2026-02-22T00:37:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=bf4afc53b77aeaa48b5409da5c8da6bb4eff7f43'/>
<id>urn:sha1:bf4afc53b77aeaa48b5409da5c8da6bb4eff7f43</id>
<content type='text'>
This was done entirely with mindless brute force, using

    git grep -l '\&lt;k[vmz]*alloc_objs*(.*, GFP_KERNEL)' |
        xargs sed -i 's/\(alloc_objs*(.*\), GFP_KERNEL)/\1)/'

to convert the new alloc_obj() users that had a simple GFP_KERNEL
argument to just drop that argument.

Note that due to the extreme simplicity of the scripting, any slightly
more complex cases spread over multiple lines would not be triggered:
they definitely exist, but this covers the vast bulk of the cases, and
the resulting diff is also then easier to check automatically.

For the same reason the 'flex' versions will be done as a separate
conversion.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>treewide: Replace kmalloc with kmalloc_obj for non-scalar types</title>
<updated>2026-02-21T09:02:28+00:00</updated>
<author>
<name>Kees Cook</name>
<email>kees@kernel.org</email>
</author>
<published>2026-02-21T07:49:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=69050f8d6d075dc01af7a5f2f550a8067510366f'/>
<id>urn:sha1:69050f8d6d075dc01af7a5f2f550a8067510366f</id>
<content type='text'>
This is the result of running the Coccinelle script from
scripts/coccinelle/api/kmalloc_objs.cocci. The script is designed to
avoid scalar types (which need careful case-by-case checking), and
instead replace kmalloc-family calls that allocate struct or union
object instances:

Single allocations:	kmalloc(sizeof(TYPE), ...)
are replaced with:	kmalloc_obj(TYPE, ...)

Array allocations:	kmalloc_array(COUNT, sizeof(TYPE), ...)
are replaced with:	kmalloc_objs(TYPE, COUNT, ...)

Flex array allocations:	kmalloc(struct_size(PTR, FAM, COUNT), ...)
are replaced with:	kmalloc_flex(*PTR, FAM, COUNT, ...)

(where TYPE may also be *VAR)

The resulting allocations no longer return "void *", instead returning
"TYPE *".

Signed-off-by: Kees Cook &lt;kees@kernel.org&gt;
</content>
</entry>
<entry>
<title>EDAC: Fix typos in comments</title>
<updated>2024-12-15T21:17:34+00:00</updated>
<author>
<name>Yan Zhen</name>
<email>yanzhen@vivo.com</email>
</author>
<published>2024-09-30T07:40:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=586e62fe380feb7992104e3cbbf407371520cb39'/>
<id>urn:sha1:586e62fe380feb7992104e3cbbf407371520cb39</id>
<content type='text'>
Fix the following typos:

'Alocate' ==&gt; 'Allocate',
'specifed' ==&gt; 'specified',
'Technlogy' ==&gt; 'Technology',
'Brnach' ==&gt; 'Branch',
'branchs' ==&gt; 'branches'.

Signed-off-by: Yan Zhen &lt;yanzhen@vivo.com&gt;
Signed-off-by: Borislav Petkov (AMD) &lt;bp@alien8.de&gt;
Link: https://lore.kernel.org/r/20240930074023.618110-1-yanzhen@vivo.com
</content>
</entry>
<entry>
<title>EDAC/mc: Add support for HBM3 memory type</title>
<updated>2023-11-28T15:39:12+00:00</updated>
<author>
<name>Muralidhara M K</name>
<email>muralidhara.mk@amd.com</email>
</author>
<published>2023-11-02T11:42:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9a5f580c1c71b6aedba696c4898a7a7184cef8ad'/>
<id>urn:sha1:9a5f580c1c71b6aedba696c4898a7a7184cef8ad</id>
<content type='text'>
AMD MI300A models use HBM3 (High Bandwidth Memory Gen 3) memory. HBM is
a high-speed computer memory interface for 3D-stacked synchronous
dynamic random-access memory (SDRAM).

Signed-off-by: Muralidhara M K &lt;muralidhara.mk@amd.com&gt;
Signed-off-by: Borislav Petkov (AMD) &lt;bp@alien8.de&gt;
Link: https://lore.kernel.org/r/20231102114225.2006878-4-muralimk@amd.com
</content>
</entry>
<entry>
<title>EDAC/mc: Drop duplicated dimm-&gt;nr_pages debug printout</title>
<updated>2022-09-01T06:52:18+00:00</updated>
<author>
<name>Serge Semin</name>
<email>Sergey.Semin@baikalelectronics.ru</email>
</author>
<published>2022-08-22T19:07:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=93df19476535a4ed871bc5eae719b6d67cf3abc3'/>
<id>urn:sha1:93df19476535a4ed871bc5eae719b6d67cf3abc3</id>
<content type='text'>
The duplicated edac_dbg()-based dimm-&gt;nr_pages print was introduced in

  6e84d359b2be ("edac_mc: Cleanup per-dimm_info debug messages").

The duplicated line can be found even in the commit message text:

  [ 1011.380101] EDAC DEBUG: edac_mc_dump_dimm:   dimm-&gt;nr_pages = 0x40000
  [ 1011.380103] EDAC DEBUG: edac_mc_dump_dimm:   dimm-&gt;grain = 8
  [ 1011.380104] EDAC DEBUG: edac_mc_dump_dimm:   dimm-&gt;nr_pages = 0x40000

Drop the second edac_dbg() call.

  [ bp: Massage commit message. ]

Signed-off-by: Serge Semin &lt;Sergey.Semin@baikalelectronics.ru&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Link: https://lore.kernel.org/r/20220822190730.27277-14-Sergey.Semin@baikalelectronics.ru
</content>
</entry>
<entry>
<title>EDAC: Use kcalloc()</title>
<updated>2022-05-02T09:32:44+00:00</updated>
<author>
<name>Borislav Petkov</name>
<email>bp@suse.de</email>
</author>
<published>2022-04-12T21:10:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=13088b65d93a1c29f07f97931c2b69788ad58f04'/>
<id>urn:sha1:13088b65d93a1c29f07f97931c2b69788ad58f04</id>
<content type='text'>
It is syntactic sugar anyway:

  # drivers/edac/edac_mc.o:

   text    data     bss     dec     hex filename
  13378     324       8   13710    358e edac_mc.o.before
  13378     324       8   13710    358e edac_mc.o.after

md5:
   70a53ee3ac7f867730e35c2be9110748  edac_mc.o.before.asm
   70a53ee3ac7f867730e35c2be9110748  edac_mc.o.after.asm

  # drivers/edac/edac_device.o:

   text    data     bss     dec     hex filename
   5704     120       4    5828    16c4 edac_device.o.before
   5704     120       4    5828    16c4 edac_device.o.after

md5:
   880563c859da6eb9aca85ec431fdbaeb  edac_device.o.before.asm
   880563c859da6eb9aca85ec431fdbaeb  edac_device.o.after.asm

No functional changes.

Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Link: https://lore.kernel.org/r/20220412211957.28899-1-bp@alien8.de
</content>
</entry>
</feed>
