OSDN Git Service

stm class: Fix an endless loop in channel allocation
authorZhi Jin <zhi.jin@intel.com>
Thu, 6 Sep 2018 07:22:10 +0000 (15:22 +0800)
committerAlexander Shishkin <alexander.shishkin@linux.intel.com>
Thu, 21 Feb 2019 15:44:18 +0000 (17:44 +0200)
commita1d75dad3a2c689e70a1c4e0214cca9de741d0aa
tree35a09b16e15e45e07f41f5515f7c35910677aeb8
parent9ed3f22223c33347ed963e7c7019cf2956dd4e37
stm class: Fix an endless loop in channel allocation

There is a bug in the channel allocation logic that leads to an endless
loop when looking for a contiguous range of channels in a range with a
mixture of free and occupied channels. For example, opening three
consequtive channels, closing the first two and requesting 4 channels in
a row will trigger this soft lockup. The bug is that the search loop
forgets to skip over the range once it detects that one channel in that
range is occupied.

Restore the original intent to the logic by fixing the omission.

Signed-off-by: Zhi Jin <zhi.jin@intel.com>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Fixes: 7bd1d4093c2f ("stm class: Introduce an abstraction for System Trace Module devices")
CC: stable@vger.kernel.org # v4.4+
drivers/hwtracing/stm/core.c