From patchwork Wed Oct 11 04:56:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Drake X-Patchwork-Id: 824214 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=endlessm-com.20150623.gappssmtp.com header.i=@endlessm-com.20150623.gappssmtp.com header.b="TEazXMBi"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3yBhY91ks9z9t5Q for ; Wed, 11 Oct 2017 15:57:17 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751732AbdJKE5O (ORCPT ); Wed, 11 Oct 2017 00:57:14 -0400 Received: from mail-pf0-f179.google.com ([209.85.192.179]:43861 "EHLO mail-pf0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750729AbdJKE5N (ORCPT ); Wed, 11 Oct 2017 00:57:13 -0400 Received: by mail-pf0-f179.google.com with SMTP id a8so80405pfc.0 for ; Tue, 10 Oct 2017 21:57:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=endlessm-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=/AfbZCK9wBK1+I9WOAjI5dJI01MZQ62HHhYnI/AtfsU=; b=TEazXMBi3poDAZ+G0hokzOX0fsXs8ZNNwF2+Niy19htArOsC+dqrZ+u9RmRuhm6aOu bpgyXvfl4yWhG7YfYgSlFPXJ7gYSurocPwFmdukkrhhsCxw3FPYmukVgR5xBJE6/IKbO PU6SCMy3As7itzh83kZS8LobYQ6TgRSS4AzYtKM1VOxVH+cHJ5eac8YmEUJyAyP8cPUm veX1gnEWlq6GGD3QU4hEbAUyEtwbMVwd5z8Rgcm/tNqq7Uj0P+6v5xwcAJUpTv4siTwN j4TogxrTeoitYPIy1eS2QDQvnF6z/s34k4rYZ1lONJ8OlCn+T2tPPbAkxns0/HhxEcaT PAxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=/AfbZCK9wBK1+I9WOAjI5dJI01MZQ62HHhYnI/AtfsU=; b=dFQKXUMNDPb7e+jJPLXxgz52Y3zIfQJF12BNIuAvR1NDNEUdTxqhmXl8dMGUgila/V wQcLIbsHxanCH6vmreTBvtAybB8fCPzoe3+Gfok1/7dbvREXyU+XI4PbgrN5p1+XA92p C1HX0nsnEoPyR9ZQI+flo7bnkbi0ys1TxmzLN9strw/GSluobESnBa0IcickdFjwbmSs Y3MvVBVuN6++AsENO32xcZeTmV8mv6QcR7CyYIieBtK5JBnsz15wXhbLM0o6Yc9HKHAr OF8iUSmGAyJja+VhqEX0wyRk7O/GHDZsrvwozhwP2Tg/YmO1GbgnP4u5l9N4J5rDRSUE BU9Q== X-Gm-Message-State: AMCzsaX87AXPwTxHC6OdlAlgofVpMz/F0HzW83EVKOu332z9CvNJrYYN 2q4EFJTNg3Pp15jkHDeYD+RAUL1r X-Google-Smtp-Source: AOwi7QCUrPLhz22fLznjGBimuTfijJ0hXTK8o8Utq8/S795gMYDMfB9+Grn7wV7N3Fr1T3p+86VmaQ== X-Received: by 10.99.103.5 with SMTP id b5mr14613963pgc.447.1507697832586; Tue, 10 Oct 2017 21:57:12 -0700 (PDT) Received: from localhost.localdomain ([125.227.158.176]) by smtp.gmail.com with ESMTPSA id h1sm23628118pgf.54.2017.10.10.21.57.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Oct 2017 21:57:11 -0700 (PDT) From: Daniel Drake To: nic_swsd@realtek.com Cc: netdev@vger.kernel.org, romieu@fr.zoreil.com, linux@enlessm.com Subject: [PATCH] r8169: only enable PCI wakeups when WOL is active Date: Wed, 11 Oct 2017 12:56:52 +0800 Message-Id: <20171011045652.6301-1-drake@endlessm.com> X-Mailer: git-send-email 2.11.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org rtl_init_one() currently enables PCI wakeups if the ethernet device is found to be WOL-capable. There is no need to do this when rtl8169_set_wol() will correctly enable or disable the same wakeup flag when WOL is activated/deactivated. This works around an ACPI DSDT bug which prevents the Acer laptop models Aspire ES1-533, Aspire ES1-732, PackardBell ENTE69AP and Gateway NE533 from entering S3 suspend - even when no ethernet cable is connected. On these platforms, the DSDT says that GPE08 is a wakeup source for ethernet, but this GPE fires as soon as the system goes into suspend, waking the system up immediately. Having the wakeup normally disabled avoids this issue in the default case. With this change, WOL will continue to be unusable on these platforms (it will instantly wake up if WOL is later enabled by the user) but we do not expect this to be a commonly used feature on these consumer laptops. We have separately determined that WOL works fine without any ACPI GPEs enabled during sleep, so a DSDT fix or override would be possible to make WOL work. Signed-off-by: Daniel Drake --- drivers/net/ethernet/realtek/r8169.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c index e03fcf914690..a3c949ea7d1a 100644 --- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c @@ -8491,8 +8491,6 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) rtl8168_driver_start(tp); } - device_set_wakeup_enable(&pdev->dev, tp->features & RTL_FEATURE_WOL); - if (pci_dev_run_wake(pdev)) pm_runtime_put_noidle(&pdev->dev);