* [GIT PULL 0/8] EFI changes for v4.10 @ 2016-10-18 14:33 Matt Fleming [not found] ` <20161018143318.15673-1-matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org> ` (3 more replies) 0 siblings, 4 replies; 13+ messages in thread From: Matt Fleming @ 2016-10-18 14:33 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner, H . Peter Anvin Cc: Matt Fleming, Ard Biesheuvel, linux-kernel-u79uwXL29TY76Z2rM5mHXA, linux-efi-u79uwXL29TY76Z2rM5mHXA, Catalin Marinas, Dan Carpenter, Ivan Hu, Ivan Khoronzhuk, Mark Rutland, Peter Jones, Wei Yongjun, Will Deacon, Yisheng Xie Folks, please queue up the following small changes for v4.10. Note that there is a patch to MAINTAINERS in this pull request that adds Ard as EFI co-maintainer. It'd probably be a good idea to send that to Linus before v4.10. The following changes since commit 92dc33501bfba74655dbf3ec63ea82d040fd6d58: x86/efi: Round EFI memmap reservations to EFI_PAGE_SIZE (2016-09-20 15:43:31 +0100) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git tags/efi-next for you to fetch changes up to a8226a73b82256b82c167956b0f4d3cd39312531: efi: efivar_ssdt_load: Don't return success on allocation failure (2016-10-13 11:55:40 +0100) ---------------------------------------------------------------- * Add Ard as EFI co-maintainer in MAINTAINERS * Misc cleanups for efi_test driver - Ivan Hu and Wei Yongjun * Fix an early_memremap() leak for ARM/arm64 - Yisheng Xie * Return an error code on failure instead of success in efivar_ssdt_load() - Dan Carpenter * Expose EFI framebuffer configuration, which allows rendering localized status strings during firmware updates - Peter Jones ---------------------------------------------------------------- Ard Biesheuvel (1): MAINTAINERS: add myself as EFI maintainer Dan Carpenter (1): efi: efivar_ssdt_load: Don't return success on allocation failure Ivan Hu (3): efi/efi_test: Fix the uninitialized value datasize efi/efi_test: Fix the uninitialized value rv efi/efi_test: Use memdup_user() as a cleanup Peter Jones (1): efifb: show framebuffer layout as device attributes Wei Yongjun (1): efi: Remove unused including <linux/version.h> Yisheng Xie (1): efi/arm*: efi_init() error handling fix MAINTAINERS | 3 +- drivers/firmware/efi/arm-init.c | 4 ++- drivers/firmware/efi/efi.c | 4 ++- drivers/firmware/efi/test/efi_test.c | 15 +++------ drivers/video/fbdev/efifb.c | 59 ++++++++++++++++++++++++++++-------- 5 files changed, 59 insertions(+), 26 deletions(-) ^ permalink raw reply [flat|nested] 13+ messages in thread
[parent not found: <20161018143318.15673-1-matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>]
* [PATCH 1/8] MAINTAINERS: add myself as EFI maintainer [not found] ` <20161018143318.15673-1-matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org> @ 2016-10-18 14:33 ` Matt Fleming 2016-10-18 14:33 ` [PATCH 2/8] efi: Remove unused including <linux/version.h> Matt Fleming ` (5 subsequent siblings) 6 siblings, 0 replies; 13+ messages in thread From: Matt Fleming @ 2016-10-18 14:33 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner, H . Peter Anvin Cc: Ard Biesheuvel, linux-kernel-u79uwXL29TY76Z2rM5mHXA, linux-efi-u79uwXL29TY76Z2rM5mHXA, Matt Fleming, Will Deacon From: Ard Biesheuvel <ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> At the request of Matt, I am taking up co-maintainership of the EFI subsystem. So add my name to the EFI section in MAINTAINERS, and change the SCM tree reference to point to the new shared Git repo. Cc: Matt Fleming <matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org> Signed-off-by: Ard Biesheuvel <ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> Acked-by: Will Deacon <will.deacon-5wv7dgnIgG8@public.gmane.org> Acked-by: Matt Fleming <matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org> --- MAINTAINERS | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 007d05acbb5f..224518556a84 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -4557,8 +4557,9 @@ F: sound/usb/misc/ua101.c EXTENSIBLE FIRMWARE INTERFACE (EFI) M: Matt Fleming <matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org> +M: Ard Biesheuvel <ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> L: linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org -T: git git://git.kernel.org/pub/scm/linux/kernel/git/mfleming/efi.git +T: git git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git S: Maintained F: Documentation/efi-stub.txt F: arch/ia64/kernel/efi.c -- 2.10.0 ^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 2/8] efi: Remove unused including <linux/version.h> [not found] ` <20161018143318.15673-1-matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org> 2016-10-18 14:33 ` [PATCH 1/8] MAINTAINERS: add myself as EFI maintainer Matt Fleming @ 2016-10-18 14:33 ` Matt Fleming 2016-10-18 14:33 ` [PATCH 3/8] efi/arm*: efi_init() error handling fix Matt Fleming ` (4 subsequent siblings) 6 siblings, 0 replies; 13+ messages in thread From: Matt Fleming @ 2016-10-18 14:33 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner, H . Peter Anvin Cc: Wei Yongjun, Ard Biesheuvel, linux-kernel-u79uwXL29TY76Z2rM5mHXA, linux-efi-u79uwXL29TY76Z2rM5mHXA, Matt Fleming, Ivan Khoronzhuk From: Wei Yongjun <weiyongjun1-hv44wF8Li93QT0dZR+AlfA@public.gmane.org> Remove including <linux/version.h> that don't need it. Signed-off-by: Wei Yongjun <weiyongjun1-hv44wF8Li93QT0dZR+AlfA@public.gmane.org> Cc: Ivan Khoronzhuk <ivan.khoronzhuk-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> Cc: Ard Biesheuvel <ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> Signed-off-by: Matt Fleming <matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org> --- drivers/firmware/efi/test/efi_test.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/firmware/efi/test/efi_test.c b/drivers/firmware/efi/test/efi_test.c index f61bb52be318..ae51268737cc 100644 --- a/drivers/firmware/efi/test/efi_test.c +++ b/drivers/firmware/efi/test/efi_test.c @@ -8,7 +8,6 @@ * */ -#include <linux/version.h> #include <linux/miscdevice.h> #include <linux/module.h> #include <linux/init.h> -- 2.10.0 ^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 3/8] efi/arm*: efi_init() error handling fix [not found] ` <20161018143318.15673-1-matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org> 2016-10-18 14:33 ` [PATCH 1/8] MAINTAINERS: add myself as EFI maintainer Matt Fleming 2016-10-18 14:33 ` [PATCH 2/8] efi: Remove unused including <linux/version.h> Matt Fleming @ 2016-10-18 14:33 ` Matt Fleming 2016-10-18 14:33 ` [PATCH 4/8] efi/efi_test: Fix the uninitialized value datasize Matt Fleming ` (3 subsequent siblings) 6 siblings, 0 replies; 13+ messages in thread From: Matt Fleming @ 2016-10-18 14:33 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner, H . Peter Anvin Cc: Yisheng Xie, Ard Biesheuvel, linux-kernel-u79uwXL29TY76Z2rM5mHXA, linux-efi-u79uwXL29TY76Z2rM5mHXA, Matt Fleming, Catalin Marinas, Mark Rutland, Will Deacon From: Yisheng Xie <xieyisheng1-hv44wF8Li93QT0dZR+AlfA@public.gmane.org> There's an early memmap leak in efi_init error path, fix it. Signed-off-by: Yisheng Xie <xieyisheng1-hv44wF8Li93QT0dZR+AlfA@public.gmane.org> Cc: Catalin Marinas <catalin.marinas-5wv7dgnIgG8@public.gmane.org> Cc: Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org> Cc: Will Deacon <will.deacon-5wv7dgnIgG8@public.gmane.org> Cc: Ingo Molnar <mingo-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> Cc: Ard Biesheuvel <ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> Signed-off-by: Matt Fleming <matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org> --- drivers/firmware/efi/arm-init.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/efi/arm-init.c b/drivers/firmware/efi/arm-init.c index 8efe13075c92..f853ad2c4ca0 100644 --- a/drivers/firmware/efi/arm-init.c +++ b/drivers/firmware/efi/arm-init.c @@ -244,8 +244,10 @@ void __init efi_init(void) "Unexpected EFI_MEMORY_DESCRIPTOR version %ld", efi.memmap.desc_version); - if (uefi_init() < 0) + if (uefi_init() < 0) { + efi_memmap_unmap(); return; + } reserve_regions(); efi_memattr_init(); -- 2.10.0 ^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 4/8] efi/efi_test: Fix the uninitialized value datasize [not found] ` <20161018143318.15673-1-matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org> ` (2 preceding siblings ...) 2016-10-18 14:33 ` [PATCH 3/8] efi/arm*: efi_init() error handling fix Matt Fleming @ 2016-10-18 14:33 ` Matt Fleming 2016-10-18 14:33 ` [PATCH 5/8] efi/efi_test: Fix the uninitialized value rv Matt Fleming ` (2 subsequent siblings) 6 siblings, 0 replies; 13+ messages in thread From: Matt Fleming @ 2016-10-18 14:33 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner, H . Peter Anvin Cc: Ivan Hu, Ard Biesheuvel, linux-kernel-u79uwXL29TY76Z2rM5mHXA, linux-efi-u79uwXL29TY76Z2rM5mHXA, Matt Fleming, Ivan Khoronzhuk From: Ivan Hu <ivan.hu-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org> Fix the minor issue found by CoverityScan CID 1358931 (#1 of 1): Uninitialized scalar variable (UNINIT)9. uninit_use: Using uninitialized value datasize. 199 prev_datasize = datasize; 200 status = efi.get_variable(name, vd, at, dz, data); Signed-off-by: Ivan Hu <ivan.hu-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org> Cc: Ivan Khoronzhuk <ivan.khoronzhuk-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> Cc: Ard Biesheuvel <ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> Signed-off-by: Matt Fleming <matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org> --- drivers/firmware/efi/test/efi_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/firmware/efi/test/efi_test.c b/drivers/firmware/efi/test/efi_test.c index ae51268737cc..348efc9cf59f 100644 --- a/drivers/firmware/efi/test/efi_test.c +++ b/drivers/firmware/efi/test/efi_test.c @@ -155,7 +155,7 @@ static long efi_runtime_get_variable(unsigned long arg) { struct efi_getvariable __user *getvariable_user; struct efi_getvariable getvariable; - unsigned long datasize, prev_datasize, *dz; + unsigned long datasize = 0, prev_datasize, *dz; efi_guid_t vendor_guid, *vd = NULL; efi_status_t status; efi_char16_t *name = NULL; -- 2.10.0 ^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 5/8] efi/efi_test: Fix the uninitialized value rv [not found] ` <20161018143318.15673-1-matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org> ` (3 preceding siblings ...) 2016-10-18 14:33 ` [PATCH 4/8] efi/efi_test: Fix the uninitialized value datasize Matt Fleming @ 2016-10-18 14:33 ` Matt Fleming 2016-10-18 14:33 ` [PATCH 6/8] efi/efi_test: Use memdup_user() as a cleanup Matt Fleming 2016-10-18 15:34 ` [GIT PULL 0/8] EFI changes for v4.10 Lukas Wunner 6 siblings, 0 replies; 13+ messages in thread From: Matt Fleming @ 2016-10-18 14:33 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner, H . Peter Anvin Cc: Ivan Hu, Ard Biesheuvel, linux-kernel-u79uwXL29TY76Z2rM5mHXA, linux-efi-u79uwXL29TY76Z2rM5mHXA, Matt Fleming, Ivan Khoronzhuk From: Ivan Hu <ivan.hu-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org> Fix the minor issue found by CoverityScan 520 kfree(name); CID 1358932 (#1 of 1): Uninitialized scalar variable (UNINIT)17. uninit_use: Using uninitialized value rv. 521 return rv; 522} Signed-off-by: Ivan Hu <ivan.hu-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org> Cc: Ivan Khoronzhuk <ivan.khoronzhuk-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> Cc: Ard Biesheuvel <ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> Signed-off-by: Matt Fleming <matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org> --- drivers/firmware/efi/test/efi_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/firmware/efi/test/efi_test.c b/drivers/firmware/efi/test/efi_test.c index 348efc9cf59f..bb26e12b0cfd 100644 --- a/drivers/firmware/efi/test/efi_test.c +++ b/drivers/firmware/efi/test/efi_test.c @@ -428,7 +428,7 @@ static long efi_runtime_get_nextvariablename(unsigned long arg) efi_guid_t *vd = NULL; efi_guid_t vendor_guid; efi_char16_t *name = NULL; - int rv; + int rv = 0; getnextvariablename_user = (struct efi_getnextvariablename __user *)arg; -- 2.10.0 ^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 6/8] efi/efi_test: Use memdup_user() as a cleanup [not found] ` <20161018143318.15673-1-matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org> ` (4 preceding siblings ...) 2016-10-18 14:33 ` [PATCH 5/8] efi/efi_test: Fix the uninitialized value rv Matt Fleming @ 2016-10-18 14:33 ` Matt Fleming 2016-10-18 15:34 ` [GIT PULL 0/8] EFI changes for v4.10 Lukas Wunner 6 siblings, 0 replies; 13+ messages in thread From: Matt Fleming @ 2016-10-18 14:33 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner, H . Peter Anvin Cc: Ivan Hu, Ard Biesheuvel, linux-kernel-u79uwXL29TY76Z2rM5mHXA, linux-efi-u79uwXL29TY76Z2rM5mHXA, Matt Fleming, Ivan Khoronzhuk From: Ivan Hu <ivan.hu-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org> Fix coccicheck warning which recommends to use memdup_user() This patch fixes below coccicheck warnings: drivers/firmware/efi/test/efi_test.c:269:8-15: WARNING opportunity for memdup_user Signed-off-by: Ivan Hu <ivan.hu-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org> Cc: Ivan Khoronzhuk <ivan.khoronzhuk-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> Cc: Ard Biesheuvel <ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> Signed-off-by: Matt Fleming <matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org> --- drivers/firmware/efi/test/efi_test.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/firmware/efi/test/efi_test.c b/drivers/firmware/efi/test/efi_test.c index bb26e12b0cfd..8cd578f62059 100644 --- a/drivers/firmware/efi/test/efi_test.c +++ b/drivers/firmware/efi/test/efi_test.c @@ -265,14 +265,10 @@ static long efi_runtime_set_variable(unsigned long arg) return rv; } - data = kmalloc(setvariable.data_size, GFP_KERNEL); - if (!data) { + data = memdup_user(setvariable.data, setvariable.data_size); + if (IS_ERR(data)) { kfree(name); - return -ENOMEM; - } - if (copy_from_user(data, setvariable.data, setvariable.data_size)) { - rv = -EFAULT; - goto out; + return PTR_ERR(data); } status = efi.set_variable(name, &vendor_guid, -- 2.10.0 ^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [GIT PULL 0/8] EFI changes for v4.10 [not found] ` <20161018143318.15673-1-matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org> ` (5 preceding siblings ...) 2016-10-18 14:33 ` [PATCH 6/8] efi/efi_test: Use memdup_user() as a cleanup Matt Fleming @ 2016-10-18 15:34 ` Lukas Wunner [not found] ` <20161018153436.GA2593-JFq808J9C/izQB+pC5nmwQ@public.gmane.org> 6 siblings, 1 reply; 13+ messages in thread From: Lukas Wunner @ 2016-10-18 15:34 UTC (permalink / raw) To: Matt Fleming Cc: Ingo Molnar, Thomas Gleixner, H . Peter Anvin, Ard Biesheuvel, linux-kernel-u79uwXL29TY76Z2rM5mHXA, linux-efi-u79uwXL29TY76Z2rM5mHXA, Catalin Marinas, Dan Carpenter, Ivan Hu, Ivan Khoronzhuk, Mark Rutland, Peter Jones, Wei Yongjun, Will Deacon, Yisheng Xie On Tue, Oct 18, 2016 at 03:33:10PM +0100, Matt Fleming wrote: > Folks, please queue up the following small changes for v4.10. These are all fixes. Did you mean 4.9? Ingo only queued up the MAINTAINERS patch for 4.9 now, the rest for 4.10. Lukas ^ permalink raw reply [flat|nested] 13+ messages in thread
[parent not found: <20161018153436.GA2593-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>]
* Re: [GIT PULL 0/8] EFI changes for v4.10 [not found] ` <20161018153436.GA2593-JFq808J9C/izQB+pC5nmwQ@public.gmane.org> @ 2016-10-18 15:40 ` Matt Fleming 0 siblings, 0 replies; 13+ messages in thread From: Matt Fleming @ 2016-10-18 15:40 UTC (permalink / raw) To: Lukas Wunner Cc: Ingo Molnar, Thomas Gleixner, H . Peter Anvin, Ard Biesheuvel, linux-kernel-u79uwXL29TY76Z2rM5mHXA, linux-efi-u79uwXL29TY76Z2rM5mHXA, Catalin Marinas, Dan Carpenter, Ivan Hu, Ivan Khoronzhuk, Mark Rutland, Peter Jones, Wei Yongjun, Will Deacon, Yisheng Xie On Tue, 18 Oct, at 05:34:36PM, Lukas Wunner wrote: > On Tue, Oct 18, 2016 at 03:33:10PM +0100, Matt Fleming wrote: > > Folks, please queue up the following small changes for v4.10. > > These are all fixes. Did you mean 4.9? Ingo only queued up > the MAINTAINERS patch for 4.9 now, the rest for 4.10. No, I meant v4.10. They are not all fixes, some are new features (like the framebuffer changes from Peter) and none of them are critical fixes that would warrant being merged into urgent. ^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 7/8] efifb: show framebuffer layout as device attributes 2016-10-18 14:33 [GIT PULL 0/8] EFI changes for v4.10 Matt Fleming [not found] ` <20161018143318.15673-1-matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org> @ 2016-10-18 14:33 ` Matt Fleming 2016-10-18 14:33 ` [PATCH 8/8] efi: efivar_ssdt_load: Don't return success on allocation failure Matt Fleming 2016-10-18 15:25 ` [GIT PULL 0/8] EFI changes for v4.10 Ingo Molnar 3 siblings, 0 replies; 13+ messages in thread From: Matt Fleming @ 2016-10-18 14:33 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner, H . Peter Anvin Cc: Peter Jones, Ard Biesheuvel, linux-kernel, linux-efi From: Peter Jones <pjones@redhat.com> Userland sometimes needs to know what the framebuffer configuration was when the firmware was running. This enables us to render localized status strings during firmware updates using the data from the ACPI BGRT table and the protocol described at the url below: https://msdn.microsoft.com/en-us/windows/hardware/drivers/bringup/boot-screen-components This patch also fixes up efifb's printk() usage to use pr_warn() / pr_info() / pr_err() instead. Signed-off-by: Peter Jones <pjones@redhat.com> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> --- drivers/video/fbdev/efifb.c | 59 +++++++++++++++++++++++++++++++++++---------- 1 file changed, 46 insertions(+), 13 deletions(-) diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/efifb.c index 924bad45c176..099b76b3e8b6 100644 --- a/drivers/video/fbdev/efifb.c +++ b/drivers/video/fbdev/efifb.c @@ -118,6 +118,31 @@ static inline bool fb_base_is_valid(void) return false; } +#define efifb_attr_decl(name, fmt) \ +static ssize_t name##_show(struct device *dev, \ + struct device_attribute *attr, \ + char *buf) \ +{ \ + return sprintf(buf, fmt "\n", (screen_info.lfb_##name)); \ +} \ +static DEVICE_ATTR_RO(name) + +efifb_attr_decl(base, "0x%x"); +efifb_attr_decl(linelength, "%u"); +efifb_attr_decl(height, "%u"); +efifb_attr_decl(width, "%u"); +efifb_attr_decl(depth, "%u"); + +static struct attribute *efifb_attrs[] = { + &dev_attr_base.attr, + &dev_attr_linelength.attr, + &dev_attr_width.attr, + &dev_attr_height.attr, + &dev_attr_depth.attr, + NULL +}; +ATTRIBUTE_GROUPS(efifb); + static int efifb_probe(struct platform_device *dev) { struct fb_info *info; @@ -205,14 +230,13 @@ static int efifb_probe(struct platform_device *dev) } else { /* We cannot make this fatal. Sometimes this comes from magic spaces our resource handlers simply don't know about */ - printk(KERN_WARNING - "efifb: cannot reserve video memory at 0x%lx\n", + pr_warn("efifb: cannot reserve video memory at 0x%lx\n", efifb_fix.smem_start); } info = framebuffer_alloc(sizeof(u32) * 16, &dev->dev); if (!info) { - printk(KERN_ERR "efifb: cannot allocate framebuffer\n"); + pr_err("efifb: cannot allocate framebuffer\n"); err = -ENOMEM; goto err_release_mem; } @@ -230,16 +254,15 @@ static int efifb_probe(struct platform_device *dev) info->screen_base = ioremap_wc(efifb_fix.smem_start, efifb_fix.smem_len); if (!info->screen_base) { - printk(KERN_ERR "efifb: abort, cannot ioremap video memory " - "0x%x @ 0x%lx\n", + pr_err("efifb: abort, cannot ioremap video memory 0x%x @ 0x%lx\n", efifb_fix.smem_len, efifb_fix.smem_start); err = -EIO; goto err_release_fb; } - printk(KERN_INFO "efifb: framebuffer at 0x%lx, using %dk, total %dk\n", + pr_info("efifb: framebuffer at 0x%lx, using %dk, total %dk\n", efifb_fix.smem_start, size_remap/1024, size_total/1024); - printk(KERN_INFO "efifb: mode is %dx%dx%d, linelength=%d, pages=%d\n", + pr_info("efifb: mode is %dx%dx%d, linelength=%d, pages=%d\n", efifb_defined.xres, efifb_defined.yres, efifb_defined.bits_per_pixel, efifb_fix.line_length, screen_info.pages); @@ -247,7 +270,7 @@ static int efifb_probe(struct platform_device *dev) efifb_defined.xres_virtual = efifb_defined.xres; efifb_defined.yres_virtual = efifb_fix.smem_len / efifb_fix.line_length; - printk(KERN_INFO "efifb: scrolling: redraw\n"); + pr_info("efifb: scrolling: redraw\n"); efifb_defined.yres_virtual = efifb_defined.yres; /* some dummy values for timing to make fbset happy */ @@ -265,7 +288,7 @@ static int efifb_probe(struct platform_device *dev) efifb_defined.transp.offset = screen_info.rsvd_pos; efifb_defined.transp.length = screen_info.rsvd_size; - printk(KERN_INFO "efifb: %s: " + pr_info("efifb: %s: " "size=%d:%d:%d:%d, shift=%d:%d:%d:%d\n", "Truecolor", screen_info.rsvd_size, @@ -285,12 +308,19 @@ static int efifb_probe(struct platform_device *dev) info->fix = efifb_fix; info->flags = FBINFO_FLAG_DEFAULT | FBINFO_MISC_FIRMWARE; - if ((err = fb_alloc_cmap(&info->cmap, 256, 0)) < 0) { - printk(KERN_ERR "efifb: cannot allocate colormap\n"); + err = sysfs_create_groups(&dev->dev.kobj, efifb_groups); + if (err) { + pr_err("efifb: cannot add sysfs attrs\n"); goto err_unmap; } - if ((err = register_framebuffer(info)) < 0) { - printk(KERN_ERR "efifb: cannot register framebuffer\n"); + err = fb_alloc_cmap(&info->cmap, 256, 0); + if (err < 0) { + pr_err("efifb: cannot allocate colormap\n"); + goto err_groups; + } + err = register_framebuffer(info); + if (err < 0) { + pr_err("efifb: cannot register framebuffer\n"); goto err_fb_dealoc; } fb_info(info, "%s frame buffer device\n", info->fix.id); @@ -298,6 +328,8 @@ static int efifb_probe(struct platform_device *dev) err_fb_dealoc: fb_dealloc_cmap(&info->cmap); +err_groups: + sysfs_remove_groups(&dev->dev.kobj, efifb_groups); err_unmap: iounmap(info->screen_base); err_release_fb: @@ -313,6 +345,7 @@ static int efifb_remove(struct platform_device *pdev) struct fb_info *info = platform_get_drvdata(pdev); unregister_framebuffer(info); + sysfs_remove_groups(&pdev->dev.kobj, efifb_groups); framebuffer_release(info); return 0; -- 2.10.0 ^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 8/8] efi: efivar_ssdt_load: Don't return success on allocation failure 2016-10-18 14:33 [GIT PULL 0/8] EFI changes for v4.10 Matt Fleming [not found] ` <20161018143318.15673-1-matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org> 2016-10-18 14:33 ` [PATCH 7/8] efifb: show framebuffer layout as device attributes Matt Fleming @ 2016-10-18 14:33 ` Matt Fleming 2016-10-18 15:25 ` [GIT PULL 0/8] EFI changes for v4.10 Ingo Molnar 3 siblings, 0 replies; 13+ messages in thread From: Matt Fleming @ 2016-10-18 14:33 UTC (permalink / raw) To: Ingo Molnar, Thomas Gleixner, H . Peter Anvin Cc: Dan Carpenter, Ard Biesheuvel, linux-kernel, linux-efi From: Dan Carpenter <dan.carpenter@oracle.com> We should return -ENOMEM here, instead of success. Fixes: 475fb4e8b2f4 ("efi / ACPI: load SSTDs from EFI variables") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> --- drivers/firmware/efi/efi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c index 1ac199cd75e7..a4944e22f294 100644 --- a/drivers/firmware/efi/efi.c +++ b/drivers/firmware/efi/efi.c @@ -259,8 +259,10 @@ static __init int efivar_ssdt_load(void) } data = kmalloc(size, GFP_KERNEL); - if (!data) + if (!data) { + ret = -ENOMEM; goto free_entry; + } ret = efivar_entry_get(entry, NULL, &size, data); if (ret) { -- 2.10.0 ^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [GIT PULL 0/8] EFI changes for v4.10 2016-10-18 14:33 [GIT PULL 0/8] EFI changes for v4.10 Matt Fleming ` (2 preceding siblings ...) 2016-10-18 14:33 ` [PATCH 8/8] efi: efivar_ssdt_load: Don't return success on allocation failure Matt Fleming @ 2016-10-18 15:25 ` Ingo Molnar [not found] ` <20161018152556.GA27061-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 3 siblings, 1 reply; 13+ messages in thread From: Ingo Molnar @ 2016-10-18 15:25 UTC (permalink / raw) To: Matt Fleming Cc: Thomas Gleixner, H . Peter Anvin, Ard Biesheuvel, linux-kernel, linux-efi, Catalin Marinas, Dan Carpenter, Ivan Hu, Ivan Khoronzhuk, Mark Rutland, Peter Jones, Wei Yongjun, Will Deacon, Yisheng Xie * Matt Fleming <matt@codeblueprint.co.uk> wrote: > Folks, please queue up the following small changes for v4.10. Applied, thanks Matt! > Note that there is a patch to MAINTAINERS in this pull request that > adds Ard as EFI co-maintainer. It'd probably be a good idea to send > that to Linus before v4.10. Ok, queued that for efi/urgent. Thanks, Ingo ^ permalink raw reply [flat|nested] 13+ messages in thread
[parent not found: <20161018152556.GA27061-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>]
* Re: [GIT PULL 0/8] EFI changes for v4.10 [not found] ` <20161018152556.GA27061-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> @ 2016-10-18 15:29 ` Ard Biesheuvel 0 siblings, 0 replies; 13+ messages in thread From: Ard Biesheuvel @ 2016-10-18 15:29 UTC (permalink / raw) To: Ingo Molnar Cc: Matt Fleming, Thomas Gleixner, H . Peter Anvin, linux-kernel-u79uwXL29TY76Z2rM5mHXA, linux-efi-u79uwXL29TY76Z2rM5mHXA, Catalin Marinas, Dan Carpenter, Ivan Hu, Ivan Khoronzhuk, Mark Rutland, Peter Jones, Wei Yongjun, Will Deacon, Yisheng Xie On 18 October 2016 at 16:25, Ingo Molnar <mingo-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote: > > * Matt Fleming <matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org> wrote: > >> Folks, please queue up the following small changes for v4.10. > > Applied, thanks Matt! > >> Note that there is a patch to MAINTAINERS in this pull request that >> adds Ard as EFI co-maintainer. It'd probably be a good idea to send >> that to Linus before v4.10. > > Ok, queued that for efi/urgent. > Thanks. Before you pass that on, though, I have an other patch to go on top. Will send that out in a minute Cheers, Ard. ^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2016-10-18 15:40 UTC | newest] Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2016-10-18 14:33 [GIT PULL 0/8] EFI changes for v4.10 Matt Fleming [not found] ` <20161018143318.15673-1-matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org> 2016-10-18 14:33 ` [PATCH 1/8] MAINTAINERS: add myself as EFI maintainer Matt Fleming 2016-10-18 14:33 ` [PATCH 2/8] efi: Remove unused including <linux/version.h> Matt Fleming 2016-10-18 14:33 ` [PATCH 3/8] efi/arm*: efi_init() error handling fix Matt Fleming 2016-10-18 14:33 ` [PATCH 4/8] efi/efi_test: Fix the uninitialized value datasize Matt Fleming 2016-10-18 14:33 ` [PATCH 5/8] efi/efi_test: Fix the uninitialized value rv Matt Fleming 2016-10-18 14:33 ` [PATCH 6/8] efi/efi_test: Use memdup_user() as a cleanup Matt Fleming 2016-10-18 15:34 ` [GIT PULL 0/8] EFI changes for v4.10 Lukas Wunner [not found] ` <20161018153436.GA2593-JFq808J9C/izQB+pC5nmwQ@public.gmane.org> 2016-10-18 15:40 ` Matt Fleming 2016-10-18 14:33 ` [PATCH 7/8] efifb: show framebuffer layout as device attributes Matt Fleming 2016-10-18 14:33 ` [PATCH 8/8] efi: efivar_ssdt_load: Don't return success on allocation failure Matt Fleming 2016-10-18 15:25 ` [GIT PULL 0/8] EFI changes for v4.10 Ingo Molnar [not found] ` <20161018152556.GA27061-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 2016-10-18 15:29 ` Ard Biesheuvel
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).