linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: allow, but warn, when issuing ioremap() on RAM
Date: Sat, 9 Oct 2010 17:45:17 +0100	[thread overview]
Message-ID: <20101009164517.GA28183@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <AANLkTi=Sv35ipSGzSoJMjdoNU-Qee9csviPL3yMSM3uf@mail.gmail.com>

On Sat, Oct 09, 2010 at 07:07:01PM +0300, Felipe Contreras wrote:
> On Sat, Oct 9, 2010 at 4:52 PM, Russell King - ARM Linux
> <linux@arm.linux.org.uk> wrote:
> > On Thu, Oct 07, 2010 at 12:44:22PM +0300, Felipe Contreras wrote:
> >> For issues related to this:
> >> http://article.gmane.org/gmane.linux.ports.arm.kernel/84454
> >
> > This one nicely shows some of the problems which can occur with the
> > memory type attributes - and this is not attributable to ioremap().
> >
> > ioremap() is used to map devices. ?It creates device memory type mappings.
> > If what you're mapping doesn't support device memory type mappings, then
> > accesses via an ioremap()'d region isn't going to work - as this guy is
> > observing.
> >
> > That's not because ioremap() is doing something wrong. ?It's doing what
> > it's meant to do. ?The use is wrong, and is completely unrelated to the
> > issue you've raised.
> 
> Ok, I was confused by Catalin's comment which does point to ioremap()
> on normal RAM:
> http://article.gmane.org/gmane.linux.ports.arm.kernel/84504

Me too - it doesn't appear to relate to the specified problem.  You
don't want to map RAM as device nor strongly ordered, and we still
don't know what this "MMR" is.

> >> http://article.gmane.org/gmane.linux.ports.sh.devel/8560
> >
> > This one we know about, and as I've already said, it ends up with three
> > aliasing mappings each with different attributes thusly:
> >
> > ? ? ? ?cpu = dma_alloc_coherent(dev, size, &dma, GFP_KERNEL);
> > ? ? ? ?dma_declare_coherent_memory(dev, dma, dma, size, DMA_MEMORY_MAP);
> > ? ? ? ? ? ? ? ?==> ioremap(dma, size);
> > ? ? ? ?...
> > ? ? ? ?dma_alloc_coherent(dev, ...);
> >
> > This wasn't spotted in the review of sh-mobile code because it's not part
> > of the sh-mobile code base, but some of the generic sh architecture code.
> > sh-mobile went into the kernel on March 12th, so it does pre-date the
> > change to ioremap, and is therefore technically a regression.
> >
> > However, as can be seen from the link above, it's been known about since
> > 8th August - two months ago. ?The problem has been discussed, and we had
> > a good solution which would work. ?But then an oar got thrown in which
> > basically resulted in that solution being rejected - on the basis that
> > "it's an established API and it must work".
> 
> I don't see anyone rejecting any solution there. Where is anybody
> saying "it's an established API and it must work"?

In a follow-on thread.

http://lists.arm.linux.org.uk/lurker/thread/20100820.200530.9bd67b3a.en.html

> > Well, this usage of the API doesn't work on x86!
> >
> > The result - progress on the issue hit a brick wall and is unable to
> > proceed because of personal viewpoints conflicting with reality.
> 
> Can you concentrate on the patch at hand?
> http://article.gmane.org/gmane.linux.kernel/1045670
> 
> This doesn't break anything, nor prevents anyone coming up with solutions.

and provides no motivation to fix anything either.

> >> http://www.spinics.net/lists/linux-fbdev/msg01745.html
> >
> > External user? ?Unreviewed code? ?You can't seriously be suggesting
> > that we should care about code we haven't seen which is sitting
> > externally to the kernel tree, and this is a valid reason to hold
> > off on changes to the kernel.
> 
> It's a plus, not the main reason to apply this patch. However,
> progress is not held by any means, people can still fix their drivers,
> generic solutions can still be proposed and worked on... This patch
> doesn't hurt anybody.
> 
> You haven't answered my question: what is so horrible about warning
> only on .36, and disallowing on .37?

