Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2296130ybl; Thu, 19 Dec 2019 11:10:00 -0800 (PST) X-Google-Smtp-Source: APXvYqzMHDrppKIQYwDFcEIdgTxtu8FN+hZ8tz1c/IqHMpxH2D2Jpf/etOIOdaFeZ0XNCbcr4Xlt X-Received: by 2002:a9d:7852:: with SMTP id c18mr5589900otm.247.1576782600694; Thu, 19 Dec 2019 11:10:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576782600; cv=none; d=google.com; s=arc-20160816; b=lz3eiCp6VV41Ut7K2ig1FABv8sHHwaXC+gA1dXZ1WyIPOSJnZ/6pLkxdhJ800dPwr9 vUuHvYKqgBkuaxk6Lxg67OVJAeabhtgHV3eI92tNnn25btndFcqn2HwWwqEWB9cVILC4 3FIxCo/kiqXg81Q0aUjnKEJLrnyly+7LNxhD57fL8i48blfA1MWKOyHxpwh1LYv+V7h0 KYlU62LnIKrGP01uNjSHPkZ0OxuiJ/030AovEjm5hxSfthL4cAb7xmtFlZrK4fn8w1yF 3MwM/DtyRDjbXmTMrMTO4moGxogyMFKFeIfTPu2zcobkhSc+CkZmFPHffD79XgOp/m6c u4Cw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ezHNEZ2ifWMTxeKBXjuNijEP05Q7ADHMNFfDM/ySyV4=; b=U8eHyTdxFOdHl+9/j2BKgk5kIA8FPLiqleBGnTUp2+UAjkZsMrEpvSNNxhO/9p/2xw qG6QWx/own1YOfBORdEv1fUvH9ctn2jQ9t8t7eb2pWhNcy7HIk6oG664YHUjBn/lNqqg XjBYMD0Jm+FrQFlNSn+5YKvBogEhkiJdadF5lQM5kFe191Bopx/pGUpaUBJ8iXHtrghZ W0Ur0E8l28OPkE9rcalH1p2rni2Bv0XT0/EU8Xou0Nr02nGyB4lBgJUpfNEBlXlNfvBg BxsVKGXKtKd/siJEsdCwtx8i3MRLlne2WD+fEvNGa6fKAMOlt7JQAGBJif+KvzE5hpyx ZW7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uzSUessM; 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 j24si232081otk.76.2019.12.19.11.09.48; Thu, 19 Dec 2019 11:10:00 -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; dkim=pass header.i=@kernel.org header.s=default header.b=uzSUessM; 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 S1728519AbfLSSlU (ORCPT + 99 others); Thu, 19 Dec 2019 13:41:20 -0500 Received: from mail.kernel.org ([198.145.29.99]:60304 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728493AbfLSSlS (ORCPT ); Thu, 19 Dec 2019 13:41:18 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7A9F7206D7; Thu, 19 Dec 2019 18:41:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576780877; bh=2vz1lTBp9Krlp9jKW8W+bMuDkeHO+WBtwPp8GG0EyYE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uzSUessMxSCRNUNC4hJkQ6Er04ozmAKHzwghjcIMxO08XbpqucyuHGNpEHyMQuVKq Fx7SyCKAjEKFgt4llbDwSxr4f5LCAUPwg9L5GqDoji68o3BY46b5+oNlr6e1dNiuW3 lyc2+liEnUMXx4tw0I+F+TV8ANMSd/Fti5FfKYEc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zhang Rui , Todd Brandt , "Rafael J. Wysocki" Subject: [PATCH 4.4 116/162] ACPI: PM: Avoid attaching ACPI PM domain to certain devices Date: Thu, 19 Dec 2019 19:33:44 +0100 Message-Id: <20191219183214.819142561@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191219183150.477687052@linuxfoundation.org> References: <20191219183150.477687052@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafael J. Wysocki commit b9ea0bae260f6aae546db224daa6ac1bd9d94b91 upstream. 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 Tested-by: Todd Brandt Cc: 3.10+ # 3.10+ Signed-off-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman --- drivers/acpi/device_pm.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) --- a/drivers/acpi/device_pm.c +++ b/drivers/acpi/device_pm.c @@ -1094,9 +1094,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 -ENODEV; if (dev->pm_domain)