Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2603388imm; Fri, 24 Aug 2018 02:03:37 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbUi9XhKh/1agQlXPZHIP8u65D7Ma0QjFLlnNUqKc20J9qz9EOASngt9KMlaiacPCM2bjQ+ X-Received: by 2002:a17:902:8604:: with SMTP id f4-v6mr792012plo.225.1535101417183; Fri, 24 Aug 2018 02:03:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535101417; cv=none; d=google.com; s=arc-20160816; b=MCsbZKeqVZsUodmJDz5HDJclyLNhvGYGwI8czY3dI5TM9UkdyQV1G+HX39wSivP0Kx 5E3USESyFsmuQWGxLMlHV72hzTAnUQVO0IRePUxjaVzuJp4H0gx0BkxvObVdzABM1F7x xjYDqlFCF21LBoVgHaVe0wZ/uFBLLSkAYJXjpHG36xFIK3SqSd9nWPC/qQMUhZhrsRNb XE+PyEF7NPYKXQAxIt+oJCxVPNj2chX3amoog2RlK6cpVr/cVQwwqhUNKZ/Q837n/bpq mssy9MDHYyH9/XxWBEmseeh4m4fL115YApM8xs/mi5s1Hr2BfvyqjPyy3Zz0y7ymDajY DOPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=cmG/YfwL+3u6RMpwlA84kKKT4jjW7akdX2h3SHwrRTY=; b=bseKA4BBJGQJuw7U7vMnZ4QYNvdBVkR0UEdK+jYJnccmjtmkQDaSAxuACnyC5r8Bbz R7hCbfqbImteYpEcKmYhQjycBtiwnXZeoomLoF/x7p+vC2yRsnmxKUOHJgAMeCmfeEsu Id/GpJnlSsvkzw12plkYR6Jh0KtSO9zx6qJlEvtmpMixc5loigjDNtTeT/IWtKIHDy5p wu8yCVZlzXLXgKdm1SHHJ2nCLjfNEHodaZMVTU+lXq3l5QfG++Z8H5fK4BuIiNtAdUFv 0pj41JIBH1meh74foi83AZRcp0ByXpU/OtGhTPT/DxMFk4iHImwPsTfQF1soAQUU716l tkPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=J3d9lPt7; 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 s13-v6si6254690pgo.505.2018.08.24.02.03.21; Fri, 24 Aug 2018 02:03:37 -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=J3d9lPt7; 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 S1727569AbeHXMf3 (ORCPT + 99 others); Fri, 24 Aug 2018 08:35:29 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:40568 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726993AbeHXMf0 (ORCPT ); Fri, 24 Aug 2018 08:35:26 -0400 Received: by mail-wr1-f67.google.com with SMTP id n2-v6so6832851wrw.7 for ; Fri, 24 Aug 2018 02:01:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=cmG/YfwL+3u6RMpwlA84kKKT4jjW7akdX2h3SHwrRTY=; b=J3d9lPt7jhAXrRMTYE+1cxbe0LMIFCpmpXZIIi9/ZrMr0T/c8Z/8Rkv6M9Ijhr5v4K ImqmMrT/hyiWl+RWjw+A8kJIklvL/7knRSTiu1/Rb1tX+3r0g4NoggC7/a+T4okDLMzJ zzXPM8R9NJ1MO6XklCWBTYSqrDqQdrxfusNAc= 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-language :content-transfer-encoding; bh=cmG/YfwL+3u6RMpwlA84kKKT4jjW7akdX2h3SHwrRTY=; b=NKn/G6K2aC6HEo8qBA7TtNAVdrhSK3JD9iZXdRraRXCOYQp4U8Km1GoMxI4GPYeD1r Ir5Wxv6Yg3iTTq9pMHLKIKjbJc9OrN9uW3QqcOWEsJT1bG5okbq9aRf6s5vSnH6vsjnS iItzRsfUQPaTJ0DZRETRxg6L/5gORIxPXj3SfEjfAV7k7KmaAXSWLSK5qsl5VAueDB4L bbZmVsrpAcRqwZR+GHloDDt3IWewf/CDpxG4XWH4WxHGFCIdA1PtT9TQSkiNq4U+80oy 2QjoaBmwKizisgttC1hypQaU7PsHTvlVE647MZw/qHAV/bFNxr+4F747Zqm1IWno4q3k 42JA== X-Gm-Message-State: APzg51AY2XOrjUuuSdRQvJHA32AA9zK/u7aUIn4ZTQ9kmY34UsOxLzaU oz9gwBZp+DSq7uvnCoqeol6d3g== X-Received: by 2002:adf:ae01:: with SMTP id x1-v6mr594301wrc.45.1535101302960; Fri, 24 Aug 2018 02:01:42 -0700 (PDT) Received: from [192.168.27.209] ([37.157.136.206]) by smtp.googlemail.com with ESMTPSA id e141-v6sm1505853wmd.32.2018.08.24.02.01.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Aug 2018 02:01:42 -0700 (PDT) Subject: Re: [PATCH v6 2/4] venus: firmware: move load firmware in a separate function To: Alexandre Courbot , vgarodia@codeaurora.org Cc: Hans Verkuil , Mauro Carvalho Chehab , robh@kernel.org, mark.rutland@arm.com, Andy Gross , Arnd Bergmann , bjorn.andersson@linaro.org, Linux Media Mailing List , LKML , linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, devicetree@vger.kernel.org References: <1535034528-11590-1-git-send-email-vgarodia@codeaurora.org> <1535034528-11590-3-git-send-email-vgarodia@codeaurora.org> From: Stanimir Varbanov Message-ID: Date: Fri, 24 Aug 2018 12:01:40 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Alex, On 08/24/2018 10:39 AM, Alexandre Courbot wrote: > On Thu, Aug 23, 2018 at 11:29 PM Vikash Garodia wrote: >> >> Separate firmware loading part into a new function. >> >> Signed-off-by: Vikash Garodia >> --- >> drivers/media/platform/qcom/venus/core.c | 4 +- >> drivers/media/platform/qcom/venus/firmware.c | 55 ++++++++++++++++++---------- >> drivers/media/platform/qcom/venus/firmware.h | 2 +- >> 3 files changed, 38 insertions(+), 23 deletions(-) >> >> diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c >> index bb6add9..75b9785 100644 >> --- a/drivers/media/platform/qcom/venus/core.c >> +++ b/drivers/media/platform/qcom/venus/core.c >> @@ -84,7 +84,7 @@ static void venus_sys_error_handler(struct work_struct *work) >> >> pm_runtime_get_sync(core->dev); >> >> - ret |= venus_boot(core->dev, core->res->fwname); >> + ret |= venus_boot(core); >> >> ret |= hfi_core_resume(core, true); >> >> @@ -284,7 +284,7 @@ static int venus_probe(struct platform_device *pdev) >> if (ret < 0) >> goto err_runtime_disable; >> >> - ret = venus_boot(dev, core->res->fwname); >> + ret = venus_boot(core); >> if (ret) >> goto err_runtime_disable; >> >> diff --git a/drivers/media/platform/qcom/venus/firmware.c b/drivers/media/platform/qcom/venus/firmware.c >> index a9d042e..34224eb 100644 >> --- a/drivers/media/platform/qcom/venus/firmware.c >> +++ b/drivers/media/platform/qcom/venus/firmware.c >> @@ -60,20 +60,18 @@ int venus_set_hw_state(struct venus_core *core, bool resume) >> return 0; >> } >> >> -int venus_boot(struct device *dev, const char *fwname) >> +static int venus_load_fw(struct venus_core *core, const char *fwname, >> + phys_addr_t *mem_phys, size_t *mem_size) > > Following the remarks of the previous patch, you would have mem_phys > and mem_size as members of venus_core (probably renamed as fw_mem_addr > and fw_mem_size). > >> { >> const struct firmware *mdt; >> struct device_node *node; >> - phys_addr_t mem_phys; >> + struct device *dev; >> struct resource r; >> ssize_t fw_size; >> - size_t mem_size; >> void *mem_va; >> int ret; >> >> - if (!IS_ENABLED(CONFIG_QCOM_MDT_LOADER) || !qcom_scm_is_available()) >> - return -EPROBE_DEFER; > > !IS_ENABLED(CONFIG_QCOM_MDT_LOADER) is not a condition that can change > at runtime, and returning -EPROBE_DEFER in that case seems erroneous > to me. Instead, wouldn't it make more sense to make the driver depend > on QCOM_MDT_LOADER? That was made on purpose, for more info git show b8f9bdc151e4a -- regards, Stan