Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 61d49d22 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "rpmsg: glink: spi: Hold channel reference during send"

parents e71e1637 d9956e80
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1216,6 +1216,7 @@ static int __glink_spi_send(struct glink_channel *channel,
	glink->activity_flag |= ACTIVE_TX;
	spin_unlock_irqrestore(&glink->activity_lock, flags);

	kref_get(&channel->refcount);
	while (!intent) {
		spin_lock_irqsave(&channel->intent_lock, flags);
		idr_for_each_entry(&channel->riids, tmp, iid) {
@@ -1294,6 +1295,7 @@ static int __glink_spi_send(struct glink_channel *channel,
	/* Mark intent available if we failed */
	if (ret && intent)
		intent->in_use = false;
	kref_put(&channel->refcount, glink_spi_channel_release);

	spin_lock_irqsave(&glink->activity_lock, flags);
	glink->activity_flag &= ~ACTIVE_TX;
@@ -2436,6 +2438,8 @@ static void glink_spi_remove(struct glink_spi *glink)
	GLINK_INFO(glink, "\n");

	glink->in_reset = true;
	kthread_cancel_work_sync(&glink->rx_work);
	cancel_work_sync(&glink->rx_defer_work);

	ret = device_for_each_child(&glink->dev, NULL, glink_spi_remove_device);
	if (ret)