From patchwork Mon Jun 26 20:36:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 106381 Delivered-To: patch@linaro.org Received: by 10.140.101.48 with SMTP id t45csp421243qge; Mon, 26 Jun 2017 13:37:07 -0700 (PDT) X-Received: by 10.98.200.214 with SMTP id i83mr1850473pfk.144.1498509427127; Mon, 26 Jun 2017 13:37:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498509427; cv=none; d=google.com; s=arc-20160816; b=FQ2DwTYcYoMlLlTr1LM+Wp8Ma8yGKbgb5SZZY213B+CDTYfzvHEwStiC2OoTAfwhN4 M6uZA0ZjgDzMHcpr6QqUrgESRyhSAned2aP+UED70ISfarmucZ2CYqj1FIOXPnQx7rUw 2ijKx8kZDpTAX0U+JuM62ZLiofK9CssO1takYx0nE4EekxMy6233nPDdYTtwIZ2+ivCu i/92OHyi73JxVWx/81rj5p4wAED5/MUgpqDTvEkpJdz4za9tXzPVzj+Cqllk7Fxd9lme 47GlXytcAieaT1jqlT+iO1raNyk1uMyZjV2E5H1xShj1CjMvUK3XNNF83iLRBNebmby9 Bm2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=4pHu2xwP6jSh2D+5paLVJwwIYbY5UdpRlupIirlmvJA=; b=jinq1vf9zlq/z0fJt41Chpom718VAlMAP3jnh1KtryVuF9cmcaFou/zNZuVPwPIL0u /2VlQPWYG21TH0BVOlsP9yF5YPtnFEIHrF8M/x2wZCrWo+Off3wWreP9Nnj1D7songZ+ Cg4j3eEBMW3yIsye78DWrI+3n+m/r7YLTxNvjbIV1tsPeWBNKluMPlMgUFPnaXpDlN71 TPsQ1lMKd3DZvoEAS2eY6zSRC0lZjEGKdbAP1/Do/ZzfBCGjeQvV1Dn3Hd6TZW8s0mGM VpAy2dhWgIC2XlKfwD5j49J0PqDvE3Q74xopuQpkXPiDXI82viXupXU8GFrsUyilM8kO +yWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=TzaghwNd; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (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 h11si638795pln.492.2017.06.26.13.37.06; Mon, 26 Jun 2017 13:37:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=TzaghwNd; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751403AbdFZUhF (ORCPT + 10 others); Mon, 26 Jun 2017 16:37:05 -0400 Received: from mail-pg0-f46.google.com ([74.125.83.46]:33982 "EHLO mail-pg0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751476AbdFZUhE (ORCPT ); Mon, 26 Jun 2017 16:37:04 -0400 Received: by mail-pg0-f46.google.com with SMTP id t186so5323316pgb.1 for ; Mon, 26 Jun 2017 13:37:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=B4y0qoLeOFLxmLd8YMnrdX3gqGtI2lFc3RbMl+yENj4=; b=TzaghwNd+GeZX1XZD3X+jlZgMDGXSCoYJIJwM6S5nuFK5szIcwT7BMRQ3A57qbAnBn sc6iY58Q7FqccHsoCTOAVE8nOpjwDOvPoPS4aTPqPEY6O6d//6xqu69l5fXFo7GsBQ57 S6LFIVDjBwPDgqgbato5mxuEW4V21bkyoq+9s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=B4y0qoLeOFLxmLd8YMnrdX3gqGtI2lFc3RbMl+yENj4=; b=PD5DkbLzH+Y8WViSJYzAr/fOv9YA2CObetzq9Kz96JUapJiOCFne+vgXDdRKaXTyC9 wcNzI2DIiMKG5qnZBatig7IImbupdTtdPrE3yE57kdZgwuyW1rSCZNaK7uKfkLpyhNdP vWa1/5z1uUi/zDGZNewJrff7m0RefKX6v2e9cErVXrEu0lUXGu71WUaQKFZJqakUC/J6 y9wM7Oek2JcPGcQ/eB1UnHkqN9UFkLQeR+u1FkIK2EA7BlUMcuH0GOLzATb+W7i6Ll/J QH0tpsglz562esnCLZA36mNsqpPL+5wd6PPiDTDKW2TiPrL5+Ctmv30W6L4KLVyasNNf SLRg== X-Gm-Message-State: AKS2vOyaWMjT8y0MM0kcIL71K2OfvOr9Uh/J+D75CWkdgAvToKK2yXDj xS3H9226s+nOSKcm X-Received: by 10.98.163.203 with SMTP id q72mr1799434pfl.97.1498509423686; Mon, 26 Jun 2017 13:37:03 -0700 (PDT) Received: from localhost.localdomain (ip68-111-217-79.sd.sd.cox.net. [68.111.217.79]) by smtp.gmail.com with ESMTPSA id k194sm1649507pgc.31.2017.06.26.13.37.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Jun 2017 13:37:03 -0700 (PDT) From: Bjorn Andersson To: Andy Gross , David Brown Cc: "Luis R. Rodriguez" , Greg Kroah-Hartman , Stephen Boyd , linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] soc: qcom: mdt_loader: Use request_firmware_into_buf() Date: Mon, 26 Jun 2017 13:36:59 -0700 Message-Id: <20170626203659.24393-1-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.12.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org By switching to the request_firmware_into_buf() we load the segment data straight into the preallocated buffers, reducing the need for allocating scratch buffers for these. In particular the modem firmware consists of multiple segments in the range 5-15MB, making this worth while. Signed-off-by: Bjorn Andersson --- drivers/soc/qcom/mdt_loader.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 2.12.0 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/soc/qcom/mdt_loader.c b/drivers/soc/qcom/mdt_loader.c index bd63df0d14e0..08bd8549242a 100644 --- a/drivers/soc/qcom/mdt_loader.c +++ b/drivers/soc/qcom/mdt_loader.c @@ -178,14 +178,13 @@ 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(&seg_fw, fw_name, dev); + ret = request_firmware_into_buf(&seg_fw, fw_name, dev, + ptr, phdr->p_filesz); if (ret) { dev_err(dev, "failed to load %s\n", fw_name); break; } - memcpy(ptr, seg_fw->data, seg_fw->size); - release_firmware(seg_fw); }