Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753425AbbBYLsw (ORCPT ); Wed, 25 Feb 2015 06:48:52 -0500 Received: from mail.skyhub.de ([78.46.96.112]:59111 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753231AbbBYLsu (ORCPT ); Wed, 25 Feb 2015 06:48:50 -0500 Date: Wed, 25 Feb 2015 12:47:47 +0100 From: Borislav Petkov To: "Kweh, Hock Leong" Cc: Andy Lutomirski , Sam Protsenko , Matt Fleming , Ming Lei , Greg Kroah-Hartman , "Ong, Boon Leong" , LKML , "linux-efi@vger.kernel.org" Subject: Re: Re: [PATCH v2 3/3] efi: Capsule update with user helper interface Message-ID: <20150225114747.GC3226@pd.tnic> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1811 Lines: 42 On Tue, Feb 24, 2015 at 12:49:09PM +0000, Kweh, Hock Leong wrote: > So the process steps basically look like this: > 1.) cat capsule_ticket =======> acquire a number and lock mutex then > expose firmware_class user helper > interface as well as start timer for timeout > counting > 2.) repeat step 1 if obtained a "0" number > 3.) echo 1 > loading > 4.) cat bin > data > 5.) echo 0 > loading =======> stop the timeout counting then unlock > mutex at the end of callback routine > 6.) cat capsule_report =======> grep the number acquired from beginning > for checking succeeded/failed So this sounds pretty overengineered for no reason, or maybe I'm missing the reason. If I had to give an example from the microcode loader, what we do there is put the microcode in /lib/firmware/... and do echo 1 > /sys/devices/system/cpu/microcode/reload which goes and calls reload_store() in arch/x86/kernel/cpu/microcode/core.c which grabs a mutex, disables CPU hotplug, etc, etc... And this mechanism is as simple as it can get. Maybe capsules can be loaded like that too? Error code can be propagated too, if needed, of course. -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply. -- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/