diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-02 01:28:19 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-02 01:28:19 +0200 |
commit | 158e0d3621683ee0cdfeeba56f0e5ddd97ae984f (patch) | |
tree | cc59e84001f0a496a681242a875ecad6463aa50e /drivers/firmware | |
parent | Merge tag 'char-misc-3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/g... (diff) | |
parent | Revert "sysfs, driver-core: remove unused {sysfs|device}_schedule_callback_ow... (diff) | |
download | linux-158e0d3621683ee0cdfeeba56f0e5ddd97ae984f.tar.xz linux-158e0d3621683ee0cdfeeba56f0e5ddd97ae984f.zip |
Merge tag 'driver-core-3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
Pull driver core and sysfs updates from Greg KH:
"Here's the big driver core / sysfs update for 3.15-rc1.
Lots of kernfs updates to make it useful for other subsystems, and a
few other tiny driver core patches.
All have been in linux-next for a while"
* tag 'driver-core-3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (42 commits)
Revert "sysfs, driver-core: remove unused {sysfs|device}_schedule_callback_owner()"
kernfs: cache atomic_write_len in kernfs_open_file
numa: fix NULL pointer access and memory leak in unregister_one_node()
Revert "driver core: synchronize device shutdown"
kernfs: fix off by one error.
kernfs: remove duplicate dir.c at the top dir
x86: align x86 arch with generic CPU modalias handling
cpu: add generic support for CPU feature based module autoloading
sysfs: create bin_attributes under the requested group
driver core: unexport static function create_syslog_header
firmware: use power efficient workqueue for unloading and aborting fw load
firmware: give a protection when map page failed
firmware: google memconsole driver fixes
firmware: fix google/gsmi duplicate efivars_sysfs_init()
drivers/base: delete non-required instances of include <linux/init.h>
kernfs: fix kernfs_node_from_dentry()
ACPI / platform: drop redundant ACPI_HANDLE check
kernfs: fix hash calculation in kernfs_rename_ns()
kernfs: add CONFIG_KERNFS
sysfs, kobject: add sysfs wrapper for kernfs_enable_ns()
...
Diffstat (limited to 'drivers/firmware')
-rw-r--r-- | drivers/firmware/google/gsmi.c | 7 | ||||
-rw-r--r-- | drivers/firmware/google/memconsole.c | 47 |
2 files changed, 26 insertions, 28 deletions
diff --git a/drivers/firmware/google/gsmi.c b/drivers/firmware/google/gsmi.c index e5a67b24587a..f1ab05ea56bb 100644 --- a/drivers/firmware/google/gsmi.c +++ b/drivers/firmware/google/gsmi.c @@ -892,13 +892,6 @@ static __init int gsmi_init(void) goto out_remove_sysfs_files; } - ret = efivars_sysfs_init(); - if (ret) { - printk(KERN_INFO "gsmi: Failed to create efivars files\n"); - efivars_unregister(&efivars); - goto out_remove_sysfs_files; - } - register_reboot_notifier(&gsmi_reboot_notifier); register_die_notifier(&gsmi_die_notifier); atomic_notifier_chain_register(&panic_notifier_list, diff --git a/drivers/firmware/google/memconsole.c b/drivers/firmware/google/memconsole.c index 2a90ba613613..2f569aaed4c7 100644 --- a/drivers/firmware/google/memconsole.c +++ b/drivers/firmware/google/memconsole.c @@ -15,6 +15,7 @@ #include <linux/kobject.h> #include <linux/module.h> #include <linux/dmi.h> +#include <linux/io.h> #include <asm/bios_ebda.h> #define BIOS_MEMCONSOLE_V1_MAGIC 0xDEADBABE @@ -41,15 +42,25 @@ struct biosmemcon_ebda { }; } __packed; -static char *memconsole_baseaddr; +static u32 memconsole_baseaddr; static size_t memconsole_length; static ssize_t memconsole_read(struct file *filp, struct kobject *kobp, struct bin_attribute *bin_attr, char *buf, loff_t pos, size_t count) { - return memory_read_from_buffer(buf, count, &pos, memconsole_baseaddr, - memconsole_length); + char *memconsole; + ssize_t ret; + + memconsole = ioremap_cache(memconsole_baseaddr, memconsole_length); + if (!memconsole) { + pr_err("memconsole: ioremap_cache failed\n"); + return -ENOMEM; + } + ret = memory_read_from_buffer(buf, count, &pos, memconsole, + memconsole_length); + iounmap(memconsole); + return ret; } static struct bin_attribute memconsole_bin_attr = { @@ -58,43 +69,42 @@ static struct bin_attribute memconsole_bin_attr = { }; -static void found_v1_header(struct biosmemcon_ebda *hdr) +static void __init found_v1_header(struct biosmemcon_ebda *hdr) { - printk(KERN_INFO "BIOS console v1 EBDA structure found at %p\n", hdr); - printk(KERN_INFO "BIOS console buffer at 0x%.8x, " + pr_info("BIOS console v1 EBDA structure found at %p\n", hdr); + pr_info("BIOS console buffer at 0x%.8x, " "start = %d, end = %d, num = %d\n", hdr->v1.buffer_addr, hdr->v1.start, hdr->v1.end, hdr->v1.num_chars); memconsole_length = hdr->v1.num_chars; - memconsole_baseaddr = phys_to_virt(hdr->v1.buffer_addr); + memconsole_baseaddr = hdr->v1.buffer_addr; } -static void found_v2_header(struct biosmemcon_ebda *hdr) +static void __init found_v2_header(struct biosmemcon_ebda *hdr) { - printk(KERN_INFO "BIOS console v2 EBDA structure found at %p\n", hdr); - printk(KERN_INFO "BIOS console buffer at 0x%.8x, " + pr_info("BIOS console v2 EBDA structure found at %p\n", hdr); + pr_info("BIOS console buffer at 0x%.8x, " "start = %d, end = %d, num_bytes = %d\n", hdr->v2.buffer_addr, hdr->v2.start, hdr->v2.end, hdr->v2.num_bytes); memconsole_length = hdr->v2.end - hdr->v2.start; - memconsole_baseaddr = phys_to_virt(hdr->v2.buffer_addr - + hdr->v2.start); + memconsole_baseaddr = hdr->v2.buffer_addr + hdr->v2.start; } /* * Search through the EBDA for the BIOS Memory Console, and * set the global variables to point to it. Return true if found. */ -static bool found_memconsole(void) +static bool __init found_memconsole(void) { unsigned int address; size_t length, cur; address = get_bios_ebda(); if (!address) { - printk(KERN_INFO "BIOS EBDA non-existent.\n"); + pr_info("BIOS EBDA non-existent.\n"); return false; } @@ -122,7 +132,7 @@ static bool found_memconsole(void) } } - printk(KERN_INFO "BIOS console EBDA structure not found!\n"); + pr_info("BIOS console EBDA structure not found!\n"); return false; } @@ -139,8 +149,6 @@ MODULE_DEVICE_TABLE(dmi, memconsole_dmi_table); static int __init memconsole_init(void) { - int ret; - if (!dmi_check_system(memconsole_dmi_table)) return -ENODEV; @@ -148,10 +156,7 @@ static int __init memconsole_init(void) return -ENODEV; memconsole_bin_attr.size = memconsole_length; - - ret = sysfs_create_bin_file(firmware_kobj, &memconsole_bin_attr); - - return ret; + return sysfs_create_bin_file(firmware_kobj, &memconsole_bin_attr); } static void __exit memconsole_exit(void) |