Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9741756pxu; Tue, 29 Dec 2020 03:59:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJybavUfeHkoCeB0U3P+VZxYz66xJxzMUPLpEXJKfcvpG2uAZuPSbh/lpwxRP+f3XVzWAUCI X-Received: by 2002:a17:906:3553:: with SMTP id s19mr44362261eja.95.1609243169117; Tue, 29 Dec 2020 03:59:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609243169; cv=none; d=google.com; s=arc-20160816; b=sauBhoswsOK55nO7o991bGD4WHMrZq3WFf5fqqiR1R4Kk9hW2iFZ4ydEWdneeT52PO PFTDXzLc01bzY/c91bT8wtuVm3DnjH9qBPgP4Yht7/CPdVJxD84y/fJgABuikcLAzaq9 TSxyueZMuBgMu3RCJtrm1mNfGozA3xejwOoNhgXGKihFYxpjAqWwb4P7g2pxUhbjyZip YHOKQzyrBAphVaZDV365VZTc5jz+hWEabO5qNEZJAWse6Sv0Gaga8lNELki6ZsAWRF51 1h4AVHYU7OMca9eeK6HQRt07x/5geiiO40t22THjuuyE44eYjB3rKidTQg+FVfbz9SIP kQng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=q74LhyOMocTQWIe3Ylg6HmsCuTC4QalH4b9SeCz/Lmw=; b=J85AgW9Up2+5O/Its5yM2X83zlN/6+aYgFFHoFE5RJ3Xeop8QBwciMRlmlsxAt+Qyg 0J8M75GZpOm7vsx3Mi5kAJ3GsqboVF+uP/SZJuJO9WXt8BB8XrOTamBARNwiRdp/dqCT MS1W2fKbq3bAiKiyIAFAagtM9padjT6KNYWdH7DlqPRjZngmTJUqSShIS2aW9B9z6IoR fumtvZnTmWPc4i5Qw+pIgXh5ROi9RzFlDG//a8SAwJAL1gBCHnbQqXISdI1tt5DVwjvG XE7U7iH5WD6XoZlHZXNsIv8zEi2IPcg7wq43BHquU5iJpJ/lQnDrdaB5cWIYOComZ3vX /1CQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e24si18811283edc.290.2020.12.29.03.59.05; Tue, 29 Dec 2020 03:59:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726060AbgL2L5O (ORCPT + 99 others); Tue, 29 Dec 2020 06:57:14 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:37171 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725964AbgL2L5M (ORCPT ); Tue, 29 Dec 2020 06:57:12 -0500 Received: from mail-oi1-f197.google.com ([209.85.167.197]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kuDc6-0004kO-HQ for linux-kernel@vger.kernel.org; Tue, 29 Dec 2020 11:56:30 +0000 Received: by mail-oi1-f197.google.com with SMTP id r204so8463458oia.19 for ; Tue, 29 Dec 2020 03:56:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=q74LhyOMocTQWIe3Ylg6HmsCuTC4QalH4b9SeCz/Lmw=; b=gB7cD8cgbJBgWmUJCggzob5fC6p2d5fkGrEIKLY+XLIfz6L7gMrsnDV/pyDuCR3ibP xKBvXP3WwLEeHL9schsVpdidsINXpee/vN3EpCKUgBHGT7DNkVgWBZVSm2zOV+bmMaMh fiC4oliGeD906djdGLzmoONJRRXGARLd4N88Nz8JOD/M4XTjHXVVR5es/mWZL4c8nYZv Qp9NDk6Ysanvu4hBsu7aSLrIDn/ZMyRK/ib7jnbNSW+DcJ/tXFV1XuXdA7xI4ZFcheVC ZBUyMxaQGDcsRu4ZjnzVNoTwUghYizQ4PMoOKcgnwQFTVo0xwi+HhNhDm1oNYtcMI3II QtCA== X-Gm-Message-State: AOAM533qS0PeTKDAPibBEY+1wd86K0aAPZpesbGEM0Sa05GRbo4sb0TJ WShywP/Km9vCy2Q/dWVWXnB5CEo9hPOHO3Dbc5I/wAxDBCAIEIgpLqdi5HKCRg9Y1d10CZTASiY g9ryyGaNezut6lP2GYOLyfRXqvsHW4gKSeeopDhqoxeIq/qyl00GHw2WDNA== X-Received: by 2002:a9d:7411:: with SMTP id n17mr35055822otk.262.1609242989498; Tue, 29 Dec 2020 03:56:29 -0800 (PST) X-Received: by 2002:a9d:7411:: with SMTP id n17mr35055815otk.262.1609242989230; Tue, 29 Dec 2020 03:56:29 -0800 (PST) MIME-Version: 1.0 References: <79940973-b631-90f9-dbc4-9579c6000816@gmail.com> <20201117163817.GA1397220@bjorn-Precision-5520> In-Reply-To: From: Kai-Heng Feng Date: Tue, 29 Dec 2020 19:56:17 +0800 Message-ID: Subject: Re: Time to re-enable Runtime PM per default for PCI devcies? To: Heiner Kallweit Cc: "Rafael J. Wysocki" , Bjorn Helgaas , "Rafael J. Wysocki" , Bjorn Helgaas , Mika Westerberg , Lukas Wunner , "linux-pci@vger.kernel.org" , Linux PM , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Dec 26, 2020 at 11:26 PM Heiner Kallweit wrote: > > On 17.11.2020 17:57, Rafael J. Wysocki wrote: > > On Tue, Nov 17, 2020 at 5:38 PM Bjorn Helgaas wrote: > >> > >> [+to Rafael, author of the commit you mentioned, > >> +cc Mika, Kai Heng, Lukas, linux-pm, linux-kernel] > >> > >> On Tue, Nov 17, 2020 at 04:56:09PM +0100, Heiner Kallweit wrote: > >>> More than 10 yrs ago Runtime PM was disabled per default by bb910a7040 > >>> ("PCI/PM Runtime: Make runtime PM of PCI devices inactive by default"). > >>> > >>> Reason given: "avoid breakage on systems where ACPI-based wake-up is > >>> known to fail for some devices" > >>> Unfortunately the commit message doesn't mention any affected devices > >>> or systems. > > > > Even if it did that, it wouldn't have been a full list almost for sure. > > > > We had received multiple problem reports related to that, most likely > > because the ACPI PM in BIOSes at that time was tailored for > > system-wide PM transitions only. > > > > To follow up on this discussion: > We could call pm_runtime_forbid() conditionally, e.g. with the following > condition. This would enable runtime pm per default for all non-ACPI > systems, and it uses the BIOS date as an indicator for a hopefully > not that broken ACPI implementation. However I could understand the > argument that this looks a little hacky .. > > if (IS_ENABLED(CONFIG_ACPI) && dmi_get_bios_year() <= 2016) dmi_get_bios_year() may not be a good indicator. Last time I used it caused regression, because the value changed after BIOS update. For example, my MacBook Pro is manufactured in 2011, but dmi_get_bios_year() returns 2018 with latest BIOS. Kai-Heng > > > > >>> With Runtime PM disabled e.g. the PHY on network devices may remain > >>> powered up even with no cable plugged in, affecting battery lifetime > >>> on mobile devices. Currently we have to rely on the respective distro > >>> or user to enable Runtime PM via sysfs (echo auto > power/control). > >>> Some devices work around this restriction by calling pm_runtime_allow > >>> in their probe routine, even though that's not recommended by > >>> https://www.kernel.org/doc/Documentation/power/pci.txt > >>> > >>> Disabling Runtime PM per default seems to be a big hammer, a quirk > >>> for affected devices / systems may had been better. And we still > >>> have the option to disable Runtime PM for selected devices via sysfs. > >>> > >>> So, to cut a long story short: Wouldn't it be time to remove this > >>> restriction? > >> > >> I don't know the history of this, but maybe Rafael or the others can > >> shed some light on it. > > > > The systems that had those problems 10 years ago would still have > > them, but I expect there to be more systems where runtime PM can be > > enabled by default for PCI devices without issues. > > >