Skip to contentSkip to conversation

drivers: misc: Add support for ANDROID_PMEM

PATCH In review Balint Czobor 3 participants 4 messages Jul 24, 2013 – Jul 27, 2013 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers: misc: Add support for ANDROID_PMEM

Add initial support for Android pmem allocator.

---
 arch/arm/include/asm/cacheflush.h             |    4 +
 arch/arm/include/asm/mach/map.h               |    3 +
 arch/arm/mach-msm/Makefile                    |    1 +
 arch/arm/mach-msm/include/mach/memory.h       |  139 ++
 arch/arm/mach-msm/include/mach/msm_memtypes.h |   70 +
 arch/arm/mach-msm/include/mach/socinfo.h      |  360 +++
 arch/arm/mach-msm/memory.c                    |  452 ++++
 drivers/misc/Kconfig                          |    4 +
 drivers/misc/Makefile                         |    1 +
 drivers/misc/pmem.c                           | 2962 +++++++++++++++++++++++++
 include/linux/android_pmem.h                  |  189 ++
 include/linux/fmem.h                          |   62 +
 include/linux/memory_alloc.h                  |   58 +
 13 files changed, 4305 insertions(+)
 create mode 100644 arch/arm/mach-msm/include/mach/memory.h
 create mode 100644 arch/arm/mach-msm/include/mach/msm_memtypes.h
 create mode 100644 arch/arm/mach-msm/include/mach/socinfo.h
 create mode 100644 arch/arm/mach-msm/memory.c
 create mode 100644 drivers/misc/pmem.c
 create mode 100644 include/linux/android_pmem.h
 create mode 100644 include/linux/fmem.h
 create mode 100644 include/linux/memory_alloc.h
arch/arm/include/asm/cacheflush.h +4 -0
index 17d0ae8..c133794 100644
@@ -142,6 +142,8 @@ extern struct cpu_cache_fns cpu_cache;
  */
 #define dmac_map_area			cpu_cache.dma_map_area
 #define dmac_unmap_area			cpu_cache.dma_unmap_area
+#define dmac_inv_range			cpu_cache.dma_inv_range
+#define dmac_clean_range		cpu_cache.dma_clean_range
 #define dmac_flush_range		cpu_cache.dma_flush_range
 
 #else
@@ -163,6 +165,8 @@ extern void __cpuc_flush_dcache_area(void *, size_t);
  */
 extern void dmac_map_area(const void *, size_t, int);
 extern void dmac_unmap_area(const void *, size_t, int);
+extern void dmac_inv_range(const void *, const void *);
+extern void dmac_clean_range(const void *, const void *);
 extern void dmac_flush_range(const void *, const void *);
 
 #endif
arch/arm/include/asm/mach/map.h +0 -0
index 2fe141f..07dd055 100644
@@ -54,6 +54,9 @@ extern const struct mem_type *get_mem_type(unsigned int type);
  */
 extern int ioremap_page(unsigned long virt, unsigned long phys,
			const struct mem_type *mtype);

+
+extern int ioremap_pages(unsigned long virt, unsigned long phys,
+ unsigned long size, const struct mem_type *mtype);
#else
#define iotable_init(map,num) do { } while (0)
#define vm_reserve_area_early(a,s,c) do { } while (0)

arch/arm/mach-msm/Makefile +1 -0
index d257ff4..33bb7cb 100644
@@ -1,5 +1,6 @@
 obj-y += io.o timer.o
 obj-y += clock.o
+obj-y += memory.o
 
 obj-$(CONFIG_MSM_VIC) += irq-vic.o
 obj-$(CONFIG_MSM_IOMMU) += devices-iommu.o
arch/arm/mach-msm/include/mach/memory.h new file +139 -0

139 lines not on this page · raw message

arch/arm/mach-msm/include/mach/msm_memtypes.h new file +70 -0

70 lines not on this page · raw message

arch/arm/mach-msm/include/mach/socinfo.h new file +360 -0

360 lines not on this page · raw message

arch/arm/mach-msm/memory.c new file +452 -0

452 lines not on this page · raw message

drivers/misc/Kconfig +0 -0
index 8dacd4c..5e0a710 100644
@@ -51,6 +51,10 @@ config AD525X_DPOT_SPI

To compile this driver as a module, choose M here: the module will be called ad525x_dpot-spi.

+config ANDROID_PMEM
+ bool "Android pmem allocator"
+ default y
+
config ATMEL_PWM
tristate "Atmel AT32/AT91 PWM support"
depends on HAVE_CLK

drivers/misc/Makefile +1 -0
index c235d5b..61bf50b 100644
@@ -22,6 +22,7 @@ obj-$(CONFIG_PHANTOM)		+= phantom.o
 obj-$(CONFIG_SENSORS_BH1780)	+= bh1780gli.o
 obj-$(CONFIG_SENSORS_BH1770)	+= bh1770glc.o
 obj-$(CONFIG_SENSORS_APDS990X)	+= apds990x.o
+obj-$(CONFIG_ANDROID_PMEM)	+= pmem.o
 obj-$(CONFIG_SGI_IOC4)		+= ioc4.o
 obj-$(CONFIG_ENCLOSURE_SERVICES) += enclosure.o
 obj-$(CONFIG_KGDB_TESTS)	+= kgdbts.o
drivers/misc/pmem.c new file +2962 -0

1,948 lines not on this page · raw message

include/linux/android_pmem.h new file +189 -0

189 lines not on this page · raw message

include/linux/fmem.h new file +62 -0

62 lines not on this page · raw message

include/linux/memory_alloc.h new file +58 -0

58 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

--
1.8.3.2

Part of the diff is not shown here. View the raw message.

#1 lore raw
Quoted 1 line · Balint Czobor

Add initial support for Android pmem allocator.

Why is this needed?

Quoted 1 line

As I don't think you wrote this code, you need to put the proper authorship information in the patch, and also you should cc: the needed developers who worked on this code.

Also, didn't we delete this driver a while ago from the tree?

Yes, we did, look at commit b0d017e80e9f4e6b37e699b9a944646e64deb473. Why do you want this back?

confused,

greg k-h

A message that is not in the archive (sent off-list or not yet received): CAL6DFdeJFz2F5FP+0w44ygfATDkNQTBpV7ODkbBFwerq50H4Rw@mail.gmail.com

#3 lore raw
Quoted 2 lines · Bálint Czobor

Thank you for the info.
However some devices still use it, sorry, I haven't seen that commit.

No modern Android devices should use pmem, only obsolete ones, right? That's why the code was removed.

Do you have a device that requires this?

You also mixed in a lot of device-specific changes, do you need those to be applied? If so, please make up a separate patch and submit it.

thanks,

greg k-h

maintainer
#4 lore raw
Quoted 11 lines · Greg Kroah-Hartman
Quoted 2 lines · Bálint Czobor

Thank you for the info.
However some devices still use it, sorry, I haven't seen that commit.

No modern Android devices should use pmem, only obsolete ones, right? That's why the code was removed.

Do you have a device that requires this?

You also mixed in a lot of device-specific changes, do you need those to be applied? If so, please make up a separate patch and submit it.

One particular problem is that it adds a dependency between the pmem driver and the mach-msm directory for header files. This conflicts with the attempt to remove all global header files from mach-msm, which is needed to support multiplatform kernels.

Arnd