<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/mtd/mtdoops.c, branch v6.6.132</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.132</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.132'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2022-11-07T16:08:00+00:00</updated>
<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>
<entry>
<title>mtd: mtdoops: synchronize kmsg_dumper</title>
<updated>2021-03-08T10:42:46+00:00</updated>
<author>
<name>John Ogness</name>
<email>john.ogness@linutronix.de</email>
</author>
<published>2021-03-03T10:15:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=40ddbbac7f16eb91f9f2bbc414f283102052ce14'/>
<id>urn:sha1:40ddbbac7f16eb91f9f2bbc414f283102052ce14</id>
<content type='text'>
The kmsg_dumper can be called from any context and CPU, possibly
from multiple CPUs simultaneously. Since the writing of the buffer
can occur from a later scheduled work queue, the oops buffer must
be protected against simultaneous dumping.

Use an atomic bit to mark when the buffer is protected. Release the
protection in between setting the buffer and the actual writing in
order for a possible panic (immediate write) to be written during
the scheduling of a previous oops (delayed write).

An atomic bit (rather than a spinlock) was chosen so that no
scheduling or preemption side-effects would be introduced. The MTD
kmsg_dumper may dump directly or it may be delayed (via scheduled
work). Depending on the context, different MTD callbacks are used.
For example, mtd_write() expects to be called in a non-atomic
context and may take a mutex.

Signed-off-by: John Ogness &lt;john.ogness@linutronix.de&gt;
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-3-john.ogness@linutronix.de
</content>
</entry>
<entry>
<title>mtd: mtdoops: Don't write panic data twice</title>
<updated>2020-09-07T12:22:12+00:00</updated>
<author>
<name>Mark Tomlinson</name>
<email>mark.tomlinson@alliedtelesis.co.nz</email>
</author>
<published>2020-09-03T03:42:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c1cf1d57d1492235309111ea6a900940213a9166'/>
<id>urn:sha1:c1cf1d57d1492235309111ea6a900940213a9166</id>
<content type='text'>
If calling mtdoops_write, don't also schedule work to be done later.

Although this appears to not be causing an issue, possibly because the
scheduled work will never get done, it is confusing.

Fixes: 016c1291ce70 ("mtd: mtdoops: do not use mtd-&gt;panic_write directly")
Signed-off-by: Mark Tomlinson &lt;mark.tomlinson@alliedtelesis.co.nz&gt;
Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Link: https://lore.kernel.org/linux-mtd/20200903034217.23079-1-mark.tomlinson@alliedtelesis.co.nz
</content>
</entry>
</feed>
