Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
lede-mikrotik
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Johannes Rudolph
lede-mikrotik
Commits
6b5a4185
Commit
6b5a4185
authored
8 years ago
by
Felix Fietkau
Browse files
Options
Downloads
Patches
Plain Diff
kernel: fix crashlog issues on various architectures
Signed-off-by:
Felix Fietkau
<
nbd@nbd.name
>
parent
eb28a0cd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
target/linux/generic/patches-4.4/930-crashlog.patch
+25
-13
25 additions, 13 deletions
target/linux/generic/patches-4.4/930-crashlog.patch
with
25 additions
and
13 deletions
target/linux/generic/patches-4.4/930-crashlog.patch
+
25
−
13
View file @
6b5a4185
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
+config CRASHLOG
+config CRASHLOG
+ bool "Crash logging"
+ bool "Crash logging"
+ depends on (!NO_BOOTMEM || HAVE_MEMBLOCK)
&& !(ARM || SPARC || PPC)
+ depends on (!NO_BOOTMEM || HAVE_MEMBLOCK)
+
+
config BLK_DEV_INITRD
config BLK_DEV_INITRD
bool "Initial RAM filesystem and RAM disk (initramfs/initrd) support"
bool "Initial RAM filesystem and RAM disk (initramfs/initrd) support"
...
@@ -43,7 +43,7 @@
...
@@ -43,7 +43,7 @@
--- /dev/null
--- /dev/null
+++ b/kernel/crashlog.c
+++ b/kernel/crashlog.c
@@ -0,0 +1,1
81
@@
@@ -0,0 +1,1
93
@@
+/*
+/*
+ * Crash information logger
+ * Crash information logger
+ * Copyright (C) 2010 Felix Fietkau <nbd@nbd.name>
+ * Copyright (C) 2010 Felix Fietkau <nbd@nbd.name>
...
@@ -75,6 +75,7 @@
...
@@ -75,6 +75,7 @@
+#include <linux/kmsg_dump.h>
+#include <linux/kmsg_dump.h>
+#include <linux/module.h>
+#include <linux/module.h>
+#include <linux/pfn.h>
+#include <linux/pfn.h>
+#include <linux/vmalloc.h>
+#include <asm/io.h>
+#include <asm/io.h>
+
+
+#define CRASHLOG_PAGES 4
+#define CRASHLOG_PAGES 4
...
@@ -208,10 +209,21 @@
...
@@ -208,10 +209,21 @@
+
+
+int __init crashlog_init_fs(void)
+int __init crashlog_init_fs(void)
+{
+{
+ if (!crashlog_addr)
+ struct page *pages[CRASHLOG_PAGES];
+ pgprot_t prot;
+ int i;
+
+ if (!crashlog_addr) {
+ printk("No memory allocated for crashlog\n");
+ return -ENOMEM;
+ return -ENOMEM;
+ }
+
+ printk("Crashlog allocated RAM at address 0x%lx\n", (unsigned long) crashlog_addr);
+ for (i = 0; i < CRASHLOG_PAGES; i++)
+ pages[i] = pfn_to_page((crashlog_addr >> PAGE_SHIFT) + i);
+
+
+ crashlog_buf = ioremap(crashlog_addr, CRASHLOG_SIZE);
+ prot = pgprot_writecombine(PAGE_KERNEL);
+ crashlog_buf = vmap(pages, CRASHLOG_PAGES, VM_MAP, prot);
+
+
+ crashlog_copy();
+ crashlog_copy();
+
+
...
@@ -265,12 +277,12 @@
...
@@ -265,12 +277,12 @@
#include <asm-generic/sections.h>
#include <asm-generic/sections.h>
#include <linux/io.h>
#include <linux/io.h>
@@ -5
03
,6 +5
0
4,8 @@
static void
__init_memblock memblock_
in
s
@@ -5
41
,6 +54
2
,8 @@
int
__init_memblock memblock_
add_range(
s
memblock_set_region_node(rgn, nid)
;
type->regions[0].flags = flags
;
type->cnt++
;
memblock_set_region_node(&type->regions[0], nid)
;
type->total_size
+
= size;
type->total_size = size;
+ if (type == &memblock.memory
&& idx == 0
)
+
if (type == &memblock.memory)
+ crashlog_init_memblock(base, size);
+
crashlog_init_memblock(base, size);
}
return 0;
}
/**
repeat:
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment