Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3403540ybi; Sun, 26 May 2019 22:40:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqyyoEqMxZsJAWBCbwp7/V5ipmyxAQl+T5Eiepe+XqjQUh6vf11Qnvkf/wZtG8/Kk+tkECLb X-Received: by 2002:a63:eb50:: with SMTP id b16mr49432408pgk.150.1558935636400; Sun, 26 May 2019 22:40:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558935636; cv=none; d=google.com; s=arc-20160816; b=lTBmMRvIZpk1YYvGHdUrFKGj3BWsVvaA4xDjDfRfmupI669l3rIa6qQKN0kgIcv+6y Ghhy/IpdBlvPayOc4zpaQUqZThHUHZ0Lxd4WUb8us0z4QglNLydoXGPCC6GcuYKtM55f aDnYhJIDZiOZyrHeSN2SxndsJLxOQKr8883PfurrFb3pDOkyq4ce/iJMY1FhJvlb2qi3 3+Yq9CWMB/5s9BQ6bsU/Lnh34/T0hRwo0RNPpRMUlO/Q35t2576wQV9J9cR03z+hwOdE 37nmwDu5guDDgbxuAL2/zuPE/5wtGRV/ryPMB1sEn6iTNgQaQZTWlcDMtgurdCVTKnXy R6jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=0Q+RZAfq2/iYUwVm8pEyCIzzp6Mp3PG1pvjpD0Wsst8=; b=KL9jMBCYPiDsdGj5guTu+qJQLvnZ1+RutsxJMPasG9g2rxC/rMwu4o2RpHdx0Cq8Pi zwA2QPJJ19opp3GYR9ORc6oKQzqt3fvSij/LU3MslXbtuOpqqkEQ6miTcvd9EGXaQAam 9pnOAEmkBktFflNdshnHcQmi0IaSxKoxP61Okm/1VQTJr4dbpRrdZfJN2eLSpGxxZZZ9 OtmHNX1lstSedcmVW4Qv12qTqBjZD0Pp43R8OwS/SnIaAuuqC8cuUvqXXuJwdtsVrL2h LE2v1avU29pBjnHiZ9plsUUwIOb31u2F5tFxbCcihDVSlo3k03Y8OEiKShxPm59lfx/p JWbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="y4LhP/pQ"; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e9si15579320pjs.108.2019.05.26.22.40.21; Sun, 26 May 2019 22:40:36 -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=@linaro.org header.s=google header.b="y4LhP/pQ"; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726225AbfE0FgM (ORCPT + 99 others); Mon, 27 May 2019 01:36:12 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:38880 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726046AbfE0FgL (ORCPT ); Mon, 27 May 2019 01:36:11 -0400 Received: by mail-pg1-f196.google.com with SMTP id v11so8443168pgl.5 for ; Sun, 26 May 2019 22:36:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=0Q+RZAfq2/iYUwVm8pEyCIzzp6Mp3PG1pvjpD0Wsst8=; b=y4LhP/pQHr/aVhOdEQODLTvwAmzQ67WSkXpzCM/HejrDe230d148gN4Zts0idcGdtp cW+9IThLSkY5AzVNjS3DeJOO6TVm6k9PY1QUtyZngouTPpDpcL2aT0G6HJ712nA+Shfs JWiWvhkroDQCVT4Br4uZcJeoBxvUki8nX/ZenVYl8o222qwiqppQKHbnFsopGBQ3JTXL kdeZ8TImTUXtAKBwaaiPPTgsUvWF5PWcSzpCxYCWn3ID2SnWMRBWLuDo28OdS9NTZjcE QJB4/q8RAimf0U2giJd/wUu5uiqcNyZn//ROTsBgIHY4avUbe1Jd/pGeTNprUgeQ5FpL gCQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=0Q+RZAfq2/iYUwVm8pEyCIzzp6Mp3PG1pvjpD0Wsst8=; b=NJj3Bg0bP8ZrcPu0ym0Osii3sqaOE6We7mZqmEzncaVe4WcloYTfrOG3qEQASe17Uv J8X1VrcNjfcoNQJNuv54MP5/ByxKXtrd4X93j/z4gTkKSNyRjO5u//Fzjt/LJ0BGRipk XVlVou3+fTdp/7oFffOUQn4btGIE0fTJe+URRh8Q8zNTFivr8dIppbs9HUL13A694Tvx 17gjCL9h8cB3aAeoctKv8kI9JeLwAQSTOw/ClBXPdEJ+MJMg/IeU8Gaq+EZp+ZvqUNze RmIfRn7WXZauUQlaIuKACYRz8ThrvGxHo+PPw8jrAIgn5gSrUIonNXVZjZ/sqFcRFm3M iADw== X-Gm-Message-State: APjAAAVnucDlJ2HwbjDFZ5Xzzf74mHAvyGBdIm7ZdpiV7HHPJ0+IOYA2 0hB9eJ4BM5i4qY4tsgoU5fEwXw== X-Received: by 2002:a17:90a:af8d:: with SMTP id w13mr28696380pjq.143.1558935370849; Sun, 26 May 2019 22:36:10 -0700 (PDT) Received: from minitux (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id m101sm18083986pjb.2.2019.05.26.22.36.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 26 May 2019 22:36:09 -0700 (PDT) Date: Sun, 26 May 2019 22:36:07 -0700 From: Bjorn Andersson To: Greg Kroah-Hartman Cc: Scott Branden , 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 Subject: Re: [PATCH 3/3] soc: qcom: mdt_loader: add offset to request_firmware_into_buf Message-ID: <20190527053607.GV31438@minitux> References: <20190523025113.4605-1-scott.branden@broadcom.com> <20190523025113.4605-4-scott.branden@broadcom.com> <20190523055212.GA22946@kroah.com> <20190523165605.GB21048@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190523165605.GB21048@kroah.com> User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Regards, Bjorn