summaryrefslogtreecommitdiffstats
path: root/drivers/staging
Commit message (Collapse)AuthorAgeFilesLines
* staging: vt6656: replaced custom BYTE definition with u8Andres More2013-03-1154-877/+874Star
| | | | | | | | | | Checkpatch findings were not resolved, only direct replacement. sed -i 's/\bBYTE\b/u8/g' drivers/staging/vt6656/*.[ch] sed -i 's/\bPBYTE\b/u8 */g' drivers/staging/vt6656/*.[ch] Signed-off-by: Andres More <more.andres@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: bcm: Fix spelling error in PHSModule.cKevin McKinney2013-03-111-1/+1
| | | | | | | This patch fixes a spelling error in PHSModule.c Signed-off-by: Kevin McKinney <klmckinney1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: bcm: Properly format comments in PHSModule.cKevin McKinney2013-03-111-271/+272
| | | | | | | | This patch properly formats comments, and removes them as needed in PHSModule.c. Signed-off-by: Kevin McKinney <klmckinney1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: bcm: Properly format braces in PHSModule.cKevin McKinney2013-03-111-293/+140Star
| | | | | | | | This patch formats braces in PHSModule.c as reported by checkpatch.pl. Signed-off-by: Kevin McKinney <klmckinney1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: bcm: Fix all white space issues in PHSModule.cKevin McKinney2013-03-111-596/+588Star
| | | | | | | | This patch fixes all white space issues in PHSModule.c as reported by checkpatch.pl. Signed-off-by: Kevin McKinney <klmckinney1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: sep: using strlcpy instead of strncpyChen Gang2013-03-111-3/+8
| | | | | | | set '\0' at tail for NUL terminated string, or TP_printk may cause issue. Signed-off-by: Chen Gang <gang.chen@asianux.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: bcm: don't cast kzalloc() return valueMihnea Dobrescu-Balaur2013-03-111-7/+7
| | | | | Signed-off-by: Mihnea Dobrescu-Balaur <mihneadb@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: bcm: potential forever loop verifying firmwareDan Carpenter2013-03-111-27/+5Star
| | | | | | | | | | | | | | | | There is an ioctl() to write data to the firmware. After the data is written, it reads the databack from the firmware and compares against what the user wanted to write and prints an error message if it doesn't match. The problem is that verify process has a forever loop if the firmware size is not a multiple of 4. I've fixed it by replacing the bcm compare function with memcmp(). I have chopped out some debugging code in the process. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: bcm: avoid use-after-free in bcm_char_ioctl()Xi Wang2013-03-111-1/+1
| | | | | | | Free pBulkBuffer (pvBuffer) after pBulkBuffer->Register. Signed-off-by: Xi Wang <xi.wang@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging/sep: Check pointers before dereferencing (fix smatch warning)Peter Huewe2013-03-111-2/+3
| | | | | | | | | | | | | | smatch complains about two dereferenced before check issues: sep_main.c:2898 sep_free_dma_tables_and_dcb() warn: variable dereferenced before check 'dma_ctx' (see line 2885) sep_main.c:2898 sep_free_dma_tables_and_dcb() warn: variable dereferenced before check '*dma_ctx' (see line 2885) -> Move the checks to the top, but keep the semantics. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging/sep: Fix smatch false positive about potential NULL dereference in ↵Peter Huewe2013-03-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | sep_main.c Smatch complains about a potential NULL pointer dereference: sep_main.c:2312 sep_construct_dma_tables_from_lli() error: potential NULL dereference 'info_out_entry_ptr'. info_out_entry_ptr is initialized with NULL and if info_in_entry_ptr is not NULL it gets derefenced. However info_out_entry_ptr is only NULL in the first iteration of the while loop and in this case info_in_entry_ptr is also NULL (as indicated by the comment /* If info entry is null - this is the first table built */ -> this is a false positive. Nevertheless we add a check for info_out_entry_ptr to silence this warning and make it more robust in regard to code changes. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: zcache/debug: compiler failure on PPC64 and revert commit.Konrad Rzeszutek Wilk2013-03-082-1/+2
| | | | | | | | | | | | | | | | On PPC64 we get this: In file included from drivers/staging/zcache/debug.c:2: drivers/staging/zcache/debug.h: In function 'dec_zcache_obj_count': drivers/staging/zcache/debug.h:16: error: implicit declaration of function 'BUG_ON' This simple patch adds the appropiate header file to finish the compile and reverts "staging: zcache: disable ZCACHE_DEBUG due to build error" (5db5a20a50cfd078c78b13a988f237cca81aedc5) Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: android: ashmem: Add support for 32bit ashmem calls in a 64bit kernelSerban Constantinescu2013-03-062-1/+27
| | | | | | | | | | | | | | | | Android's shared memory subsystem, Ashmem, does not support calls from a 32bit userspace in a 64 bit kernel. This patch adds support for syscalls coming from a 32bit userspace in a 64bit kernel. The patch has been successfully tested on ARMv8 AEM(64bit platform model) and Versatile Express A9(32bit platform). v2: Fix missing compat.h include. Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com> Acked-by: Arve Hjønnevåg <arve@android.com> Acked-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: zcache: disable ZCACHE_DEBUG due to build errorStephen Rothwell2013-03-061-0/+1
| | | | | | | | | In file included from drivers/staging/zcache/debug.c:2:0: drivers/staging/zcache/debug.h: In function 'dec_zcache_obj_count': drivers/staging/zcache/debug.h:16:2: error: implicit declaration of function 'BUG_ON' [-Werror=implicit-function-declaration] Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* zcache/debug: Coalesce all debug under CONFIG_ZCACHE_DEBUGKonrad Rzeszutek Wilk2013-03-053-4/+12
| | | | | | | | and also define this extra attribute in the Kconfig entry. Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* zcache: Module license is defined twice.Konrad Rzeszutek Wilk2013-03-051-2/+0Star
| | | | | | | | The other (same license) is at the end of the file. Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* zcache: Move the last of the debugfs counters outKonrad Rzeszutek Wilk2013-03-052-66/+89
| | | | | | | | | We now have in zcache-main only the counters that are are not debugfs related. Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* zcache/debug: Use an array to initialize/use debugfs attributes.Konrad Rzeszutek Wilk2013-03-051-112/+51Star
| | | | | | | | | It makes it neater and also allows us to piggyback on that in the zcache_dump function. Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* zcache: Move debugfs code out of zcache-main.c file.Konrad Rzeszutek Wilk2013-03-054-256/+328
| | | | | | | | | | | | Note that at this point there is no CONFIG_ZCACHE_DEBUG option in the Kconfig. So in effect all of the counters are nop until that option gets re-introduced in: zcache/debug: Coalesce all debug under CONFIG_ZCACHE_DEBUG Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com> [v1: Fixed conflicts due to rebase] Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* zcache: Make the debug code use pr_debugKonrad Rzeszutek Wilk2013-03-051-44/+41Star
| | | | | | | | | | | | as if you are debugging this driver you would be using 'debug' on the command line anyhow - and this would dump the debug data on the proper loglevel. While at it also remove the unconditional #define ZCACHE_DEBUG. Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* zcache: The last of the atomic reads has now an accessory function.Konrad Rzeszutek Wilk2013-03-051-4/+9
| | | | | | | | | And now we can move the code ([inc|dec]_zcache_[*]) to their own file with a header to make them nops or feed in debugfs. Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* zcache: Provide accessory functions for counter decrease.Konrad Rzeszutek Wilk2013-03-051-39/+57
| | | | | | | | | | | This way we can have all wrapped with these functions and can disable/enable this with CONFIG_DEBUG_FS. Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com> [v2: Rebase on top of staging/zcache: Fix/improve zcache writeback code, tie to a config option] [v3: Rebase on top of zcache: Fix compile warnings due to usage of debugfs_create_size_t] Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* zcache: Provide accessory functions for counter increaseKonrad Rzeszutek Wilk2013-03-051-36/+73
| | | | | | | | | | | | This is the first step in moving the debugfs code out of the main file in-to another file. And also allow the code to run without CONFIG_DEBUG_FS defined. Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com> [v2: Rebase on top staging/zcache: Fix/improve zcache writeback code, tie to a config option] [v3: Rebase on top of zcache: Fix compile warnings due to usage of debugfs_create_size_t] Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* zcache: s/int/bool/ on the various options.Konrad Rzeszutek Wilk2013-03-051-15/+15
| | | | | | | | | | | There are so many, but this allows us to at least have them right in as bool. Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com> [v1: Rebase on ramster->zcache move] [v2: Rebase on staging/zcache: Fix/improve zcache writeback code, tie to a config option] Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: android: logger: enforce GID and CAP check on log flushCharndeep Grewal2013-03-051-0/+5
| | | | | | | | | | | Restrict log flushing to those in the logs group, or anyone with CAP_SYSLOG. Cc: Android Kernel Team <kernel-team@android.com> Cc: Charndeep Grewal <csgrewa@tycho.ncsc.mil> Signed-off-by: Charndeep Grewal <csgrewa@tycho.ncsc.mil> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: android: logger: Allow a UID to read it's own log entriesNick Kralevich2013-03-052-29/+202
| | | | | | | | | | | | | | | | | | Modify the kernel logger to record the UID associated with the log entries. Always allow the same UID which generated a log message to read the log message. Allow anyone in the logs group, or anyone with CAP_SYSLOG, to read all log entries. In addition, allow the client to upgrade log formats, so they can get additional information from the kernel. Cc: Android Kernel Team <kernel-team@android.com> Cc: Nick Kralevich <nnk@google.com> Signed-off-by: Nick Kralevich <nnk@google.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: android: lowmemorykiller: Change default debug_level to 1Arve Hjønnevåg2013-03-051-1/+1
| | | | | | | | | | | | | | The select...to kill messages are not very useful when not debugging the lowmemorykiller itself. After the change to check TIF_MEMDIE instead of using a task notifer this message can also get very noisy. Cc: Android Kernel Team <kernel-team@android.com> Cc: Arve Hjønnevåg <arve@android.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Arve Hjønnevåg <arve@android.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: android: lowmemorykiller: Don't count reserved free memoryArve Hjønnevåg2013-03-051-1/+2
| | | | | | | | | | | | | The amount of reserved memory varies between devices. Subtract it here to reduce the amount of devices specific tuning needed for the minfree values. Cc: Android Kernel Team <kernel-team@android.com> Cc: Arve Hjønnevåg <arve@android.com> Signed-off-by: Arve Hjønnevåg <arve@android.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Acked-by: David Rientjes <rientjes@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: android: ashmem: get_name,set_name not to hold ashmem_mutexShankar Brahadeeswaran2013-03-051-13/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: There exists a path in ashmem driver that could lead to acquistion of mm->mmap_sem, ashmem_mutex in reverse order. This could lead to deadlock in the system. For Example, assume that mmap is called on a ashmem region in the context of a thread say T1. sys_mmap_pgoff (1. acquires mm->mmap_sem) | --> mmap_region | ----> ashmem_mmap (2. acquires asmem_mutex) Now if there is a context switch after 1 and before 2, and if another thread T2 (that shares the mm struct) invokes an ioctl say ASHMEM_GET_NAME, this can lead to the following path ashmem_ioctl | -->get_name (3. acquires ashmem_mutex) | ---> copy_to_user (4. acquires the mm->mmap_sem) Note that the copy_to_user could lead to a valid fault if no physical page is allocated yet for the user address passed. Now T1 has mmap_sem and is waiting for ashmem_mutex. and T2 has the ashmem_mutex and is waiting for mmap_sem Thus leading to deadlock. Solution: Do not call copy_to_user or copy_from_user while holding the ahsmem_mutex. Instead copy this to a local buffer that lives in the stack while holding this lock. This will maintain data integrity as well never reverse the lock order. Testing: Created a unit test case to reproduce the problem. Used the same to test this fix on kernel version 3.4.0 Ported the same patch to 3.8 Signed-off-by: Shankar Brahadeeswaran <shankoo77@gmail.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: sync: Fix timeout = 0 wait behaviorJamie Gennis2013-03-041-4/+6
| | | | | | | | | | | | | | | | Fix wait behavior on timeout == 0 case Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com> Cc: Erik Gilling <konkers@android.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Rob Clark <robclark@gmail.com> Cc: Sumit Semwal <sumit.semwal@linaro.org> Cc: dri-devel@lists.freedesktop.org Cc: Android Kernel Team <kernel-team@android.com> Signed-off-by: Jamie Gennis <jgennis@google.com> [jstultz: Added commit message] Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: sync: Don't log wait timeouts when timeout = 0Erik Gilling2013-03-041-1/+1
| | | | | | | | | | | | | | | | If the timeout is zero, don't trip the timeout debugging Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com> Cc: Erik Gilling <konkers@android.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Rob Clark <robclark@gmail.com> Cc: Sumit Semwal <sumit.semwal@linaro.org> Cc: dri-devel@lists.freedesktop.org Cc: Android Kernel Team <kernel-team@android.com> Signed-off-by: Erik Gilling <konkers@android.com> [jstultz: Added commit message] Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: sync: Fix race condition between merge and signalØrjan Eide2013-03-041-3/+7
| | | | | | | | | | | | | | | | | | | | | | | The copied sync_pt was activated immediately. If the sync_pt was signaled before the entire merge was completed, the new fence's pt_list could be iterated over while it is still in the process of being created. Moving the the sync_pt_activate call for all new sync_pts to after both the sync_fence_copy_pts and the sync_fence_merge_pts calls ensure that the pt_list is complete and immutable before it can be reached from the timeline's active list. Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com> Cc: Erik Gilling <konkers@android.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Rob Clark <robclark@gmail.com> Cc: Sumit Semwal <sumit.semwal@linaro.org> Cc: dri-devel@lists.freedesktop.org Cc: Android Kernel Team <kernel-team@android.com> Signed-off-by: Erik Gilling <konkers@android.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: sync: Add tracepoint supportErik Gilling2013-03-042-0/+93
| | | | | | | | | | | | | | | | Add support for tracepoints Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com> Cc: Erik Gilling <konkers@android.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Rob Clark <robclark@gmail.com> Cc: Sumit Semwal <sumit.semwal@linaro.org> Cc: dri-devel@lists.freedesktop.org Cc: Android Kernel Team <kernel-team@android.com> Signed-off-by: Erik Gilling <konkers@android.com> [jstultz: Whitespace changes, add commit message, move to staging] Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: sw_sync: Convert to use new value_str debug opsErik Gilling2013-03-041-19/+17Star
| | | | | | | | | | | | | | | | | Switch from print_obj/print_pt to the new timeline_value_str and pt_value_str ops. Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com> Cc: Erik Gilling <konkers@android.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Rob Clark <robclark@gmail.com> Cc: Sumit Semwal <sumit.semwal@linaro.org> Cc: dri-devel@lists.freedesktop.org Cc: Android Kernel Team <kernel-team@android.com> Signed-off-by: Erik Gilling <konkers@android.com> [jstultz: Add commit message] Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: sync: Refactor sync debug printingErik Gilling2013-03-042-8/+29
| | | | | | | | | | | | | | | | Move driver callbacks to fill strings instead of using seq_files. This will allow those values to be used in a future tracepoint patch. Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com> Cc: Erik Gilling <konkers@android.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Rob Clark <robclark@gmail.com> Cc: Sumit Semwal <sumit.semwal@linaro.org> Cc: dri-devel@lists.freedesktop.org Cc: Android Kernel Team <kernel-team@android.com> Signed-off-by: Erik Gilling <konkers@android.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: sync: Use proper barriers when waiting indefinitelyErik Gilling2013-03-041-1/+2
| | | | | | | | | | | | | | | The previous fix only addressed waiting with a timeout. Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com> Cc: Erik Gilling <konkers@android.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Rob Clark <robclark@gmail.com> Cc: Sumit Semwal <sumit.semwal@linaro.org> Cc: dri-devel@lists.freedesktop.org Cc: Android Kernel Team <kernel-team@android.com> Signed-off-by: Erik Gilling <konkers@android.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: sync: Update new fence status with sync_fence_signal_ptErik Gilling2013-03-041-1/+13
| | | | | | | | | | | | | | | | | | If a fence's pt is signaled before sync_fence_create is called, the fence will never transition into the signaled state. This also address a tiny race if a merged fence's pt after sync_fence_get_status checks it's status and before fence->status is updated. Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com> Cc: Erik Gilling <konkers@android.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Rob Clark <robclark@gmail.com> Cc: Sumit Semwal <sumit.semwal@linaro.org> Cc: dri-devel@lists.freedesktop.org Cc: Android Kernel Team <kernel-team@android.com> Signed-off-by: Erik Gilling <konkers@android.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: sync: Protect unlocked access to fence statusErik Gilling2013-03-041-1/+17
| | | | | | | | | | | | | | | | | Fence status is checked outside of locks in both sync_fence_wait and sync_fence_poll. This patch adds propper barrier protection in these cases to avoid seeing stale status. Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com> Cc: Erik Gilling <konkers@android.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Rob Clark <robclark@gmail.com> Cc: Sumit Semwal <sumit.semwal@linaro.org> Cc: dri-devel@lists.freedesktop.org Cc: Android Kernel Team <kernel-team@android.com> Signed-off-by: Erik Gilling <konkers@android.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: sync: Dump sync state on fence errorsErik Gilling2013-03-041-1/+4
| | | | | | | | | | | | | | | | When we get a bad status, dump sync state Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com> Cc: Erik Gilling <konkers@android.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Rob Clark <robclark@gmail.com> Cc: Sumit Semwal <sumit.semwal@linaro.org> Cc: dri-devel@lists.freedesktop.org Cc: Android Kernel Team <kernel-team@android.com> Signed-off-by: Erik Gilling <konkers@android.com> [jstultz: Added commit message] Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: sync: Improve timeout dump messagesErik Gilling2013-03-041-1/+4
| | | | | | | | | | | | | | | | | Improve the output of the timeout dumps, including the fence pointer. Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com> Cc: Erik Gilling <konkers@android.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Rob Clark <robclark@gmail.com> Cc: Sumit Semwal <sumit.semwal@linaro.org> Cc: dri-devel@lists.freedesktop.org Cc: Android Kernel Team <kernel-team@android.com> Signed-off-by: Erik Gilling <konkers@android.com> [jstultz: Added commit message] Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: sync: Dump sync state to console on timeoutErik Gilling2013-03-041-2/+32
| | | | | | | | | | | | | | | | If we hit a timeout, dump sync state to console Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com> Cc: Erik Gilling <konkers@android.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Rob Clark <robclark@gmail.com> Cc: Sumit Semwal <sumit.semwal@linaro.org> Cc: dri-devel@lists.freedesktop.org Cc: Android Kernel Team <kernel-team@android.com> Signed-off-by: Erik Gilling <konkers@android.com> [jstultz: Add commit message, whitespace fixups] Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: sync: Change wait timeout to mirror poll semanticsErik Gilling2013-03-042-7/+7
| | | | | | | | | | | | | | | | Change wait timeout to act like poll Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com> Cc: Erik Gilling <konkers@android.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Rob Clark <robclark@gmail.com> Cc: Sumit Semwal <sumit.semwal@linaro.org> Cc: dri-devel@lists.freedesktop.org Cc: Android Kernel Team <kernel-team@android.com> Signed-off-by: Erik Gilling <konkers@android.com> [jstultz: Added commit message, squished typo-fix] Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: sw_sync: Fix error pathsRebecca Schultz Zavin2013-03-041-2/+7
| | | | | | | | | | | | | | | | | | | Check the return value of get_unused_fd to make sure a valid file descriptor is returned. Make sure to call put_unused_fd even if an error occurs before the fd can be used. Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com> Cc: Erik Gilling <konkers@android.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Rob Clark <robclark@gmail.com> Cc: Sumit Semwal <sumit.semwal@linaro.org> Cc: dri-devel@lists.freedesktop.org Cc: Android Kernel Team <kernel-team@android.com> Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: sync: Fix error pathsRebecca Schultz Zavin2013-03-041-2/+7
| | | | | | | | | | | | | | | | | | | Check the return value of get_unused_fd to make sure a valid file descriptor is returned. Make sure to call put_unused_fd even if an error occurs before the fd can be used. Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com> Cc: Erik Gilling <konkers@android.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Rob Clark <robclark@gmail.com> Cc: Sumit Semwal <sumit.semwal@linaro.org> Cc: dri-devel@lists.freedesktop.org Cc: Android Kernel Team <kernel-team@android.com> Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: sync: Add reference counting to timelinesErik Gilling2013-03-042-16/+15Star
| | | | | | | | | | | | | | | | | | If a timeline is destroyed while fences still hold pts on it, the reworked fence release handler can cause the timeline to be freed before all it's points are freed. Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com> Cc: Erik Gilling <konkers@android.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Rob Clark <robclark@gmail.com> Cc: Sumit Semwal <sumit.semwal@linaro.org> Cc: dri-devel@lists.freedesktop.org Cc: Android Kernel Team <kernel-team@android.com> Signed-off-by: Erik Gilling <konkers@android.com> [jstultz: Squished in compiler warning fix] Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: sync: Add internal refcounting to fencesErik Gilling2013-03-042-8/+51
| | | | | | | | | | | | | | | | | | If a fence is released while a timeline that one of it's pts is on is being signaled, it is possible for that fence to be deleted before it is signaled. This patch adds a refcount for internal references such as signaled pt processing. Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com> Cc: Erik Gilling <konkers@android.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Rob Clark <robclark@gmail.com> Cc: Sumit Semwal <sumit.semwal@linaro.org> Cc: dri-devel@lists.freedesktop.org Cc: Android Kernel Team <kernel-team@android.com> Signed-off-by: Erik Gilling <konkers@android.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: sync: Optimize fence mergesErik Gilling2013-03-041-1/+51
| | | | | | | | | | | | | | | | | | If the two fences being merged contain sync_pts from the same timeline, those two pts will be collapsed into a single pt representing the latter of the two. Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com> Cc: Erik Gilling <konkers@android.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Rob Clark <robclark@gmail.com> Cc: Sumit Semwal <sumit.semwal@linaro.org> Cc: dri-devel@lists.freedesktop.org Cc: Android Kernel Team <kernel-team@android.com> Signed-off-by: Erik Gilling <konkers@android.com> [jstultz: Whitespace fixes] Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: sync: Reorder sync_fence_releaseErik Gilling2013-03-041-2/+2
| | | | | | | | | | | | | | | | | Previously fence's pts were freed before the were the fence was removed from the global fence list. This led to a race with the debugfs support where it would iterate over sync_pts that had been freed. Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com> Cc: Erik Gilling <konkers@android.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Rob Clark <robclark@gmail.com> Cc: Sumit Semwal <sumit.semwal@linaro.org> Cc: dri-devel@lists.freedesktop.org Cc: Android Kernel Team <kernel-team@android.com> Signed-off-by: Erik Gilling <konkers@android.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: sw_sync: Export sw_sync APIErik Gilling2013-03-041-1/+4
| | | | | | | | | | | | | | | Needed to let modules link against sw_sync. Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com> Cc: Erik Gilling <konkers@android.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Rob Clark <robclark@gmail.com> Cc: Sumit Semwal <sumit.semwal@linaro.org> Cc: dri-devel@lists.freedesktop.org Cc: Android Kernel Team <kernel-team@android.com> Signed-off-by: Erik Gilling <konkers@android.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: sync: Export sync API symbolsErik Gilling2013-03-041-0/+14
| | | | | | | | | | | | | | | This is needed to allow modules to link against the sync subsystem Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com> Cc: Erik Gilling <konkers@android.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Rob Clark <robclark@gmail.com> Cc: Sumit Semwal <sumit.semwal@linaro.org> Cc: dri-devel@lists.freedesktop.org Cc: Android Kernel Team <kernel-team@android.com> Signed-off-by: Erik Gilling <konkers@android.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>