Skip to content

Commit cf48797

Browse files
committed
DebugFs: enable
+ debugFS + raw FS dumper + Fixed keys
1 parent e2102b2 commit cf48797

4 files changed

Lines changed: 51 additions & 14 deletions

File tree

.github/workflows/build-kernel.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,19 +61,19 @@ jobs:
6161
uses: actions/cache@v4
6262
with:
6363
path: ~/.ccache
64-
key: ccache-${{ runner.os }}-${{ matrix.model }}-v1
64+
key: kernel-out-Linux-${{ matrix.model }}-v1
6565
restore-keys: |
66-
ccache-${{ runner.os }}-${{ matrix.model }}-
66+
kernel-out-Linux-${{ matrix.model }}-
6767
6868
- name: Restore kernel build output
6969
uses: actions/cache@v4
7070
with:
7171
path: |
7272
out
7373
toolchain/neutron_18
74-
key: kernel-out-${{ runner.os }}-${{ matrix.model }}-v1
74+
key: kernel-out-Linux-${{ matrix.model }}-v1
7575
restore-keys: |
76-
kernel-out-${{ runner.os }}-${{ matrix.model }}-
76+
kernel-out-Linux-${{ matrix.model }}-
7777
7878
- name: Build kernel
7979
run: |

arch/arm64/configs/exynos9820-m62xx_defconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5799,7 +5799,7 @@ CONFIG_FRAME_WARN=4096
57995799
# CONFIG_READABLE_ASM is not set
58005800
# CONFIG_UNUSED_SYMBOLS is not set
58015801
# CONFIG_PAGE_OWNER is not set
5802-
# CONFIG_DEBUG_FS is not set
5802+
CONFIG_DEBUG_FS=y
58035803
# CONFIG_HEADERS_CHECK is not set
58045804
# CONFIG_DEBUG_SECTION_MISMATCH is not set
58055805
CONFIG_SECTION_MISMATCH_WARN_ONLY=y

arch/arm64/configs/exynos9820_defconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5924,7 +5924,7 @@ CONFIG_FRAME_WARN=4096
59245924
# CONFIG_READABLE_ASM is not set
59255925
# CONFIG_UNUSED_SYMBOLS is not set
59265926
# CONFIG_PAGE_OWNER is not set
5927-
# CONFIG_DEBUG_FS is not set
5927+
CONFIG_DEBUG_FS=y
59285928
# CONFIG_HEADERS_CHECK is not set
59295929
# CONFIG_DEBUG_SECTION_MISMATCH is not set
59305930
CONFIG_SECTION_MISMATCH_WARN_ONLY=y

drivers/soc/samsung/ect_parser.c

Lines changed: 45 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2107,10 +2107,42 @@ static int dump_all_open(struct inode *inode, struct file *file)
21072107
}
21082108

21092109
static struct file_operations ops_all_dump = {
2110-
.open = dump_all_open,
2111-
.read = seq_read,
2112-
.llseek = seq_lseek,
2113-
.release = single_release,
2110+
.open = dump_all_open,
2111+
.read = seq_read,
2112+
.llseek = seq_lseek,
2113+
.release = single_release,
2114+
};
2115+
2116+
static ssize_t ect_raw_blob_read(struct file *file, char __user *user_buf,
2117+
size_t count, loff_t *ppos)
2118+
{
2119+
void *base;
2120+
phys_addr_t phys;
2121+
size_t size;
2122+
2123+
if (!ect_early_vm.phys_addr || !ect_early_vm.size)
2124+
return -ENODEV;
2125+
2126+
phys = ect_early_vm.phys_addr;
2127+
size = ect_early_vm.size;
2128+
2129+
base = memremap(phys, size, MEMREMAP_WB);
2130+
if (!base) {
2131+
pr_err("[ect-raw] failed to remap 0x%llx (size 0x%zx)\n",
2132+
(unsigned long long)phys, size);
2133+
return -ENOMEM;
2134+
}
2135+
2136+
ret = simple_read_from_buffer(user_buf, count, ppos, base, size);
2137+
2138+
memunmap(base);
2139+
2140+
return ret;
2141+
}
2142+
2143+
static const struct file_operations ops_raw_blob_dump = {
2144+
.read = ect_raw_blob_read,
2145+
.llseek = default_llseek,
21142146
};
21152147

21162148
static ssize_t create_binary_store(struct class *class,
@@ -2172,10 +2204,15 @@ static int ect_dump_init(void)
21722204
if (!d)
21732205
return -ENOMEM;
21742206

2175-
d = debugfs_create_file(ect_header_info.dump_node_name, S_IRUGO, root, &ect_header_info,
2176-
&ect_header_info.dump_ops);
2177-
if (!d)
2178-
return -ENOMEM;
2207+
d = debugfs_create_file("raw_blob", S_IRUGO, root, NULL,
2208+
&ops_raw_blob_dump);
2209+
if (!d)
2210+
return -ENOMEM;
2211+
2212+
d = debugfs_create_file(ect_header_info.dump_node_name, S_IRUGO, root, &ect_header_info,
2213+
&ect_header_info.dump_ops);
2214+
if (!d)
2215+
return -ENOMEM;
21792216

21802217
for (i = 0; i < ARRAY_SIZE32(ect_list); ++i) {
21812218
if (ect_list[i].block_handle == NULL)

0 commit comments

Comments
 (0)