From: plagnioj@jcrosoft.com (Jean-Christophe PLAGNIOL-VILLARD)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH 1/2] arm: introduce arch_ioremap and arch_iounmap function pointer
Date: Sun, 22 May 2011 16:58:47 +0200 [thread overview]
Message-ID: <20110522145847.GF15292@game.jcrosoft.org> (raw)
In-Reply-To: <20110522131958.GF17672@n2100.arm.linux.org.uk>
On 14:19 Sun 22 May , Russell King - ARM Linux wrote:
> On Sun, May 22, 2011 at 01:05:43PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > did see that and I should I did it on at91 too
> >
> > so how about introduce a new ioreamap/iouremap functiom
>
> How about not. How about we intercept all the ioremap() calls at a better
> place like at the beginning of __arm_ioremap_pfn_caller() - iow, something
> like this:
>
> void __iomem * __arm_ioremap_pfn_caller(unsigned long pfn,
> unsigned long offset, size_t size, unsigned int mtype, void *caller)
> {
> const struct mem_type *type;
> int err;
> unsigned long addr;
> struct vm_struct * area;
>
> /*
> * High mappings must be supersection aligned
> */
> if (pfn >= 0x100000 && (__pfn_to_phys(pfn) & ~SUPERSECTION_MASK))
> return NULL;
>
> /*
> * Don't allow RAM to be mapped - this causes problems with ARMv6+
> */
> if (WARN_ON(pfn_valid(pfn)))
> return NULL;
>
> type = get_mem_type(mtype);
> if (!type)
> return NULL;
>
> /*
> * Page align the mapping size, taking account of any offset.
> */
> size = PAGE_ALIGN(offset + size);
>
> + addr = __arch_ioremap(pfn, size);
> + if (addr)
> + return (void __iomem *) (offset + addr);
> ...
>
> and then we can have __arch_ioremap() do whatever checking of static
> mappings we desire.
I like that
and for ioummap
void __iounmap(volatile void __iomem *io_addr)
{
void *addr = (void *)(PAGE_MASK & (unsigned long)io_addr);
#ifndef CONFIG_SMP
struct vm_struct **p, *tmp;
+#endif
+ __arch_iounmap(io_addr);
+
+#ifndef CONFIG_SMP
/*
* If this is a section based mapping we need to handle it
* specially as the VM subsystem does not know how to handle
* such a beast. We need the lock here b/c we need to clear
* all the mappings before the area can be reclaimed
* by someone else.
*/
Best Regards,
J.
prev parent reply other threads:[~2011-05-22 14:58 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-22 9:04 [RFC PATCH 1/2] arm: introduce arch_ioremap and arch_iounmap function pointer Jean-Christophe PLAGNIOL-VILLARD
2011-05-22 9:04 ` [RFC PATCH 2/2] omap: switch to ioremap " Jean-Christophe PLAGNIOL-VILLARD
2011-05-22 9:54 ` Arnd Bergmann
2011-05-22 11:13 ` Jean-Christophe PLAGNIOL-VILLARD
2011-05-22 11:20 ` Santosh Shilimkar
2011-05-22 11:17 ` Jean-Christophe PLAGNIOL-VILLARD
2011-05-22 11:35 ` Arnd Bergmann
2011-05-22 11:46 ` Santosh Shilimkar
2011-05-22 12:56 ` Arnd Bergmann
2011-05-22 13:20 ` Santosh Shilimkar
2011-05-22 13:09 ` Russell King - ARM Linux
2011-05-22 13:23 ` Santosh Shilimkar
2011-05-22 16:40 ` Arnd Bergmann
2011-05-22 10:03 ` [RFC PATCH 1/2] arm: introduce arch_ioremap and arch_iounmap " Russell King - ARM Linux
2011-05-22 11:05 ` Jean-Christophe PLAGNIOL-VILLARD
2011-05-22 13:19 ` Russell King - ARM Linux
2011-05-22 14:58 ` Jean-Christophe PLAGNIOL-VILLARD [this message]
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=20110522145847.GF15292@game.jcrosoft.org \
--to=plagnioj@jcrosoft.com \
--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 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.