Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1015691pxb; Wed, 6 Apr 2022 06:47:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwM5bN0bLfBp0Py5jEk2ig9zur6Evnuk4n4tllXVqcLmj3nZl90dvGZHgB1XCNus1eoP+eW X-Received: by 2002:a17:90b:1281:b0:1ca:b7e8:1084 with SMTP id fw1-20020a17090b128100b001cab7e81084mr10207509pjb.196.1649252833972; Wed, 06 Apr 2022 06:47:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649252833; cv=none; d=google.com; s=arc-20160816; b=0Quf5w3NdN/I9C+coJvt84kWl0jIbbtRwHU5ausyQUNhI9pg/vLGtgiAfMuktl5ji1 NzG6xkSZCvWJc3O0lcidPimkmOzadxy0lnLJflcSLsWkTK/+oTdGBWjEuWgTo3Z/vnWL oW9S/iZsggPSufJOG3YEsnmx4RDrPfm7bS2GhN8cyU99Nb3iGhNsv57xLiV/YdHhc7/E 4ZXZ6sQA4tSa/CzgYSjvxB30qmDawsnTT8tau/qmHVDkVfiow4ruDsU41c/RuwHWaZ9H nt+MPMYUhP7Yhl3ol7F9AyqjOnxXryFmzEEIIYOl78OaLsjU5wlEBPziKAL7y2m9Vpmn eCfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=n/IB7ZCQdywQNLbYs183BWnG8SCnTqeUSvLmqsptYmk=; b=FZv6VnFyYb5Ho/+X33WNCVZ55VH/r6lwGlXDwmVDqNkaOWlY031MzmThKgxIt7GSnW atsopE+z2bKB/x6yn+GMNOsRi3mkONhD4zs5XfU3BNjh2Fw6IXlOvhKBw9prSiBA4aK+ ivnkkxx4yxufE7PVc6mlppQlXWuuXdpPXA/0CxzXUG+h10boZUBszLLkvOO634lkazvq C0Bs5Q0O/BKDs1rdMfj69TiYQ763SVAkLeVr8Fm6DStCxb4nW5LESp+ZyYLQD0ac/qH7 s2+rytd2AOqXghH6bMaBspdC006hwCSZkFEFGQ96VPaS5tQhV+iiFAhYoJedjPz2eCoW Pcog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=BxM8NniR; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id 64-20020a630243000000b0038273ec0f54si15874003pgc.586.2022.04.06.06.47.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 06:47:13 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=BxM8NniR; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8647A2CF2F9; Wed, 6 Apr 2022 04:42:38 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1455781AbiDEWoH (ORCPT + 99 others); Tue, 5 Apr 2022 18:44:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349467AbiDEJtz (ORCPT ); Tue, 5 Apr 2022 05:49:55 -0400 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55F5FFD1D; Tue, 5 Apr 2022 02:46:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649152006; x=1680688006; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=HZf/S7rVd3q8yY5bhWH8nEyTLZa+T5GesGL7jfopFXY=; b=BxM8NniRHwZrdAKEyoRLdXzc21jdTLEM9ka8fp3n/zXnd+M+0StfBm+k eMR8T0cGhJ6qJ8HA3WOqarsQO+Hy9tneZ49D7KOIgc9Rm2Jy7uvHv8h0L BF02vZexaKVbpoWUnU6ip8r1JbXE29qYrUL9Ea/5rZA82O3NiUfdlr85o cqzzMdhU6wa6XufFvZRehT5+j3GQluyuMm4ryCsxoyJST4FZpe3NIfxzY VdNCAirZJJgpJlKc55AIb9I7T3fTn6peH5Dbutw/ygh7IlJvdbV1M2Y6Z Z/jB2NDvZkkn+ROUt+R+wCIYbD6eNe8Hp1J7GRPDvjQriQzhxoFg/3ZVa w==; X-IronPort-AV: E=McAfee;i="6200,9189,10307"; a="242851251" X-IronPort-AV: E=Sophos;i="5.90,236,1643702400"; d="scan'208";a="242851251" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Apr 2022 02:46:45 -0700 X-IronPort-AV: E=Sophos;i="5.90,236,1643702400"; d="scan'208";a="651826968" Received: from lahna.fi.intel.com (HELO lahna) ([10.237.72.162]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Apr 2022 02:46:43 -0700 Received: by lahna (sSMTP sendmail emulation); Tue, 05 Apr 2022 12:46:40 +0300 Date: Tue, 5 Apr 2022 12:46:40 +0300 From: Mika Westerberg To: "Rafael J. Wysocki" Cc: Linux ACPI , LKML , Linux PM , Linux PCI , Bjorn Helgaas Subject: Re: [PATCH v1 0/3] ACPI: PCI: PM: Power up PCI devices with ACPI companions upfront Message-ID: References: <21439956.EfDdHjke4D@kreacher> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <21439956.EfDdHjke4D@kreacher> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Rafael, On Mon, Apr 04, 2022 at 05:20:30PM +0200, Rafael J. Wysocki wrote: > Hi All, > > There are cases in which the power state of a PCI device depends on an ACPI > power resource (or more of them) in such a way that when the given power > resource is in the "off" state, the PCI device depending on it is in D3cold. > > On some systems, the initial state of these power resources is "off", so the > kernel should not access the config space of PCI devices depending on them, > until the power resources in question are turned "on", but currently that is > not respected during PCI device enumeration. Namely, the PCI device > enumeration code walks the entire bus and enumerates all of the devices it > can find, including the ones whose initial power state in principle depends on > the ACPI power resources in the "off" state. I guess these devices do not have _PRE() method either. > Apparently, most of the time, the config space of such devices is accessible > regardless of the state of the ACPI power resource associated with the PCI > device, so the device enumeration is successful, but there are two potential > issues related to this behavior. First off, even if the given PCI device > is accessible when the ACPI power resource depended on by it is "off", > changing its configuration may confuse the platform firmware and lead to > problems when the ACPI power resource in question is turned "on". Second, > the PCI device may not be actually accessible at all when the ACPI power > resource depended on by it is "off", in which case it won't be found during > the PCI enumeration of devices. > > This patch series addresses that problem by turning "on" all ACPI power > resources depended on by PCI devices before attempting to access the config > space of those devices for the first time. Makes sense. For the series, Reviewed-by: Mika Westerberg