^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) .. SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) pstore block oops/panic logger
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) ==============================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) Introduction
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) ------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) pstore block (pstore/blk) is an oops/panic logger that writes its logs to a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) block device and non-block device before the system crashes. You can get
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) these log files by mounting pstore filesystem like::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) mount -t pstore pstore /sys/fs/pstore
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) pstore block concepts
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) ---------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) pstore/blk provides efficient configuration method for pstore/blk, which
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) divides all configurations into two parts, configurations for user and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) configurations for driver.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) Configurations for user determine how pstore/blk works, such as pmsg_size,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) kmsg_size and so on. All of them support both Kconfig and module parameters,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) but module parameters have priority over Kconfig.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) Configurations for driver are all about block device and non-block device,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) such as total_size of block device and read/write operations.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) Configurations for user
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) -----------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) All of these configurations support both Kconfig and module parameters, but
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) module parameters have priority over Kconfig.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) Here is an example for module parameters::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) pstore_blk.blkdev=179:7 pstore_blk.kmsg_size=64
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) The detail of each configurations may be of interest to you.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) blkdev
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) ~~~~~~
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) The block device to use. Most of the time, it is a partition of block device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) It's required for pstore/blk. It is also used for MTD device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) It accepts the following variants for block device:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) 1. <hex_major><hex_minor> device number in hexadecimal represents itself; no
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) leading 0x, for example b302.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) #. /dev/<disk_name> represents the device number of disk
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) #. /dev/<disk_name><decimal> represents the device number of partition - device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) number of disk plus the partition number
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) #. /dev/<disk_name>p<decimal> - same as the above; this form is used when disk
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) name of partitioned disk ends with a digit.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) #. PARTUUID=00112233-4455-6677-8899-AABBCCDDEEFF represents the unique id of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) a partition if the partition table provides it. The UUID may be either an
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) EFI/GPT UUID, or refer to an MSDOS partition using the format SSSSSSSS-PP,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) where SSSSSSSS is a zero-filled hex representation of the 32-bit
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) "NT disk signature", and PP is a zero-filled hex representation of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) 1-based partition number.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) #. PARTUUID=<UUID>/PARTNROFF=<int> to select a partition in relation to a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) partition with a known unique id.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) #. <major>:<minor> major and minor number of the device separated by a colon.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) It accepts the following variants for MTD device:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) 1. <device name> MTD device name. "pstore" is recommended.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) #. <device number> MTD device number.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) kmsg_size
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) ~~~~~~~~~
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) The chunk size in KB for oops/panic front-end. It **MUST** be a multiple of 4.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) It's optional if you do not care oops/panic log.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) There are multiple chunks for oops/panic front-end depending on the remaining
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) space except other pstore front-ends.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) pstore/blk will log to oops/panic chunks one by one, and always overwrite the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) oldest chunk if there is no more free chunk.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) pmsg_size
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) ~~~~~~~~~
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) The chunk size in KB for pmsg front-end. It **MUST** be a multiple of 4.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) It's optional if you do not care pmsg log.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) Unlike oops/panic front-end, there is only one chunk for pmsg front-end.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) Pmsg is a user space accessible pstore object. Writes to */dev/pmsg0* are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) appended to the chunk. On reboot the contents are available in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) */sys/fs/pstore/pmsg-pstore-blk-0*.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) console_size
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) ~~~~~~~~~~~~
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) The chunk size in KB for console front-end. It **MUST** be a multiple of 4.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) It's optional if you do not care console log.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) Similar to pmsg front-end, there is only one chunk for console front-end.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) All log of console will be appended to the chunk. On reboot the contents are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) available in */sys/fs/pstore/console-pstore-blk-0*.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) ftrace_size
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) ~~~~~~~~~~~
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) The chunk size in KB for ftrace front-end. It **MUST** be a multiple of 4.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) It's optional if you do not care console log.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) Similar to oops front-end, there are multiple chunks for ftrace front-end
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) depending on the count of cpu processors. Each chunk size is equal to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) ftrace_size / processors_count.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) All log of ftrace will be appended to the chunk. On reboot the contents are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) combined and available in */sys/fs/pstore/ftrace-pstore-blk-0*.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) Persistent function tracing might be useful for debugging software or hardware
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) related hangs. Here is an example of usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) # mount -t pstore pstore /sys/fs/pstore
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) # mount -t debugfs debugfs /sys/kernel/debug/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) # echo 1 > /sys/kernel/debug/pstore/record_ftrace
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) # reboot -f
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) [...]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) # mount -t pstore pstore /sys/fs/pstore
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) # tail /sys/fs/pstore/ftrace-pstore-blk-0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) CPU:0 ts:5914676 c0063828 c0063b94 call_cpuidle <- cpu_startup_entry+0x1b8/0x1e0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) CPU:0 ts:5914678 c039ecdc c006385c cpuidle_enter_state <- call_cpuidle+0x44/0x48
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) CPU:0 ts:5914680 c039e9a0 c039ecf0 cpuidle_enter_freeze <- cpuidle_enter_state+0x304/0x314
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) CPU:0 ts:5914681 c0063870 c039ea30 sched_idle_set_state <- cpuidle_enter_state+0x44/0x314
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) CPU:1 ts:5916720 c0160f59 c015ee04 kernfs_unmap_bin_file <- __kernfs_remove+0x140/0x204
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) CPU:1 ts:5916721 c05ca625 c015ee0c __mutex_lock_slowpath <- __kernfs_remove+0x148/0x204
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) CPU:1 ts:5916723 c05c813d c05ca630 yield_to <- __mutex_lock_slowpath+0x314/0x358
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) CPU:1 ts:5916724 c05ca2d1 c05ca638 __ww_mutex_lock <- __mutex_lock_slowpath+0x31c/0x358
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) max_reason
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) ~~~~~~~~~~
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) Limiting which kinds of kmsg dumps are stored can be controlled via
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) the ``max_reason`` value, as defined in include/linux/kmsg_dump.h's
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) ``enum kmsg_dump_reason``. For example, to store both Oopses and Panics,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) ``max_reason`` should be set to 2 (KMSG_DUMP_OOPS), to store only Panics
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) ``max_reason`` should be set to 1 (KMSG_DUMP_PANIC). Setting this to 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) (KMSG_DUMP_UNDEF), means the reason filtering will be controlled by the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) ``printk.always_kmsg_dump`` boot param: if unset, it'll be KMSG_DUMP_OOPS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) otherwise KMSG_DUMP_MAX.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) Configurations for driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) -------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) Only a block device driver cares about these configurations. A block device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) driver uses ``register_pstore_blk`` to register to pstore/blk.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) A non-block device driver uses ``register_pstore_device`` with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) ``struct pstore_device_info`` to register to pstore/blk.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) .. kernel-doc:: fs/pstore/blk.c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) :export:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) Compression and header
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) ----------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) Block device is large enough for uncompressed oops data. Actually we do not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) recommend data compression because pstore/blk will insert some information into
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) the first line of oops/panic data. For example::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) Panic: Total 16 times
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) It means that it's OOPS|Panic for the 16th time since the first booting.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) Sometimes the number of occurrences of oops|panic since the first booting is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) important to judge whether the system is stable.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) The following line is inserted by pstore filesystem. For example::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) Oops#2 Part1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) It means that it's OOPS for the 2nd time on the last boot.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) Reading the data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) ----------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) The dump data can be read from the pstore filesystem. The format for these
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) files is ``dmesg-pstore-blk-[N]`` for oops/panic front-end,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) ``pmsg-pstore-blk-0`` for pmsg front-end and so on. The timestamp of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) dump file records the trigger time. To delete a stored record from block
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) device, simply unlink the respective pstore file.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) Attentions in panic read/write APIs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) -----------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) If on panic, the kernel is not going to run for much longer, the tasks will not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) be scheduled and most kernel resources will be out of service. It
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) looks like a single-threaded program running on a single-core computer.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) The following points require special attention for panic read/write APIs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 1. Can **NOT** allocate any memory.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) If you need memory, just allocate while the block driver is initializing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) rather than waiting until the panic.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) #. Must be polled, **NOT** interrupt driven.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) No task schedule any more. The block driver should delay to ensure the write
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) succeeds, but NOT sleep.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) #. Can **NOT** take any lock.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) There is no other task, nor any shared resource; you are safe to break all
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) locks.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) #. Just use CPU to transfer.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) Do not use DMA to transfer unless you are sure that DMA will not keep lock.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) #. Control registers directly.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) Please control registers directly rather than use Linux kernel resources.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) Do I/O map while initializing rather than wait until a panic occurs.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) #. Reset your block device and controller if necessary.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) If you are not sure of the state of your block device and controller when
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) a panic occurs, you are safe to stop and reset them.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) pstore/blk supports psblk_blkdev_info(), which is defined in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) *linux/pstore_blk.h*, to get information of using block device, such as the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) device number, sector count and start sector of the whole disk.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) pstore block internals
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) ----------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) For developer reference, here are all the important structures and APIs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) .. kernel-doc:: fs/pstore/zone.c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) :internal:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) .. kernel-doc:: include/linux/pstore_zone.h
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) :internal:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) .. kernel-doc:: fs/pstore/blk.c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) :internal:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) .. kernel-doc:: include/linux/pstore_blk.h
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) :internal: