From: "Luis R. Rodriguez" <mcgrof@suse.com>
To: Dan Williams <dan.j.williams@intel.com>
Cc: tglx@linutronix.de, mingo@kernel.org, hpa@zytor.com,
linux-arch@vger.kernel.org, toshi.kani@hp.com,
Arnd Bergmann <arnd@arndb.de>,
linux-nvdimm@ml01.01.org, linux-kernel@vger.kernel.org,
rmk+kernel@arm.linux.org.uk, hch@lst.de,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v3 05/24] arch: introduce memremap()
Date: Thu, 30 Jul 2015 23:02:04 +0200 [thread overview]
Message-ID: <20150730210204.GQ30479@wotan.suse.de> (raw)
In-Reply-To: <20150730165407.33962.79603.stgit@dwillia2-desk3.amr.corp.intel.com>
On Thu, Jul 30, 2015 at 12:54:07PM -0400, Dan Williams wrote:
> diff --git a/include/linux/io.h b/include/linux/io.h
> index fb5a99800e77..3fcf6256c088 100644
> --- a/include/linux/io.h
> +++ b/include/linux/io.h
> @@ -121,4 +121,13 @@ static inline int arch_phys_wc_index(int handle)
> #endif
> #endif
>
> +enum {
> + /* See memremap() kernel-doc for usage description... */
> + MEMREMAP_WB = 1 << 0,
> + MEMREMAP_WT = 1 << 1,
> +};
Same feedback for enum nameing and also kdoc style.
> diff --git a/kernel/memremap.c b/kernel/memremap.c
> new file mode 100644
> index 000000000000..27637f42f30d
> --- /dev/null
> +++ b/kernel/memremap.c
<-- ... -->
> +/**
> + * memremap() - remap an iomem_resource as cacheable memory
> + * @offset: iomem resource start address
> + * @size: size of remap
> + * @flags: either MEMREMAP_WB or MEMREMAP_WT
> + *
> + * memremap() is "ioremap" for cases where it is known that the resource
> + * being mapped does not have i/o side effects and the __iomem
> + * annotation is not applicable.
> + *
> + * MEMREMAP_WB - matches the default mapping for "System RAM" on
> + * the architecture. This is usually a read-allocate write-back cache.
> + * Morever, if MEMREMAP_WB is specified and the requested remap region is RAM
> + * memremap() will bypass establishing a new mapping and instead return
> + * a pointer into the direct map.
> + *
> + * MEMREMAP_WT - establish a mapping whereby writes either bypass the
> + * cache or are written through to memory and never exist in a
> + * cache-dirty state with respect to program visibility. Attempts to
> + * map "System RAM" with this mapping type will fail.
Then you can extrend all this on kdoc on the enum.
> + */
> +void *memremap(resource_size_t offset, size_t size, unsigned long flags)
> +{
> + int is_ram = region_intersects(offset, size, "System RAM");
This could be the enum region_intersect_type, then if the region enum is
extended you'd get a compiler error if one type was not handled.
Luis
next prev parent reply other threads:[~2015-07-30 21:02 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-30 16:53 [PATCH v3 00/24] replace ioremap_{cache|wt} with memremap Dan Williams
2015-07-30 16:53 ` [PATCH v3 01/24] mm: enhance region_is_ram() to region_intersects() Dan Williams
2015-07-30 20:42 ` Luis R. Rodriguez
2015-07-30 20:44 ` Dan Williams
2015-07-30 20:54 ` Luis R. Rodriguez
2015-07-30 20:59 ` Dan Williams
2015-07-30 21:10 ` Luis R. Rodriguez
2015-07-30 20:58 ` Luis R. Rodriguez
2015-07-30 16:53 ` [PATCH v3 02/24] arch, drivers: don't include <asm/io.h> directly, use <linux/io.h> instead Dan Williams
2015-07-30 16:53 ` [PATCH v3 03/24] cleanup IORESOURCE_CACHEABLE vs ioremap() Dan Williams
2015-07-30 16:54 ` [PATCH v3 04/24] intel_iommu: fix leaked ioremap mapping Dan Williams
2015-08-03 14:26 ` Joerg Roedel
2015-07-30 16:54 ` [PATCH v3 05/24] arch: introduce memremap() Dan Williams
2015-07-30 21:02 ` Luis R. Rodriguez [this message]
2015-07-30 21:11 ` Dan Williams
2015-07-30 16:54 ` [PATCH v3 06/24] arm: switch from ioremap_cache to memremap Dan Williams
2015-07-30 16:54 ` [PATCH v3 07/24] x86: " Dan Williams
2015-07-30 16:54 ` [PATCH v3 08/24] gma500: switch from acpi_os_ioremap " Dan Williams
2015-07-30 16:54 ` [PATCH v3 09/24] i915: " Dan Williams
2015-07-30 16:54 ` [PATCH v3 10/24] acpi: switch from ioremap_cache " Dan Williams
2015-07-30 16:54 ` [PATCH v3 11/24] toshiba laptop: replace ioremap_cache with ioremap Dan Williams
2015-07-30 16:54 ` [PATCH v3 12/24] memconsole: fix __iomem mishandling, switch to memremap Dan Williams
2015-07-30 16:54 ` [PATCH v3 13/24] visorbus: switch from ioremap_cache " Dan Williams
2015-08-06 0:27 ` Greg Kroah-Hartman
2015-07-30 16:54 ` [PATCH v3 14/24] intel-iommu: " Dan Williams
2015-07-30 16:55 ` [PATCH v3 15/24] libnvdimm, pmem: push call to ioremap_cache out of line Dan Williams
2015-07-30 16:55 ` [PATCH v3 16/24] pxa2xx-flash: switch from ioremap_cache to memremap Dan Williams
2015-07-30 16:55 ` [PATCH v3 17/24] sfi: " Dan Williams
2015-07-30 16:55 ` [PATCH v3 18/24] fbdev: switch from ioremap_wt " Dan Williams
2015-07-30 16:55 ` [PATCH v3 19/24] pmem: " Dan Williams
2015-07-30 16:55 ` [PATCH v3 20/24] arch: kill ioremap_cached() Dan Williams
2015-07-30 16:55 ` [PATCH v3 21/24] arch: kill ioremap_fullcache() Dan Williams
2015-07-30 16:55 ` [PATCH v3 22/24] arch: remove ioremap_cache, replace with arch_memremap Dan Williams
2015-07-30 16:55 ` [PATCH v3 23/24] arch: remove ioremap_wt, optionally " Dan Williams
2015-07-30 16:55 ` [PATCH v3 24/24] pmem: convert to generic memremap Dan Williams
2015-08-03 17:21 ` Ross Zwisler
2015-08-03 18:01 ` Dan Williams
2015-08-04 16:53 ` Ross Zwisler
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=20150730210204.GQ30479@wotan.suse.de \
--to=mcgrof@suse.com \
--cc=arnd@arndb.de \
--cc=dan.j.williams@intel.com \
--cc=hch@lst.de \
--cc=hpa@zytor.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvdimm@ml01.01.org \
--cc=mingo@kernel.org \
--cc=rmk+kernel@arm.linux.org.uk \
--cc=tglx@linutronix.de \
--cc=toshi.kani@hp.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
all inboxes | Powered by JetHome®