<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/arch/s390/include/asm/debug.h, branch v7.1-rc5</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v7.1-rc5</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v7.1-rc5'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2026-02-18T14:22:59+00:00</updated>
<entry>
<title>s390/debug: Convert debug area lock from a spinlock to a raw spinlock</title>
<updated>2026-02-18T14:22:59+00:00</updated>
<author>
<name>Benjamin Block</name>
<email>bblock@linux.ibm.com</email>
</author>
<published>2026-02-17T13:29:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3ce500aac0e71f71b358fe68aa69f0912047968c'/>
<id>urn:sha1:3ce500aac0e71f71b358fe68aa69f0912047968c</id>
<content type='text'>
With PREEMPT_RT as potential configuration option, spinlock_t is now
considered as a sleeping lock, and thus might cause issues when used in
an atomic context. But even with PREEMPT_RT as potential configuration
option, raw_spinlock_t remains as a true spinning lock/atomic context.
This creates potential issues with the s390 debug/tracing feature. The
functions to trace errors are called in various contexts, including
under lock of raw_spinlock_t, and thus the used spinlock_t in each debug
area is in violation of the locking semantics.

Here are two examples involving failing PCI Read accesses that are
traced while holding `pci_lock` in `drivers/pci/access.c`:

=============================
[ BUG: Invalid wait context ]
6.19.0-devel #18 Not tainted
-----------------------------
bash/3833 is trying to lock:
0000027790baee30 (&amp;rc-&gt;lock){-.-.}-{3:3}, at: debug_event_common+0xfc/0x300
other info that might help us debug this:
context-{5:5}
5 locks held by bash/3833:
 #0: 0000027efbb29450 (sb_writers#3){.+.+}-{0:0}, at: ksys_write+0x7c/0xf0
 #1: 00000277f0504a90 (&amp;of-&gt;mutex#2){+.+.}-{4:4}, at: kernfs_fop_write_iter+0x13e/0x260
 #2: 00000277beed8c18 (kn-&gt;active#339){.+.+}-{0:0}, at: kernfs_fop_write_iter+0x164/0x260
 #3: 00000277e9859190 (&amp;dev-&gt;mutex){....}-{4:4}, at: pci_dev_lock+0x2e/0x40
 #4: 00000383068a7708 (pci_lock){....}-{2:2}, at: pci_bus_read_config_dword+0x4a/0xb0
stack backtrace:
CPU: 6 UID: 0 PID: 3833 Comm: bash Kdump: loaded Not tainted 6.19.0-devel #18 PREEMPTLAZY
Hardware name: IBM 9175 ME1 701 (LPAR)
Call Trace:
 [&lt;00000383048afec2&gt;] dump_stack_lvl+0xa2/0xe8
 [&lt;00000383049ba166&gt;] __lock_acquire+0x816/0x1660
 [&lt;00000383049bb1fa&gt;] lock_acquire+0x24a/0x370
 [&lt;00000383059e3860&gt;] _raw_spin_lock_irqsave+0x70/0xc0
 [&lt;00000383048bbb6c&gt;] debug_event_common+0xfc/0x300
 [&lt;0000038304900b0a&gt;] __zpci_load+0x17a/0x1f0
 [&lt;00000383048fad88&gt;] pci_read+0x88/0xd0
 [&lt;00000383054cbce0&gt;] pci_bus_read_config_dword+0x70/0xb0
 [&lt;00000383054d55e4&gt;] pci_dev_wait+0x174/0x290
 [&lt;00000383054d5a3e&gt;] __pci_reset_function_locked+0xfe/0x170
 [&lt;00000383054d9b30&gt;] pci_reset_function+0xd0/0x100
 [&lt;00000383054ee21a&gt;] reset_store+0x5a/0x80
 [&lt;0000038304e98758&gt;] kernfs_fop_write_iter+0x1e8/0x260
 [&lt;0000038304d995da&gt;] new_sync_write+0x13a/0x180
 [&lt;0000038304d9c5d0&gt;] vfs_write+0x200/0x330
 [&lt;0000038304d9c88c&gt;] ksys_write+0x7c/0xf0
 [&lt;00000383059cfa80&gt;] __do_syscall+0x210/0x500
 [&lt;00000383059e4c06&gt;] system_call+0x6e/0x90
INFO: lockdep is turned off.

