From patchwork Thu Jul 15 13:20:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Chiu X-Patchwork-Id: 1505701 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=OQZWH+io; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GQZkV0JpZz9sWl; Thu, 15 Jul 2021 23:20:49 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1m41IE-00048U-IZ; Thu, 15 Jul 2021 13:20:46 +0000 Received: from smtp-relay-canonical-1.internal ([10.131.114.174] helo=smtp-relay-canonical-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1m41IB-000480-RA for kernel-team@lists.ubuntu.com; Thu, 15 Jul 2021 13:20:43 +0000 Received: from localhost.localdomain (111-240-103-86.dynamic-ip.hinet.net [111.240.103.86]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-1.canonical.com (Postfix) with ESMTPSA id C341D409F4 for ; Thu, 15 Jul 2021 13:20:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1626355243; bh=5+mq/rk01Gg7Z1CHmZW81Cpqch+ZpgfhqYQ63CSg+88=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=OQZWH+ioC9kKFAgW24vUVaQhmUG89XdTY3yomNbla7pmBWlfiDGjNjpCIodJP7Rpn ciEUvNmRccBbAszJpaW/ANZwBN/McmrIuOTQPXFfR80NIHGV/NRC86jnr2Q6dIRmSn kj1IzqmtNVodkrYeV1fr301txemTtCa/TyRzzPlRv/e6fSJjOW5Gi0oMxlldOy6vnH XT/cGJUU/SVLTKkj18zRI2FICpMNBDLeWdJYhs7wlqOtv3sQtb+naLtcNujKaNLtgG nUMxml5Taj1SNfEzDsKZVW4z592HRYyW7E3egNfGyzGdZJR2QEexyBa2rlzV8Gs/rk VzSB3sPjCtAaQ== From: chris.chiu@canonical.com To: kernel-team@lists.ubuntu.com Subject: [PATCH 1/1][SRU][H] UBUNTU: SAUCE: Revert "ethernet: alx: fix order of calls on resume" Date: Thu, 15 Jul 2021 21:20:37 +0800 Message-Id: <20210715132037.191837-2-chris.chiu@canonical.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210715132037.191837-1-chris.chiu@canonical.com> References: <20210715132037.191837-1-chris.chiu@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Chris Chiu BugLink: https://bugs.launchpad.net/bugs/1931301 This reverts commit 59a1c7f9fbbb6d69924aefb9318b9a7a26546116. We don't really need the upstream commit a4dcfbc4ee22 ("ethernet: alx: fix order of calls on resume") after WoL feature support code been added back. The order of calls on resume is already correct. The WoL version suspend will do netif_device_detach despite of the status of netif_running, but the netif_device_attach is not there on resume if the netif_running return false in the previous commit. The network interface will not be present after resume if its state is not up and running before suspend. Signed-off-by: Chris Chiu --- drivers/net/ethernet/atheros/alx/main.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/net/ethernet/atheros/alx/main.c b/drivers/net/ethernet/atheros/alx/main.c index 20eabdda7466..a2d16630571e 100644 --- a/drivers/net/ethernet/atheros/alx/main.c +++ b/drivers/net/ethernet/atheros/alx/main.c @@ -2011,18 +2011,17 @@ static int alx_resume(struct device *dev) return -EIO; } - if (!netif_running(netdev)) - return 0; - - rtnl_lock(); - err = __alx_open(alx, true); - rtnl_unlock(); - if (err) - return err; + if (netif_running(netdev)) { + rtnl_lock(); + err = __alx_open(alx, true); + rtnl_unlock(); + if (err) + return err; + } netif_device_attach(netdev); - return 0; + return err; } #endif