My objection is one of methodology.

It's been known for six months that this change was going to be made.
It was discussed at the time it was proposed, and omapfb was raised as
a concern by OMAP people.

Most of the relevant parties (except sh-mobile as it wasn't obvious)
had been told.  The patch went in about three months ago.  Only now is
a major fuss being made over it.

If precisely nothing has happened in six months, inspite of my (repeated)
warnings that this change will hit mainline, then what hope is there that
giving a further three month grace in any form will be respected to get
drivers into shape?  If people can't get the idea with six months of
warning, then what is the use of adding such a restriction when no one
takes any notice of it anyway?

There's two ways to deal with no progress inspite of repeated warnings -
you either drop the issue, forget it ever existed and let people find the
resulting problems, or you force the issue.

I chose the latter, and yes, I expected that people will complain.  It
gets the issue _far_ higher in peoples sights than adding silly WARN_ON
stuff which all too easily gets ignored.  If email messages and verbal
discussions get ignored, what hope is there for a one-line kernel message
amongst 75 lines of kernel spew?

I doubt that a WARN_ON will result in any progress on the issue.

  reply	other threads:[~2010-10-09 16:45 UTC|newest]

Thread overview: 101+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-07  9:44 [PATCH] ARM: allow, but warn, when issuing ioremap() on RAM Felipe Contreras
2010-10-07 11:51 ` Baruch Siach
2010-10-07 12:29   ` [PATCH v2] " Felipe Contreras
2010-10-07 18:00     ` Uwe Kleine-König
2010-10-07 19:22 ` [PATCH] " Russell King - ARM Linux
2010-10-08  9:32   ` Felipe Contreras
2010-10-08 17:53     ` Russell King - ARM Linux
2010-10-08 19:37       ` Felipe Contreras
2010-10-08 23:04         ` Russell King - ARM Linux
2010-10-08 23:25           ` Greg KH
2010-10-08 23:44             ` Russell King - ARM Linux
2010-10-09  0:00               ` Greg KH
2010-10-09  0:25                 ` Russell King - ARM Linux
2010-10-09  0:54                   ` Greg KH
2010-10-09  2:41                   ` Nicolas Pitre
2010-10-09  3:04                     ` Greg KH
2010-10-09  9:32                       ` Felipe Contreras
2010-10-11 10:05                     ` Catalin Marinas
2010-10-11 10:39                       ` Felipe Contreras
2010-10-11 10:52                         ` Russell King - ARM Linux
2010-10-11 11:23                         ` Catalin Marinas
2010-10-11 12:03                           ` Felipe Contreras
2010-10-11 12:30                             ` Catalin Marinas
2010-10-11 22:53                               ` Nicolas Pitre
2010-10-14 15:02                               ` Felipe Contreras
2010-10-14 17:18                                 ` Catalin Marinas
2010-10-14 17:44                                   ` Felipe Contreras
2010-10-11 11:01                       ` Pawel Moll
2010-10-11 11:03                         ` Catalin Marinas
2010-10-16  2:39                 ` Benjamin Herrenschmidt
2010-10-16  9:43                   ` Felipe Contreras
2010-10-09  0:10               ` Russell King - ARM Linux
2010-10-09  0:56               ` Felipe Contreras
2010-10-09  9:21                 ` Russell King - ARM Linux
2010-10-09 10:28                   ` Felipe Contreras
2010-10-09 11:11                     ` Arnd Bergmann
2010-10-09 11:43                       ` Dave Airlie
2010-10-09 11:55                         ` Christoph Hellwig
2010-10-09 12:17                           ` Felipe Contreras
2010-10-09 12:10                         ` Felipe Contreras
2010-10-09 14:37                           ` Russell King - ARM Linux
2010-10-09 16:18                             ` Felipe Contreras
2010-10-09 11:44                       ` Uwe Kleine-König
2010-10-09 12:05                         ` Russell King - ARM Linux
2010-10-09 11:59                       ` Felipe Contreras
2010-10-09 14:43                         ` Arnd Bergmann
2010-10-09 18:59                           ` Guennadi Liakhovetski
2010-10-10  1:52                   ` Felipe Contreras
2010-10-11  8:35                     ` Uwe Kleine-König
2010-10-11  9:02                       ` Russell King - ARM Linux
2010-10-11  9:24                         ` Uwe Kleine-König
2010-10-11 10:08                           ` Felipe Contreras
2010-10-11 10:15                             ` Russell King - ARM Linux
2010-10-11 15:25                     ` Russell King - ARM Linux
2010-10-14 14:47                       ` Felipe Contreras
2010-10-19  8:13                       ` Colin Cross
2010-10-19 18:12                         ` Russell King - ARM Linux
2010-10-19 19:21                         ` Russell King - ARM Linux
2010-11-23  9:43                       ` [PATCH] ARM: mx3/pcm037: properly allocate memory for mx3-camera Uwe Kleine-König
2010-11-23 10:12                         ` Russell King - ARM Linux
2010-11-23 10:26                           ` Uwe Kleine-König
2010-11-23 14:08                             ` Alberto Panizzo
2010-11-23 14:17                               ` Uwe Kleine-König
2010-11-24  8:02                                 ` Uwe Kleine-König
2010-12-06  8:33                                   ` Uwe Kleine-König
2010-12-06 10:14                                     ` Alberto Panizzo
2010-12-06 10:26                                       ` Russell King - ARM Linux
2010-12-06 11:37                                         ` Alberto Panizzo
2010-12-06 11:46                                           ` Russell King - ARM Linux
2010-12-06 14:09                                             ` Alberto Panizzo
2010-12-06 14:34                                               ` Russell King - ARM Linux
2010-12-06 14:54                                                 ` Alberto Panizzo
2010-12-06 16:54                                                   ` Alberto Panizzo
2010-11-23 10:39                           ` About multi-line printk and the need (not) to repeat loglevel markers [Was: Re: [PATCH] ARM: mx3/pcm037: properly allocate memory for mx3-camera] Uwe Kleine-König
2010-11-23 10:58                             ` Uwe Kleine-König
2010-11-23 22:16                               ` Linus Torvalds
2010-11-23 22:33                                 ` Russell King - ARM Linux
2010-11-23 23:23                                   ` Joe Perches
2010-11-24  8:17                                 ` Uwe Kleine-König
2010-11-24  9:09                                   ` Michał Mirosław
2010-11-23 22:54                         ` [PATCH] ARM: mx3/pcm037: properly allocate memory for mx3-camera Guennadi Liakhovetski
2010-10-09  0:45             ` [PATCH] ARM: allow, but warn, when issuing ioremap() on RAM Felipe Contreras
2010-10-09  8:56               ` Russell King - ARM Linux
2010-10-08 23:19       ` Greg KH
2010-10-09  3:36         ` Nicolas Pitre
2010-10-09 10:00           ` Felipe Contreras
2010-10-09 17:38             ` Nicolas Pitre
2010-10-09 20:16               ` Felipe Contreras
2010-10-13 16:17             ` Woodruff, Richard
2010-10-14 13:48               ` Felipe Contreras
2010-10-14 15:29                 ` Woodruff, Richard
2010-10-16  2:36       ` Benjamin Herrenschmidt
2010-10-17 13:05         ` Woodruff, Richard
2010-10-17 23:17           ` Benjamin Herrenschmidt
2010-10-08 19:58   ` Andrew Morton
2010-10-09 13:52 ` Russell King - ARM Linux
2010-10-09 16:07   ` Felipe Contreras
2010-10-09 16:45     ` Russell King - ARM Linux [this message]
2010-10-09 19:25       ` Felipe Contreras
2010-10-10 14:23       ` Pedanekar, Hemant
2010-10-11  9:26       ` Catalin Marinas

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=20101009164517.GA28183@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=linux-arm-kernel@lists.infradead.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).