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

Commit 9ebfb8d1 authored by Sean Tranchetti's avatar Sean Tranchetti Committed by Gerrit - the friendly Code Review server
Browse files

soc: qcom: wda: Additional cleanup logic



Perform cleanup of WDA and DFC structures when all rmnet VNDs
are removed. This is needed in case IPA notifier callback is
not invoked in for example shutdown process. Also protect the
rmnet check stats function with RCU lock.

Change-Id: I88f0fb7efb73465b467ef37f5dd15a389ee50d1c
Acked-by: default avatarWeiyi Chen <weiyic@qti.qualcomm.com>
Signed-off-by: default avatarSean Tranchetti <stranche@codeaurora.org>
parent d8ccfa1e
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
/* Copyright (c) 2013-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2019, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -224,6 +224,10 @@ static void rmnet_dellink(struct net_device *dev, struct list_head *head)
		synchronize_rcu();
		kfree(ep);
	}

	if (!port->nr_rmnet_devs)
		qmi_rmnet_qmi_exit(port->qmi_info, port);

	rmnet_unregister_real_device(real_dev, port);

	unregister_netdevice_queue(dev, head);
@@ -557,6 +561,7 @@ void rmnet_get_packets(void *port, u64 *rx, u64 *tx)

	*tx = 0;
	*rx = 0;
	rcu_read_lock();
	hash_for_each(((struct rmnet_port *)port)->muxed_ep, bkt, ep, hlnode) {
		priv = netdev_priv(ep->egress_dev);
		for_each_possible_cpu(cpu) {
@@ -568,6 +573,7 @@ void rmnet_get_packets(void *port, u64 *rx, u64 *tx)
			} while (u64_stats_fetch_retry_irq(&ps->syncp, start));
		}
	}
	rcu_read_unlock();
}
EXPORT_SYMBOL(rmnet_get_packets);