Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966054AbcKOJac (ORCPT ); Tue, 15 Nov 2016 04:30:32 -0500 Received: from s3.sipsolutions.net ([5.9.151.49]:46966 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755545AbcKOJa0 (ORCPT ); Tue, 15 Nov 2016 04:30:26 -0500 Message-ID: <1479202125.12007.24.camel@sipsolutions.net> Subject: Re: [RFC] fs: add userspace critical mounts event support From: Johannes Berg To: "Luis R. Rodriguez" , Linus Torvalds , Jiri Kosina , Jouni Malinen , Seth Forshee , Tom Gundersen , Kay Sievers , Bjorn Andersson , Daniel Wagner , Daniel Wagner , "Rafael J. Wysocki" Cc: "Herbert, Marc" , Daniel Vetter , Rob Landley , Mimi Zohar , Felix Fietkau , David Woodhouse , Roman Pen , Ming Lei , Andrew Morton , Michal Marek , Greg KH , Linux Kernel Mailing List , Vikram Mulukutla , Stephen Boyd , Mark Brown , Takashi Iwai , Christian Lamparter , Hauke Mehrtens , Josh Boyer , Dmitry Torokhov , Jiri Slaby , Andy Lutomirski , Wu Fengguang , Richard Purdie , Jeff Mahoney , Jacek Anaszewski , Abhay_Salunke@dell.com, Julia Lawall , Gilles.Muller@lip6.fr, nicolas.palix@imag.fr, David Howells , Alessandro Rubini , Kevin Cernekee , Kees Cook , Jonathan Corbet , Thierry Martinez , linux-serial , "open list:DOCUMENTATION" , linuxppc-dev , Josh Triplett Date: Tue, 15 Nov 2016 10:28:45 +0100 In-Reply-To: <20161108224726.GD13978@wotan.suse.de> References: <20160824203901.GT3296@wotan.suse.de> <20160825194133.GC3296@wotan.suse.de> <20160902235916.GO3296@wotan.suse.de> <20160903002014.GP3296@wotan.suse.de> <6332a54e-74c6-eafd-368e-71e87a3fa34e@landley.net> <20161005180017.GD3296@wotan.suse.de> <20161005194633.GE3296@wotan.suse.de> <20161108224726.GD13978@wotan.suse.de> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.20.5-1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2912 Lines: 62 On Tue, 2016-11-08 at 23:47 +0100, Luis R. Rodriguez wrote: > This issue still stands. At Plumbers Johannes Berg did indicate to me > he had a simple elegant solution in mind. He suggested that since the > usermode helper was available, he had added support to be able to > differentiate async firmware request calls form sync requests, For reference: commit e9045f9178f3e3445a3a5b85206f8681b3869562 Author: Johannes Berg Date:   Mon Mar 29 17:57:20 2010 +0200     firmware class: export nowait to userspace > it can determine we're initramfs. The semantics issue is the same > though, is there a generic way to determine we're initramfs ? What if > we move multiple levels? Anyway -- provided we could figure this out, > userspace would simply yield and wait until the real rootfs is met. One way or another we have to have this kind of information somewhere. I don't actually know how/where though. > Upon pivot_root() the assumption is all previous udev events pending > would be re-triggered and finally udev could finally confirm/deny if > the firmware was present. The retriggering is already the case, as far as I know, if only to load modules that weren't part of initramfs. > note Johannes was asking for *all* async firmware requests to always > rely on the kernel syfs UMH fallback -- this suggestion is against > the direction we've been taking to eventually compartamentalize the > kernel UMH code, so whatever we decide to do, lets please take a > breather and seriously address this properly *with* systemd folks. I was saying that because that's the only way you can actually rely on this functionality as a system integrator. If drivers have to opt in or can opt out then you'll always end up chasing the drivers around. My argument basically goes like this: First, given good drivers (i.e. using request_firmware_nowait()) putting firmware even for a built-in driver into initramfs or not should be a system integrator decision. If they don't need the device that early, it should be possible for them to delay it. Or, perhaps, if the firmware is too big, etc. I'm sure we can all come up with more examples of why you'd want to do it one way or another. Second, all of this can be solved in other ways by adding logic to the kernel, like the rejected proposal to add a "rootfs available" bit somewhere, that would cause async requests to behave similarly within the kernel (don't return "not found" until they time out or this bit is set, and retry loading when the bit gets set) Third, having this in place can be more friendly to users who play with kernel compilation, modules, etc. This is a fringe group in some ways, but it is (was?) actually a relatively common complaint that drivers built into the kernel wouldn't work - we'd always have to direct users to do magic steps like rebuilding initramfs with the right options etc. johannes