<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/mtd/mtdoops.c, branch v6.12.80</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.80</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.80'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2024-07-22T15:56:22+00:00</updated>
<entry>
<title>mtd: mtdoops: Fix kmsgdump parameter renaming.</title>
<updated>2024-07-22T15:56:22+00:00</updated>
<author>
<name>Jocelyn Falempe</name>
<email>jfalempe@redhat.com</email>
</author>
<published>2024-07-19T15:24:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1f7ce4316d8c8ca8fdf5e477fee91012420b1fa3'/>
<id>urn:sha1:1f7ce4316d8c8ca8fdf5e477fee91012420b1fa3</id>
<content type='text'>
When the kmsg_dumper callback parameter changed, the reason variable
in mtdoops_do_dump() was not updated accordingly.
This breaks the build with mtdoops.

Fixes: e1a261ba599e ("printk: Add a short description string to kmsg_dump()")
Suggested-by: Knop Ryszard &lt;ryszard.knop@intel.com&gt;
Signed-off-by: Jocelyn Falempe &lt;jfalempe@redhat.com&gt;
Acked-by: Richard Weinberger &lt;richard@nod.at&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240719152542.1554440-1-jfalempe@redhat.com
</content>
</entry>
<entry>
<title>printk: Add a short description string to kmsg_dump()</title>
<updated>2024-07-17T10:35:24+00:00</updated>
<author>
<name>Jocelyn Falempe</name>
<email>jfalempe@redhat.com</email>
</author>
<published>2024-07-02T12:26:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e1a261ba599eec97e1c5c7760d5c3698fc24e6a6'/>
<id>urn:sha1:e1a261ba599eec97e1c5c7760d5c3698fc24e6a6</id>
<content type='text'>
kmsg_dump doesn't forward the panic reason string to the kmsg_dumper
callback.
This patch adds a new struct kmsg_dump_detail, that will hold the
reason and description, and pass it to the dump() callback.

To avoid updating all kmsg_dump() call, it adds a kmsg_dump_desc()
function and a macro for backward compatibility.

I've written this for drm_panic, but it can be useful for other
kmsg_dumper.
It allows to see the panic reason, like "sysrq triggered crash"
or "VFS: Unable to mount root fs on xxxx" on the drm panic screen.

v2:
 * Use a struct kmsg_dump_detail to hold the reason and description
   pointer, for more flexibility if we want to add other parameters.
   (Kees Cook)
 * Fix powerpc/nvram_64 build, as I didn't update the forward
   declaration of oops_to_nvram()

Signed-off-by: Jocelyn Falempe &lt;jfalempe@redhat.com&gt;
Acked-by: Petr Mladek &lt;pmladek@suse.com&gt;
Acked-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt; (powerpc)
Acked-by: Kees Cook &lt;kees@kernel.org&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240702122639.248110-1-jfalempe@redhat.com
</content>
</entry>
<entry>
<title>mtd: mtdoops: panic caused mtdoops to call mtdoops_erase function immediately</title>
<updated>2022-11-07T16:08:00+00:00</updated>
<author>
<name>Ray Zhang</name>
<email>sgzhang@google.com</email>
</author>
<published>2022-10-10T04:55:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7cc84e0e07d063c246809ea78f51607f858766bf'/>
<id>urn:sha1:7cc84e0e07d063c246809ea78f51607f858766bf</id>
<content type='text'>
The panic function disables the local interrupts, preemption, and all
other processors. When the invoked mtdoops needs to erase a used page,
calling schedule_work() to do it will not work. Instead, just call
mtdoops_erase function immediately.

Tested:
~# echo c &gt; /proc/sysrq-trigger
[  171.654759] sysrq: Trigger a crash
[  171.658325] Kernel panic - not syncing: sysrq triggered crash
......
[  172.406423] mtdoops: not ready 34, 35 (erase immediately)
[  172.432285] mtdoops: ready 34, 35
[  172.435633] Rebooting in 10 seconds..

Signed-off-by: Ray Zhang &lt;sgzhang@google.com&gt;
Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Link: https://lore.kernel.org/linux-mtd/20221010045549.2221965-4-sgzhang@google.com
</content>
</entry>
<entry>
<title>mtd: mtdoops: add mtdoops_erase function and move mtdoops_inc_counter to after it</title>
<updated>2022-11-07T16:07:59+00:00</updated>
<author>
<name>Ray Zhang</name>
<email>sgzhang@google.com</email>
</author>
<published>2022-10-10T04:55:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=340193e079a899f5527cddccff2b5de2c98bc31b'/>
<id>urn:sha1:340193e079a899f5527cddccff2b5de2c98bc31b</id>
<content type='text'>
Preparing for next patch with minimal code difference, add mtdoops_erase
function and move mtdoops_inc_counter to after it, with no functional
change.

Signed-off-by: Ray Zhang &lt;sgzhang@google.com&gt;
Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Link: https://lore.kernel.org/linux-mtd/20221010045549.2221965-3-sgzhang@google.com
</content>
</entry>
<entry>
<title>mtd: mtdoops: change printk() to counterpart pr_ functions</title>
<updated>2022-11-07T16:07:59+00:00</updated>
<author>
<name>Ray Zhang</name>
<email>sgzhang@google.com</email>
</author>
<published>2022-10-10T04:55:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=43cfba56d312f0a45e0b3eaa63606e05ae7fac14'/>
<id>urn:sha1:43cfba56d312f0a45e0b3eaa63606e05ae7fac14</id>
<content type='text'>
To comply with latest kernel code requirement, change printk() to
counterpart pr_ functions in mtdoops driver:
- change printk(INFO) to pr_info()
- change printk(DEBUG) to pr_debug()
- change printk(WARNING) to pr_warn()
- change printk(ERR) to pr_err()

