lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Tue, 19 Mar 2013 22:52:32 +0100
From:	"Henrik Rydberg" <rydberg@...omail.se>
To:	Benson Leung <bleung@...omium.org>
Cc:	linux-input@...r.kernel.org,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Dmitry Torokhov <dmitry.torokhov@...il.com>,
	Olof Johansson <olofj@...omium.org>,
	Daniel Kurtz <djkurtz@...omium.org>,
	Dudley Du <dudl@...ress.com>
Subject: Re: [PATCH 2/4] Input: cyapa - Firmware update via request firmware

Hi Benson,

> On Sat, Mar 16, 2013 at 1:00 PM, Henrik Rydberg <rydberg@...omail.se> wrote:
> >> Userspace can initiate the firmware update procedure by copying cyapa.bin
> >> to /lib/firmware, and then writing anything to the device sysfs attribute:
> >>   /sys/bus/i2c/devices/7-0067/update_fw
> >
> > Why do you need to trigger this from userland via sysfs?
> >
> 
> It's a confluence of factors that drives the decision trigger from userland.
> - As a part of the cold-boot probe steps, the trackpad's bootloader
> will load an operational firmware from its flash memory. In the
> average case, the trackpad driver does not need to update the firmware
> because it's current. (the non-average cases are cases where on device
> firmware is corrupted or out of date)
> - The cypress firmware payloads we are working with here do not
> contain an indication of firmware version in the payload itself, so
> the driver can't tell at probe time whether what it would get if it
> request_firmware is newer, older, or the same version as what's
> already loaded on the trackpad.
> - On a 400kHz i2c bus, it takes 13 seconds to send the 31K payload to
> the device and to wait for it to jump into the operational mode
> firmware. This is too long to block probe every time.
> - Because it takes so long to do a firmware update, our user space
> would like to put up a warning message anyhow to tell the user that
> the touchpad is being updated, and not to disturb the system.
> 
> >> +     if (sysfs_create_group(&client->dev.kobj, &cyapa_sysfs_group))
> >> +             dev_warn(dev, "error creating sysfs entries.\n");
> >> +
> >
> > Would it not be neat to invoke the firmware update automatically instead?
> 
> The one situation where I could see an automatic firmware update being
> useful would be cases where the driver, during probe, discovered that
> the trackpad is in Bootloader mode because no valid firmware was found
> (a case of corruption of some kind due to the system powering down
> during a previous fw update, or example). In that case, the driver can
> request firmware and update it without user space having to trigger it
> later.
> 
> Another driver in input does it the same way. atmel_mxt_ts.c, which
> our team is actively working on as well, also has an update_fw sysfs
> for a lot of the same reasons.

Thanks for the rationale, it looks compelling enough for me.

The cyapa_firmware() function has loops that looks like they could be
simplified. With that and the previous comments said,

    Acked-by: Henrik Rydberg <rydberg@...omail.se>

Henrik
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