linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Roger Quadros <rogerq@ti.com>
To: David Lechner <david@lechnology.com>, <ohad@wizery.com>,
	<bjorn.andersson@linaro.org>, <s-anna@ti.com>
Cc: <tony@atomide.com>, <robh+dt@kernel.org>, <bcousson@baylibre.com>,
	<ssantosh@kernel.org>, <nsekhar@ti.com>, <t-kristo@ti.com>,
	<nsaulnier@ti.com>, <jreeder@ti.com>, <m-karicheri2@ti.com>,
	<woods.technical@gmail.com>, <linux-omap@vger.kernel.org>,
	<linux-remoteproc@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <devicetree@vger.kernel.org>
Subject: Re: [PATCH 01/16] remoteproc: Extend rproc_da_to_va() API with a flags parameter
Date: Tue, 4 Dec 2018 12:03:51 +0200	[thread overview]
Message-ID: <5C065107.8080600@ti.com> (raw)
In-Reply-To: <ec83108c-1748-cec4-bebf-119d261fb229@lechnology.com>

On 29/11/18 18:12, David Lechner wrote:
> On 11/29/18 4:29 AM, Roger Quadros wrote:
>> Bjorn, Suman,
>>
>> On 26/11/18 23:29, David Lechner wrote:
>>> On 11/26/18 1:52 AM, Roger Quadros wrote:
>>>> From: Suman Anna <s-anna@ti.com>
>>>>
>>>> The rproc_da_to_va() API is currently used to perform any device
>>>> to kernel address translations to meet the different needs of the
>>>> remoteproc core/platform drivers (eg: loading). The function also
>>>> invokes the da_to_va ops, if present, to allow the remoteproc
>>>> platform drivers to provide address translation. However, not all
>>>> platform implementations have linear address spaces, and may need
>>>> an additional parameter to be able to perform proper translations.
>>>>
>>>> The rproc_da_to_va() API and the rproc .da_to_va ops have therefore
>>>> been expanded to take in an additional flags field enabling some
>>>> remoteproc implementations (like the TI PRUSS remoteproc driver)
>>>> to use these flags. Also, define some semantics for this flags
>>>> argument as this can vary from one implementation to another. A
>>>> new flags type is encoded into the upper 16 bits along side the
>>>> actual value in the lower 16-bits for the flags argument, to
>>>> allow different individual implementations to have better
>>>> flexibility in interpreting the flags as per their needs.
>>>
>>> This seems like an overly complex solution for a rather simple
>>> problem. Instead of passing all sorts of flags, could we just add
>>> a parameter named "page" to da_to_va() that indicates the memory
>>> page of the address in the remote processor?
>>>
>>> Or perhaps there is some other use for all of these flags that I
>>> am not aware of?
>>
>> I'm not a big fan of this patch either.
>>
>> rproc_da_to_va() is used at the following places
>>
>> 2 qcom_q6v5_mss.c         qcom_q6v5_dump_segment           974 void *ptr = rproc_da_to_va(rproc, segment->da, segment->size,
>> 3 remoteproc_core.c       rproc_da_to_va                   197 void *rproc_da_to_va(struct rproc *rproc, u64 da, int len, u32 flags)
>> 4 remoteproc_core.c       rproc_handle_trace               582 ptr = rproc_da_to_va(rproc, rsc->da, rsc->len, RPROC_FLAGS_NONE);
>> 5 remoteproc_core.c       rproc_coredump                  1592 ptr = rproc_da_to_va(rproc, segment->da, segment->size,
>> 6 remoteproc_elf_loader.c rproc_elf_load_segments          185 ptr = rproc_da_to_va(rproc, da, memsz,
>> 7 remoteproc_elf_loader.c rproc_elf_find_loaded_rsc_table  337 return rproc_da_to_va(rproc, shdr->sh_addr, shdr->sh_size,
>>
>> At rproc_elf_load_segments() we need to pass enough information so that
>> the rproc driver can load the segment into proper area (IRAM vs DRAM).
>> So providing page should suffice.
> 
> FYI, the PRU series I sent a while back has some patches to do
> something like this so feel free to use them if they are helpful.
> 
> https://lore.kernel.org/lkml/20180623210810.21232-2-david@lechnology.com/
> https://lore.kernel.org/lkml/20180623210810.21232-3-david@lechnology.com/
> 

Thanks. I think we need to do something like that. Too bad you had to reverse engineer
the TI specific headers. I'll check if we have this available somewhere internally.

>>
>> I want to understand more about rproc_elf_find_loaded_rsc_table() myself.
>> rproc_elf_find_loaded_rsc_table() is called only in rproc_start() in remoteproc_core.c
>> with the comment
>>
>>          /*
>>           * The starting device has been given the rproc->cached_table as the
>>           * resource table. The address of the vring along with the other
>>           * allocated resources (carveouts etc) is stored in cached_table.
>>           * In order to pass this information to the remote device we must copy
>>           * this information to device memory. We also update the table_ptr so
>>           * that any subsequent changes will be applied to the loaded version.
>>           */
>>          loaded_table = rproc_find_loaded_rsc_table(rproc, fw);
>>
>> Why isn't cached_table sufficient?
>> Why do we need to call rproc_find_loaded_rsc_table()?
>>
>> why do we need to load the resource table into remote processor memory at all.
>> As discussed earlier, some PRU systems have very little memory (512 bytes?)
>> and we want to avoid unnecessary loading.
>>

This question still holds.
Suman?

cheers,
-roger

-- 
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

  reply	other threads:[~2018-12-04 10:04 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-26  7:52 [PATCH 00/16] remoteproc: Add support for TI PRU Roger Quadros
2018-11-26  7:52 ` [PATCH 01/16] remoteproc: Extend rproc_da_to_va() API with a flags parameter Roger Quadros
2018-11-26 21:29   ` David Lechner
2018-11-29 10:29     ` Roger Quadros
2018-11-29 16:12       ` David Lechner
2018-12-04 10:03         ` Roger Quadros [this message]
2019-02-14  3:35           ` Suman Anna
2018-11-26  7:52 ` [PATCH 02/16] remoteproc: Add a rproc_set_firmware() API Roger Quadros
2018-11-26 21:41   ` David Lechner
2018-11-29  8:51     ` Roger Quadros
2018-11-26  7:52 ` [PATCH 03/16] remoteproc: Add support to handle device specific resource types Roger Quadros
2018-11-26  7:52 ` [PATCH 04/16] remoteproc/pru: Add PRU remoteproc driver Roger Quadros
2018-11-26 22:32   ` David Lechner
2018-11-29  9:26     ` Roger Quadros
2018-11-30 21:39   ` Dimitar Dimitrov
2018-12-04  8:47     ` Roger Quadros
2018-12-14  9:53     ` Roger Quadros
2018-12-15 13:43       ` Dimitar Dimitrov
2018-11-26  7:52 ` [PATCH 05/16] remoteproc/pru: Add pru-specific debugfs support Roger Quadros
2018-11-26 22:37   ` David Lechner
2018-11-29 10:17     ` Roger Quadros
2018-12-18 15:51       ` Roger Quadros
2018-12-19 12:38         ` Mark Brown
2018-12-19 15:43           ` Roger Quadros
2018-12-19 15:48             ` David Lechner
2018-12-19 17:07               ` Mark Brown
2018-12-19 17:18                 ` Tony Lindgren
2018-12-20  8:45                   ` Roger Quadros
2018-11-26  7:52 ` [PATCH 06/16] dt-bindings: remoteproc: ti-pruss: Update bindings for supporting rpmsg Roger Quadros
2018-11-26  7:52 ` [PATCH 07/16] remoteproc/pru: Add support for virtio rpmsg stack Roger Quadros
2018-11-26  7:52 ` [PATCH 08/16] remoteproc/pru: Add pru_rproc_set_ctable() function Roger Quadros
2018-11-26  7:52 ` [PATCH 09/16] remoteproc/pru: add APIs to get and put the PRU cores Roger Quadros
2018-11-26  7:52 ` [PATCH 10/16] remoteproc/pru: add pru_rproc_get_id() API to retrieve the PRU id Roger Quadros
2018-11-26  7:52 ` [PATCH 11/16] soc: ti: pruss: add helper functions to set GPI mode, MII_RT_event and XFR Roger Quadros
2018-11-26  7:52 ` [PATCH 12/16] dt-bindings: remoteproc: ti-pruss: Document application node bindings Roger Quadros
2018-11-26 23:27   ` David Lechner
2018-11-29 10:07     ` Roger Quadros
2018-11-29 16:33       ` David Lechner
2018-11-30 11:42         ` Roger Quadros
2018-12-11 22:06   ` Rob Herring
2018-12-17 16:03     ` Roger Quadros
2018-11-26  7:52 ` [PATCH 13/16] remoteproc/pru: add support for configuring GPMUX based on client setup Roger Quadros
2018-11-26  7:52 ` [PATCH 14/16] remoteproc/pru: configure firmware " Roger Quadros
2018-11-26  7:52 ` [PATCH 15/16] remoteproc/pru: add support for parsing pru interrupt mapping from DT Roger Quadros
2018-11-26  7:52 ` [PATCH 16/16] remoteproc/pru: Add support for INTC Interrupt map resource Roger Quadros

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=5C065107.8080600@ti.com \
    --to=rogerq@ti.com \
    --cc=bcousson@baylibre.com \
    --cc=bjorn.andersson@linaro.org \
    --cc=david@lechnology.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jreeder@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=m-karicheri2@ti.com \
    --cc=nsaulnier@ti.com \
    --cc=nsekhar@ti.com \
    --cc=ohad@wizery.com \
    --cc=robh+dt@kernel.org \
    --cc=s-anna@ti.com \
    --cc=ssantosh@kernel.org \
    --cc=t-kristo@ti.com \
    --cc=tony@atomide.com \
    --cc=woods.technical@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).