=============================
[ BUG: Invalid wait context ]
6.19.0-devel #3 Not tainted
-----------------------------
bash/6861 is trying to lock:
0000009da05c7430 (&amp;rc-&gt;lock){-.-.}-{3:3}, at: debug_event_common+0xfc/0x300
other info that might help us debug this:
context-{5:5}
5 locks held by bash/6861:
 #0: 000000acff404450 (sb_writers#3){.+.+}-{0:0}, at: ksys_write+0x7c/0xf0
 #1: 000000acff41c490 (&amp;of-&gt;mutex#2){+.+.}-{4:4}, at: kernfs_fop_write_iter+0x13e/0x260
 #2: 0000009da36937d8 (kn-&gt;active#75){.+.+}-{0:0}, at: kernfs_fop_write_iter+0x164/0x260
 #3: 0000009dd15250d0 (&amp;zdev-&gt;state_lock){+.+.}-{4:4}, at: enable_slot+0x2e/0xc0
 #4: 000001a19682f708 (pci_lock){....}-{2:2}, at: pci_bus_read_config_byte+0x42/0xa0
stack backtrace:
CPU: 16 UID: 0 PID: 6861 Comm: bash Kdump: loaded Not tainted 6.19.0-devel #3 PREEMPTLAZY
Hardware name: IBM 9175 ME1 701 (LPAR)
Call Trace:
 [&lt;000001a194837ec2&gt;] dump_stack_lvl+0xa2/0xe8
 [&lt;000001a194942166&gt;] __lock_acquire+0x816/0x1660
 [&lt;000001a1949431fa&gt;] lock_acquire+0x24a/0x370
 [&lt;000001a19596b810&gt;] _raw_spin_lock_irqsave+0x70/0xc0
 [&lt;000001a194843b6c&gt;] debug_event_common+0xfc/0x300
 [&lt;000001a194888b0a&gt;] __zpci_load+0x17a/0x1f0
 [&lt;000001a194882d88&gt;] pci_read+0x88/0xd0
 [&lt;000001a195453b88&gt;] pci_bus_read_config_byte+0x68/0xa0
 [&lt;000001a195457bc2&gt;] pci_setup_device+0x62/0xad0
 [&lt;000001a195458e70&gt;] pci_scan_single_device+0x90/0xe0
 [&lt;000001a19488a0f6&gt;] zpci_bus_scan_device+0x46/0x80
 [&lt;000001a19547f958&gt;] enable_slot+0x98/0xc0
 [&lt;000001a19547f134&gt;] power_write_file+0xc4/0x110
 [&lt;000001a194e20758&gt;] kernfs_fop_write_iter+0x1e8/0x260
 [&lt;000001a194d215da&gt;] new_sync_write+0x13a/0x180
 [&lt;000001a194d245d0&gt;] vfs_write+0x200/0x330
 [&lt;000001a194d2488c&gt;] ksys_write+0x7c/0xf0
 [&lt;000001a195957a30&gt;] __do_syscall+0x210/0x500
 [&lt;000001a19596cbb6&gt;] system_call+0x6e/0x90
INFO: lockdep is turned off.

Since it is desired to keep it possible to create trace records in most
situations, including this particular case (failing PCI config space
accesses are relevant), convert the used spinlock_t in `struct
debug_info` to raw_spinlock_t.

The impact is small, as the debug area lock only protects bounded memory
access without external dependencies, apart from one function
debug_set_size() where kfree() is implicitly called with the lock held.
Move debug_info_free() out of this lock, to keep remove this external
dependency.

Acked-by: Heiko Carstens &lt;hca@linux.ibm.com&gt;
Signed-off-by: Benjamin Block &lt;bblock@linux.ibm.com&gt;
Signed-off-by: Heiko Carstens &lt;hca@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>s390/pci: Add pci_msg debug view to PCI report</title>
<updated>2024-12-16T15:14:27+00:00</updated>
<author>
<name>Niklas Schnelle</name>
<email>schnelle@linux.ibm.com</email>
</author>
<published>2024-12-13T13:47:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4c41a48f5f3ecd3b963cd3820d2ea41d9a8d6516'/>
<id>urn:sha1:4c41a48f5f3ecd3b963cd3820d2ea41d9a8d6516</id>
<content type='text'>
Using the newly introduced debug_dump() mechanism add formatted content
of pci_debug_msg_id to the PCI report. The formatting is based on the
existing sprintf format but removes caller pointer and area index and
adds an column header. This will allow the platform to collect this log
data together with hardware errors. This sets the reverse flag such that
the newest log entries get added to the PCI report even if not all debug
log entries fit.

