Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp17375533rwd; Tue, 27 Jun 2023 02:01:58 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5N1tKmzS2rInVIOQ2aP8ckaa2PMxa2npbsV46YosUqTOFq2FQxjrMP1mluUp9TkjFuNUjv X-Received: by 2002:a05:6a00:1a0f:b0:668:8705:57dd with SMTP id g15-20020a056a001a0f00b00668870557ddmr20019552pfv.28.1687856518378; Tue, 27 Jun 2023 02:01:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687856518; cv=none; d=google.com; s=arc-20160816; b=K5AfvWIwWh6xAqlYr144E5fm4ahdcJrnaCZjpK6SW1zGFUVOKmcYWQb563r05x9qT5 5PEuLBcvl3ohJaZJhSXZd4SZCMTNnXyEzo4QvdyR4A96Bx4hJTS2HJ7M1DEPli5owBoR 0KggILahgURE+RnqWwx/BY4GxKVPob4tqG934NUejDoXUa+IYF2odfazaGgq7gih2Wd6 p0OHlR2062HfBc/nklPOI9KvN2bWH7VRDCg3hi3lNyoeP5o7yNGbznbPCbO3kF3StSyk tVmCVnAcMt1ekeu4bHrafnyJHgtHy0+z3nyXk1kBXsiAldwqCawY2sAl3omQiR/It0s/ c4eQ== 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=cRPd42UjLsQHHlZk9zoi1NoFgO3UAhUdUSvEc9A0iZk=; fh=EhIsvpEwtRIcMrytcZHD8yzaAzN3cnykBpbn8tdxnMk=; b=oNTHT7yk5i4ZlKyN0F6gUQeRJ/EOh6/IBE74hNRVfc4qaHj9aqDHtn9R/gBHPlGqRh 4vj3HS5PfjLoSvYt7BbIbGxrtBYumw1gHdVfOqICE/6nKIkVMSxDZBxH5kNkPI5SnGrR ameR2QP8/pm7px4U59Gv1FQa/ne3b54AmWW9sXhn4Vjio8rCTpfHL+3vux4LWC/GKaIS CcOsotqt3XGwbDV90FOhGcYRdFFOkCKN+jG749Z4a7GI5AA5Wa8yuWGE0ovUCcR2xBlq itdiHzY/fommEJKtxWG59nVDIVZv5FF4a6U5TE2zRJanSiW5n5xYqRzXIpIVig50Y420 pVdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=dmJu8jPz; 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 ct24-20020a056a000f9800b0066881cb1b2fsi6652078pfb.346.2023.06.27.02.01.45; Tue, 27 Jun 2023 02:01:58 -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=dmJu8jPz; 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 S231236AbjF0IgL (ORCPT + 99 others); Tue, 27 Jun 2023 04:36:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230494AbjF0Ifn (ORCPT ); Tue, 27 Jun 2023 04:35:43 -0400 Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9192F10CF for ; Tue, 27 Jun 2023 01:35:41 -0700 (PDT) Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) (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-0.canonical.com (Postfix) with ESMTPS id 25002423E9 for ; Tue, 27 Jun 2023 08:35:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1687854939; bh=cRPd42UjLsQHHlZk9zoi1NoFgO3UAhUdUSvEc9A0iZk=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=dmJu8jPzzyyvTdUNWV9vjdq1TsWOcIVodf5VrX41eGFs04e7s1zMx7m3uUw6e4Kkd 9LYhzbVzCZdsMTvbAjAafOn1f4T9S/Ujj5R2XaPrhnc0eoNS2C3nPO6xGUyQ8/EJcq JzcAffZALUEAmp1Zi/1StX5LMsrrmNDq1jGrap196+3YG0CfwRfkUh+JRqjvx3KeDq dlXNEDwYOvuLdM1c3uO6aLEq+3nNu8DDX2zH5tftHNQRoA6mJHIGIf2lhpzlpC1mla bP3+00z6D7+OCT0M1D0gWYTzc/pgDsFGOcCmzUyRwOXnQHG4Jlt2/iHbC9jWH9j/VY zlCYW1RUyUjzw== Received: by mail-pj1-f71.google.com with SMTP id 98e67ed59e1d1-262e04a6fd1so1270578a91.3 for ; Tue, 27 Jun 2023 01:35:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687854937; x=1690446937; 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=cRPd42UjLsQHHlZk9zoi1NoFgO3UAhUdUSvEc9A0iZk=; b=LaDccfSB25k9QY26LEsg0u+KXJXOF+BEUUnB2n5MDLZMcVsmPh+NZ3M6dKVDUvk+2I uWKYQmoAr5UNFy+fCtt0xd06YJKyKt3XtYd4CJh2QmeqdUCAJjcPdzGgBM6/zbF+yDG+ j7TGS8LWpcIJDvjosP2r/GdR9P6SS2mxozKGo/cXyd13/Dg5w3nV8phZB0EnZkf5C1q9 EbFEmQiYEzRsgmM+WQQxd22tPBz5TCj8V49/E8u/75WcFChWdiRhIlcNYZvWTxTnfWPJ IDeenu1OPzGWjshIzeYLykJBebjgNxlbWIF4m6bxsxTjCuOOX2+jknPk317BWhqCgcpB rbIw== X-Gm-Message-State: AC+VfDx6UP8tAZnHuwG2AqA2BLsPAmVN9Fl8GKatXmxRXeMm8Q/UJi8f xmyOTrFbH46JA59gRfDCJuYV2j4IqaBmu4zTD9c53EdD0/I7TalnegeFDr8hUnTXYQw7KADh1aO cE1kBW9oI4aVdxXmscOdPQKpD+4jE6iEeyM12otTIBtMsa9x28cCO8PG4xQ== X-Received: by 2002:a17:90b:38cf:b0:262:d4c8:cb3c with SMTP id nn15-20020a17090b38cf00b00262d4c8cb3cmr4511922pjb.49.1687854937513; Tue, 27 Jun 2023 01:35:37 -0700 (PDT) X-Received: by 2002:a17:90b:38cf:b0:262:d4c8:cb3c with SMTP id nn15-20020a17090b38cf00b00262d4c8cb3cmr4511912pjb.49.1687854937083; Tue, 27 Jun 2023 01:35:37 -0700 (PDT) MIME-Version: 1.0 References: <1b4b2c6c-8119-95fd-8958-dbbecc66510c@amd.com> <20230622230607.GA155247@bhelgaas> In-Reply-To: <20230622230607.GA155247@bhelgaas> From: Kai-Heng Feng Date: Tue, 27 Jun 2023 16:35:25 +0800 Message-ID: Subject: Re: [PATCH] PCI/ASPM: Enable ASPM on external PCIe devices To: Bjorn Helgaas Cc: "Limonciello, Mario" , bhelgaas@google.com, Mika Westerberg , Kuppuswamy Sathyanarayanan , Vidya Sagar , Michael Bottini , "Rafael J. Wysocki" , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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 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 wrote: > > > > > > A variety of Intel chipsets don't support lane width switching > > > > or speed switching. When ASPM has been enabled on a dGPU, > > > > these features are utilized and breakage ensues. > > > Maybe this helps explain all the completely unmaintainable ASPM > > > garbage in amdgpu and radeon. > > > > > > If these devices are broken, we need quirks for them. > > > > The problem is which device do you consider "broken"? > > The dGPU that uses these features when the platform advertises ASPM > > or the chipset which doesn't support the features that the device > > uses when ASPM is active? > > > > With this problem I'm talking about the dGPU works fine on hosts > > that support these features. > > Without more details about what's broken and when, I can't say. What > I *think* is that a device that doesn't work per spec needs a quirk. > Typically it's a device that advertises a capability that doesn't work > correctly. Many silicon vendors use the same "PCI IP" and integrate it into their own chip. That's one of the reason why the capability doesn't really reflect what actually being support. The vendors then send their private datasheet to system integrator so BIOS can enable what's really supported. So the logic is to ignore the capability and trust the default set by BIOS. > > > > > > > I think the pragmatic way to approach it is to (essentially) > > > > > > apply the policy as BIOS defaults and allow overrides from > > > > > > that. > > > > > > > > > > Do you mean that when enumerating a device (at boot-time or > > > > > hot-add time), we would read the current ASPM config but not > > > > > change it? And users could use the sysfs knobs to > > > > > enable/disable ASPM as desired? > > > > > > > > Yes. > > > > > > > Hot-added devices power up with ASPM disabled. This policy would > > > mean the user has to explicitly enable it, which doesn't seem > > > practical to me. > > > > Could we maybe have the hot added devices follow the policy of > > the bridge they're connected to by default? > > > > > > > That wouldn't solve the problem Kai-Heng is trying to solve. > > > > > > > > Alone it wouldn't; but if you treated the i225 PCIe device > > > > connected to the system as a "quirk" to apply ASPM policy > > > > from the parent device to this child device it could. > > > > > > I want quirks for BROKEN devices. Quirks for working hardware is a > > > maintenance nightmare. > > > > If you follow my idea of hot added devices the policy follows > > the parent would it work for the i225 PCIe device case? > > That doesn't *sound* really robust to me because even if the default > config after hot-add works, the user can change things via sysfs, and > any configuration we set it to should work as well. If there are > land-mines there, we need a quirk that prevents sysfs from running > into it. For this case it means driver needs to provide a ASPM callback to flip PTM based on ASPM sysfs. Kai-Heng > Bjorn