Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5576588rdb; Wed, 13 Dec 2023 12:45:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IERnVEhF0LNBMO59/ECeXRhl794R+yC1ljHYFkBivGhtT1rka2q9HRp78SjS8Cwggy6AxrG X-Received: by 2002:a05:6a21:998a:b0:190:cab:b3d4 with SMTP id ve10-20020a056a21998a00b001900cabb3d4mr10131118pzb.30.1702500351780; Wed, 13 Dec 2023 12:45:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702500351; cv=none; d=google.com; s=arc-20160816; b=oHhtuQ7KyN7UqE9L3IqPIJVCrvUvNWwh/URVOIEvvu+MNVwgo/y2ZumIreAJ3AO6RW NpG85YEdjwfV2sbnw+MvJZCpVWL9UTuptGA7ZPWWP2yZMEveaoaF0bfcAZ8L6sna5ZG1 uTgtJhdKe6I8+z96fjj3ISE+mmAjFm+gfol2N63KR9YYFz92cS80EEL8cQWJAPhljNIL wpnhPioz+2TbgcNqmRxEQZ0g6HXMatAwqHvtEys5i/KkgxL0NfKUoyPNR8qcXYApmsiI Ts/400NU+g7BTe4a/L66AQOIf10CuNflismjQJcNTxvWF1cOwAdLIHnUARuXcbXZPNn4 P5/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:message-id:subject:cc:to:from:date :dkim-signature; bh=Su8wEeIVdC3uT8wOFz5Ut/B7OdcGjSGe70n4QRJcI1A=; fh=lKFBgP0T/fbyZ0ihksNIz1okUZNpkfsf+zc36zC0SYU=; b=lcaeYqtQ/84SuwU/5hwG5DTC/hGrWU3ole+dLQtkQyuG/SUhQ3u4ISjlOWRn9JvD7D ukM14z9LelNXnZYGG4lvGaEpFemIQ1emR5vWw7qqKFp/txgsAnJskcwd9t5O0HQyC0FJ ucuGpsPkfdT1f+ZADZB7yaudONiGPjV/N4CyksIIdTeHxVh+8esYU5BUBa4ZIMoMWVmv eN6IyWt/a+U7QY2hGEgqfcJ7O4pB/ezr5/EovLAS6jQObLOtBVv/zMRsC5ZUoDXc3DSi a4RRanQQD5FJnV48/Z6Z6/NKdfY1ssdBi3587g8UzzrSwbSjhgL2kXxTBx8V11QmKX46 ZjCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jU0biiVw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id k82-20020a628455000000b006ce97669ffcsi10112790pfd.387.2023.12.13.12.45.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 12:45:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jU0biiVw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 5D8B280822F0; Wed, 13 Dec 2023 12:45:29 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233702AbjLMUpJ (ORCPT + 99 others); Wed, 13 Dec 2023 15:45:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229671AbjLMUpI (ORCPT ); Wed, 13 Dec 2023 15:45:08 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D54EAF for ; Wed, 13 Dec 2023 12:45:14 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F0203C433C8; Wed, 13 Dec 2023 20:45:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702500314; bh=CctU/GXFsJ6lkzjLDWKmTw9Q8WHFXHMPsA3fF1u3ins=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=jU0biiVwBqqCmMPRcXhKvCDlf5/4gMNy06byWaEFkVgA+mOoYcSVBKhWycLe60QTE dPvQSQLQjGzSLvS8QGPNwrQeuVTpyPReHAkMKGJHFmX3rdhvv+dELhJDUMEAfJ+HLk GfQEns7Arnq4/Oi6o4IGLO3QDuXI/fTGO4yFdypXzodmQkGQ9fsdMFqWZxhmnRbq4G kqD/6D/kkoyBkuYABDuS1FFHFSZVuQ9ijv9eyXeC9LaJF++Bh6LghOcFJNzH783MG3 TAmWPGpxmnmCqlnxz7pJfrPrJYSqJ1EnfQw2WlUR5D2ABvELju644Ai3BM7nvbUoc+ NiS6BH/jeSW0g== Date: Wed, 13 Dec 2023 14:45:12 -0600 From: Bjorn Helgaas To: "David E. Box" Cc: Kai-Heng Feng , Johan Hovold , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Bjorn Helgaas , Andy Gross , Bjorn Andersson , Konrad Dybcio , Manivannan Sadhasivam , Rob Herring , Nirmal Patel , Jonathan Derrick , linux-arm-msm@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Manivannan Sadhasivam Subject: Re: [PATCH v2 1/6] PCI/ASPM: Add locked helper for enabling link state Message-ID: <20231213204512.GA1056289@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <970144d9b5c3d36dbd0d50f01c1c4355cd42de89.camel@linux.intel.com> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, 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 howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 13 Dec 2023 12:45:29 -0800 (PST) On Wed, Dec 13, 2023 at 11:48:41AM -0800, David E. Box wrote: > On Tue, 2023-12-12 at 15:27 -0600, Bjorn Helgaas wrote: > > On Tue, Dec 12, 2023 at 11:48:27AM +0800, Kai-Heng Feng wrote: > > > On Fri, Dec 8, 2023 at 4:47 AM Bjorn Helgaas wrote: > > > ... > > > > > > I hope we can obsolete this whole idea someday.  Using pci_walk_bus() > > > > in qcom and vmd to enable ASPM is an ugly hack to work around this > > > > weird idea that "the OS isn't allowed to enable more ASPM states than > > > > the BIOS did because the BIOS might have left ASPM disabled because it > > > > knows about hardware issues."  More history at > > > > https://lore.kernel.org/linux-pci/20230615070421.1704133-1-kai.heng.feng@canonical.com/T/#u > > > > > > > > I think we need to get to a point where Linux enables all supported > > > > ASPM features by default.  If we really think x86 BIOS assumes an > > > > implicit contract that the OS will never enable ASPM more > > > > aggressively, we might need some kind of arch quirk for that. > > > > > > The reality is that PC ODM toggles ASPM to workaround hardware > > > defects, assuming that OS will honor what's set by the BIOS. > > > If ASPM gets enabled for all devices, many devices will break. > > > > That's why I mentioned some kind of arch quirk.  Maybe we're forced to > > do that for x86, for instance.  But even that is a stop-gap. > > > > The idea that the BIOS ASPM config is some kind of handoff protocol is > > really unsupportable. > > To be clear, you are not talking about a situation where > ACPI_FADT_NO_ASPM or _OSC PCIe disallow OS ASPM control, right? > Everyone agrees that this should be honored? The question is what to > do by default when the OS is not restricted by these mechanisms? Exactly. The OS should respect ACPI_FADT_NO_ASPM and _OSC. I think there are a couple exceptions where we want to disable ASPM even if the platform said the OS shouldn't touch ASPM at all, but that's a special case. > Reading the mentioned thread, I too think that using the BIOS config > as the default would be the safest option, but only to avoid > breaking systems, not because of an implied contract between the > BIOS and OS. However, enabling all capable ASPM features is the > ideal option. If the OS isn't limited by ACPI_FADT_NO_ASPM or _OSC > PCIe, then ASPM enabling is fully under its control. If this > doesn't work for some devices then they are broken and need a quirk. Agreed. It may not be practical to identify such devices, so we may need a broader arch-based and/or date-based quirk. I'd be shocked if Windows treated the BIOS config as a "do not exceed this" situation, so my secret hope is that some of these "broken" devices are really caused by defects in the Linux ASPM support or the driver, and that we can fix them if we find out about them. But I have no details about any of these alleged broken devices, so it's hard to make progress on them. Maybe we should log a debug note if the device advertises ASPM support that BIOS didn't enable. Bjorn