Reviewed-by: Halil Pasic &lt;pasic@linux.ibm.com&gt;
Co-developed-by: Halil Pasic &lt;pasic@linux.ibm.com&gt;
Signed-off-by: Halil Pasic &lt;pasic@linux.ibm.com&gt;
Signed-off-by: Niklas Schnelle &lt;schnelle@linux.ibm.com&gt;
Signed-off-by: Alexander Gordeev &lt;agordeev@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>s390/debug: Add a reverse mode for debug_dump()</title>
<updated>2024-12-16T15:14:26+00:00</updated>
<author>
<name>Niklas Schnelle</name>
<email>schnelle@linux.ibm.com</email>
</author>
<published>2024-12-13T13:47:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=dc18c81a57e75c2abfd826164600b5b4f96f5fd9'/>
<id>urn:sha1:dc18c81a57e75c2abfd826164600b5b4f96f5fd9</id>
<content type='text'>
In this mode debug_dump() writes the debug log starting at the newest
entry followed by earlier entries. To this end add a debug_prev_entry()
helper analogous to debug_next_entry() a helper to get the latest entry
which is one before the active entry and a helper to iterate either
forward or backward.

Reviewed-by: Halil Pasic &lt;pasic@linux.ibm.com&gt;
Co-developed-by: Halil Pasic &lt;pasic@linux.ibm.com&gt;
Signed-off-by: Halil Pasic &lt;pasic@linux.ibm.com&gt;
Signed-off-by: Niklas Schnelle &lt;schnelle@linux.ibm.com&gt;
Signed-off-by: Alexander Gordeev &lt;agordeev@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>s390/debug: Add debug_dump() to write debug view to a string buffer</title>
<updated>2024-12-16T15:14:26+00:00</updated>
<author>
<name>Niklas Schnelle</name>
<email>schnelle@linux.ibm.com</email>
</author>
<published>2024-12-13T13:47:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5f952dae48d034b0736593ba98b5aef84038522b'/>
<id>urn:sha1:5f952dae48d034b0736593ba98b5aef84038522b</id>
<content type='text'>
The debug_dump() function allows to get the content of a debug log and
view pair in a string buffer. One future application of this is to
provide debug logs to the platform to be collected with hardware error
logs during recovery.

Reviewed-by: Halil Pasic &lt;pasic@linux.ibm.com&gt;
Co-developed-by: Halil Pasic &lt;pasic@linux.ibm.com&gt;
Signed-off-by: Halil Pasic &lt;pasic@linux.ibm.com&gt;
Signed-off-by: Niklas Schnelle &lt;schnelle@linux.ibm.com&gt;
Signed-off-by: Alexander Gordeev &lt;agordeev@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>s390/debug: Pass in and enforce output buffer size for format handlers</title>
<updated>2024-11-21T11:44:06+00:00</updated>
<author>
<name>Niklas Schnelle</name>
<email>schnelle@linux.ibm.com</email>
</author>
<published>2024-11-14T15:46:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=897614f90f7cd9fd7f5b7acca24dfb55b6c0c4ae'/>
<id>urn:sha1:897614f90f7cd9fd7f5b7acca24dfb55b6c0c4ae</id>
<content type='text'>
The s390dbf format handler rely on being passed an output buffer sized
such that their output will always fit and then use plain sprintf() to
write to it. While only supplied data from other kernel components this
still potentially allows buffer overwrite if callers are not careful.
Instead just pass in the size of the output buffer and use scnprintf()
instead of sprintf() and strscpy() instead of strcpy(). The latter also
allows us to get rid of a separate strlen() call.

Signed-off-by: Niklas Schnelle &lt;schnelle@linux.ibm.com&gt;
Reviewed-by: Heiko Carstens &lt;hca@linux.ibm.com&gt;
Signed-off-by: Heiko Carstens &lt;hca@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>docs: move s390 under arch</title>
<updated>2023-07-24T10:12:24+00:00</updated>
<author>
<name>Costa Shulyupin</name>
<email>costa.shul@redhat.com</email>
</author>
<published>2023-07-18T04:55:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=37002bc6b6039e1491140869c6801e0a2deee43e'/>
<id>urn:sha1:37002bc6b6039e1491140869c6801e0a2deee43e</id>
<content type='text'>
and fix all in-tree references.

Architecture-specific documentation is being moved into Documentation/arch/
as a way of cleaning up the top-level documentation directory and making
the docs hierarchy more closely match the source hierarchy.

