From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751937AbcBUS5b (ORCPT ); Sun, 21 Feb 2016 13:57:31 -0500 Received: from e28smtp07.in.ibm.com ([125.16.236.7]:44322 "EHLO e28smtp07.in.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751729AbcBUS5a (ORCPT ); Sun, 21 Feb 2016 13:57:30 -0500 X-IBM-Helo: d28relay01.in.ibm.com X-IBM-MailFrom: zohar@linux.vnet.ibm.com X-IBM-RcptTo: linux-kernel@vger.kernel.org Message-ID: <1456062411.6604.8.camel@linux.vnet.ibm.com> Subject: Re: [PATCH] firmware: set firmware_buf size in fw_get_filesystem_firmware() From: Mimi Zohar To: Sergey Senozhatsky Cc: Ming Lei , Greg Kroah-Hartman , Kees Cook , linux-kernel@vger.kernel.org Date: Sun, 21 Feb 2016 08:46:51 -0500 In-Reply-To: <20160221050128.GA563@swordfish> References: <1455959650-2571-1-git-send-email-sergey.senozhatsky@gmail.com> <1455960148-4781-1-git-send-email-sergey.senozhatsky@gmail.com> <1456027178.2906.196.camel@linux.vnet.ibm.com> <20160221050128.GA563@swordfish> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.11 (3.12.11-1.fc21) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable x-cbid: 16022113-0025-0000-0000-00000A0F7600 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 2016-02-21 at 14:01 +0900, Sergey Senozhatsky wrote: > Hello, > > On (02/20/16 22:59), Mimi Zohar wrote: > > On Sat, 2016-02-20 at 18:22 +0900, Sergey Senozhatsky wrote: > > > Set firmware_buf->size in fw_get_filesystem_firmware() after > > > successful kernel_read_file_from_path(), otherwise assign_firmware_buf() > > > fails. > > > > > > Signed-off-by: Sergey Senozhatsky > > > --- > > > drivers/base/firmware_class.c | 1 + > > > 1 file changed, 1 insertion(+) > > > > > > diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c > > > index b8bc846..7cf41a5 100644 > > > --- a/drivers/base/firmware_class.c > > > +++ b/drivers/base/firmware_class.c > > > @@ -335,6 +335,7 @@ static int fw_get_filesystem_firmware(struct device *device, > > > } > > > dev_dbg(device, "direct-loading %s\n", > > > buf->fw_id); > > > + buf->size = size; > > > fw_finish_direct_load(device, buf); > > > break; > > > } > > > > Thanks, Sergey. > > > > Somehow this was dropped in v4. > > sure, no prob. > if there is a way to fold this small fix into the original patch, then I wouldn't > mind at all to go with this option. Will do, thanks. > > The other thing is that, the dmesg output has changed, and now it keeps the > log of unsuccessful ucode accesses from ->ucode_api_max to ->ucode_api_min: > > [ 1.236866] Unable to open file: /lib/firmware/updates/4.5.0-rc4-mm1-dbg-00407-g2edf49f-dirty/iwlwifi-7260-17.ucode (-2) > [ 1.236874] iwlwifi 0000:02:00.0: loading /lib/firmware/updates/4.5.0-rc4-mm1-dbg-00407-g2edf49f-dirty/iwlwifi-7260-17.ucode failed with error -2 > [ 1.236889] Unable to open file: /lib/firmware/updates/iwlwifi-7260-17.ucode (-2) > [ 1.236894] iwlwifi 0000:02:00.0: loading /lib/firmware/updates/iwlwifi-7260-17.ucode failed with error -2 > [ 1.237064] Unable to open file: /lib/firmware/4.5.0-rc4-mm1-dbg-00407-g2edf49f-dirty/iwlwifi-7260-17.ucode (-2) > [ 1.237073] iwlwifi 0000:02:00.0: loading /lib/firmware/4.5.0-rc4-mm1-dbg-00407-g2edf49f-dirty/iwlwifi-7260-17.ucode failed with error -2 > [ 1.237094] Unable to open file: /lib/firmware/iwlwifi-7260-17.ucode (-2) > [ 1.237099] iwlwifi 0000:02:00.0: loading /lib/firmware/iwlwifi-7260-17.ucode failed with error -2 > [ 1.237106] iwlwifi 0000:02:00.0: Direct firmware load for iwlwifi-7260-17.ucode failed with error -2 > [ 1.237190] Unable to open file: /lib/firmware/updates/4.5.0-rc4-mm1-dbg-00407-g2edf49f-dirty/iwlwifi-7260-16.ucode (-2) > [ 1.237195] iwlwifi 0000:02:00.0: loading /lib/firmware/updates/4.5.0-rc4-mm1-dbg-00407-g2edf49f-dirty/iwlwifi-7260-16.ucode failed with error -2 > [ 1.237201] Unable to open file: /lib/firmware/updates/iwlwifi-7260-16.ucode (-2) > [ 1.237204] iwlwifi 0000:02:00.0: loading /lib/firmware/updates/iwlwifi-7260-16.ucode failed with error -2 > [ 1.237217] Unable to open file: /lib/firmware/4.5.0-rc4-mm1-dbg-00407-g2edf49f-dirty/iwlwifi-7260-16.ucode (-2) > [ 1.237221] iwlwifi 0000:02:00.0: loading /lib/firmware/4.5.0-rc4-mm1-dbg-00407-g2edf49f-dirty/iwlwifi-7260-16.ucode failed with error -2 > > > is this intentional? is there any reason to give this info back to user or > this is just a small regression? Thank you for pointing this out. The move from kernel_read_file_from_fd() to kernel_read_from_path() introduced this change. Neither function should display errors. Mimi