All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tomasz Figa <tfiga@chromium.org>
To: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Cc: vgarodia@codeaurora.org, Hans Verkuil <hverkuil@xs4all.nl>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Rob Herring <robh@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Andy Gross <andy.gross@linaro.org>,
	bjorn.andersson@linaro.org,
	Linux Media Mailing List <linux-media@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-arm-msm <linux-arm-msm@vger.kernel.org>,
	linux-soc@vger.kernel.org, devicetree@vger.kernel.org,
	Alexandre Courbot <acourbot@chromium.org>,
	Arnd Bergmann <arnd@arndb.de>
Subject: Re: [PATCH v2 5/5] venus: register separate driver for firmware device
Date: Wed, 6 Jun 2018 14:41:38 +0900	[thread overview]
Message-ID: <CAAFQd5AtjVdB2uZrvYs=VBr-0XfwmUc4NhD1yHv9L4sAOtZD2Q@mail.gmail.com> (raw)
In-Reply-To: <fd74c277-e8d3-a026-fbd2-914a029e8efe@linaro.org>

On Tue, Jun 5, 2018 at 5:45 PM Stanimir Varbanov
<stanimir.varbanov@linaro.org> wrote:
>
> Cc: Arnd
>
> On 06/05/2018 07:08 AM, Tomasz Figa wrote:
> > On Mon, Jun 4, 2018 at 10:56 PM Stanimir Varbanov
> > <stanimir.varbanov@linaro.org> 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 <vgarodia@codeaurora.org> 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].

I might have misunderstood something, but wasn't the shared-dma-pool
about reserving physical memory, while the venus firmware problem is
about reserving certain range of IOVA?

>
> 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.

Looking at current implementation in driver core,
of_platform_populate() would actually trigger a synchronous probe, so
I guess it could work. However, I'm not sure if this is a general
guarantee here or it's an implementation detail that shouldn't be
relied on.

If we end up really need to have this platform_driver, I guess we
could call platform_driver_probe() after of_platform_populate(),
rather than pre-registering the driver. That seems to be the way to
ensure that the probe is synchronous and we can also check that a
matching device was found by the return value.

Best regards,
Tomasz

  reply	other threads:[~2018-06-06  5:41 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-01 20:26 [PATCH v2 0/5] Venus updates - PIL Vikash Garodia
2018-06-01 20:26 ` [PATCH v2 1/5] media: venus: add a routine to reset ARM9 Vikash Garodia
2018-06-01 22:15   ` Stanimir Varbanov
2018-06-05 10:57     ` Vinod
2018-06-06  1:34       ` Alexandre Courbot
2018-07-04  8:35     ` Vikash Garodia
2018-06-22 23:15   ` Bjorn Andersson
2018-06-01 20:26 ` [PATCH v2 2/5] media: venus: add a routine to set venus state Vikash Garodia
2018-06-01 21:21   ` Jordan Crouse
2018-06-04 12:54     ` Tomasz Figa
2018-07-04  7:59       ` Vikash Garodia
2018-07-04  9:00         ` Tomasz Figa
2018-07-04  9:41           ` Vikash Garodia
2018-07-04 10:08             ` Tomasz Figa
2018-06-04 13:50   ` Stanimir Varbanov
2018-07-04  8:08     ` Vikash Garodia
2018-06-05 11:03   ` Vinod
2018-06-01 20:26 ` [PATCH v2 3/5] venus: add check to make scm calls Vikash Garodia
2018-06-01 21:22   ` Jordan Crouse
2018-06-04 12:58   ` Tomasz Figa
2018-06-22 23:19     ` Bjorn Andersson
2018-06-01 20:26 ` [PATCH v2 4/5] media: venus: add no TZ boot and shutdown routine Vikash Garodia
2018-06-01 21:30   ` Jordan Crouse
2018-06-04 13:09   ` Tomasz Figa
2018-06-01 20:26 ` [PATCH v2 5/5] venus: register separate driver for firmware device Vikash Garodia
2018-06-01 21:32   ` Jordan Crouse
2018-06-04 13:18   ` Tomasz Figa
2018-06-04 13:56     ` Stanimir Varbanov
2018-06-05  4:08       ` Tomasz Figa
2018-06-05  8:45         ` Stanimir Varbanov
2018-06-06  5:41           ` Tomasz Figa [this message]
2018-06-06 16:46       ` Bjorn Andersson
2018-06-05 21:07   ` Rob Herring
2018-06-06  4:46     ` Tomasz Figa
2018-06-06 12:53       ` Rob Herring
2018-06-06 13:03       ` Vikash Garodia

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAAFQd5AtjVdB2uZrvYs=VBr-0XfwmUc4NhD1yHv9L4sAOtZD2Q@mail.gmail.com' \
    --to=tfiga@chromium.org \
    --cc=acourbot@chromium.org \
    --cc=andy.gross@linaro.org \
    --cc=arnd@arndb.de \
    --cc=bjorn.andersson@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-soc@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mchehab@kernel.org \
    --cc=robh@kernel.org \
    --cc=stanimir.varbanov@linaro.org \
    --cc=vgarodia@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.