From patchwork Tue Jan 24 23:13:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sarangdhar Joshi X-Patchwork-Id: 9536079 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DB7A06042D for ; Tue, 24 Jan 2017 23:13:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CF72A26E98 for ; Tue, 24 Jan 2017 23:13:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C419C271BC; Tue, 24 Jan 2017 23:13:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 785ED26E98 for ; Tue, 24 Jan 2017 23:13:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751065AbdAXXNN (ORCPT ); Tue, 24 Jan 2017 18:13:13 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:39676 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750782AbdAXXNM (ORCPT ); Tue, 24 Jan 2017 18:13:12 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 4540960954; Tue, 24 Jan 2017 23:13:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1485299591; bh=39Ge9j1k04xxB+MFyWg/tqkbekVHrCFUk9NB/nEqF0Y=; h=From:To:Cc:Subject:Date:From; b=Cvs5R4iQBmQ+3O9CUTW8Iubj7dCIWbnEIbxpNSHgGJ4rG/OFYLX/uM9Mbij0QTgbd e192EpLW/Z85toZ/GJtvOne7RWwsge0HurvspQU8S3kWzlnCmoTQxvpWgD5xmYMwHO 4Av6CWL0KuhJqM+YNLKdBR+3BkfNP8ouRzX35sU8= Received: from spjoshi-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: spjoshi@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 0AF61607F1; Tue, 24 Jan 2017 23:13:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1485299590; bh=39Ge9j1k04xxB+MFyWg/tqkbekVHrCFUk9NB/nEqF0Y=; h=From:To:Cc:Subject:Date:From; b=GZosY8DAgNJKh9Z9D5rEyVAL9C8k7rMoQoU048Df8LRIhdZfOx3QOzRqHu71KX8Qx GFKDqeCs+TYi95yzC1fAYxDMyY6VNkmemixtxeGy06++Gbty+i7lp9BhzHl1NtG4du r0oFT6ay6EOMZdlx8rPmKmoRrGiW7niR+mjevKC0= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 0AF61607F1 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=spjoshi@codeaurora.org From: Sarangdhar Joshi To: Ohad Ben-Cohen , Bjorn Andersson , Loic Pallardy , Santosh Shilimkar Cc: Sarangdhar Joshi , linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Dave Gerlach , Suman Anna , Stephen Boyd , Trilok Soni Subject: [RFC][PATCH 1/2] remoteproc: Reduce asynchronous request_firmware to auto-boot only Date: Tue, 24 Jan 2017 15:13:00 -0800 Message-Id: <1485299581-30476-1-git-send-email-spjoshi@codeaurora.org> X-Mailer: git-send-email 1.9.1 Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The rproc_add_virtio_devices() requests firmware asynchronously and triggers boot if the auto_boot flag is set. However, this asynchronous call seems to be redundant for non auto-boot scenario since the rproc_boot() would call request_firmware() anyways. Move the auto_boot check to rproc_add() so that a redundant call to _request_firmware can be avoided for non auto-boot case. Signed-off-by: Sarangdhar Joshi --- I'm requesting RFC on this patch since I'm not aware of any scenario where we might need asynchronous firmware loading for non auto-boot case. drivers/remoteproc/remoteproc_core.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index f58e634..16242b0 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -970,9 +970,7 @@ static void rproc_fw_config_virtio(const struct firmware *fw, void *context) { struct rproc *rproc = context; - /* if rproc is marked always-on, request it to boot */ - if (rproc->auto_boot) - rproc_boot(rproc); + rproc_boot(rproc); release_firmware(fw); } @@ -1286,9 +1284,13 @@ int rproc_add(struct rproc *rproc) /* create debugfs entries */ rproc_create_debug_dir(rproc); - ret = rproc_add_virtio_devices(rproc); - if (ret < 0) - return ret; + + /* if rproc is marked always-on, request it to boot */ + if (rproc->auto_boot) { + ret = rproc_add_virtio_devices(rproc); + if (ret < 0) + return ret; + } /* expose to rproc_get_by_phandle users */ mutex_lock(&rproc_list_mutex);