Signed-off-by: Costa Shulyupin &lt;costa.shul@redhat.com&gt;
Reviewed-by: Tony Krowiak &lt;akrowiak@linux.ibm.com&gt;
Acked-by: Jonathan Corbet &lt;corbet@lwn.net&gt;
Acked-by: Heiko Carstens &lt;hca@linux.ibm.com&gt;
Reviewed-by: Philippe Mathieu-Daudé &lt;philmd@linaro.org&gt;
Reviewed-by: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Link: https://lore.kernel.org/r/20230718045550.495428-1-costa.shul@redhat.com
Signed-off-by: Heiko Carstens &lt;hca@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>s390/debug: add _ASM_S390_ prefix to header guard</title>
<updated>2023-01-06T15:38:21+00:00</updated>
<author>
<name>Niklas Schnelle</name>
<email>schnelle@linux.ibm.com</email>
</author>
<published>2023-01-03T14:11:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0d4d52361b6c29bf771acd4fa461f06d78fb2fac'/>
<id>urn:sha1:0d4d52361b6c29bf771acd4fa461f06d78fb2fac</id>
<content type='text'>
Using DEBUG_H without a prefix is very generic and inconsistent with
other header guards in arch/s390/include/asm. In fact it collides with
the same name in the ath9k wireless driver though that depends on !S390
via disabled wireless support. Let's just use a consistent header guard
name and prevent possible future trouble.

Signed-off-by: Niklas Schnelle &lt;schnelle@linux.ibm.com&gt;
Signed-off-by: Heiko Carstens &lt;hca@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>s390/debug: fix kernel-doc warnings</title>
<updated>2021-10-11T18:55:58+00:00</updated>
<author>
<name>Randy Dunlap</name>
<email>rdunlap@infradead.org</email>
</author>
<published>2021-10-05T05:16:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4a667ba873088d23c4a6d7564239160c9af11783'/>
<id>urn:sha1:4a667ba873088d23c4a6d7564239160c9af11783</id>
<content type='text'>
Fix kernel-doc warning due to incorrect parameter name in
kernel-doc function notation:

../arch/s390/include/asm/debug.h:484: warning: Function parameter or member 'pages' not described in 'DEFINE_STATIC_DEBUG_INFO'
../arch/s390/include/asm/debug.h:484: warning: Excess function parameter 'pages_per_area' description in 'DEFINE_STATIC_DEBUG_INFO'

Fixes: d72541f94512 ("s390/debug: add early tracing support")
Signed-off-by: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Cc: Heiko Carstens &lt;hca@linux.ibm.com&gt;
Cc: Vasily Gorbik &lt;gor@linux.ibm.com&gt;
Cc: Christian Borntraeger &lt;borntraeger@de.ibm.com&gt;
Cc: linux-s390@vger.kernel.org
Cc: Peter Oberparleiter &lt;oberpar@linux.ibm.com&gt;
Link: https://lore.kernel.org/r/20211005051657.16714-1-rdunlap@infradead.org
Signed-off-by: Christian Borntraeger &lt;borntraeger@de.ibm.com&gt;
Signed-off-by: Vasily Gorbik &lt;gor@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>s390/debug: add early tracing support</title>
<updated>2021-08-25T09:03:35+00:00</updated>
<author>
<name>Peter Oberparleiter</name>
<email>oberpar@linux.ibm.com</email>
</author>
<published>2021-08-13T13:05:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d72541f945127b4873dace501406a1bc8cd8e1e9'/>
<id>urn:sha1:d72541f945127b4873dace501406a1bc8cd8e1e9</id>
<content type='text'>
Debug areas can currently only be used after s390dbf initialization
which occurs as a postcore_initcall. This is too late for tracing
earlier code such as that related to console_init().

This patch introduces a macro for defining a statically initialized
debug area that can be used to trace very early code. The macro is made
available for built-in code only because modules are never running
during early boot.

Example usage:

1. Define static debug area:

  DEFINE_STATIC_DEBUG_INFO(my_debug, "my_debug", 4, 1, 16,
			   &amp;debug_hex_ascii_view);

2. Add trace entry:

  debug_event(&amp;my_debug, 0, "DATA", 4);

Note: The debug area is automatically registered in debugfs during boot.
      A driver must not call any of the debug_register()/_unregister()
      functions on a static debug_info_t!

Signed-off-by: Peter Oberparleiter &lt;oberpar@linux.ibm.com&gt;
Signed-off-by: Heiko Carstens &lt;hca@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>s390/debug: remove unused print defines</title>
<updated>2021-07-27T07:39:14+00:00</updated>
<author>
<name>Heiko Carstens</name>
<email>hca@linux.ibm.com</email>
</author>
<published>2021-07-13T19:09:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b49d08acb5d924866b86059dc58a4efa6f39189b'/>
<id>urn:sha1:b49d08acb5d924866b86059dc58a4efa6f39189b</id>
<content type='text'>
Remove unused print defines from debug feature header file.

Signed-off-by: Heiko Carstens &lt;hca@linux.ibm.com&gt;
</content>
</entry>
</feed>
