android_kernel_samsung_a7y1.../drivers/firmware
Duncan Laurie 43df296d7d gsmi: Fix bug in append_to_eventlog sysfs handler
[ Upstream commit 655603de68469adaff16842ac17a5aec9c9ce89b ]

The sysfs handler should return the number of bytes consumed, which in the
case of a successful write is the entire buffer.  Also fix a bug where
param.data_len was being set to (count - (2 * sizeof(u32))) instead of just
(count - sizeof(u32)).  The latter is correct because we skip over the
leading u32 which is our param.type, but we were also incorrectly
subtracting sizeof(u32) on the line where we were actually setting
param.data_len:

	param.data_len = count - sizeof(u32);

This meant that for our example event.kernel_software_watchdog with total
length 10 bytes, param.data_len was just 2 prior to this change.

To test, successfully append an event to the log with gsmi sysfs.
This sample event is for a "Kernel Software Watchdog"

> xxd -g 1 event.kernel_software_watchdog
0000000: 01 00 00 00 ad de 06 00 00 00

> cat event.kernel_software_watchdog > /sys/firmware/gsmi/append_to_eventlog

> mosys eventlog list | tail -1
14 | 2012-06-25 10:14:14 | Kernl Event | Software Watchdog

Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
Signed-off-by: Furquan Shaikh <furquan@google.com>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Justin TerAvest <teravest@chromium.org>
[zwisler: updated changelog for 2nd bug fix and upstream]
Signed-off-by: Ross Zwisler <zwisler@google.com>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-04-07 12:34:33 +02:00
..
broadcom A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
efi efi/cper: Fix endianness of PCIe class code 2020-04-07 09:27:43 +02:00
google gsmi: Fix bug in append_to_eventlog sysfs handler 2020-04-07 12:34:33 +02:00
arm_scpi.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dcdbas.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dcdbas.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dell_rbu.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dmi_scan.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dmi-id.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dmi-sysfs.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
edd.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
iscsi_ibft_find.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
iscsi_ibft.c iscsi_ibft: make ISCSI_IBFT dependson ACPI instead of ISCSI_IBFT_FIND 2020-04-06 20:38:38 +02:00
Kconfig iscsi_ibft: make ISCSI_IBFT dependson ACPI instead of ISCSI_IBFT_FIND 2020-04-06 20:38:38 +02:00
Makefile A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
memmap.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
pcdp.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
pcdp.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
psci.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
qcom_scm-32.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
qcom_scm-64.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
qcom_scm.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
qcom_scm.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
raspberrypi.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30