Lines Matching +full:no +full:- +full:dump +full:- +full:oops

1 // SPDX-License-Identifier: GPL-2.0
3 * Implements pstore backend driver that write to block (or non-block) storage
24 MODULE_PARM_DESC(kmsg_size, "kmsg dump record size in kbytes");
29 "maximum reason for kmsg dump (default 2: Oops and Panic)");
34 static long pmsg_size = -1;
42 static long console_size = -1;
50 static long ftrace_size = -1;
60 * blkdev - the block device to use for pstore storage
61 * See Documentation/admin-guide/pstore-blk.rst for details.
78 if (_##name_ & ((alignsize) - 1)) { \
94 dev->zone.name = _##name_; \
105 return -EINVAL; in __register_pstore_device()
107 if (!dev->zone.total_size) { in __register_pstore_device()
109 return -EINVAL; in __register_pstore_device()
111 if (!dev->zone.read) { in __register_pstore_device()
112 pr_err("no read handler for device\n"); in __register_pstore_device()
113 return -EINVAL; in __register_pstore_device()
115 if (!dev->zone.write) { in __register_pstore_device()
116 pr_err("no write handler for device\n"); in __register_pstore_device()
117 return -EINVAL; in __register_pstore_device()
122 return -EBUSY; in __register_pstore_device()
125 if (!dev->flags) in __register_pstore_device()
126 dev->flags = UINT_MAX; in __register_pstore_device()
129 verify_size(kmsg_size, 4096, dev->flags & PSTORE_FLAGS_DMESG); in __register_pstore_device()
130 verify_size(pmsg_size, 4096, dev->flags & PSTORE_FLAGS_PMSG); in __register_pstore_device()
131 verify_size(console_size, 4096, dev->flags & PSTORE_FLAGS_CONSOLE); in __register_pstore_device()
132 verify_size(ftrace_size, 4096, dev->flags & PSTORE_FLAGS_FTRACE); in __register_pstore_device()
133 dev->zone.max_reason = max_reason; in __register_pstore_device()
136 dev->zone.name = KBUILD_MODNAME; in __register_pstore_device()
137 dev->zone.owner = THIS_MODULE; in __register_pstore_device()
139 ret = register_pstore_zone(&dev->zone); in __register_pstore_device()
146 * register_pstore_device() - register non-block device to pstore/blk
148 * @dev: non-block device information
151 * * 0 - OK
152 * * Others - something error.
170 unregister_pstore_zone(&dev->zone); in __unregister_pstore_device()
176 * unregister_pstore_device() - unregister non-block device from pstore/blk
178 * @dev: non-block device information
198 return -EBUSY; in psblk_generic_blk_write()
208 int ret = -ENODEV; in __register_pstore_blk()
219 if (!S_ISBLK(file_inode(psblk_file)->i_mode)) { in __register_pstore_blk()
224 dev->zone.total_size = in __register_pstore_blk()
225 bdev_nr_bytes(I_BDEV(psblk_file->f_mapping->host)); in __register_pstore_blk()
244 strscpy(info->device, blkdev); in pstore_blk_get_config()
245 info->max_reason = max_reason; in pstore_blk_get_config()
246 info->kmsg_size = check_size(kmsg_size, 4096); in pstore_blk_get_config()
247 info->pmsg_size = check_size(pmsg_size, 4096); in pstore_blk_get_config()
248 info->ftrace_size = check_size(ftrace_size, 4096); in pstore_blk_get_config()
249 info->console_size = check_size(console_size, 4096); in pstore_blk_get_config()
257 static const char devname[] = "/dev/pstore-blk";
262 * mounted yet, and no device nodes are present yet. Use the in early_boot_devpath()
290 /* No best-effort mode requested. */ in __best_effort_init()
297 return -EINVAL; in __best_effort_init()
302 return -ENOMEM; in __best_effort_init()
304 best_effort_dev->zone.read = psblk_generic_blk_read; in __best_effort_init()
305 best_effort_dev->zone.write = psblk_generic_blk_write; in __best_effort_init()
312 pr_info("attached %s (%lu) (no dedicated panic_write!)\n", in __best_effort_init()
313 blkdev, best_effort_dev->zone.total_size); in __best_effort_init()