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

Commit 30a98b63 authored by Andrei Danaila's avatar Andrei Danaila Committed by Matt Wagantall
Browse files

mhi: rmnet: Prevent NAPI disable during RX



When the netdev interface is released, NAPI is disabled.
This condition can occur while the device is still sending RX data
causing a potential kernel panic.

Wait for all incoming data to be received, before releasing
the interface.

Change-Id: If33ff721a581fdafb9712fe3cf9243996187f09d
Signed-off-by: default avatarAndrei Danaila <adanaila@codeaurora.org>
parent 47d3c73f
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -567,7 +567,6 @@ static int rmnet_mhi_open(struct net_device *dev)
			rmnet_mhi_ptr->tx_channel,
			rmnet_mhi_ptr->rx_channel);
	netif_start_queue(dev);
	napi_enable(&(rmnet_mhi_ptr->napi));

	/* Poll to check if any buffers are accumulated in the
	 * transport buffers
@@ -616,7 +615,6 @@ static int rmnet_mhi_stop(struct net_device *dev)
	struct rmnet_mhi_private *rmnet_mhi_ptr =
		*(struct rmnet_mhi_private **)netdev_priv(dev);
	netif_stop_queue(dev);
	napi_disable(&(rmnet_mhi_ptr->napi));
	rmnet_log(MSG_VERBOSE, "Entered\n");
	if (atomic_read(&rmnet_mhi_ptr->irq_masked_cntr)) {
		mhi_unmask_irq(rmnet_mhi_ptr->rx_client_handle);
@@ -935,8 +933,8 @@ static int rmnet_mhi_enable_iface(struct rmnet_mhi_private *rmnet_mhi_ptr)
			  "Network device registration failed\n");
		goto net_dev_reg_fail;
	}
	napi_enable(&(rmnet_mhi_ptr->napi));

	netif_start_queue(rmnet_mhi_ptr->dev);
	rmnet_log(MSG_INFO, "Exited.\n");

	return 0;