From: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
Cc: Mian Yousaf Kaukab <ykaukab-l3A5Bk7waGM@public.gmane.org>,
robin.murphy-5wv7dgnIgG8@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
talho-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org,
thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
afaerber-l3A5Bk7waGM@public.gmane.org,
arnd-r2nGTMty4D4@public.gmane.org,
gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH 2/4] dt-bindings: sram: add documentation for reserved-only flag
Date: Tue, 19 May 2020 17:03:26 -0600 [thread overview]
Message-ID: <20200519230326.GA827289@bogus> (raw)
In-Reply-To: <efcc6b5e-423c-8ae1-8a46-d6a06c1a1bab-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
On Tue, May 19, 2020 at 10:16:43AM -0600, Stephen Warren wrote:
> On 5/13/20 4:41 AM, Mian Yousaf Kaukab wrote:
> > On Tue, May 12, 2020 at 01:45:28PM -0600, Stephen Warren wrote:
> >> On 5/12/20 8:48 AM, Mian Yousaf Kaukab wrote:
> >>> Add documentation for the new optional flag added for SRAM driver.
> >>
> >>> diff --git a/Documentation/devicetree/bindings/sram/sram.yaml b/Documentation/devicetree/bindings/sram/sram.yaml
> >>
> >>> + reserved-only:
> >>> + description:
> >>> + The flag indicating, that only SRAM reserved regions have to be remapped.
> >>> + remapping type is selected depending upon no-memory-wc as usual.
> >>> + type: boolean
> >>
> >> This feels a bit like a SW flag rather than a HW description, so I'm not
> >> sure it's appropriate to put it into DT.
> >
> > Reserved regions themselves are software descriptions, no? Then we have 'pool'
> > flag which is again a software flag and so on. This flag falls into same
> > category and nothing out of ordinary.
>
> I suppose that's true to some extent. This is indeed a description of
> the system environment presented to the SW that consumes the DT, which
> is a bit more than pure HW description but still a description of
> something imposed externally rather than describing something that's up
> to the discretion of the consuming SW. So, go ahead.
>
> >> Are there any cases where the SW should map all of the SRAM, i.e. where
> >> we wouldn't expect to set reserved-only? [...]
> >
> > Yes, here are a few examples:
> > arch/arm/boot/dts/aspeed-g*.dtsi
> > arch/arm/boot/dts/at91*.dtsi
> > arch/arm/boot/dts/bcm7445.dtsi
> > Then arch/arm/boot/dts/dra7.dtsi is an example where we should map everything
> > except the reserved region.
> >
> >> [...] I'd expect reserved-only to be
> >> the default, and perhaps only, mode of operation for the SRAM driver.
> >
> > It will break compatibility with existing dtbs.
> >
> >> If we can't do that because some SW currently expects to be able to map
> >> arbitrary portions of the SRAM, shouldn't that SW be fixed to tell the
> >> SRAM driver which parts it's using, hence still allowing the driver to
> >> only map in-use portions?
> >
> > User doesn’t need sram driver in that case. It can use genalloc api directly.
>
> This sounds a bit odd. Without a driver for the reserved region, nothing
> should be touching it, since otherwise there's no code that owns an
> manages the region. If any code needs to consume the region, it should
> obtain info about the region from some form of provider code that can
> handle both the allocation and mapping. Anything else sounds like some
> consumer code directly making use of DT nodes it doesn't own. But since
> I'm not familiar enough with the SRAM driver and genalloc code that you
> mention to fully understand the allocation paths I guess I won't object
> for now, although it does still sound fishy.
I'm fine with the concept, but I don't think a single flag is adequate.
If there are reserved regions within the SRAM, then define child nodes
to mark those regions reserved. I don't think you need a new flag. Just
a 'reg' property and nothing else.
Rob
WARNING: multiple messages have this Message-ID (diff)
From: Rob Herring <robh@kernel.org>
To: Stephen Warren <swarren@wwwdotorg.org>
Cc: devicetree@vger.kernel.org, arnd@arndb.de,
gregkh@linuxfoundation.org, Mian Yousaf Kaukab <ykaukab@suse.de>,
linux-kernel@vger.kernel.org, jonathanh@nvidia.com,
talho@nvidia.com, thierry.reding@gmail.com,
linux-tegra@vger.kernel.org, robin.murphy@arm.com,
afaerber@suse.de, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 2/4] dt-bindings: sram: add documentation for reserved-only flag
Date: Tue, 19 May 2020 17:03:26 -0600 [thread overview]
Message-ID: <20200519230326.GA827289@bogus> (raw)
In-Reply-To: <efcc6b5e-423c-8ae1-8a46-d6a06c1a1bab@wwwdotorg.org>
On Tue, May 19, 2020 at 10:16:43AM -0600, Stephen Warren wrote:
> On 5/13/20 4:41 AM, Mian Yousaf Kaukab wrote:
> > On Tue, May 12, 2020 at 01:45:28PM -0600, Stephen Warren wrote:
> >> On 5/12/20 8:48 AM, Mian Yousaf Kaukab wrote:
> >>> Add documentation for the new optional flag added for SRAM driver.
> >>
> >>> diff --git a/Documentation/devicetree/bindings/sram/sram.yaml b/Documentation/devicetree/bindings/sram/sram.yaml
> >>
> >>> + reserved-only:
> >>> + description:
> >>> + The flag indicating, that only SRAM reserved regions have to be remapped.
> >>> + remapping type is selected depending upon no-memory-wc as usual.
> >>> + type: boolean
> >>
> >> This feels a bit like a SW flag rather than a HW description, so I'm not
> >> sure it's appropriate to put it into DT.
> >
> > Reserved regions themselves are software descriptions, no? Then we have 'pool'
> > flag which is again a software flag and so on. This flag falls into same
> > category and nothing out of ordinary.
>
> I suppose that's true to some extent. This is indeed a description of
> the system environment presented to the SW that consumes the DT, which
> is a bit more than pure HW description but still a description of
> something imposed externally rather than describing something that's up
> to the discretion of the consuming SW. So, go ahead.
>
> >> Are there any cases where the SW should map all of the SRAM, i.e. where
> >> we wouldn't expect to set reserved-only? [...]
> >
> > Yes, here are a few examples:
> > arch/arm/boot/dts/aspeed-g*.dtsi
> > arch/arm/boot/dts/at91*.dtsi
> > arch/arm/boot/dts/bcm7445.dtsi
> > Then arch/arm/boot/dts/dra7.dtsi is an example where we should map everything
> > except the reserved region.
> >
> >> [...] I'd expect reserved-only to be
> >> the default, and perhaps only, mode of operation for the SRAM driver.
> >
> > It will break compatibility with existing dtbs.
> >
> >> If we can't do that because some SW currently expects to be able to map
> >> arbitrary portions of the SRAM, shouldn't that SW be fixed to tell the
> >> SRAM driver which parts it's using, hence still allowing the driver to
> >> only map in-use portions?
> >
> > User doesn’t need sram driver in that case. It can use genalloc api directly.
>
> This sounds a bit odd. Without a driver for the reserved region, nothing
> should be touching it, since otherwise there's no code that owns an
> manages the region. If any code needs to consume the region, it should
> obtain info about the region from some form of provider code that can
> handle both the allocation and mapping. Anything else sounds like some
> consumer code directly making use of DT nodes it doesn't own. But since
> I'm not familiar enough with the SRAM driver and genalloc code that you
> mention to fully understand the allocation paths I guess I won't object
> for now, although it does still sound fishy.
I'm fine with the concept, but I don't think a single flag is adequate.
If there are reserved regions within the SRAM, then define child nodes
to mark those regions reserved. I don't think you need a new flag. Just
a 'reg' property and nothing else.
Rob
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
WARNING: multiple messages have this Message-ID (diff)
From: Rob Herring <robh@kernel.org>
To: Stephen Warren <swarren@wwwdotorg.org>
Cc: Mian Yousaf Kaukab <ykaukab@suse.de>,
robin.murphy@arm.com, devicetree@vger.kernel.org,
talho@nvidia.com, thierry.reding@gmail.com, jonathanh@nvidia.com,
linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, afaerber@suse.de,
arnd@arndb.de, gregkh@linuxfoundation.org
Subject: Re: [PATCH 2/4] dt-bindings: sram: add documentation for reserved-only flag
Date: Tue, 19 May 2020 17:03:26 -0600 [thread overview]
Message-ID: <20200519230326.GA827289@bogus> (raw)
In-Reply-To: <efcc6b5e-423c-8ae1-8a46-d6a06c1a1bab@wwwdotorg.org>
On Tue, May 19, 2020 at 10:16:43AM -0600, Stephen Warren wrote:
> On 5/13/20 4:41 AM, Mian Yousaf Kaukab wrote:
> > On Tue, May 12, 2020 at 01:45:28PM -0600, Stephen Warren wrote:
> >> On 5/12/20 8:48 AM, Mian Yousaf Kaukab wrote:
> >>> Add documentation for the new optional flag added for SRAM driver.
> >>
> >>> diff --git a/Documentation/devicetree/bindings/sram/sram.yaml b/Documentation/devicetree/bindings/sram/sram.yaml
> >>
> >>> + reserved-only:
> >>> + description:
> >>> + The flag indicating, that only SRAM reserved regions have to be remapped.
> >>> + remapping type is selected depending upon no-memory-wc as usual.
> >>> + type: boolean
> >>
> >> This feels a bit like a SW flag rather than a HW description, so I'm not
> >> sure it's appropriate to put it into DT.
> >
> > Reserved regions themselves are software descriptions, no? Then we have 'pool'
> > flag which is again a software flag and so on. This flag falls into same
> > category and nothing out of ordinary.
>
> I suppose that's true to some extent. This is indeed a description of
> the system environment presented to the SW that consumes the DT, which
> is a bit more than pure HW description but still a description of
> something imposed externally rather than describing something that's up
> to the discretion of the consuming SW. So, go ahead.
>
> >> Are there any cases where the SW should map all of the SRAM, i.e. where
> >> we wouldn't expect to set reserved-only? [...]
> >
> > Yes, here are a few examples:
> > arch/arm/boot/dts/aspeed-g*.dtsi
> > arch/arm/boot/dts/at91*.dtsi
> > arch/arm/boot/dts/bcm7445.dtsi
> > Then arch/arm/boot/dts/dra7.dtsi is an example where we should map everything
> > except the reserved region.
> >
> >> [...] I'd expect reserved-only to be
> >> the default, and perhaps only, mode of operation for the SRAM driver.
> >
> > It will break compatibility with existing dtbs.
> >
> >> If we can't do that because some SW currently expects to be able to map
> >> arbitrary portions of the SRAM, shouldn't that SW be fixed to tell the
> >> SRAM driver which parts it's using, hence still allowing the driver to
> >> only map in-use portions?
> >
> > User doesn’t need sram driver in that case. It can use genalloc api directly.
>
> This sounds a bit odd. Without a driver for the reserved region, nothing
> should be touching it, since otherwise there's no code that owns an
> manages the region. If any code needs to consume the region, it should
> obtain info about the region from some form of provider code that can
> handle both the allocation and mapping. Anything else sounds like some
> consumer code directly making use of DT nodes it doesn't own. But since
> I'm not familiar enough with the SRAM driver and genalloc code that you
> mention to fully understand the allocation paths I guess I won't object
> for now, although it does still sound fishy.
I'm fine with the concept, but I don't think a single flag is adequate.
If there are reserved regions within the SRAM, then define child nodes
to mark those regions reserved. I don't think you need a new flag. Just
a 'reg' property and nothing else.
Rob
next prev parent reply other threads:[~2020-05-19 23:03 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-12 14:48 [PATCH 1/4] misc: sram: add support for remapping reserved regions only Mian Yousaf Kaukab
2020-05-12 14:48 ` Mian Yousaf Kaukab
2020-05-12 14:48 ` Mian Yousaf Kaukab
[not found] ` <20200512144803.24344-1-ykaukab-l3A5Bk7waGM@public.gmane.org>
2020-05-12 14:48 ` [PATCH 2/4] dt-bindings: sram: add documentation for reserved-only flag Mian Yousaf Kaukab
2020-05-12 14:48 ` Mian Yousaf Kaukab
2020-05-12 14:48 ` Mian Yousaf Kaukab
[not found] ` <20200512144803.24344-2-ykaukab-l3A5Bk7waGM@public.gmane.org>
2020-05-12 19:45 ` Stephen Warren
2020-05-12 19:45 ` Stephen Warren
2020-05-12 19:45 ` Stephen Warren
[not found] ` <52f099e4-5c03-2141-f049-cd3adeb04c5b-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2020-05-13 10:41 ` Mian Yousaf Kaukab
2020-05-13 10:41 ` Mian Yousaf Kaukab
2020-05-13 10:41 ` Mian Yousaf Kaukab
[not found] ` <20200513104127.GA2309-l3A5Bk7waGM@public.gmane.org>
2020-05-19 16:16 ` Stephen Warren
2020-05-19 16:16 ` Stephen Warren
2020-05-19 16:16 ` Stephen Warren
[not found] ` <efcc6b5e-423c-8ae1-8a46-d6a06c1a1bab-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2020-05-19 23:03 ` Rob Herring [this message]
2020-05-19 23:03 ` Rob Herring
2020-05-19 23:03 ` Rob Herring
2020-05-20 8:55 ` Thierry Reding
2020-05-20 8:55 ` Thierry Reding
2020-05-26 15:28 ` Mian Yousaf Kaukab
2020-05-26 15:28 ` Mian Yousaf Kaukab
2020-05-26 15:28 ` Mian Yousaf Kaukab
2020-05-20 8:40 ` Thierry Reding
2020-05-20 8:40 ` Thierry Reding
2020-05-20 8:40 ` Thierry Reding
2020-05-12 14:48 ` [PATCH 3/4] arm64: tegra186: add reserved-only flag in sysram node Mian Yousaf Kaukab
2020-05-12 14:48 ` Mian Yousaf Kaukab
2020-05-12 14:48 ` Mian Yousaf Kaukab
2020-05-12 14:48 ` [PATCH 4/4] arm64: tegra194: " Mian Yousaf Kaukab
2020-05-12 14:48 ` Mian Yousaf Kaukab
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=20200519230326.GA827289@bogus \
--to=robh-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
--cc=afaerber-l3A5Bk7waGM@public.gmane.org \
--cc=arnd-r2nGTMty4D4@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
--cc=jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=robin.murphy-5wv7dgnIgG8@public.gmane.org \
--cc=swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org \
--cc=talho-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
--cc=thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=ykaukab-l3A5Bk7waGM@public.gmane.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.