提交 d9fb3754 编写于 作者: B Bryan O'Donoghue 提交者: Greg Kroah-Hartman

greybus: loopback: Relax locking during loopback operations

Currently a per-connection mutex is held during calls to
gb_operation_send_sync. It is not necessary to hold this lock and later
patches supporting multiple-outstanding bi-directional operations need to
take the per-connection lock and the gb_dev level lock. Since gb_dev must
always be taken before per-connection locks, it is both desirable and safe
to drop the lock now.
Signed-off-by: NBryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@google.com>
上级 1700507d
......@@ -774,6 +774,8 @@ static int gb_loopback_fn(void *data)
mutex_unlock(&gb->mutex);
goto sleep;
}
mutex_unlock(&gb->mutex);
/* Else operations to perform */
gb->apbridge_latency_ts = 0;
gb->gpbridge_latency_ts = 0;
......@@ -783,7 +785,6 @@ static int gb_loopback_fn(void *data)
error = gb_loopback_transfer(gb, size);
else if (type == GB_LOOPBACK_TYPE_SINK)
error = gb_loopback_sink(gb, size);
mutex_unlock(&gb->mutex);
mutex_lock(&gb_dev.mutex);
mutex_lock(&gb->mutex);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册