aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-09-04 00:14:06 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-09-04 00:14:06 -0400
commitf83b0a4e4c33aa31dac0b8b48f1f3a470edc933a (patch)
treefade92500aa68531de6cd4761cc4693ea901540b /drivers/acpi
parent32dad03d164206ea886885d0740284ba215b0970 (diff)
parent3bd11cf56e4d9c9a79c0c1a4ebe381c674ec9709 (diff)
Merge tag 'please-pull-pstore' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux
Pull pstore changes from Tony Luck: "A big part of this is the addition of compression to the generic pstore layer so that all backends can use the pitiful amounts of storage they control more effectively. Three other small fixes/cleanups too. * tag 'please-pull-pstore' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux: pstore/ram: (really) fix undefined usage of rounddown_pow_of_two pstore/ram: Read and write to the 'compressed' flag of pstore efi-pstore: Read and write to the 'compressed' flag of pstore erst: Read and write to the 'compressed' flag of pstore powerpc/pseries: Read and write to the 'compressed' flag of pstore pstore: Add file extension to pstore file if compressed pstore: Add decompression support to pstore pstore: Introduce new argument 'compressed' in the read callback pstore: Add compression support to pstore pstore/Kconfig: Select ZLIB_DEFLATE and ZLIB_INFLATE when PSTORE is selected pstore: Add new argument 'compressed' in pstore write callback powerpc/pseries: Remove (de)compression in nvram with pstore enabled pstore: d_alloc_name() doesn't return an ERR_PTR acpi/apei/erst: Add missing iounmap() on error in erst_exec_move_data()
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/apei/erst.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/drivers/acpi/apei/erst.c b/drivers/acpi/apei/erst.c
index 88d0b0f9f92b..822b1ed3b00f 100644
--- a/drivers/acpi/apei/erst.c
+++ b/drivers/acpi/apei/erst.c
@@ -284,8 +284,10 @@ static int erst_exec_move_data(struct apei_exec_context *ctx,
284 if (!src) 284 if (!src)
285 return -ENOMEM; 285 return -ENOMEM;
286 dst = ioremap(ctx->dst_base + offset, ctx->var2); 286 dst = ioremap(ctx->dst_base + offset, ctx->var2);
287 if (!dst) 287 if (!dst) {
288 iounmap(src);
288 return -ENOMEM; 289 return -ENOMEM;
290 }
289 291
290 memmove(dst, src, ctx->var2); 292 memmove(dst, src, ctx->var2);
291 293
@@ -933,9 +935,9 @@ static int erst_open_pstore(struct pstore_info *psi);
933static int erst_close_pstore(struct pstore_info *psi); 935static int erst_close_pstore(struct pstore_info *psi);
934static ssize_t erst_reader(u64 *id, enum pstore_type_id *type, int *count, 936static ssize_t erst_reader(u64 *id, enum pstore_type_id *type, int *count,
935 struct timespec *time, char **buf, 937 struct timespec *time, char **buf,
936 struct pstore_info *psi); 938 bool *compressed, struct pstore_info *psi);
937static int erst_writer(enum pstore_type_id type, enum kmsg_dump_reason reason, 939static int erst_writer(enum pstore_type_id type, enum kmsg_dump_reason reason,
938 u64 *id, unsigned int part, int count, size_t hsize, 940 u64 *id, unsigned int part, int count, bool compressed,
939 size_t size, struct pstore_info *psi); 941 size_t size, struct pstore_info *psi);
940static int erst_clearer(enum pstore_type_id type, u64 id, int count, 942static int erst_clearer(enum pstore_type_id type, u64 id, int count,
941 struct timespec time, struct pstore_info *psi); 943 struct timespec time, struct pstore_info *psi);
@@ -956,6 +958,9 @@ static struct pstore_info erst_info = {
956#define CPER_SECTION_TYPE_DMESG \ 958#define CPER_SECTION_TYPE_DMESG \
957 UUID_LE(0xc197e04e, 0xd545, 0x4a70, 0x9c, 0x17, 0xa5, 0x54, \ 959 UUID_LE(0xc197e04e, 0xd545, 0x4a70, 0x9c, 0x17, 0xa5, 0x54, \
958 0x94, 0x19, 0xeb, 0x12) 960 0x94, 0x19, 0xeb, 0x12)
961#define CPER_SECTION_TYPE_DMESG_Z \
962 UUID_LE(0x4f118707, 0x04dd, 0x4055, 0xb5, 0xdd, 0x95, 0x6d, \
963 0x34, 0xdd, 0xfa, 0xc6)
959#define CPER_SECTION_TYPE_MCE \ 964#define CPER_SECTION_TYPE_MCE \
960 UUID_LE(0xfe08ffbe, 0x95e4, 0x4be7, 0xbc, 0x73, 0x40, 0x96, \ 965 UUID_LE(0xfe08ffbe, 0x95e4, 0x4be7, 0xbc, 0x73, 0x40, 0x96, \
961 0x04, 0x4a, 0x38, 0xfc) 966 0x04, 0x4a, 0x38, 0xfc)
@@ -989,7 +994,7 @@ static int erst_close_pstore(struct pstore_info *psi)
989 994
990static ssize_t erst_reader(u64 *id, enum pstore_type_id *type, int *count, 995static ssize_t erst_reader(u64 *id, enum pstore_type_id *type, int *count,
991 struct timespec *time, char **buf, 996 struct timespec *time, char **buf,
992 struct pstore_info *psi) 997 bool *compressed, struct pstore_info *psi)
993{ 998{
994 int rc; 999 int rc;
995 ssize_t len = 0; 1000 ssize_t len = 0;
@@ -1034,7 +1039,12 @@ skip:
1034 } 1039 }
1035 memcpy(*buf, rcd->data, len - sizeof(*rcd)); 1040 memcpy(*buf, rcd->data, len - sizeof(*rcd));
1036 *id = record_id; 1041 *id = record_id;
1042 *compressed = false;
1037 if (uuid_le_cmp(rcd->sec_hdr.section_type, 1043 if (uuid_le_cmp(rcd->sec_hdr.section_type,
1044 CPER_SECTION_TYPE_DMESG_Z) == 0) {
1045 *type = PSTORE_TYPE_DMESG;
1046 *compressed = true;
1047 } else if (uuid_le_cmp(rcd->sec_hdr.section_type,
1038 CPER_SECTION_TYPE_DMESG) == 0) 1048 CPER_SECTION_TYPE_DMESG) == 0)
1039 *type = PSTORE_TYPE_DMESG; 1049 *type = PSTORE_TYPE_DMESG;
1040 else if (uuid_le_cmp(rcd->sec_hdr.section_type, 1050 else if (uuid_le_cmp(rcd->sec_hdr.section_type,
@@ -1055,7 +1065,7 @@ out:
1055} 1065}
1056 1066
1057static int erst_writer(enum pstore_type_id type, enum kmsg_dump_reason reason, 1067static int erst_writer(enum pstore_type_id type, enum kmsg_dump_reason reason,
1058 u64 *id, unsigned int part, int count, size_t hsize, 1068 u64 *id, unsigned int part, int count, bool compressed,
1059 size_t size, struct pstore_info *psi) 1069 size_t size, struct pstore_info *psi)
1060{ 1070{
1061 struct cper_pstore_record *rcd = (struct cper_pstore_record *) 1071 struct cper_pstore_record *rcd = (struct cper_pstore_record *)
@@ -1085,7 +1095,10 @@ static int erst_writer(enum pstore_type_id type, enum kmsg_dump_reason reason,
1085 rcd->sec_hdr.flags = CPER_SEC_PRIMARY; 1095 rcd->sec_hdr.flags = CPER_SEC_PRIMARY;
1086 switch (type) { 1096 switch (type) {
1087 case PSTORE_TYPE_DMESG: 1097 case PSTORE_TYPE_DMESG:
1088 rcd->sec_hdr.section_type = CPER_SECTION_TYPE_DMESG; 1098 if (compressed)
1099 rcd->sec_hdr.section_type = CPER_SECTION_TYPE_DMESG_Z;
1100 else
1101 rcd->sec_hdr.section_type = CPER_SECTION_TYPE_DMESG;
1089 break; 1102 break;
1090 case PSTORE_TYPE_MCE: 1103 case PSTORE_TYPE_MCE:
1091 rcd->sec_hdr.section_type = CPER_SECTION_TYPE_MCE; 1104 rcd->sec_hdr.section_type = CPER_SECTION_TYPE_MCE;