summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-04-22version: Update version number to 4.20.00.01HEAD4.20.00.01masterlu-nextSuman Anna
Update the minor version number that now includes the fixes for build issues against all applicable platforms with 5.10 kernel. Signed-off-by: Suman Anna <s-anna@ti.com>
2021-04-22cmemk: Fix 5.10 build errors for non Keystone2 platformsSuman Anna
The commit 8aba20e20bf7 ("cmemk: Fix build errors for 5.10+ kernels") introduced a return type for cmem_dma_offset_configure(), but the function is not returning a value for all code paths. This causes a build failure for non Keystone 2 platforms. Fix this. Fixes: 8aba20e20bf7 ("cmemk: Fix build errors for 5.10+ kernels") Signed-off-by: Suman Anna <s-anna@ti.com>
2021-04-20version: Update version number to 4.20.00.004.20.00.00Suman Anna
Signed-off-by: Suman Anna <s-anna@ti.com>
2021-04-20cmemk: Fix build errors for 5.10+ kernelsSuman Anna
The Linux kernel v5.10 has couple of changes in the DMA layers that causes build failures with the CMEM kernel module: - The dma-mapping.h header file is split up to separate out the dma_map_ops related code into a separate dma-map-ops.h header file [1]. The dma-mapping.h itself is included in this new header file. - The dma-contiguous.h header file is merged into the dma-map-ops.h file [2]. - The dma_pfn_offset is removed from struct device and is replaced with multiple DMA range maps [3]. Update the CMEM kernel module to deal with all the above changes to build properly against v5.10+ kernels - The DMA headers are fixed by just including the new dma-map-ops.h - The dma_pfn_offset removal is addressed by using the newly added dma_direct_set_offset(). This is only an interim fix, and the ideal actual fix would be to actually use dma-ranges in DT. [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0a0f0d8be76dcd4390ff538e7060fda34db79717 [2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0b1abd1fb7efafc25231c54a67c6fbb3d3127efd [3] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e0d072782c734d27f5af062c62266f2598f68542 Signed-off-by: Suman Anna <s-anna@ti.com>
2021-04-20cmemk: Introduce cmem_dma_offset_configure wrapperSuman Anna
The Keystone2 platforms require the dma_pfn_offset to be configured on the CMEM device. Introduce a new cmem_dma_offset_configure() wrapper function so that the Linux kernel version variations can be localized to a single function. The wrapper is only effective for ARCH_KEYSTONE with LPAE enable (no change in functionality) and is a no-op for all other builds. Signed-off-by: Suman Anna <s-anna@ti.com>
2021-04-20version: Update version number to 4.19.00.004.19.00.00Suman Anna
Signed-off-by: Suman Anna <s-anna@ti.com>
2021-04-20cmemk: Fix usage of get_user_pages_remote() on 5.9+ kernelsSuman Anna
The get_user_pages_remote() function signature has changed in 5.9 kernel, it lost the first task_struct pointer argument [1]. Fix the current get_user_pages_remote() invocation in cmemk kernel with the appropriate signature to build properly for these kernels. [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/include/linux/mm.h?id=64019a2e467a288a16b65ab55ddcbf58c1b00187 Signed-off-by: Suman Anna <s-anna@ti.com>
2021-04-20version: Update version number to 4.18.00.004.18.00.00Suman Anna
Signed-off-by: Suman Anna <s-anna@ti.com>
2021-04-20cmemk: Fix usage of mmap_sem for 5.8+ kernelsSuman Anna
The mmap_sem locking semantics were abstracted out in preparation for some scalability work in v5.8 kernel. The mmap_sem field is no longer defined (renamed), and is abstracted out through newly introduced mmap_read_{lock,unlock} wrappers in a new mmap_lock.h file in commit 9740ca4e95b4 ("mmap locking API: initial implementation as rwsem wrappers"). Adopt to these new wrappers to fix the CMEM kernel module build against these newer kernels. Signed-off-by: Suman Anna <s-anna@ti.com>
2021-04-20cmemk: Introduce cmem_mmap_read_{lock,unlock} wrappersSuman Anna
Introduce small inline wrapper functions around down_read() and up_read() in preparation for scaling the CMEM kernel module for changes in v5.8 kernel around the mmap lock semantics. Signed-off-by: Suman Anna <s-anna@ti.com>
2021-04-20version: Update version number to 4.17.00.004.17.00.00Suman Anna
Signed-off-by: Suman Anna <s-anna@ti.com>
2021-04-20cmemk: Fix module for 5.6+ kernelsSuman Anna
The CMEM kernel module fails to build for 5.6 Linux kernel due to couple of changes: 1. The dma_buf ops lost the .map() and .unmap() callbacks in commit 4337ebbbbda3 ("dma-buf: Remove kernel map/unmap hooks") 2. The proc_create() function signature has changed to use a new proc_ops structure in place of the larger file_operations structure in commit d56c0d45f0e2 ("proc: decouple proc from VFS with "struct proc_ops") Fix #1 by limiting the ops for only older Linux kernels, and fix #2 by introducing a new proc_ops similar to the conversions done in commit 97a32539b956 ("proc: convert everything to "struct proc_ops"") Signed-off-by: Suman Anna <s-anna@ti.com>
2021-04-20version: Update version number to 4.16.00.014.16.00.01Suman Anna
Signed-off-by: Suman Anna <s-anna@ti.com>
2021-04-20tests: Fix compile warnings around off_tSuman Anna
Fix various compile warnings in the tests folder around off_t. Signed-off-by: Suman Anna <s-anna@ti.com>
2018-12-20version: update to new version 4.16.0.04.16.00.00Sam Nelson
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2018-12-20tests: Cleanup to prevent size mismatch warningsShravan Karthik
Signed-off-by: Shravan Karthik <shravan.karthik@ti.com> Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2018-12-20module: cmemk: Modifications to dmabuf operations for Linux Kernel > v4.18Shravan Karthik
From kernel versions 4.18, the map_atomic, unmap_atomic interfaces are removed. The device parameter for the attach callback is also removed. Signed-off-by: Shravan Karthik <shravan.karthik@ti.com> Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2018-12-20apitest: Update to check for return value for allocPhysSam Nelson
Adds check for return value of zero and exit instead of going ahead with map. Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2018-12-20cmem: Code clean upSam Nelson
Add spaces instead of spaces for consistency across code Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2018-12-20cmemk: portability fixes for handling physical addressSam Nelson
Fixes return of unsigned long long to user space for physp Fixes print issues to be address with portability in mind. Fix argument pointers Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2018-12-20cmem: Add portability fix for user space library sourceSam Nelson
Adds handling of 64 bit properly Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2018-12-20cmemk: Update for K3 architectureSam Nelson
Adds portabilty fix for 64 bit address handling. Also, with K3 cache coherence architecture, Cache operations are not required from the Arm Host side. This patch disables all cache operations for K3 architecture. Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2018-08-21version: update to new version 4.15.0.24.15.00.02Sam Nelson
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2018-08-17lu.mak: Update to allow building for aarch64Sam Nelson
Remove hard coding to ARCH=arm Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2018-08-17cmemk: Fix mmap failures on K2 devices with v4.14.49Suman Anna
The commit 16d7ceb04b55 ("mmap: introduce sane default mmap limits") that came through v4.14.49 stable tree has added additional range checks that resulted in the mmap() calls on the CMEM device to fail on K2 SoCs. K2 SoCs use 36-bit address spaces and the range check fails when comparing (in page indices) the 33-bit physical address against the 4 GB address imit, resulting in CMEM API failures and unable to launch MPM daemon on K2 SoCs affecting all MPM based IPC use-cases. Work around this problem by setting FMODE_UNSIGNED_OFFSET in the file flags in the driver's open() fops implementation for the /dev/cmem device. The change follows the suggestion in the above commit to mark the file descriptors as safe in the full 64-bit mmap address space by using the repurposed FMODE_UNSIGNED_OFFSET bit. The fix was also inspired by a similar fix in commit 2abd4c3ed20d ("drm: set FMODE_UNSIGNED_OFFSET for drm files") for the same problem. The same fix applies when using CMEM against kernels v4.17-rc5 and above as well overcoming the corresponding upstream equivalent commit be83bbf80682 ("mmap: introduce sane default mmap limits"). Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2018-03-05cmem: Update version number to 4.15.0.14.15.00.01Sam Nelson
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2018-02-15cmemk: Update handling of get_physSam Nelson
Fixes one issue related to falling through for direct mapped memory. Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2018-02-15cmem: Bug fix: Correct return value checkingSam Nelson
Need to check all negative values not only -1. Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2018-01-31version: Update version number to 4.15.00.004.15.00.00_engSam Nelson
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2018-01-31cmemk: Cleanup of tabs and spacesSam Nelson
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2018-01-31cmemk: Update to make code work with kernel 4.14Sam Nelson
Changes are backward compatible with Linux Kernel 4.4 as well. Replaced use of deprecated ioremap_page_range function with ioremap Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2018-01-26cmemk: Clean up of tabs and spacesSam Nelson
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2018-01-26cmemk: Add error checks and cleanupSam Nelson
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2018-01-26cmemk: Need protection for find_vma for multithread useSam Nelson
There is a race condition when mmap is happening simultaneously in a different thread and find_vma returns invalid value. Adding protection here to avoid race condition Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2018-01-26cmem: Fix return value for export_dmabufSam Nelson
In case of error, function expected to return negative value Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2017-11-20cmemk: Fix the dma_buf ops names on 4.12+ kernelsSuman Anna
The dma-buf ops .kmap_atomic, .kunmap_atomic, .kmap and .kunmap have been renamed to .map_atomic, .unmap_atomic, .map and .unmap respectively on 4.12+ kernels to avoid conflict with a kmap_atomic macro from the Linux highmem.h header file. Fix the ops names in the current definitions of cmem_dmabuf_ops, so that the CMEM module can be built against 4.12+ kernels properly. [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/include/linux/dma-buf.h?id=f9b67f0014cba18f1aabb6fa9272335a043eb6fd Signed-off-by: Suman Anna <s-anna@ti.com>
2017-11-20cmemk: Use architecture agnostic uaccess.h headerSuman Anna
Replace the architecture specific asm/uaccess.h with the Linux generic linux/uaccess.h header file. The architecture specific header files will be included by the generic header file. This fixes an issue when building the CMEM kernel module against 4.12+ kernels. Signed-off-by: Suman Anna <s-anna@ti.com>
2017-11-20cmemk: Fix usage of get_user_pages_remote() on 4.10+ kernelsSuman Anna
The get_user_pages_remote() function signature has changed in 4.10 kernel, it gained an additional integer pointer argument [1]. Fix the current get_user_pages_remote() invocation in cmemk kernel with the appropriate signature to build properly for these kernels. [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/include/linux/mm.h?id=5b56d49fc31dbb0487e14ead790fc81ca9fb2c99 Signed-off-by: Suman Anna <s-anna@ti.com>
2017-11-01cmem: Update version to 4.14.01.004.14.01.00Sam Nelson
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2017-09-19Android: move cmem libraries/binaries to vendor partitionVishal Mahaveer
Updating Android makefile to generate cmem userspace binaries and libraries in /vendor location instead of /system. Signed-off-by: Vishal Mahaveer <vishalm@ti.com>
2017-02-16version: Update cmem version to 4.144.14.00.00.eng4.14.00.00Sam Nelson
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2017-02-16cmemk: Fix usage of get_user_pages() on 4.6+ kernelsSuman Anna
The get_user_pages() function has gone through a bunch of changes between 4.4 and 4.9 Linux kernel versions. The function first lost the first two arguments - the task_struct and the mm_struct pointers in 4.6 kernel (and got replaced with a new get_user_pages_remote() function)[1][2], and then replaced two other arguments 'write' and 'force' with a single 'gup_flags' argument in 4.9 kernel[3][4]. Fix the current get_user_pages() invocation in cmemk kernel with the appropriate functions to build properly for these kernels. [1] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/include/linux/mm.h?id=1e9877902dc7e11d2be038371c6fbf2dfcd469d7 [2] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/include/linux/mm.h?id=c12d2da56d0e07d230968ee2305aaa86b93a6832 [3] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/include/linux/mm.h?id=768ae309a96103ed02eb1e111e838c87854d8b51 [4] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/include/linux/mm.h?id=9beae1ea89305a9667ceaab6d0bf46a045ad71e7 Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2017-02-16cmemk: Fix cmem_dma_buf_end_cpu_access() signature on 4.6+ kernelsSuman Anna
Commit 18b862dcd57a ("dma-buf, drm, ion: Propagate error code from dma_buf_start_cpu_access()") in Linux kernel has changed the signature for the dma_buf's end_cpu_access() ops. It now returns an error code, so adjust the signature for the cmem_dma_buf_end_cpu_access() function appropriately based on the kernel version. Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2017-01-10cmem: Update version4.13.00.01.eng4.13.00.01Sam Nelson
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2017-01-10cmemk: Initialize vma variableSam Nelson
This is a bug fix. Uninitialized variable caused freeing of random pointer and page fault. Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2016-12-02version: Update cmem version4.13.00.00.engSam Nelson
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2016-12-02Documentation: Update ti,cmem.txt with updated featuresSam Nelson
Adds support for using sram node Also updated documentation by demarcating the entries in the block subnodes Signed-off-by: Sam Nelson <sam.nelson@ti.com> --- Updated documentation with "sram" node definition ---
2016-12-02cmemk: Add support for blocks using sram nodesSam Nelson
Some memory sections can be managed by sram nodes in the dts. Adding support for sram subnodes allows the CMEM memory to use sram memory areas. Parsing of addresses on the subnodes now use of_address_to_resource for both sram and mem-region nodes. NOTE: For some of the routines the spacing and tabs are updated to general linux kernel coding guidelines. Signed-off-by: Sam Nelson <sam.nelson@ti.com> --- Change from previous version Redesigned to use "sram" node instead of mem-type. ---
2016-11-15tests: Update apitest to exercise dmabuf exportSam Nelson
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2016-11-15cmem: Add support to export cmem buffer as dmabufSam Nelson
Added new API to export buffer as dmabuf Added kernel driver code to support dmabuf ops Signed-off-by: Sam Nelson <sam.nelson@ti.com>