Note that only if dynamic debugging is enabled or DEBUG is defined,
printk(KERN_DEBUG) and pr_debug() are equivalent; Otherwise pr_debug()
is no-op, causing different behavior.

Signed-off-by: Ray Zhang &lt;sgzhang@google.com&gt;
Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Link: https://lore.kernel.org/linux-mtd/20221010045549.2221965-2-sgzhang@google.com
</content>
</entry>
<entry>
<title>mtd: mtdoops: Add a timestamp to the mtdoops header.</title>
<updated>2022-04-26T07:27:12+00:00</updated>
<author>
<name>Jean-Marc Eurin</name>
<email>jmeurin@google.com</email>
</author>
<published>2022-04-25T16:09:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=aa641a22bb5b1971a459b37746b845e3f5f084ca'/>
<id>urn:sha1:aa641a22bb5b1971a459b37746b845e3f5f084ca</id>
<content type='text'>
On some systems, the oops only has relative time from boot.

Signed-off-by: Jean-Marc Eurin &lt;jmeurin@google.com&gt;
Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Link: https://lore.kernel.org/linux-mtd/20220425160927.3823016-1-jmeurin@google.com
</content>
</entry>
<entry>
<title>mtd: mtdoops: Create a header structure for the saved mtdoops.</title>
<updated>2022-04-26T07:27:07+00:00</updated>
<author>
<name>Jean-Marc Eurin</name>
<email>jmeurin@google.com</email>
</author>
<published>2022-04-21T23:42:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0bd359ee712d9d3e757971ded4094c8ba006acd4'/>
<id>urn:sha1:0bd359ee712d9d3e757971ded4094c8ba006acd4</id>
<content type='text'>
Create a dump header to enable the addition of fields without having
to modify the rest of the code.

Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Signed-off-by: Jean-Marc Eurin &lt;jmeurin@google.com&gt;
Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Link: https://lore.kernel.org/linux-mtd/20220421234244.2172003-3-jmeurin@google.com
</content>
</entry>
<entry>
<title>mtd: mtdoops: Fix the size of the header read buffer.</title>
<updated>2022-04-26T07:27:05+00:00</updated>
<author>
<name>Jean-Marc Eurin</name>
<email>jmeurin@google.com</email>
</author>
<published>2022-04-21T23:42:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=fbb83e546ea4543ab0c59dcbfc5a5a1471ea1806'/>
<id>urn:sha1:fbb83e546ea4543ab0c59dcbfc5a5a1471ea1806</id>
<content type='text'>
The read buffer size depends on the MTDOOPS_HEADER_SIZE.

Tested: Changed the header size, it doesn't panic, header is still
read/written correctly.

Signed-off-by: Jean-Marc Eurin &lt;jmeurin@google.com&gt;
Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Link: https://lore.kernel.org/linux-mtd/20220421234244.2172003-2-jmeurin@google.com
</content>
</entry>
<entry>
<title>mtd: mtdoops: remove unnecessary oom message</title>
<updated>2021-06-11T18:43:46+00:00</updated>
<author>
<name>Zhen Lei</name>
<email>thunder.leizhen@huawei.com</email>
</author>
<published>2021-06-10T02:12:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=313ea21aee18f5bb49cbfd767547c935f6d5a018'/>
<id>urn:sha1:313ea21aee18f5bb49cbfd767547c935f6d5a018</id>
<content type='text'>
Fixes scripts/checkpatch.pl warning:
WARNING: Possible unnecessary 'out of memory' message

Remove it can help us save a bit of memory.

Signed-off-by: Zhen Lei &lt;thunder.leizhen@huawei.com&gt;
Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Link: https://lore.kernel.org/linux-mtd/20210610021201.15076-1-thunder.leizhen@huawei.com
</content>
</entry>
<entry>
<title>printk: introduce a kmsg_dump iterator</title>
<updated>2021-03-08T10:43:27+00:00</updated>
<author>
<name>John Ogness</name>
<email>john.ogness@linutronix.de</email>
</author>
<published>2021-03-03T10:15:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f9f3f02db98bbe678a8e57fe9432b196174744a3'/>
<id>urn:sha1:f9f3f02db98bbe678a8e57fe9432b196174744a3</id>
<content type='text'>
Rather than storing the iterator information in the registered
kmsg_dumper structure, create a separate iterator structure. The
kmsg_dump_iter structure can reside on the stack of the caller, thus
allowing lockless use of the kmsg_dump functions.

Update code that accesses the kernel logs using the kmsg_dumper
structure to use the new kmsg_dump_iter structure. For kmsg_dumpers,
this also means adding a call to kmsg_dump_rewind() to initialize
the iterator.

All this is in preparation for removal of @logbuf_lock.

Signed-off-by: John Ogness &lt;john.ogness@linutronix.de&gt;
Reviewed-by: Kees Cook &lt;keescook@chromium.org&gt; # pstore
Reviewed-by: Petr Mladek &lt;pmladek@suse.com&gt;
Signed-off-by: Petr Mladek &lt;pmladek@suse.com&gt;
Link: https://lore.kernel.org/r/20210303101528.29901-13-john.ogness@linutronix.de
</content>
</entry>
</feed>
