From: Vitaly Bordug <vbordug@ru.mvista.com>
To: Dan Malek <dan@embeddedalley.com>
Cc: linuxppc-dev <linuxppc-dev@ozlabs.org>,
Paul Mackerras <paulus@samba.org>
Subject: Re: [PATCH 2/2] POWERPC: Remove global CPM mappings
Date: Tue, 24 Apr 2007 09:18:31 +0400 [thread overview]
Message-ID: <20070424091831.1793fa26@localhost.localdomain> (raw)
In-Reply-To: <5AC8BD28-125C-4552-97E9-D35E85D0E555@embeddedalley.com>
On Mon, 23 Apr 2007 21:26:59 -0400
Dan Malek wrote:
>
> On Apr 23, 2007, at 6:39 PM, Vitaly Bordug wrote:
>
> >
> > Gets rid or direct IMMR accesses/dereferences for PQ SoC targets and
> > relevant drivers.
>
> Can we find a way to do this without the constant
> ioremapping and unmapping? It's a quick and
> dirty hack, but it would be nice if we could map once
> during an initialization, keep the pointer around
> and at least use it within the file context. I know it
> doesn't cost much, but all of these cycles add up,
> and someday ioremap could grow into something
> more complex. Please?
Well, I know the solution is not ideal, neither it is final,
but it is a step forward in cleaning up CPM-related stuff.
In many drivers it used to be just modifications of immr->foo,
which fills driver with pleasant board-specific ifdefs and gives hard time
to figure out with something's not working as expected.
At first I was thinking of make_everybody_happy solution,
but with the whole kernel moving forward even brilliant ideas tend to
stay at draft stage (well, you know that much better than me:) )
>
> The whole of the CPM supporting functions need this,
> it could be mapped once and shared at least among
> them. Any drivers that use the IMMR should also be
> cleaner about managing this space as they would
> any other mapped resource that is typically done
> only once for the life of the driver.
>
I know it can be more efficient. And I am looking at this way, but it just cannot
be achieved via single step. TODO list includes rehaul of GPIO (with long-time-grown
feature_call + device tree bindings that were implemented for 8360 but looks reasonable), muxing, etc.
Also I had to take care of arch/ppc since most affected cpm-related drivers (as well as targets) exist and
work both at ppc/ and powerpc/.
> There are also many different methods used that
> I don't understand the reason. Sometimes the
> mappings are hidden in macros, sometimes done
> in a function that is called, other times ioremap()
> is called explicitly. It just looks, well.... icky. :-)
>
This patch just fixes what already exist in kernel, removing the global IMMR pointer and bringing all remaining code paths to the same need_stuff->immr_map->use_it->immr_unmap model. IOW , wraps up what has began before. This ppc/powerpc scatter makes it pretty tricky to move drivers forward without ugly code to handle both
or leaving one of the ways aside, and this approach gives sane code that works in both cases. Current code is messy at some parts, and this what I am trying to address (with current patch and upcomings).
Thanks for looking at it!
-Vitaly
next prev parent reply other threads:[~2007-04-24 5:18 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20070423223649.4955.77579.stgit@localhost.localdomain>
2007-04-23 22:39 ` [PATCH 1/2] POWERPC: Remove global CPM2 mappings Vitaly Bordug
2007-04-23 22:39 ` [PATCH 2/2] POWERPC: Remove global CPM mappings Vitaly Bordug
2007-04-24 1:26 ` Dan Malek
2007-04-24 5:18 ` Vitaly Bordug [this message]
2007-04-24 20:24 ` Dan Malek
2007-04-24 23:57 ` Vitaly Bordug
2007-03-27 21:00 [PATCH 1/2] POWERPC: Remove global CPM2 mappings Vitaly Bordug
2007-03-27 21:01 ` [PATCH 2/2] POWERPC: Remove global CPM mappings Vitaly Bordug
2007-03-27 22:12 ` Dan Malek
2007-03-27 23:01 ` Vitaly Bordug
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=20070424091831.1793fa26@localhost.localdomain \
--to=vbordug@ru.mvista.com \
--cc=dan@embeddedalley.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=paulus@samba.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).