Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1954409ybl; Thu, 5 Dec 2019 09:32:44 -0800 (PST) X-Google-Smtp-Source: APXvYqwT4tJxjoWkoyZUXVe97GzeaQ7/aGa2H+EDyHT7sMsFXK5wO93DsdLKMonGfgVZlveeBJMe X-Received: by 2002:aca:530e:: with SMTP id h14mr7831457oib.105.1575567164840; Thu, 05 Dec 2019 09:32:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575567164; cv=none; d=google.com; s=arc-20160816; b=f7m7Q+ViOS2OwKj7FISp9XvZCV+hkk9Rdl06/j0T1kmF/1FJLwYQZoSAY+4TmOfhpb 5HCdLBztuMoux9jyXpEBw/1hZgoEShF5sAfNB5ErakH0sINqTE3M4wDmJnmgqTCi8drl 1tovRsDI04Q38RGIu4TY+nln+FtQRewNzTR4N8Tq9T93QGo83T8J9+CUrOiWjgHOKgkP GXDi9vz96+ha1XKjbXOJIrdtDlwZAtTPxKErOUGYh0LYQsDmZagfOpYNBwGg1JhGJm83 cXvVKhNNNVMS2B5uM+8V8lIh396yXbzh9krm+bhWqo4Lnhwf+a4nxpqx1VAK0YQiOazk 62Mg== 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 :references:in-reply-to:date:cc:to:reply-to:from:subject:message-id; bh=pXLsP0NAElgax+RQoTuMPw8j3UxjTcV4xjlAxeBZyOI=; b=V/1+TUZVo/MAMpfGk8W81mMvBIFGlSKAOpX7u3WlzA9MJRlMi+zfEw9KuncfuqOyqj +QIW0JtDl3vXuPoxxSwQNC+7kDY+rlAGswmC1WHS77lG/osUOjBWp9nyElg179x7ffxE oKven/unnuKgv1bxX//tVCOMdmp433J0GvG89lSMUPEWgHC5gwDbqM53KfJt9aYNmHWF yJNsyYBZOtdBRiMeYQRpFhrXP97emPVyXa/YE69XcjypWmnjyCZQWLYsJHm3CW1DJIbO b8+AtmsI9o8GkdmysKscEY7addasTYWXNzpZz/2PKL/a7Y9ts3NEOdVZalY+ko/rtCHP j2yA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k125si3570726oif.166.2019.12.05.09.32.31; Thu, 05 Dec 2019 09:32:44 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730033AbfLERbv (ORCPT + 99 others); Thu, 5 Dec 2019 12:31:51 -0500 Received: from mga09.intel.com ([134.134.136.24]:50971 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729396AbfLERbv (ORCPT ); Thu, 5 Dec 2019 12:31:51 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Dec 2019 09:31:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,282,1571727600"; d="scan'208";a="209217337" Received: from pdemke-mobl.amr.corp.intel.com ([10.251.20.175]) by fmsmga007.fm.intel.com with ESMTP; 05 Dec 2019 09:31:49 -0800 Message-ID: <56a33219fc336c26b8ef9d8de1a3d50893a7b7d1.camel@linux.intel.com> Subject: Re: [PATCH] ACPI: PM: Avoid attaching ACPI PM domain to certain devices From: Todd Brandt Reply-To: todd.e.brandt@linux.intel.com To: Zhang Rui , "Rafael J. Wysocki" , Linux ACPI Cc: LKML , Linux PM , "Brandt, Todd E" Date: Thu, 05 Dec 2019 09:32:09 -0800 In-Reply-To: <2991d01601fdbcf25d745a387eda74926f1192b2.camel@intel.com> References: <1773028.iBGNyVBcMc@kreacher> <2991d01601fdbcf25d745a387eda74926f1192b2.camel@intel.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2019-12-04 at 22:04 +0800, Zhang Rui wrote: > On Wed, 2019-12-04 at 02:54 +0100, Rafael J. Wysocki wrote: > > 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. > > Sure, Todd and I will re-run stress test with this patch applied when > 5.5-rc1 released. I've applied it 5.4.0 and will do a full stress test run this weekend in the lab (where 7 out of 20 machines have this issue). The kernel will be called "5.4.0-acpifanfix", and the data should be ready Sunday Dec 8. This is the issue I'll test for: https://bugzilla.kernel.org/show_bug.cgi?id=204321 > > thanks, > rui > > > > > 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; > > > > /* > > > > > > > >