linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Daniel Walker <dwalker@codeaurora.org>
Cc: Nicolas Pitre <nico@fluxnic.net>,
	linux-arm-msm@vger.kernel.org,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
	Jeremy Kerr <jeremy.kerr@canonical.com>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	Jason Wang <jason77.wang@gmail.com>,
	Tony Lindgren <tony@atomide.com>
Subject: Re: [PATCH] msm: fix debug-macro.S build failure
Date: Fri, 29 Oct 2010 23:14:37 +0100	[thread overview]
Message-ID: <20101029221437.GA31224@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1288387033.6631.13.camel@m0nster>

On Fri, Oct 29, 2010 at 02:17:13PM -0700, Daniel Walker wrote:
> On Thu, 2010-10-28 at 23:03 -0400, Nicolas Pitre wrote:
> > On Thu, 28 Oct 2010, Russell King - ARM Linux wrote:
> > 
> > > On Thu, Oct 28, 2010 at 02:43:16PM -0400, Nicolas Pitre wrote:
> > > > On Thu, 28 Oct 2010, Russell King - ARM Linux wrote:
> > > > 
> > > > > On Thu, Oct 28, 2010 at 02:24:33PM -0400, Nicolas Pitre wrote:
> > > > > > On Thu, 28 Oct 2010, Daniel Walker wrote:
> > > > > > 
> > > > > > > This is what the function currently has,
> > > > > > > 
> > > > > > >         .macro  addruart, rp, rv
> > > > > > >         ldr     \rp, =MSM_DEBUG_UART_PHYS
> > > > > > >         ldr     \rv, =MSM_DEBUG_UART_BASE
> > > > > > >         .endm
> > > > > > > 
> > > > > > > So if we have a MSM_DEBUG_UART_PHYS and MSM_DEBUG_UART_BASE we're
> > > > > > > returning it. We don't actually have those values for all the boards
> > > > > > > tho. My understanding was that there are some generic arm changes
> > > > > > > needed, but I need to confirm that.
> > > > > > 
> > > > > > Just return 0 in both registers when you have nothing better to return.
> > > > > 
> > > > > That's not a good idea - it'll cause 512MB of 1:1 mappings to be setup
> > > > > at virtual location 0 using the IO flags, which may conflict on ARMv6+.
> > > > > A better idea would be to return 0xfff00000, which'll cause it to only
> > > > > populate the top-most 1MB.
> > > > 
> > > > Given that this a phony address, better test for 0 explicitly and skip 
> > > > the mapping as well as bailing out early from putchar, etc.
> > > 
> > > That could be 0 phys, which given there is no defined memory layout on
> > > ARM, I would not put it past someone to put a UART at phys location 0
> > > one day.
> > 
> > Who knows.  But in this case I think it is probably cleaner to just care 
> > about the virtual address, and do something like this:
> 
> I need something for this merge window (which is closing soon) .. So I'm
> just going to go with my original revert .. It seems like anything I do
> to get addruart to return something turns into too large a patch which I
> don't want to force.
> 
> I think the revert should be fine until we come up with a good way to
> fix this, either what you suggested or something entirely in msm.

Your original patch is unsuitable as it leaves the values uninitialized.

What will happen is that rp will be the value of the procinfo mmuflags,
so effectively zero.  rv will be page table value for the section
following the kernel, which is effectively the physical address of that.

This I guess will mean that it generally won't overwrite an existing
mapping, unless the folowing 512MB of mappings does so.

As I've said, the safest thing is to set rv to 0xfff00000 and have it
only setup one mapping.  Set rp to whatever you like - leave it
uninitialised if you're not filling in the other functions, it doesn't
matter (but note that.)

  reply	other threads:[~2010-10-29 22:14 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-27 21:58 [PATCH] msm: fix debug-macro.S build failure Daniel Walker
2010-10-27 22:14 ` Russell King - ARM Linux
2010-10-27 22:25   ` [PATCH -v2] " Daniel Walker
2010-10-28  2:30   ` [PATCH] " Nicolas Pitre
2010-10-28 16:30     ` Daniel Walker
2010-10-28 16:35       ` Russell King - ARM Linux
2010-10-28 16:41         ` Daniel Walker
2010-10-28 17:46           ` Russell King - ARM Linux
2010-10-28 18:00             ` Daniel Walker
2010-10-28 18:24               ` Nicolas Pitre
2010-10-28 18:27                 ` Daniel Walker
2010-10-28 18:29                   ` Russell King - ARM Linux
2010-10-28 18:46                     ` Nicolas Pitre
2010-10-28 18:40                   ` Nicolas Pitre
2010-10-28 18:28                 ` Russell King - ARM Linux
2010-10-28 18:43                   ` Nicolas Pitre
2010-10-28 18:46                     ` Russell King - ARM Linux
2010-10-29  3:03                       ` Nicolas Pitre
2010-10-29 21:17                         ` Daniel Walker
2010-10-29 22:14                           ` Russell King - ARM Linux [this message]
2010-10-29 22:21                             ` Daniel Walker
2010-10-29 22:28                               ` Russell King - ARM Linux
2010-10-29 23:06                             ` [PATCH -v3] " Daniel Walker
2010-10-29 22:17                           ` [PATCH] " Nicolas Pitre
2010-10-29 22:32                             ` Daniel Walker
2010-10-29 22:53                               ` Nicolas Pitre
2010-10-29 23:07                                 ` Daniel Walker
2010-11-05 21:31                                   ` David Brown
2010-10-28 22:36             ` Rohit Vaswani
2010-10-29  2:26               ` Nicolas Pitre

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=20101029221437.GA31224@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=dwalker@codeaurora.org \
    --cc=jason77.wang@gmail.com \
    --cc=jeremy.kerr@canonical.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=nico@fluxnic.net \
    --cc=tony@atomide.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).