lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 20 Feb 2017 12:43:11 +0000
From:   "Ruinskiy, Dima" <dima.ruinskiy@...el.com>
To:     Chris Wilson <chris@...is-wilson.co.uk>,
        "Kirsher, Jeffrey T" <jeffrey.t.kirsher@...el.com>
CC:     "Ursulin, Tvrtko" <tvrtko.ursulin@...el.com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "intel-wired-lan@...ts.osuosl.org" <intel-wired-lan@...ts.osuosl.org>,
        "Ertman, David M" <david.m.ertman@...el.com>
Subject: RE: [Intel-wired-lan] [PATCH] e1000e: Undo e1000e_pm_freeze if
        __e1000_shutdown fails

>-----Original Message-----

>Fixes: 2800209994f8 ("e1000e: Refactor PM flows")
>Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99847
>Signed-off-by: Chris Wilson <chris@...is-wilson.co.uk>
>Cc: Tvrtko Ursulin <tvrtko.ursulin@...el.com>
>Cc: Jeff Kirsher <jeffrey.t.kirsher@...el.com>
>Cc: Dave Ertman <davidx.m.ertman@...el.com>
>Cc: Bruce Allan <bruce.w.allan@...el.com>
>Cc: intel-wired-lan@...ts.osuosl.org
>Cc: netdev@...r.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)
>--

Looks reasonable. However, can't you get the same result with fewer code lines?
-	return __e1000_shutdown(pdev, false);
+	rc = __e1000_shutdown(pdev, false);
+	if (rc)
+		e1000e_pm_thaw(dev);
+
+	return rc;
---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