Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

intel_th: msu: Prevent freeing buffers while locked windows exist

We already prevent freeing buffers via sysfs interface in case there are
existing users or if trace is active. Treat the existence of locked windows
similarly and return -EBUSY on attempts to free the buffer. When the last
window is unlocked, the freeing will succeed.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20190705141425.19894-5-alexander.shishkin@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Alexander Shishkin and committed by
Greg Kroah-Hartman
ed5207af 57b69a1f

+5
+5
drivers/hwtracing/intel_th/msu.c
··· 724 724 725 725 win->lockout = new; 726 726 727 + if (old == expect && new == WIN_LOCKED) 728 + atomic_inc(&win->msc->user_count); 729 + else if (old == expect && old == WIN_LOCKED) 730 + atomic_dec(&win->msc->user_count); 731 + 727 732 unlock: 728 733 spin_unlock_irqrestore(&win->lo_lock, flags); 729 734