Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp5264947ybi; Tue, 30 Jul 2019 17:23:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqxlKTDbfJ6T1WTpezI428XwhvUhu05BZDTf4Eb6NeNxi8+WoDhVla9wpsHqkiKCdWggBXbd X-Received: by 2002:a17:90a:30e4:: with SMTP id h91mr56775pjb.37.1564532612763; Tue, 30 Jul 2019 17:23:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564532612; cv=none; d=google.com; s=arc-20160816; b=fUa3Nq+Yak/tC4KAEO4f/SWA3Y5wUy++KcWJigckVot4LSg5CtjX6yr/lzLaHGZsIU 7JVjgIi2WuzEtHSFnEBC2ebI9Ak7oeBslmPxlZl7N6rSDRF1+6/R3zVdjJBt9vClfjza NQ4bEiw4g/hUZElHlg94MjHpcVD8VHHdS7ufswCFs9Nclv4ivFnCPd9TPs3WVQ8pzC7/ HfmbNAK6VFnwjLd/a5euY2DWrqL2WhZXcvm7dEgZIm4aqYly625oa31Zn/0H5DRj5Vs7 ap/xck/EemnfdYewHMPWdMnCGKWhygazPz3Oq0DtQpJbt2fsM0NcXSJnpa+E48hZJhYR t52A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=l67md0ipmih3vEYzhRRc7F2bAQdJBdaBVciR4FmReuc=; b=zDn7pU224MF1dnFFDaGlASRn1zflGKvl7O+2ZAbD01vk1W/iKO9ipYVZOXGLB6tsrz AtyPre5srZhoyX4Q+ZNjvSm1qs/y7p5+sFuSU0vr6hjYrs6TR+F4B1uKp/bAI/McvQBr 7iihCF90BNqNnQwlZRQHLq0ifBenIIjq15Rbmysn1TfbAclKuPVfWu8XAS7I67QJui3Y nRGGd0hree//oxZc/WooSzPw9T5VS/5HoybNmQw8u2WpeuffR/44Uj5c6KASKAuX52vm wp7UWd7DnzYAkuArCx9XqKr9RYcEItc8SjXBgr8qOtHfpaSK3msTY24YL/3z7aIv5My4 Lcbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=FoanKqKH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z14si27315pju.64.2019.07.30.17.23.17; Tue, 30 Jul 2019 17:23:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=FoanKqKH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726890AbfG3XCp (ORCPT + 99 others); Tue, 30 Jul 2019 19:02:45 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:33264 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726689AbfG3XCp (ORCPT ); Tue, 30 Jul 2019 19:02:45 -0400 Received: by mail-pl1-f194.google.com with SMTP id c14so29404931plo.0 for ; Tue, 30 Jul 2019 16:02:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=l67md0ipmih3vEYzhRRc7F2bAQdJBdaBVciR4FmReuc=; b=FoanKqKHePYQ/GrvPeWBEWvqtTZlkzE2ilWM53avnGJq/i7+zFPkZBhfZDKsatefR1 /vUJBumYNSjcpb1s85/pZN3MhOWcMdMsG8jYjn0KJMxNSBFQgQNdbKyH9f3/GciscsFS YMsi0Q1Whsbp9UbLbS294SGQazWyStgu9hW84= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=l67md0ipmih3vEYzhRRc7F2bAQdJBdaBVciR4FmReuc=; b=tajRk85gcVGWo5CcgtXxJCNo77LY/NWNQfYpYwB5obw26SVRhwweCJgW0ojwju9Lbc mRrsBe8IysoPaCdzk7d7a6+REQ1q9MuJDD+D0Q8XsLaECiTtyw86UMfYhZZ2m/Qo6MC3 HBOWKUd5Z+1tHM1YWQwu5qCrN6dlTLS/X/sv+A890UH46WXsLl1LmxkSABXnJCvM68zG 8N5d5WlsCbO/YgV6uk8wiR7gLPVFkbZ4xjm2iTPDLZjbx7XnKptmkCYZbrWV8XU26sks 8iD8EF+F9pExTo+vKia7nyBpFaSuEtuchP6xMvditZxGImYo2EA99ZsmrGIUkepFOdJZ zE7A== X-Gm-Message-State: APjAAAWwohFp7QiK3FggivW2/39clftKpfhUtfa3YG9kRU4WJeTYYtmh SKD0B/8+Z2AH3gS81yVra0BxhQ== X-Received: by 2002:a17:902:da4:: with SMTP id 33mr107262813plv.209.1564527764489; Tue, 30 Jul 2019 16:02:44 -0700 (PDT) Received: from [10.136.13.136] ([192.19.228.250]) by smtp.gmail.com with ESMTPSA id b26sm74753491pfo.129.2019.07.30.16.02.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Jul 2019 16:02:43 -0700 (PDT) Subject: Re: [PATCH 3/3] soc: qcom: mdt_loader: add offset to request_firmware_into_buf To: Bjorn Andersson , Greg Kroah-Hartman Cc: Luis Chamberlain , Andy Gross , David Brown , Alexander Viro , "Rafael J . Wysocki" , linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-fsdevel@vger.kernel.org, BCM Kernel Feedback , Olof Johansson References: <20190523025113.4605-1-scott.branden@broadcom.com> <20190523025113.4605-4-scott.branden@broadcom.com> <20190523055212.GA22946@kroah.com> <20190523165605.GB21048@kroah.com> <20190527053607.GV31438@minitux> From: Scott Branden Message-ID: <4aec9d4e-fd6c-afba-d051-6ab22bdfa17f@broadcom.com> Date: Tue, 30 Jul 2019 16:02:40 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190527053607.GV31438@minitux> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Bjorn, On 2019-05-26 10:36 p.m., Bjorn Andersson wrote: > On Thu 23 May 09:56 PDT 2019, Greg Kroah-Hartman wrote: > >> On Thu, May 23, 2019 at 09:41:49AM -0700, Scott Branden wrote: >>> Hi Greg, >>> >>> On 2019-05-22 10:52 p.m., Greg Kroah-Hartman wrote: >>>> On Wed, May 22, 2019 at 07:51:13PM -0700, Scott Branden wrote: >>>>> Adjust request_firmware_into_buf API to allow for portions >>>>> of firmware file to be read into a buffer. mdt_loader still >>>>> retricts request fo whole file read into buffer. >>>>> >>>>> Signed-off-by: Scott Branden >>>>> --- >>>>> drivers/soc/qcom/mdt_loader.c | 7 +++++-- >>>>> 1 file changed, 5 insertions(+), 2 deletions(-) >>>>> >>>>> diff --git a/drivers/soc/qcom/mdt_loader.c b/drivers/soc/qcom/mdt_loader.c >>>>> index 1c488024c698..ad20d159699c 100644 >>>>> --- a/drivers/soc/qcom/mdt_loader.c >>>>> +++ b/drivers/soc/qcom/mdt_loader.c >>>>> @@ -172,8 +172,11 @@ static int __qcom_mdt_load(struct device *dev, const struct firmware *fw, >>>>> if (phdr->p_filesz) { >>>>> sprintf(fw_name + fw_name_len - 3, "b%02d", i); >>>>> - ret = request_firmware_into_buf(&seg_fw, fw_name, dev, >>>>> - ptr, phdr->p_filesz); >>>>> + ret = request_firmware_into_buf >>>>> + (&seg_fw, fw_name, dev, >>>>> + ptr, phdr->p_filesz, >>>>> + 0, >>>>> + KERNEL_PREAD_FLAG_WHOLE); >>>> So, all that work in the first 2 patches for no real change at all? Why >>>> are these changes even needed? >>> The first two patches allow partial read of files into memory. >>> >>> Existing kernel drivers haven't need such functionality so, yes, there >>> should be no real change >>> >>> with first two patches other than adding such partial file read support. >>> >>> We have a new driver in development which needs partial read of files >>> supported in the kernel. >> As I said before, I can not take new apis without any in-kernel user. >> So let's wait for your new code that thinks it needs this, and then we >> will be glad to evaluate all of this at that point in time. >> > The .mdt files are ELF files split to avoid having to allocate large > (5-60MB) chunks of temporary firmware buffers while installing the > segments. > > But for multiple reasons it would be nice to be able to load the > non-split ELF files and the proposed interface would allow this. > > So I definitely like the gist of the series. > >> To do so otherwise is to have loads of unused "features" aquiring cruft >> in the kernel source, and you do not want that. >> > Agreed. > > I'll take the opportunity and see if I can implement this (support for > non-split Qualcomm firmware) based on the patches in this series. I'm back from my leave now. Have you managed to utilize my partial firmware read in your driver yet? > > Regards, > Bjorn