Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2068287ybl; Tue, 3 Dec 2019 17:55:57 -0800 (PST) X-Google-Smtp-Source: APXvYqyYmOr80OeSoIitj7L3CGCa8eGnPgqn8U6ie08tiM0nUvPTtolTwnt+FUH0mqW78E8vIBSN X-Received: by 2002:aca:52c4:: with SMTP id g187mr672637oib.76.1575424557748; Tue, 03 Dec 2019 17:55:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575424557; cv=none; d=google.com; s=arc-20160816; b=cQHo5Kj7LADa+JXRQgpnPBOztxslDMFc18gAhuteheyBCJ9PvXstXDlrCCc1A1SBbC kObaJ9Lowo32jVvP5Y9JSPqBe6j8gGawu1nS+mUwEjSTjXbLZo3QKVxUgkoS4GXRrNrs FolcBQlrWDQ2LA2uknz6OuxIkKcd+fJKieUd+SNdCVrOOGkAPDbqwnqWWiDafCIFBh/h pc6qbFuLroEy9H75Oj1aVU8Dbt5w2wyW7vL/s5RRFVzqicLGazVzjcebKpgNzoyhB1lt Kxfe1o76MvVnJ5QNFMGZQKMVSCfeiI6vmjvrw8NfTqjzNtdIXiRzX1zUS2FHSBanp9Eg hScw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=3wVSmSKQ7eSM7LUcgW5j5fH7mlQrXAiYKQA/FAyQrF4=; b=UppA9vzfWiVwpgKz8AaJYaKWp/PluPn8kdK/xuUUEPPuHytHdN6ok/Py/ZOUWIr6JQ nNhwHGlybCYgz6BaE1CtBbN6e4CGPUB6jCeV2eCMYDz+tqZIuEtwHAoqV4TfeRy2JUG6 msgCpVX1STzt8wL5htbqCY7wUs8nen29HwCblNso/0iBpHqo1hfbLP1QLc4Is8Oj9+6B BWUCL1I8PUHN8/e5GtoZuxTR33mZIAIXGgUFuTJZuLww4XitcV2qmcD3wx6CtUnmgyiJ MT07BXknyUBeVw7Lt/8COM7794sTlrh+vrJTGvHWQ8lZEjTTM5uZXEk8uJdtL4/At6jI ZTwQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k8si2790461otf.76.2019.12.03.17.55.45; Tue, 03 Dec 2019 17:55:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726823AbfLDBya (ORCPT + 99 others); Tue, 3 Dec 2019 20:54:30 -0500 Received: from cloudserver094114.home.pl ([79.96.170.134]:44328 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726189AbfLDBya (ORCPT ); Tue, 3 Dec 2019 20:54:30 -0500 Received: from 79.184.254.100.ipv4.supernova.orange.pl (79.184.254.100) (HELO kreacher.localnet) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.320) id faa3772347af143e; Wed, 4 Dec 2019 02:54:27 +0100 From: "Rafael J. Wysocki" To: Linux ACPI , Zhang Rui Cc: LKML , Linux PM Subject: [PATCH] ACPI: PM: Avoid attaching ACPI PM domain to certain devices Date: Wed, 04 Dec 2019 02:54:27 +0100 Message-ID: <1773028.iBGNyVBcMc@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafael J. Wysocki Certain ACPI-enumerated devices represented as platform devices in Linux, like fans, require special low-level power management handling implemented by their drivers that is not in agreement with the ACPI PM domain behavior. That leads to problems with managing ACPI fans during system-wide suspend and resume. For this reason, make acpi_dev_pm_attach() skip the affected devices by adding a list of device IDs to avoid to it and putting the IDs of the affected devices into that list. Fixes: e5cc8ef31267 (ACPI / PM: Provide ACPI PM callback routines for subsystems) Reported-by: Zhang Rui Cc: 3.10+ # 3.10+ Signed-off-by: Rafael J. Wysocki --- Rui, Please test this on the machine(s) affected by the fan suspend/resume issues. I don't really see any cleaner way to address this problem, because the ACPI PM domain should not be used with the devices in question even if the driver that binds to them is not loaded. Cheers, Rafael --- drivers/acpi/device_pm.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) Index: linux-pm/drivers/acpi/device_pm.c =================================================================== --- linux-pm.orig/drivers/acpi/device_pm.c +++ linux-pm/drivers/acpi/device_pm.c @@ -1314,9 +1314,19 @@ static void acpi_dev_pm_detach(struct de */ int acpi_dev_pm_attach(struct device *dev, bool power_on) { + /* + * Skip devices whose ACPI companions match the device IDs below, + * because they require special power management handling incompatible + * with the generic ACPI PM domain. + */ + static const struct acpi_device_id special_pm_ids[] = { + {"PNP0C0B", }, /* Generic ACPI fan */ + {"INT3404", }, /* Fan */ + {} + }; struct acpi_device *adev = ACPI_COMPANION(dev); - if (!adev) + if (!adev || !acpi_match_device_ids(adev, special_pm_ids)) return 0; /*