Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1758763imm; Tue, 22 May 2018 08:53:12 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq98sGwpRovFeFcI1lfxmHp2nrCU2sQQa8agZpxyvJKXYOq9mQUcW5IH5tgx4pjjRtSZDIo X-Received: by 2002:a62:ecdc:: with SMTP id e89-v6mr24907843pfm.33.1527004392432; Tue, 22 May 2018 08:53:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527004392; cv=none; d=google.com; s=arc-20160816; b=l3TU6YOhQGRAOLE1FCgYtwxtbUKfgeyQW38pvDgk0R7W9575qsarHs62WYy3WYWhvT Jh2Q169Ajj1iaBNxvUFqPJukZPxGVcgjmGgt9cdzL97dnhDMbrcGRpu6MKZSz8JweKFV gm9TqZWczoWrGNBQNzbJSpwocJbob6bcDs0GCoNzavUgF/AU9AS1isxvXKT4QHzBX9Is G3bwO5k/mWvQI9bXbJ9OnMjZlwC8DljsjuzmkGWiITNFDzHYNbF7/ljpQ4WwrvUwnK2l y9zSQRU08bA9h/S7DCtt++g6qQZzgcDDvlossf8gWO4CF2Swtab6Vf6RjNxNApVllCpV 1fQA== 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=zU8ORE5o7JY/vsybVZlARMzk26IrKRD64CP7rXnW3QQ=; b=Bfu0o4uw1T6xBmAES4FE9bmz2zJmqdFhkKNCKxTnbd4rf0fHmZ9h6wtCqoNm21mTx4 96gUuyS8RQjmwXEdx+L/ff2knTRtdbG+w1pu47DKLj/PjWYq9DlAiXKIad9Bh4FuOxJL gN4dUHcQLM3Bpd6fcfn/a9febbYuGN3ED0Zfng8SJm6Jb9JykudTqxrSk2xLPpu4H7kz hAzpPty4n7ongjUXszTKpEcJl/HB1qIOligv871qt3wAWdAmfobF9dSDQpm0o/tr6H72 NuhgqPX0i7Q0HRYijrO05zQkczseTUkrsJvVh+qL2ssXAALoz+8/66VNEHuoLsM8AeJx eY1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kIDsesTm; 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 w64-v6si17127524pfw.201.2018.05.22.08.52.56; Tue, 22 May 2018 08:53:12 -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=kIDsesTm; 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 S1751528AbeEVPwo (ORCPT + 99 others); Tue, 22 May 2018 11:52:44 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:38284 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751257AbeEVPwm (ORCPT ); Tue, 22 May 2018 11:52:42 -0400 Received: by mail-wm0-f66.google.com with SMTP id m129-v6so1128284wmb.3 for ; Tue, 22 May 2018 08:52:41 -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=zU8ORE5o7JY/vsybVZlARMzk26IrKRD64CP7rXnW3QQ=; b=kIDsesTm4dNOBj6S6QqnTtzwuwvEL49GBvd3Jcv84D+bduCaup7RUzFu9LyNR+ZBS2 +T7ziyPUMLwZVdBbKYLMemY1u55csCr28t37nFZVUcyqPfCziRTdRLQ64FQdje7JJTsW yuu0x7EckhKzO7ECCM0FfsyiSByVmWIgytVM8= 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=zU8ORE5o7JY/vsybVZlARMzk26IrKRD64CP7rXnW3QQ=; b=LwII1pTJuPfnfIOK0OZ7DB8+ZnRXpCS+ZmB/h/Qk229yTEKUf+lv+GfJNPl0+3Fr49 QyhcvcHFj9qfcOImFBJDsDWAU1T5pNkF4aEcZB3h21L8SeStONYqpuya8sjCQh7HYCFt PQ8oj48mTtNr5xyDlZDXstfIyF4L5cJlyI5SorYfzY5tjjtE9VhXinuPUfTbaVT9r9JJ dLc6szZrvB7gyu9SQGAH/jGneDNvViLIaReSuvuYm+RiLPh2lTVZ1OzbD7hMfD2SuYg5 1/2d3VbMY+RKnoZRPVsw0OgrlPDTDmuL3eifEsNVL3sk9KSAWlZu2jdFZiUbymJq8ROJ 7faw== X-Gm-Message-State: ALKqPwfuZHkU0i7NWfKUw3ZzHMuWn4rJRz9p94wJUrUYrxj2DKm0ueYQ qtCdDIG2/47lMvAEsuULmci4wQ== X-Received: by 2002:a1c:7619:: with SMTP id r25-v6mr1747162wmc.5.1527004360981; Tue, 22 May 2018 08:52:40 -0700 (PDT) Received: from [192.168.27.209] ([37.157.136.206]) by smtp.googlemail.com with ESMTPSA id k9-v6sm15791454wre.1.2018.05.22.08.52.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 May 2018 08:52:39 -0700 (PDT) Subject: Re: [PATCH 4/4] media: venus: add PIL support To: Stanimir Varbanov , Vikash Garodia , hverkuil@xs4all.nl, mchehab@kernel.org, andy.gross@linaro.org, bjorn.andersson@linaro.org Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, acourbot@google.com References: <1526556740-25494-1-git-send-email-vgarodia@codeaurora.org> <1526556740-25494-5-git-send-email-vgarodia@codeaurora.org> <3822394c-b304-15c3-c978-ee39589308eb@linaro.org> From: Stanimir Varbanov Message-ID: <65b3d26a-8180-c051-1d34-44d49dca34ca@linaro.org> Date: Tue, 22 May 2018 18:52:36 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <3822394c-b304-15c3-c978-ee39589308eb@linaro.org> 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, On 05/22/2018 04:02 PM, Stanimir Varbanov wrote: > Hi Vikash, > > On 05/17/2018 02:32 PM, Vikash Garodia wrote: >> This adds support to load the video firmware >> and bring ARM9 out of reset. This is useful >> for platforms which does not have trustzone >> to reset the ARM9. >> >> Signed-off-by: Vikash Garodia >> --- >> .../devicetree/bindings/media/qcom,venus.txt | 8 +- >> drivers/media/platform/qcom/venus/core.c | 67 +++++++-- >> drivers/media/platform/qcom/venus/core.h | 6 + >> drivers/media/platform/qcom/venus/firmware.c | 163 +++++++++++++++++---- >> drivers/media/platform/qcom/venus/firmware.h | 10 +- >> 5 files changed, 217 insertions(+), 37 deletions(-) >> >> >> -int venus_shutdown(struct device *dev) >> +int venus_boot_noTZ(struct venus_core *core, phys_addr_t mem_phys, >> + size_t mem_size) >> { >> - return qcom_scm_pas_shutdown(VENUS_PAS_ID); >> + struct iommu_domain *iommu; >> + struct device *dev; >> + int ret; >> + >> + if (!core->fw.dev) >> + return -EPROBE_DEFER; >> + >> + dev = core->fw.dev; >> + >> + iommu = iommu_domain_alloc(&platform_bus_type); >> + if (!iommu) { >> + dev_err(dev, "Failed to allocate iommu domain\n"); >> + return -ENOMEM; >> + } >> + >> + iommu->geometry.aperture_start = 0x0; >> + iommu->geometry.aperture_end = VENUS_FW_MEM_SIZE; > > The same comment for geometry params as for venus_probe is valid here. Infact aperture_end will be overwritten by arm-smmu driver in the next call to iommu_attach_device(), and by chance geometry.force_aperture will become true. I wonder is that geometry params are supposed to be used by drivers or by iommu drivers? > >> + >> + ret = iommu_attach_device(iommu, dev); >> + if (ret) { >> + dev_err(dev, "could not attach device\n"); >> + goto err_attach; >> + } >> + >> + ret = iommu_map(iommu, core->fw.iova, mem_phys, mem_size, >> + IOMMU_READ|IOMMU_WRITE|IOMMU_PRIV); > > iova is not initialized and is zero, maybe we don't need that variable > in the venus_firmware structure? > >> + if (ret) { >> + dev_err(dev, "could not map video firmware region\n"); >> + goto err_map; >> + } >> + core->fw.iommu_domain = iommu; >> + venus_reset_hw(core); >> + >> + return 0; >> + >> +err_map: >> + iommu_detach_device(iommu, dev); >> +err_attach: >> + iommu_domain_free(iommu); >> + return ret; >> } >> + -- regards, Stan