devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Rob Herring <robh+dt@kernel.org>
Cc: Frank Rowand <frowand.list@gmail.com>,
	Andy Gross <andy.gross@linaro.org>,
	David Brown <david.brown@linaro.org>,
	Mark Rutland <mark.rutland@arm.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	linux-arm-msm <linux-arm-msm@vger.kernel.org>,
	"open list:ARM/QUALCOMM SUPPORT" <linux-soc@vger.kernel.org>
Subject: Re: [PATCH v2 2/5] of: reserved_mem: Accessor for acquiring reserved_mem
Date: Thu, 3 Aug 2017 16:31:46 -0700	[thread overview]
Message-ID: <20170803233146.GB29306@minitux> (raw)
In-Reply-To: <CAL_JsqL1Jh2AnWSWfau3LGhvuS1giTg6_r7gPGrHyZ6KRocSYg@mail.gmail.com>

On Thu 03 Aug 10:45 PDT 2017, Rob Herring wrote:

> On Wed, Aug 2, 2017 at 9:57 PM, Bjorn Andersson
> <bjorn.andersson@linaro.org> wrote:
> > In some cases drivers referencing a reserved-memory region might want to
> > remap the entire region, but when defining the reserved-memory by "size"
> > the client driver has no means to know the associated base address of
> > the reserved memory region.
> >
> > This patch adds an accessor for such drivers to acquire a handle to
> > their associated reserved-memory for this purpose.
> >
> > A complicating factor for the implementation is that the reserved_mem
> > objects are created from the flattened DeviceTree, as such we can't
> > use the device_node address for comparison. Fortunately the name of the
> > node will be used as "name" of the reserved_mem and will be used when
> > building the full_name, so we can compare the "name" with the basename
> > of the full_name to find the match.
> 
> Maybe we should add the device_node pointer when we unflatten?
> 

It did try to figure something sane out in that direction.

The solution I came up with was to amend populate_node() to in a !dryrun
block check if the "dad" full_name is /reserved-memory and if so
call call a new accessor in of_reserved_mem.c to add the "np" to the
reserved_mem object with fdt_node equal offset.

This code path is already cluttered due to the version differences when
it comes to building full_name and we would end up checking for each
node in the entire tree if the parent happens to be "/reserved-mem".

So I went for the less intrusive and more straight forward comparison
with basename(full_name) instead.


Do you have any alternative suggestion of how to do this?

Regards,
Bjorn

  reply	other threads:[~2017-08-03 23:31 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-03  2:57 [PATCH v2 0/5] Qualcomm remote filesystem shared memory driver Bjorn Andersson
2017-08-03  2:57 ` [PATCH v2 1/5] of/platform: Generalize /reserved-memory handling Bjorn Andersson
2017-08-03 17:40   ` Rob Herring
     [not found]     ` <CAL_JsqKBre5yPJHG3s+8Y7_hgj0_r35nNZc3QiL4HbWLuFx=Bg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-08-03 23:33       ` Bjorn Andersson
2017-08-03  2:57 ` [PATCH v2 2/5] of: reserved_mem: Accessor for acquiring reserved_mem Bjorn Andersson
     [not found]   ` <20170803025754.19101-3-bjorn.andersson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2017-08-03 17:45     ` Rob Herring
2017-08-03 23:31       ` Bjorn Andersson [this message]
2017-08-04 14:50         ` Rob Herring
2017-08-04 15:08           ` Bjorn Andersson
2017-08-03  2:57 ` [PATCH v2 3/5] dt-binding: soc: qcom: Add binding for RFSA Bjorn Andersson
2017-08-10 16:50   ` Rob Herring
     [not found] ` <20170803025754.19101-1-bjorn.andersson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2017-08-03  2:57   ` [PATCH v2 4/5] soc: qcom: Remote FS memory driver Bjorn Andersson
2017-08-05  9:58     ` Christoph Hellwig
2017-08-07 16:23       ` Bjorn Andersson
2017-08-11 10:00         ` Christoph Hellwig
2017-08-03  2:57 ` [PATCH v2 5/5] arm64: dts: msm8916: Mark rmtfs node as qcom,rfsa compatible Bjorn Andersson

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=20170803233146.GB29306@minitux \
    --to=bjorn.andersson@linaro.org \
    --cc=andy.gross@linaro.org \
    --cc=david.brown@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=frowand.list@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-soc@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.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;
as well as URLs for NNTP newsgroup(s).