From patchwork Fri Feb 17 12:41:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 729312 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vQ45H6dNGz9s8D for ; Sat, 18 Feb 2017 07:15:15 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="P2SozLli"; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 0B19530A98; Fri, 17 Feb 2017 20:15:14 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id syof-4j-zDKw; Fri, 17 Feb 2017 20:15:11 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id A8A2A30A56; Fri, 17 Feb 2017 20:15:11 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 5C0581C1018 for ; Fri, 17 Feb 2017 12:41:54 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 570B38A162 for ; Fri, 17 Feb 2017 12:41:54 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bzhnDChDub44 for ; Fri, 17 Feb 2017 12:41:53 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by hemlock.osuosl.org (Postfix) with ESMTPS id 3049B8A147 for ; Fri, 17 Feb 2017 12:41:53 +0000 (UTC) Received: by mail-wm0-f68.google.com with SMTP id r18so2373318wmd.3 for ; Fri, 17 Feb 2017 04:41:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=9dQoIdV7kzl0S+TIGk7ywThXWYNzf8kYjxbnK7/YVQQ=; b=P2SozLlipvZ9iZWzb6rRxyVdUxw2Y5ymv5xt/M9nsqZIx6ZW7qxiax1nFEBETl5ipV ZNoRHOXPbn2q91lq+p+opyChU0PYhTQmhBpyQYp1MCxbSk6yfA4xGW4p2ZmvQjpHz+i1 VSFeGTf6rKS/4DXLUxH+5JFs0DDBuqU90dH6iDRG+2j5RXGZ6vaHbnCMDbqtF41J9/QN M0CkhQvgFlT4GEmkXmViTWmYouBzTObd6e2PFin0W+4tWh3hXV8c/KpbMbwroEPH+xTK MP8k9gXeFSDIHcsIrb0iKgpzXq9KRWjA+lSI9dRhnaJSTlStF5ApiZkaBH3pC8JTi5Pm VhwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=9dQoIdV7kzl0S+TIGk7ywThXWYNzf8kYjxbnK7/YVQQ=; b=ehXMi+ILnIkJt9g2LJiMCbyV6x6tUsgeFdbOGgb4sqyFgk3IdlNri/cJgvkWIQqYD4 RLYOQrCArVUmy2dclonpRs7H/cOT63O59urO6+dxUB/a6STG2LmxB4us9pAb7yC7XXBv t6WD80KMEld28rjMg/1PGq41CW/GT+HvORFt1QnpxlbmRhuKJkOmjs+dKZ3C9w8sv1o8 Zp4jELJ4ImQYB9/XTLai1o+HpMQyts3rDXnct3sMYgLnbzsyGFqTK8BtLJA1XQJKUTwz qYNRf8Zm2QGcMYeR9CYgvTvDl4sclPNGmB+lmgkcF9q1pegAFNw/gt/fwEk13JcJB3an W+Cg== X-Gm-Message-State: AMke39m9tGhV4wEEhXWK8+sT58OCMxTNxEGk+wD8MqOAq/JTGBcdTYTS7SJTNjtPwHHnCQ== X-Received: by 10.28.58.204 with SMTP id h195mr3318013wma.116.1487335311445; Fri, 17 Feb 2017 04:41:51 -0800 (PST) Received: from haswell.alporthouse.com ([78.156.65.138]) by smtp.gmail.com with ESMTPSA id g81sm1567284wmf.16.2017.02.17.04.41.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Feb 2017 04:41:50 -0800 (PST) From: Chris Wilson To: jeffrey.t.kirsher@intel.com Date: Fri, 17 Feb 2017 12:41:48 +0000 Message-Id: <20170217124148.17130-1-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.11.0 X-Mailman-Approved-At: Fri, 17 Feb 2017 20:15:09 +0000 Cc: Tvrtko Ursulin , netdev@vger.kernel.org, Chris Wilson , intel-wired-lan@lists.osuosl.org, Dave Ertman Subject: [Intel-wired-lan] [PATCH] e1000e: Undo e1000e_pm_freeze if __e1000_shutdown fails X-BeenThere: intel-wired-lan@lists.osuosl.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-wired-lan-bounces@lists.osuosl.org Sender: "Intel-wired-lan" An error during suspend (e100e_pm_suspend), [ 429.994338] ACPI : EC: event blocked [ 429.994633] e1000e: EEE TX LPI TIMER: 00000011 [ 430.955451] pci_pm_suspend(): e1000e_pm_suspend+0x0/0x30 [e1000e] returns -2 [ 430.955454] dpm_run_callback(): pci_pm_suspend+0x0/0x140 returns -2 [ 430.955458] PM: Device 0000:00:19.0 failed to suspend async: error -2 [ 430.955581] PM: Some devices failed to suspend, or early wake event detected [ 430.957709] ACPI : EC: event unblocked lead to complete failure: [ 432.585002] ------------[ cut here ]------------ [ 432.585013] WARNING: CPU: 3 PID: 8372 at kernel/irq/manage.c:1478 __free_irq+0x9f/0x280 [ 432.585015] Trying to free already-free IRQ 20 [ 432.585016] Modules linked in: cdc_ncm usbnet x86_pkg_temp_thermal intel_powerclamp coretemp mii crct10dif_pclmul crc32_pclmul ghash_clmulni_intel snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic snd_hda_intel snd_hda_codec snd_hwdep lpc_ich snd_hda_core snd_pcm mei_me mei sdhci_pci sdhci i915 mmc_core e1000e ptp pps_core prime_numbers [ 432.585042] CPU: 3 PID: 8372 Comm: kworker/u16:40 Tainted: G U 4.10.0-rc8-CI-Patchwork_3870+ #1 [ 432.585044] Hardware name: LENOVO 2356GCG/2356GCG, BIOS G7ET31WW (1.13 ) 07/02/2012 [ 432.585050] Workqueue: events_unbound async_run_entry_fn [ 432.585051] Call Trace: [ 432.585058] dump_stack+0x67/0x92 [ 432.585062] __warn+0xc6/0xe0 [ 432.585065] warn_slowpath_fmt+0x4a/0x50 [ 432.585070] ? _raw_spin_lock_irqsave+0x49/0x60 [ 432.585072] __free_irq+0x9f/0x280 [ 432.585075] free_irq+0x34/0x80 [ 432.585089] e1000_free_irq+0x65/0x70 [e1000e] [ 432.585098] e1000e_pm_freeze+0x7a/0xb0 [e1000e] [ 432.585106] e1000e_pm_suspend+0x21/0x30 [e1000e] [ 432.585113] pci_pm_suspend+0x71/0x140 [ 432.585118] dpm_run_callback+0x6f/0x330 [ 432.585122] ? pci_pm_freeze+0xe0/0xe0 [ 432.585125] __device_suspend+0xea/0x330 [ 432.585128] async_suspend+0x1a/0x90 [ 432.585132] async_run_entry_fn+0x34/0x160 [ 432.585137] process_one_work+0x1f4/0x6d0 [ 432.585140] ? process_one_work+0x16e/0x6d0 [ 432.585143] worker_thread+0x49/0x4a0 [ 432.585145] kthread+0x107/0x140 [ 432.585148] ? process_one_work+0x6d0/0x6d0 [ 432.585150] ? kthread_create_on_node+0x40/0x40 [ 432.585154] ret_from_fork+0x2e/0x40 [ 432.585156] ---[ end trace 6712df7f8c4b9124 ]--- The unwind failures stems from commit 2800209994f8 ("e1000e: Refactor PM flows"), but it may be a later patch that introduced the non-recoverable behaviour. Fixes: 2800209994f8 ("e1000e: Refactor PM flows") Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99847 Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Cc: Jeff Kirsher Cc: Dave Ertman Cc: Bruce Allan Cc: intel-wired-lan@lists.osuosl.org Cc: netdev@vger.kernel.org --- drivers/net/ethernet/intel/e1000e/netdev.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c index eccf1da9356b..429a5210230d 100644 --- a/drivers/net/ethernet/intel/e1000e/netdev.c +++ b/drivers/net/ethernet/intel/e1000e/netdev.c @@ -6615,12 +6615,19 @@ static int e1000e_pm_thaw(struct device *dev) static int e1000e_pm_suspend(struct device *dev) { struct pci_dev *pdev = to_pci_dev(dev); + int rc; e1000e_flush_lpic(pdev); e1000e_pm_freeze(dev); - return __e1000_shutdown(pdev, false); + rc = __e1000_shutdown(pdev, false); + if (rc) { + e1000e_pm_thaw(dev); + return rc; + } + + return 0; } static int e1000e_pm_resume(struct device *dev)