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

Commit a206f95d authored by Alok Chauhan's avatar Alok Chauhan
Browse files

msm: emac: Avoid device suspend in case of link active



EMAC driver should not allow device to go into system suspend
incase Ethernet link is up. This is to avoid active xfer
failing over the Ethernet link.

If link is down then allow system to go into suspend state.

Change-Id: I5bd3fa58ca716ad0a1ab4a64a4fa3e43086e88c4
Signed-off-by: default avatarAlok Chauhan <alokc@codeaurora.org>
parent c808da70
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
/* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2016, 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
@@ -3021,6 +3021,10 @@ static int emac_suspend(struct device *device)
	bool link_up = false;
	int retval = 0;

	/* Check link state. Don't suspend if link is up */
	if (netif_carrier_ok(adpt->netdev))
		return -EPERM;

	/* cannot suspend if WOL is disabled */
	if (!adpt->irq[EMAC_WOL_IRQ].irq)
		return -EPERM;