Skip to content

Commit 3ccc00a

Browse files
maheshsalozbenh
authored andcommitted
fadump: Register for firmware assisted dump.
On 2012-02-20 11:02:51 Mon, Paul Mackerras wrote: > On Thu, Feb 16, 2012 at 04:44:30PM +0530, Mahesh J Salgaonkar wrote: > > If I have read the code correctly, we are going to get this printk on > non-pSeries machines or on older pSeries machines, even if the user > has not put the fadump=on option on the kernel command line. The > printk will be annoying since there is no actual error condition. It > seems to me that the condition for the printk should include > fw_dump.fadump_enabled. In other words you should probably add > > if (!fw_dump.fadump_enabled) > return 0; > > at the beginning of the function. Hi Paul, Thanks for pointing it out. Please find the updated patch below. The existing patches above this (4/10 through 10/10) cleanly applies on this update. Thanks, -Mahesh. Signed-off-by: Benjamin Herrenschmidt <[email protected]>
1 parent eb39c88 commit 3ccc00a

File tree

4 files changed

+427
-4
lines changed

4 files changed

+427
-4
lines changed

arch/powerpc/include/asm/fadump.h

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,58 @@
4848
#define FADUMP_HPTE_REGION 0x0002
4949
#define FADUMP_REAL_MODE_REGION 0x0011
5050

51+
/* Dump request flag */
52+
#define FADUMP_REQUEST_FLAG 0x00000001
53+
54+
/* FAD commands */
55+
#define FADUMP_REGISTER 1
56+
#define FADUMP_UNREGISTER 2
57+
#define FADUMP_INVALIDATE 3
58+
59+
/* Kernel Dump section info */
60+
struct fadump_section {
61+
u32 request_flag;
62+
u16 source_data_type;
63+
u16 error_flags;
64+
u64 source_address;
65+
u64 source_len;
66+
u64 bytes_dumped;
67+
u64 destination_address;
68+
};
69+
70+
/* ibm,configure-kernel-dump header. */
71+
struct fadump_section_header {
72+
u32 dump_format_version;
73+
u16 dump_num_sections;
74+
u16 dump_status_flag;
75+
u32 offset_first_dump_section;
76+
77+
/* Fields for disk dump option. */
78+
u32 dd_block_size;
79+
u64 dd_block_offset;
80+
u64 dd_num_blocks;
81+
u32 dd_offset_disk_path;
82+
83+
/* Maximum time allowed to prevent an automatic dump-reboot. */
84+
u32 max_time_auto;
85+
};
86+
87+
/*
88+
* Firmware Assisted dump memory structure. This structure is required for
89+
* registering future kernel dump with power firmware through rtas call.
90+
*
91+
* No disk dump option. Hence disk dump path string section is not included.
92+
*/
93+
struct fadump_mem_struct {
94+
struct fadump_section_header header;
95+
96+
/* Kernel dump sections */
97+
struct fadump_section cpu_state_data;
98+
struct fadump_section hpte_region;
99+
struct fadump_section rmr_region;
100+
};
101+
102+
/* Firmware-assisted dump configuration details. */
51103
struct fw_dump {
52104
unsigned long cpu_state_data_size;
53105
unsigned long hpte_region_size;
@@ -62,10 +114,15 @@ struct fw_dump {
62114
unsigned long fadump_enabled:1;
63115
unsigned long fadump_supported:1;
64116
unsigned long dump_active:1;
117+
unsigned long dump_registered:1;
65118
};
66119

67120
extern int early_init_dt_scan_fw_dump(unsigned long node,
68121
const char *uname, int depth, void *data);
69122
extern int fadump_reserve_mem(void);
123+
extern int setup_fadump(void);
124+
extern int is_fadump_active(void);
125+
#else /* CONFIG_FA_DUMP */
126+
static inline int is_fadump_active(void) { return 0; }
70127
#endif
71128
#endif

0 commit comments

Comments
 (0)