Commit graph

8 commits

Author SHA1 Message Date
Sahitya Tummala
a63c4e469e uio: msm_sharedmem: add guard page around shared memory
If guard_memory dtsi property is set, then the shared memory
region will be guarded by SZ_4K at the start and at the end.
This is needed to overcome the XPU limitation on few MSM HW,
so as to make this memory not contiguous with other allocations
that may possibly happen from other clients in the system.

Change-Id: I57637619cea8fe7f0f7254624e07177ea4a4fce0
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
2018-08-09 04:35:22 -07:00
Anant Goel
3002a37ec9 uio: msm_sharedmem: Add stub shutdown function
A stub shutdown function is added as the default
implementation. This function is used by targets
that do not need to free their memory when the
driver is shutdown.

Change-Id: I073cda4fee7a1c6c34c5ba72d9ba73478ef2d90d
Signed-off-by: Anant Goel <anantg@codeaurora.org>
2018-08-09 02:08:04 -07:00
Anant Goel
205812e0fc uio: msm_sharedmem: Add a function to release the shared RAM section
A function to free the shared RAM section has been added to the
msm_sharedmem driver. This function is needed to free the RAM section
on shutdown of the msm_sharedmem driver. The function is called on
the shutdown command for the driver.

Change-Id: Iff04f93d380664c5e3df9b0cd575cf9e6300ea39
Signed-off-by: Anant Goel <anantg@codeaurora.org>
2018-06-15 12:19:56 -07:00
Sahitya Tummala
ae92a00f02 uio: fix potential use after free issue when accessing debug_buffer
The variable debug_buffer is a global variable which is allocated
and free'd when open/close is called on debugfs file -
"/sys/kernel/debug/rmt_storage/info". The current code doesn't
have locks to handle concurrent accesses to the above file.
This results into use after free issue when debug_buffer is
accessed by two threads at the same time. Fix this by adding
a mutex lock to protect this global variable.

Change-Id: I6bc3f0ae2d7fca3ca9fe8561612f5863b6c3268a
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
2017-02-15 20:22:41 -08:00
Nikhilesh Reddy
011cf1fe1e uio: msm_sharedmem: Fix format specifier to print resource_size_t
Use proper printk format specifier %pa to print resource_size_t
type variable.

Signed-off-by: Nikhilesh Reddy <reddyn@codeaurora.org>
2016-03-23 21:24:33 -07:00
Prasad Sodagudi
73283bb3b8 uio: msm_sharedmem: Use proper format to print phys_addr_t
Use proper printk format specifier to print phys_addr_t
type variable.

Change-Id: I7c55e44e813d8d41e1ead03280044c8542a24922
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
2016-03-22 11:08:11 -07:00
Nikhilesh Reddy
060c1d5d23 uio: msm_sharedmem: Add support for HYP call
Add support for HYP call to setup the sharedmem permissions
for the MPSS client.

Change-Id: I3b48ae962865d8d0a0ea6e3fbb8e21278b59c690
Signed-off-by: Nikhilesh Reddy <reddyn@codeaurora.org>
2016-03-22 11:08:11 -07:00
Nikhilesh Reddy
d21221f75a uio: Add snapshot of MSM sharedmem driver
This is a snapshot of the MSM sharedmem driver as of msm-3.14
commit:

149717c082aab8168283b7e0c23d8bd5a45b1999
( uio: msm_sharedmem: Add custom mmap )

The following changes are included:
02d55287 uio: msm_sharedmem: Restrict debugfs write to root.
de961fc7 uio: msm_sharedmem: Return ENOMEM if the shared mem addr
	 is zero.
b974ce64 uio: msm_sharedmem: Add addtional information to debugfs
c46af547 uio: msm_sharedmem: Add support for dynamic shared memory
	 allocation

Change-Id: I49902f018bde1d59d41027b7e46268cc17231a3e
Signed-off-by: Nikhilesh Reddy <reddyn@codeaurora.org>
2016-03-22 11:08:10 -07:00