Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp5137761rwp; Sun, 16 Jul 2023 20:53:57 -0700 (PDT) X-Google-Smtp-Source: APBJJlEbpwujlSho9BseCIUTj3RfGPYucEPYx+NaIeeMsImV4zdrNNQ2CY+NL5a/aa/MtmxGNt+Q X-Received: by 2002:a05:6a00:99c:b0:675:8521:ddc7 with SMTP id u28-20020a056a00099c00b006758521ddc7mr6284349pfg.0.1689566037373; Sun, 16 Jul 2023 20:53:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689566037; cv=none; d=google.com; s=arc-20160816; b=u3dJgRIo/bjZjXYIOz1gYCeuZthmneTz773i8upAhKDXLJJTBafwcHCYgHrgvGbu03 lIecRroSunJhwK23wbsXnN/USVfTr8lnVkAH/zDJRJHkZt6x0s2+x03MuxP/lVktQupq fKOyYfa/PBL2MmnYQDQe4oX9nhVirS7jmNA+V2J5twxzKwfXdAKd3zVM/gRbl70RvqLY ZcupVFj04MjvCD+QgZp5jNxAXU2kpyYyzb/xoNzgqUaBegWPvK1m4y3z6MY+hgt/Bps0 F9BGdsSUX1QTzO1vs6Spm1T8F+tbSECxUw60HdaAi/VFYXbNg9JJleS7cB0d8/jw9hPW kiRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=DnRdLOx1Ivb7fT2g6W01ng/Xf0iUV7nR0rj9XNZC/LM=; fh=uQs0A3RSd89yt2O5+9B8xN9oNCGE3kYuLh3WF6FcoGg=; b=OACM2Q1hc/BZgMt5civDE5NtwpAt36MmVzWsF+vxuxcx8oN2e3mcxOGvRxxkVnLizw 7O3LN9F0X71j+4PbM05EK7mItdlW2BWpOlXUwwGWovCRwyFsmI2nTr3WtM1t9KSyfZxI fKU5DIpVOJ9iQlKdsC/TznrdD+wi0YPeXzFzgOwkErVWwuqJyotuIsv/I/fbLY6OWMMD OT9sR5h5uAgMsRouF9D/aQRtU3z3ZkLBFpjLaDPD2do5F26d8Aw5R/MslgRHtZHt3FNw 1WZI0PBij4vXg0dDFqLZO36ViwZQbrPX9M7UAOYnzuKtsJg3bh/KqyZAPVyNCkKhtF7l 8Vkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=kLPh7o4u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cb13-20020a056a00430d00b006819405e9d9si10747162pfb.145.2023.07.16.20.53.45; Sun, 16 Jul 2023 20:53:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=kLPh7o4u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229579AbjGQDe3 (ORCPT + 99 others); Sun, 16 Jul 2023 23:34:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229476AbjGQDe0 (ORCPT ); Sun, 16 Jul 2023 23:34:26 -0400 Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4667BEC for ; Sun, 16 Jul 2023 20:34:25 -0700 (PDT) Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 0FAC83F1C6 for ; Mon, 17 Jul 2023 03:34:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1689564863; bh=DnRdLOx1Ivb7fT2g6W01ng/Xf0iUV7nR0rj9XNZC/LM=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=kLPh7o4uKOF3cFVFLER/SNzh0npZ37TN4KWCy1/fbTwp40uiW2KK+vjyqKtQXBwkL bBt3egiM6OJJIEwQNg3SjK4U53r29xERObxZILm0ideAy9R77NRg4iI2eLgNAdmAf1 4jPDcUasKx0MUbE/IMufY7vd6BTwfl5uAPcAHAY/0EUQYRYQ6Pt1n49mlA2X9iQ8eG qCPL52VBwquQ9UbK3AAtVi+nPlUf5W3auZ5lRqumiQdKfZaRP3QTlM/gaiENzwfyfX 1hJtwKNNmLhUqLT/KQlE6+MknpRa81tbD+WSM3284bSnQyBgp2kw43NDGhMnP2p5nE lLLQSVfmEff8w== Received: by mail-qt1-f197.google.com with SMTP id d75a77b69052e-40355a81f5aso51108681cf.3 for ; Sun, 16 Jul 2023 20:34:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689564862; x=1692156862; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DnRdLOx1Ivb7fT2g6W01ng/Xf0iUV7nR0rj9XNZC/LM=; b=LDcwKGBtn7WTN+0cplomzgyipKbInoAN6l3KzpVMgynTrJgQpu5qrpHFJxtSBTEArD /5ehKYe2tAzdc2m8/X/LW10yKvDMNY6WGVBhhUiNQSRUNDAF+sfA0L5CdJQjWWPyOWM6 xvJkFD9UI3K3cPOwA4pLGrgmFgGva89PqOyTJETv8h4ViRuP3V+4jXsn5jdHDnqbVPcS 8nJGzQQcXxByiivNWzcGGiG2xUuZygwl+E5MKBNy7tUvn89jZvBw2VTWrqWPDTygsgnA YxUFamAtjiVVvpWVIaRLOzhbJ8W66hZrX3wmSArMMU1rFAKtV1v44F0fqFKf/ohDy82T /hYQ== X-Gm-Message-State: ABy/qLYpGXgPv1vWcKB/fsE9XEtLbq583HttzNMgX1rMazFePgaT/lx/ 4lQk6+Yo26ZY2vylMud4UBzPnRDrR6DGg2REs3IgWNyEY5fVsfIy0sJKReF1NG2ywJKYIWXAO7t dmTBhg034xJDafS8QciuRPfqwiqaDmbPFyXgu7fBtX65RSBq0mJlKrZfCDw== X-Received: by 2002:a05:622a:1113:b0:403:eb71:1fa6 with SMTP id e19-20020a05622a111300b00403eb711fa6mr3643088qty.5.1689564861894; Sun, 16 Jul 2023 20:34:21 -0700 (PDT) X-Received: by 2002:a05:622a:1113:b0:403:eb71:1fa6 with SMTP id e19-20020a05622a111300b00403eb711fa6mr3643069qty.5.1689564861653; Sun, 16 Jul 2023 20:34:21 -0700 (PDT) MIME-Version: 1.0 References: <20230705200617.GA72825@bhelgaas> <9d1095ab-23e5-3df3-58d6-b2974f87ee72@amd.com> <60b2f5fb-8294-d104-16d8-0acfc70426c1@amd.com> In-Reply-To: <60b2f5fb-8294-d104-16d8-0acfc70426c1@amd.com> From: Kai-Heng Feng Date: Mon, 17 Jul 2023 11:34:10 +0800 Message-ID: Subject: Re: [Intel-wired-lan] [PATCH] PCI/ASPM: Enable ASPM on external PCIe devices To: Mario Limonciello Cc: Bjorn Helgaas , Kuppuswamy Sathyanarayanan , linux-pci@vger.kernel.org, "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, Vidya Sagar , Michael Bottini , intel-wired-lan@osuosl.org, bhelgaas@google.com, Mika Westerberg Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 On Sat, Jul 15, 2023 at 12:37=E2=80=AFAM Mario Limonciello wrote: > > On 7/14/23 03:17, Kai-Heng Feng wrote: > > On Thu, Jul 6, 2023 at 12:07=E2=80=AFPM Mario Limonciello > > wrote: > >> > >> On 7/5/23 15:06, Bjorn Helgaas wrote: > >>> On Wed, Jun 28, 2023 at 01:09:49PM +0800, Kai-Heng Feng wrote: > >>>> On Wed, Jun 28, 2023 at 4:54=E2=80=AFAM Bjorn Helgaas wrote: > >>>>> On Tue, Jun 27, 2023 at 04:35:25PM +0800, Kai-Heng Feng wrote: > >>>>>> On Fri, Jun 23, 2023 at 7:06=E2=80=AFAM Bjorn Helgaas wrote: > >>>>>>> On Tue, Jun 20, 2023 at 01:36:59PM -0500, Limonciello, Mario wrot= e: > >>> > >>>>> It's perfectly fine for the IP to support PCI features that are not > >>>>> and can not be enabled in a system design. But I expect that > >>>>> strapping or firmware would disable those features so they are not > >>>>> advertised in config space. > >>>>> > >>>>> If BIOS leaves features disabled because they cannot work, but at t= he > >>>>> same time leaves them advertised in config space, I'd say that's a > >>>>> BIOS defect. In that case, we should have a DMI quirk or something= to > >>>>> work around the defect. > >>>> > >>>> That means most if not all BIOS are defected. > >>>> BIOS vendors and ODM never bothered (and probably will not) to chang= e > >>>> the capabilities advertised by config space because "it already work= s > >>>> under Windows". > >>> > >>> This is what seems strange to me. Are you saying that Windows never > >>> enables these power-saving features? Or that Windows includes quirks > >>> for all these broken BIOSes? Neither idea seems very convincing. > >>> > >> > >> I see your point. I was looking through Microsoft documentation for > >> hints and came across this: > >> > >> https://learn.microsoft.com/en-us/windows-hardware/customize/power-set= tings/pci-express-settings-link-state-power-management > >> > >> They have a policy knob to globally set L0 or L1 for PCIe links. > >> > >> They don't explicitly say it, but surely it's based on what the device= s > >> advertise in the capabilities registers. > > > > So essentially it can be achieved via boot time kernel parameter > > and/or sysfs knob. > > > > The main point is OS should stick to the BIOS default, which is the > > only ASPM setting tested before putting hardware to the market. > > Unfortunately; I don't think you can jump to this conclusion. > > A big difference in the Windows world to Linux world is that OEMs ship > with a factory Windows image that may set policies like this. OEM > "platform" drivers can set registry keys too. Thanks. This is new to me. > > I think the next ASPM issue that comes up what we (collectively) need to > do is compare ASPM policy and PCI registers for: > 1) A "clean" Windows install from Microsoft media before all the OEM > drivers are installed. > 2) A Windows install that the drivers have been installed. > 3) A up to date mainline Linux kernel. > > Actually as this thread started for determining policy for external PCIe > devices, maybe that would be good to check with those. Did that before submitting the patch. From very limited devices I tested, ASPM is enabled for external connected PCIe device via TBT ports. I wonder if there's any particular modification should be improved for this patch? Kai-Heng > > > > > Kai-Heng > > > >> > >>>>>> So the logic is to ignore the capability and trust the default set > >>>>>> by BIOS. > >>>>> > >>>>> I think limiting ASPM support to whatever BIOS configured at boot-t= ime > >>>>> is problematic. I don't think we can assume that all platforms hav= e > >>>>> firmware that configures ASPM as aggressively as possible, and > >>>>> obviously firmware won't configure hot-added devices at all (in > >>>>> general; I know ACPI _HPX can do some of that). > >>>> > >>>> Totally agree. I was not suggesting to limiting the setting at all. > >>>> A boot-time parameter to flip ASPM setting is very useful. If none h= as > >>>> been set, default to BIOS setting. > >>> > >>> A boot-time parameter for debugging and workarounds is fine. IMO, > >>> needing a boot-time parameter in the course of normal operation is > >>> not OK. > >>> > >>> Bjorn > >> >