Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1401684 > unrolled thread

[PATCH v2 1/3] dell_rbu: Don't fallback to userhelper

Started byMario Limonciello <mario_limonciello@dell.com>
First post2016-05-16 20:30 +0200
Last post2016-05-16 20:30 +0200
Articles 2 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH v2 1/3] dell_rbu: Don't fallback to userhelper Mario Limonciello <mario_limonciello@dell.com> - 2016-05-16 20:30 +0200
    [PATCH v2 2/3] dell_rbu: Update documentation Mario Limonciello <mario_limonciello@dell.com> - 2016-05-16 20:30 +0200

#1401684 — [PATCH v2 1/3] dell_rbu: Don't fallback to userhelper

FromMario Limonciello <mario_limonciello@dell.com>
Date2016-05-16 20:30 +0200
Subject[PATCH v2 1/3] dell_rbu: Don't fallback to userhelper
Message-ID<rzvrh-25A-19@gated-at.bofh.it>
when loading firmware dell_rbu previously would allow a userspace
application to craft the payload after dell_rbu was loaded and
abuse the udev userspace API.

Instead require the payload to be crafted and placed in
/lib/firmware/dell_rbu ahead of time.

This adjusts dell_rbu to immediately load the firmware from
/lib/firmware/dell_rbu when "init" is passed into image_type using the
kernel helper.

Signed-off-by: Mario Limonciello <mario_limonciello@dell.com>
---
 drivers/firmware/Kconfig    | 1 -
 drivers/firmware/dell_rbu.c | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig
index 6664f11..85afe59 100644
--- a/drivers/firmware/Kconfig
+++ b/drivers/firmware/Kconfig
@@ -86,7 +86,6 @@ config DELL_RBU
 	tristate "BIOS update support for DELL systems via sysfs"
 	depends on X86
 	select FW_LOADER
-	select FW_LOADER_USER_HELPER
 	help
 	 Say m if you want to have the option of updating the BIOS for your
 	 DELL system. Note you need a Dell OpenManage or Dell Update package (DUP)
diff --git a/drivers/firmware/dell_rbu.c b/drivers/firmware/dell_rbu.c
index 2f452f1..77b2a77 100644
--- a/drivers/firmware/dell_rbu.c
+++ b/drivers/firmware/dell_rbu.c
@@ -620,7 +620,7 @@ static ssize_t write_rbu_image_type(struct file *filp, struct kobject *kobj,
 		if (!rbu_data.entry_created) {
 			spin_unlock(&rbu_data.lock);
 			req_firm_rc = request_firmware_nowait(THIS_MODULE,
-				FW_ACTION_NOHOTPLUG, "dell_rbu",
+				FW_ACTION_HOTPLUG, "dell_rbu",
 				&rbu_device->dev, GFP_KERNEL, &context,
 				callbackfn_rbu);
 			if (req_firm_rc) {
-- 
2.7.4

[toc] | [next] | [standalone]


#1401689 — [PATCH v2 2/3] dell_rbu: Update documentation

FromMario Limonciello <mario_limonciello@dell.com>
Date2016-05-16 20:30 +0200
Subject[PATCH v2 2/3] dell_rbu: Update documentation
Message-ID<rzvrh-25A-27@gated-at.bofh.it>
In reply to#1401684
Signed-off-by: Mario Limonciello <mario_limonciello@dell.com>
---
 Documentation/dell_rbu.txt | 24 +++---------------------
 1 file changed, 3 insertions(+), 21 deletions(-)

diff --git a/Documentation/dell_rbu.txt b/Documentation/dell_rbu.txt
index d262e22..b2714e6 100644
--- a/Documentation/dell_rbu.txt
+++ b/Documentation/dell_rbu.txt
@@ -31,8 +31,6 @@ The user should not unload the rbu driver after downloading the BIOS image
 or updating.
 
 The driver load creates the following directories under the /sys file system.
-/sys/class/firmware/dell_rbu/loading
-/sys/class/firmware/dell_rbu/data
 /sys/devices/platform/dell_rbu/image_type
 /sys/devices/platform/dell_rbu/data
 /sys/devices/platform/dell_rbu/packet_size
@@ -60,7 +58,7 @@ added together should match the specified packet_size. This makes one
 packet, the user needs to create more such packets out of the entire BIOS
 image file and then arrange all these packets back to back in to one single
 file.
-This file is then copied to /sys/class/firmware/dell_rbu/data.
+This file is then copied to /lib/firmware/dell_rbu.
 Once this file gets to the driver, the driver extracts packet_size data from
 the file and spreads it across the physical memory in contiguous packet_sized
 space.
@@ -70,29 +68,13 @@ In monolithic update the user simply get the BIOS image (.hdr file) and copies
 to the data file as is without any change to the BIOS image itself.
 
 Do the steps below to download the BIOS image.
-1) echo 1 > /sys/class/firmware/dell_rbu/loading
-2) cp bios_image.hdr /sys/class/firmware/dell_rbu/data
-3) echo 0 > /sys/class/firmware/dell_rbu/loading
-
-The /sys/class/firmware/dell_rbu/ entries will remain till the following is
-done.
-echo -1 > /sys/class/firmware/dell_rbu/loading
-Until this step is completed the driver cannot be unloaded.
-Also echoing either mono, packet or init in to image_type will free up the
-memory allocated by the driver.
-
-If a user by accident executes steps 1 and 3 above without executing step 2;
-it will make the /sys/class/firmware/dell_rbu/ entries disappear.
-The entries can be recreated by doing the following
-echo init > /sys/devices/platform/dell_rbu/image_type
-NOTE: echoing init in image_type does not change it original value.
+1) Prepare BIOS image and place in /lib/firmware/dell_rbu
+2) echo "init" > /sys/devices/platform/dell_rbu/packet_type
 
 Also the driver provides /sys/devices/platform/dell_rbu/data readonly file to
 read back the image downloaded.
 
 NOTE:
-This driver requires a patch for firmware_class.c which has the modified
-request_firmware_nowait function.
 Also after updating the BIOS image a user mode application needs to execute
 code which sends the BIOS update request to the BIOS. So on the next reboot
 the BIOS knows about the new image downloaded and it updates itself.
-- 
2.7.4

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web