Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp635948imm; Tue, 5 Jun 2018 01:47:08 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIHJqJVQA1J5erAySk7sPfZl1766N9tCIeDR2r07UvcVvGNcZj6J0vcWfbj2WLJ3x93SNtj X-Received: by 2002:a17:902:9f84:: with SMTP id g4-v6mr7804170plq.339.1528188428887; Tue, 05 Jun 2018 01:47:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528188428; cv=none; d=google.com; s=arc-20160816; b=Zrn4eybGVcNU1MEWDiknGJZf0UABsnD8Lq0Ixh4pu6SxSABk7tSGi7g3bKpzyMPwO/ rO4ZublDbppZSHfj5LiX3dKI6+IHr3aE53aJwQiu1bEDleNwXLQ/C+j9bGa7oIGIXzr+ hQ+zoUSWaBBIyjr8KbpjnQSGZwDCjAmcGUxAMz4SksPr5SLP7LMI6mFOlfI3V6ZBaSkX N21dSx1yQRXiDSkjqv865L0yJOJJG+AamoIxh/iUriYFfr908CZVM+Vb8ywnb2Mwm1dG GW5i1SctMDG0u12Jo+Zmq/7zqIrKJ6fgq2381IdBEwsEEHbgyKXSshhP2S3W0hLruAwQ 6ncQ== 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=NRb1szb+pE9Yl03f7CLmIVQKKa4sq4bAQtVvDIPSaGI=; b=KWxvnumHaH8dTpg33d4bvCetHd4peO9yC7j59VmLA0mBxcEJkH8/lfzkwkFBz8Lmlh ExlJh/qrigjuWXayP7GK/ZfG94pPiZovdBjHmlWQ1KFnYJ3HOmcgruW3TArpHZta6uUV B9ecXHfDKCjqhNkBzacMWMURVUl6q6p0MGAWof8EgeHlP0Gy1xOAIhJgCxLwA5lkc5SF cC4lxQgUAc7o/wl46H9ZDabn65t2Zdweuc32fdugKZWyaZblFn/kVYZrmGgZ85YFP9as ntABnSoaNLxHzESIDsaXfaogub+6DUPeiV2TyfabXC2ifR21RzoJgvxLv4YF36YhUOuF BA9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=E0/4Q4cj; 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 85-v6si4965244pfm.264.2018.06.05.01.46.54; Tue, 05 Jun 2018 01:47:08 -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=E0/4Q4cj; 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 S1751610AbeFEIpQ (ORCPT + 99 others); Tue, 5 Jun 2018 04:45:16 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:36567 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751506AbeFEIpM (ORCPT ); Tue, 5 Jun 2018 04:45:12 -0400 Received: by mail-wm0-f67.google.com with SMTP id v131-v6so3443545wma.1 for ; Tue, 05 Jun 2018 01:45:12 -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=NRb1szb+pE9Yl03f7CLmIVQKKa4sq4bAQtVvDIPSaGI=; b=E0/4Q4cjdyymjEbGH83eBlqAffpvjbnAZD8/zIeQmTUd6TeRCpkENPM85joo/n+67q Sz65Bnc1h87w/9XmWH8Zvm7VWi2I884wWAFGiSYAhT88p6ZxFtp8qJCjLw/1DSyHFSWD bjx0jxpotO4bwgf8slX3BAWqYmFAKyK+yIRIk= 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=NRb1szb+pE9Yl03f7CLmIVQKKa4sq4bAQtVvDIPSaGI=; b=p5sqY5D9WC4MMO3zFbvd5mykbgN39Iu1zO5QZiw/qdZyPNHK+l/GU7QWzKE1WluVDG ZavQP6CPX75NaJQXuRySDyb0+JbS5gl54RxNSWZExphcSh7JnRBZtwtToH3zGZODwcq4 1lcHiwsuzcvfLihtrqo3VoPPWTQrtj9OaYTpGHmGycSkpzBrOvXHD4vhgx6VGefPH6Ag KddcJD2ezbMXRakk7Kml6c0x7F1YBHxVV3jf+U+9bvo4AYWdFoJg4dYJXL+w6rT1rKoj 95hap48b7gyJN/NpQSxvogY+JMh9xURdsBmujJltckmLyNoP7EjZkAaa9zE+EmjVfQRZ AWlA== X-Gm-Message-State: APt69E2/Th219jiIAk1kc2IQiCnIZC9/zhbEctn1cupUvaIX+jo+/ZBU fxp9GDTHekh9X9Fh0szxkiDM1w== X-Received: by 2002:a1c:20c7:: with SMTP id g190-v6mr12035327wmg.2.1528188311659; Tue, 05 Jun 2018 01:45:11 -0700 (PDT) Received: from [192.168.27.209] ([37.157.136.206]) by smtp.googlemail.com with ESMTPSA id b80-v6sm1563201wmf.2.2018.06.05.01.45.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Jun 2018 01:45:11 -0700 (PDT) Subject: Re: [PATCH v2 5/5] venus: register separate driver for firmware device To: Tomasz Figa , Stanimir Varbanov Cc: vgarodia@codeaurora.org, Hans Verkuil , Mauro Carvalho Chehab , Rob Herring , Mark Rutland , andy.gross@linaro.org, bjorn.andersson@linaro.org, Linux Media Mailing List , Linux Kernel Mailing List , linux-arm-msm , linux-soc@vger.kernel.org, devicetree@vger.kernel.org, Alexandre Courbot , Arnd Bergmann References: <1527884768-22392-1-git-send-email-vgarodia@codeaurora.org> <1527884768-22392-6-git-send-email-vgarodia@codeaurora.org> <2cf4f7e8-f9e6-d62b-45a8-2c348af4aafe@linaro.org> From: Stanimir Varbanov Message-ID: Date: Tue, 5 Jun 2018 11:45:08 +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: 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 Cc: Arnd On 06/05/2018 07:08 AM, Tomasz Figa wrote: > On Mon, Jun 4, 2018 at 10:56 PM Stanimir Varbanov > wrote: >> >> Hi Tomasz, >> >> On 06/04/2018 04:18 PM, Tomasz Figa wrote: >>> Hi Vikash, >>> >>> On Sat, Jun 2, 2018 at 5:27 AM Vikash Garodia wrote: >>>> +static int __init venus_init(void) >>>> +{ >>>> + int ret; >>>> + >>>> + ret = platform_driver_register(&qcom_video_firmware_driver); >>>> + if (ret) >>>> + return ret; >>> >>> Do we really need this firmware driver? As far as I can see, the >>> approach used here should work even without any driver bound to the >>> firmware device. >> >> We need device/driver bind because we need to call dma_configure() which >> internally doing iommus sID parsing. > > I can see some drivers calling of_dma_configure() directly: > https://elixir.bootlin.com/linux/latest/ident/of_dma_configure > > I'm not sure if it's more elegant, but should at least require less code. I think that in this case of non-TZ where we do iommu mapping by hand we can use shared-dma-pool reserved memory see how venus_boot has been implemented in the beginning [1]. Arnd what do you think? Some background, we have a use-case where the memory for firmware needs to be mapped by the venus driver by hand instead of TZ firmware calls. I.e. we want to support both, iommu mapping from the driver and mapping done by TZ firmware. How we will differentiate what mapping (TZ or non-TZ) will be used is a separate issue. > > By the way, can we really assume that probe of firmware platform > device really completes before we call venus_boot()? I'd say we cannot. -- regards, Stan [1] https://lkml.org/lkml/2017/4/28/214