From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755519AbaHFMYn (ORCPT ); Wed, 6 Aug 2014 08:24:43 -0400 Received: from cantor2.suse.de ([195.135.220.15]:40043 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752835AbaHFMYm (ORCPT ); Wed, 6 Aug 2014 08:24:42 -0400 Date: Wed, 06 Aug 2014 14:24:39 +0200 Message-ID: From: Takashi Iwai To: Jean-Michel Hautbois Cc: Shuah Khan , B_B_Singh@dell.com, Greg KH , Arnd Bergmann , Kay Sievers , Ming Lei , Stefan Roese , Tom Gundersen , Stuart_Hayes@dell.com, Srinivas_G_Gowda@dell.com, linux-kernel Subject: Re: patch "firmware loader: allow disabling of udev as firmware loader" added to driver-core tree In-Reply-To: References: <14048583172593@kroah.com> <8B2F6FFD0BD1E448853114367400A37306FD6FBBE9@BLRX7MCDC203.AMER.DELL.COM> <8B2F6FFD0BD1E448853114367400A37306FD6FBBF8@BLRX7MCDC203.AMER.DELL.COM> <8B2F6FFD0BD1E448853114367400A37306FD6FBC06@BLRX7MCDC203.AMER.DELL.COM> <8B2F6FFD0BD1E448853114367400A37306FD6FBDAB@BLRX7MCDC203.AMER.DELL.COM> <8B2F6FFD0BD1E448853114367400A37306FE07C773@BLRX7MCDC203.AMER.DELL.COM> <8B2F6FFD0BD1E448853114367400A37306FE07CC64@BLRX7MCDC203.AMER.DELL.COM> <8B2F6FFD0BD1E448853114367400A37306FE311D74@BLRX7MCDC203.AMER.DELL.COM> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/24.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org At Wed, 6 Aug 2014 13:24:37 +0200, Jean-Michel Hautbois wrote: > > 2014-08-06 12:52 GMT+02:00 Takashi Iwai : > > At Wed, 6 Aug 2014 12:50:28 +0200, > > Jean-Michel Hautbois wrote: > >> > >> 2014-08-06 12:21 GMT+02:00 Takashi Iwai : > >> > At Wed, 6 Aug 2014 11:44:14 +0200, > >> > Jean-Michel Hautbois wrote: > >> >> > >> >> 2014-08-06 11:24 GMT+02:00 Takashi Iwai : > >> >> > At Wed, 6 Aug 2014 11:10:27 +0200, > >> >> > Jean-Michel Hautbois wrote: > >> >> >> > >> >> >> 2014-08-05 21:22 GMT+02:00 Shuah Khan : > >> >> >> > On Tue, Aug 5, 2014 at 10:01 AM, Takashi Iwai wrote: > >> >> >> >>> Yes, it worked, if the firmware was in the /lib/firmware directory. > >> >> >> >> > >> >> >> > > >> >> >> > ok it works when the firmware is in /lib/firmware. It sounds to me the > >> >> >> > reason load fails when the firmware is under /sys/class/firmware is > >> >> >> > fw_load_from_user_helper() returns -ENOENT when > >> >> >> > CONFIG_FW_LOADER_USER_HELPER is disabled. > >> >> >> > > >> >> >> > It would be nice to see the entire dmesg with debug enabled though. > >> >> >> > > >> >> >> > -- Shuah > >> >> >> > >> >> >> It does not work with the 3.16 kernel even when firmware is in > >> >> >> /lib/firmware, it worked before this patch is applied. > >> >> > > >> >> > Hm? 3.16 doesn't contain my patch yet. It's merged for 3.17-rc1. > >> >> > >> >> Oh, you are right of course, I am on upstream kernel and I have your > >> >> patch. I don't mean your match is causing the issue though ;-). > >> > > >> > I see. > >> > > >> >> >> Here is what I got in my dmesg : > >> >> >> [ 0.307856] __allocate_fw_buf: fw-lattice-ecp3.bit buf=bd81a480 > >> >> >> [ 0.308029] lattice-ecp3 spi2.3: Direct firmware load for > >> >> >> lattice-ecp3.bit failed with error -2 > >> >> > > >> >> > It's -ENOENT. Are you sure that you really have > >> >> > /lib/firmware/lattice-ecp3.bit file? > >> >> > >> >> Yes : > >> >> ls -al /lib/firmware/lattice-ecp3.bit > >> >> -rwxr-xr-x 1 root root 897753 Aug 5 15:04 /lib/firmware/lattice-ecp3.bit > >> > > >> > Then you'd better bisect... > >> > Or, at least, put a debug code to see which file is opened in the loop > >> > in fw_get_filesystem_firmware(). > >> > >> Well, when this function is called, my rootfs is not yet mounted (I > >> have a dedicated partition on a SDCard)... > >> So I probably missed a step in order to get /lib/firmware before / is > >> mounted... ? > > > > Yeah, possibly :) Maybe you did put /lib/firmware/* into initrd in > > the earlier tests? > > Nope, it failed and when / was mounted, it was called again and used > the firmware thanks to udev. > This is the CONFIG_FW_LOADER_USER_HELPER config which makes that now, right ? Not really. The user helper is invoked when CONFIG_FW_LOADER_USER_HELPER_FALLBACK is set. The exception is the case of non-udev f/w handling like dell-rbu (which passes FW_ACTION_NOHOTPLUG). Then the user mode helper is used as fallback even if CONFIG_FW_LOADER_USER_HELPER_FALLBACK isn't set. > But how can I have /lib/firmware in my initrd, that is the question I > need to answer now :). Pretty depends on how to create initrd. But most programs look up the MODULE_FIRMWARE() entries of the modules to be loaded in initrd and put them automatically. And it's missing in lattice-ecp3-config driver... Takashi