mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stanimir Varbanov <stanimir.varbanov@linaro.org>
To: Bjorn Andersson <bjorn.andersson@linaro.org>,
	Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Rob Herring <robh@kernel.org>, Andy Gross <andy.gross@linaro.org>,
	Ohad Ben-Cohen <ohad@wizery.com>,
	Stephen Boyd <sboyd@codeaurora.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Rob Clark <robdclark@gmail.com>,
	Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
	linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH 3/4] dt-binding: remoteproc: venus rproc dt binding document
Date: Wed, 7 Sep 2016 14:52:15 +0300	[thread overview]
Message-ID: <4eb0a339-e861-c2a9-dd94-94f6577ec25a@linaro.org> (raw)
In-Reply-To: <20160902201255.GZ15161@tuxbot>

Hi Bjorn,

On 09/02/2016 11:12 PM, Bjorn Andersson wrote:
> On Fri 02 Sep 04:52 PDT 2016, Marek Szyprowski wrote:
> 
>> Hi,
>>
>>
>> On 2016-09-01 16:58, Stanimir Varbanov wrote:
>>> Hi,
>>>
>>> Cc: Marek
>>>
>>
>> ...
>>
>>>>>> But I presume we have the implementation issue of dma_alloc_coherent()
>>>>>> failing in either case with the 5MB size. I think we need to look into
>>>>> I'd be good to include Marek Szyprowski? At least he will know what
>>>>> design restrictions there are.
>>>>>
>>>> Please do. The more I look at this the more I think we must use the
>>>> existing infrastructure for allocating "dma memory". Getting
>>>> dma_alloc_coherent() supporting non-power-of-2 memory regions would
>>> Just to be precise it should be dma_alloc_from_coherent().
>>>
>>> Marek, what is your opinion on that, can we make dma_alloc_from_coherent
>>> able to allocate memory for sizes with bigger granularity.
>>>
>>> For your convenience here [1] is the mail thread.
>>
>> There should be no technical restrictions to add support for bigger
>> granularity than power-of-2. dma_alloc_from_coherent uses standard
>> bitmap based allocator, so it already support tracking allocations of
>> arbitrary size.
> 
> I believe we should be able to change the parameter of
> bitmap_{find_free,release,allocate}_region() to take a size rather than
> an order.
> 
> The mask used in __reg_op() is an unsigned long, that is stamped over
> the region to be masked or cleared, so there are some clear restrictions
> in what parameters we can pass there - without having to break this
> operation up in steps.
> 
> But if drive the offset by taking the next power-of-two of the size and
> then align the number of bits to min(count, BITS_PER_LONG) we should
> retain the performance characteristics and requirements of __reg_op().
> 
>> However for the small allocations (smaller than 64KiB?, 512KiB?) it
>> would make sense to keep nearest-power-of-2 round up to prevent memory
>> fragmentation.
> 
> But in our case each bit matches a single page, so by making sure the
> mask always fills the unsigned long in the larger cases we would end up
> with having to align things to 128kb (or 256kb if unsigned long is 64
> bit).
> 
> 
> Does this sound reasonable?

I haven't looked in bitmap details, but can't we reuse genalloc?

-- 
regards,
Stan

  reply	other threads:[~2016-09-07 11:52 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-19 15:53 [PATCH 0/4] Venus remoteproc driver Stanimir Varbanov
2016-08-19 15:53 ` [PATCH 1/4] firmware: qcom: scm: add a video command for state setting Stanimir Varbanov
2016-08-19 15:53 ` [PATCH 2/4] firmware: qcom: scm: add iommu scm calls for pg table Stanimir Varbanov
2016-08-22 16:29   ` kbuild test robot
2016-08-24 18:35   ` Gupta, Puja
2016-08-25  9:08     ` Stanimir Varbanov
2016-08-30 21:15     ` Andy Gross
2016-08-19 15:53 ` [PATCH 3/4] dt-binding: remoteproc: venus rproc dt binding document Stanimir Varbanov
2016-08-23 17:32   ` Rob Herring
2016-08-23 18:21     ` Bjorn Andersson
2016-08-24 15:36     ` Stanimir Varbanov
2016-08-25  0:05       ` Bjorn Andersson
2016-08-25 11:10         ` Stanimir Varbanov
2016-08-26 22:23           ` Bjorn Andersson
2016-08-29 11:48             ` Stanimir Varbanov
2016-08-30 17:17               ` Bjorn Andersson
2016-09-01 14:58                 ` Stanimir Varbanov
2016-09-01 20:46                   ` Andy Gross
2016-09-02 11:52                   ` Marek Szyprowski
2016-09-02 20:12                     ` Bjorn Andersson
2016-09-07 11:52                       ` Stanimir Varbanov [this message]
     [not found]                       ` <CGME20160915084644eucas1p1bd3f2078d4e1cb3acfa0ea87557bff4f@eucas1p1.samsung.com>
2016-09-15  8:46                         ` Marek Szyprowski
2016-08-19 15:53 ` [PATCH 4/4] remoteproc: qcom: add Venus video core firmware loader driver Stanimir Varbanov
2016-10-18 16:23   ` Stanimir Varbanov

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=4eb0a339-e861-c2a9-dd94-94f6577ec25a@linaro.org \
    --to=stanimir.varbanov@linaro.org \
    --cc=andy.gross@linaro.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mark.rutland@arm.com \
    --cc=ohad@wizery.com \
    --cc=robdclark@gmail.com \
    --cc=robh@kernel.org \
    --cc=sboyd@codeaurora.org \
    --cc=srinivas.kandagatla@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®