If a heap is marked as reusuable (i.e. memory is to be gotten from
fmem) the base used from allocation should not come from
allocate_contiguous_memory but from fmem_get_info instead. Otherwise,
the memory allocated isn't actually coming from fmem.
Change-Id: If9737c93df3bd34e9cac9585a4dbbc8993562c5f
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Fix a possible Null pointer dereference when allocating the
garbage page and fixed potential leaks caused in the error path.
Fixed potential leaks in pmem_remove.
Change-Id: I7d4fa0798553691ed80e5024b19ba363249576b3
CRs-Fixed: 313700
Signed-off-by: Vipul Gandhi <vgandhi@codeaurora.org>
Individual pmem devices can now be marked as reusable. The
memory will be reused through fmem.
Change-Id: Id71c2e0c42f093420c241771d7a2620ed2accfc4
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
the request_region/release_region call backs now return
an error code. This way if the request fails the allocation
can fail as well.
Change-Id: I817c65a43935fb41176ad03f5a7672fb5640084e
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Return invalid error if a NULL virtual address is
passed for pmem cache maintenance ioctl's
Change-Id: I18c369d4c2ac790b622408a988d171d6f75c4cd3
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
Since the PMEM driver establishes ioremaps on the fly for
on demand devices it is possible for the virtual address space
to become quickly fragmented. For such devices, pre-reserve the
virtual address range and only set up page table mappings when
required.
CRs-Fixed: 299510
Signed-off-by: Naveen Ramaraj <nramaraj@codeaurora.org>
when finding an aligned chunk, the allocator cannot assume that
bit 0 will point to an aligned block. The only way to guarantee
a block will be aligned is to pass in the starting bit of a block
that is aligned. if t is the start bit which points to an aligned
block, and s is the spacing, bit t+n*s is guaranteed to be aligned
to spacing s for positive integer values of n.
CRs-Fixed: 288000
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Due to hardware constraints, the SMI should not be mapped
in the kernel space when not in use. Unmap the SMI from
the kernel address space when the last allocation is freed.
Vote for bus bandwidth as well while the SMI is allocated.
CRs-Fixed: 281723
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Signed-off-by: Rebecca Schultz <rschultz@google.com>
pmem: Use the thread group leader insted of the current thread.
Instead of keeping track of the current thread, use the thread group leader
Signed-off-by: Rebecca Schultz <rschultz@google.com>
pmem: Add some apis to reference and flush pmem files by file struct
The api to refer to pmem files by fd should be depricated, it can
cause problems if a processes fd table changes while the kernel is processing
data in a pmem file. This change adds the safer api.
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
pmem: Remove unused depricated fd api to pmem.
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
pmem: Remove error message when calling get_pmem_addr
This call is used from the mdp driver to determine if the memory
is in pmem or in the fb. We will encounter this case during normal operation
so this error message should be removed.
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
pmem: Add include sched.h to fix compile errors
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
pmem: remove HW3D_* ioctls
Signed-off-by: Dima Zavin <dima@android.com>
pmem: Expose is_pmem_file to the in-kernel users.
Signed-off-by: Dima Zavin <dima@android.com>
pmem: Make the exposed functions be noops if CONFIG_ANDROID_PMEM is not set.
Signed-off-by: Dima Zavin <dima@android.com>
misc: pmem: don't flush if file was opened with O_SYNC
Change-Id: I067218658a0d7f7ecc1fe73e9ff6b0c3b3054653
Signed-off-by: Dima Zavin <dima@android.com>
pmem: Add cache flush ioctl for pmem buffers
Change-Id: I9156bad829e8c65087f122b48cc57638902fab12
Signed-off-by: Dima Zavin <dima@android.com>
Allow multiple pmem master mmap()s.
Signed-off-by: Jamie Gennis <jgennis@google.com>
Change-Id: Icbe619c92e0ebb391f0a93f81937705452a67d87
pmem: convert data_list_sem to a mutex
Also rename a function that now conflicts with a new
define in asm/pgtable.h
Change-Id: I4798048cb8dece1bc03604e7d0b03d86e0c0ef7f
Signed-off-by: Dima Zavin <dima@android.com>