mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
Merge branch 'pstore' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux
* 'pstore' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux: pstore: make pstore write function return normal success/fail value pstore: change mutex locking to spin_locks pstore: defer inserting OOPS entries into pstore
This commit is contained in:
commit
1c39865151
6 changed files with 129 additions and 43 deletions
|
|
@ -490,8 +490,8 @@ static ssize_t efi_pstore_read(u64 *id, enum pstore_type_id *type,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static u64 efi_pstore_write(enum pstore_type_id type, unsigned int part,
|
||||
size_t size, struct pstore_info *psi)
|
||||
static int efi_pstore_write(enum pstore_type_id type, u64 *id,
|
||||
unsigned int part, size_t size, struct pstore_info *psi)
|
||||
{
|
||||
char name[DUMP_NAME_LEN];
|
||||
char stub_name[DUMP_NAME_LEN];
|
||||
|
|
@ -499,7 +499,7 @@ static u64 efi_pstore_write(enum pstore_type_id type, unsigned int part,
|
|||
efi_guid_t vendor = LINUX_EFI_CRASH_GUID;
|
||||
struct efivars *efivars = psi->data;
|
||||
struct efivar_entry *entry, *found = NULL;
|
||||
int i;
|
||||
int i, ret = 0;
|
||||
|
||||
sprintf(stub_name, "dump-type%u-%u-", type, part);
|
||||
sprintf(name, "%s%lu", stub_name, get_seconds());
|
||||
|
|
@ -548,18 +548,19 @@ static u64 efi_pstore_write(enum pstore_type_id type, unsigned int part,
|
|||
efivar_unregister(found);
|
||||
|
||||
if (size)
|
||||
efivar_create_sysfs_entry(efivars,
|
||||
ret = efivar_create_sysfs_entry(efivars,
|
||||
utf16_strsize(efi_name,
|
||||
DUMP_NAME_LEN * 2),
|
||||
efi_name, &vendor);
|
||||
|
||||
return part;
|
||||
*id = part;
|
||||
return ret;
|
||||
};
|
||||
|
||||
static int efi_pstore_erase(enum pstore_type_id type, u64 id,
|
||||
struct pstore_info *psi)
|
||||
{
|
||||
efi_pstore_write(type, id, 0, psi);
|
||||
efi_pstore_write(type, &id, (unsigned int)id, 0, psi);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -580,8 +581,8 @@ static ssize_t efi_pstore_read(u64 *id, enum pstore_type_id *type,
|
|||
return -1;
|
||||
}
|
||||
|
||||
static u64 efi_pstore_write(enum pstore_type_id type, unsigned int part,
|
||||
size_t size, struct pstore_info *psi)
|
||||
static int efi_pstore_write(enum pstore_type_id type, u64 *id,
|
||||
unsigned int part, size_t size, struct pstore_info *psi)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -978,7 +979,7 @@ int register_efivars(struct efivars *efivars,
|
|||
if (efivars->efi_pstore_info.buf) {
|
||||
efivars->efi_pstore_info.bufsize = 1024;
|
||||
efivars->efi_pstore_info.data = efivars;
|
||||
mutex_init(&efivars->efi_pstore_info.buf_mutex);
|
||||
spin_lock_init(&efivars->efi_pstore_info.buf_lock);
|
||||
pstore_register(&efivars->efi_pstore_info);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue