diff --git a/drivers/hwtracing/intel_th/core.c b/drivers/hwtracing/intel_th/core.c index 31d553760063c9f3b06d9236b2e3fabe74a79609..06c84bffffb3dce79f9d0aff400ca0f179111b4f 100644 --- a/drivers/hwtracing/intel_th/core.c +++ b/drivers/hwtracing/intel_th/core.c @@ -17,14 +17,14 @@ #include #include #include -#include +#include #include "intel_th.h" #include "debug.h" static bool host_mode __read_mostly; module_param(host_mode, bool, 0444); -static DEFINE_SPINLOCK(intel_th_lock); +static DEFINE_MUTEX(intel_th_lock); static DEFINE_IDA(intel_th_ida); @@ -718,7 +718,7 @@ int intel_th_output_enable(struct intel_th *th, unsigned int otype) { struct intel_th_device *thdev; int src = 0, dst = 0; - spin_lock(&intel_th_lock); + mutex_lock(&intel_th_lock); for (src = 0, dst = 0; dst <= th->num_thdevs; src++, dst++) { for (; src < ARRAY_SIZE(intel_th_subdevices); src++) { if (intel_th_subdevices[src].type != INTEL_TH_OUTPUT) @@ -732,7 +732,7 @@ int intel_th_output_enable(struct intel_th *th, unsigned int otype) /* no unallocated matching subdevices */ if (src == ARRAY_SIZE(intel_th_subdevices)) { - spin_unlock(&intel_th_lock); + mutex_unlock(&intel_th_lock); return -ENODEV; } @@ -753,18 +753,18 @@ int intel_th_output_enable(struct intel_th *th, unsigned int otype) if (dst == th->num_thdevs) goto found; } - spin_unlock(&intel_th_lock); + mutex_unlock(&intel_th_lock); return -ENODEV; found: thdev = intel_th_subdevice_alloc(th, &intel_th_subdevices[src]); if (IS_ERR(thdev)) { - spin_unlock(&intel_th_lock); + mutex_unlock(&intel_th_lock); return PTR_ERR(thdev); } th->thdev[th->num_thdevs++] = thdev; - spin_unlock(&intel_th_lock); + mutex_unlock(&intel_th_lock); return 0; } EXPORT_SYMBOL_GPL(intel_th_output_enable); @@ -773,7 +773,7 @@ static int intel_th_populate(struct intel_th *th) { int src; - spin_lock(&intel_th_lock); + mutex_lock(&intel_th_lock); /* create devices for each intel_th_subdevice */ for (src = 0; src < ARRAY_SIZE(intel_th_subdevices); src++) { const struct intel_th_subdevice *subdev = @@ -799,14 +799,14 @@ static int intel_th_populate(struct intel_th *th) /* ENODEV for individual subdevices is allowed */ if (PTR_ERR(thdev) == -ENODEV) continue; - spin_unlock(&intel_th_lock); + mutex_unlock(&intel_th_lock); return PTR_ERR(thdev); } th->thdev[th->num_thdevs++] = thdev; } - spin_unlock(&intel_th_lock); + mutex_unlock(&intel_th_lock); return 0; }