Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp18920026rwd; Wed, 28 Jun 2023 02:29:56 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4GNQPHBXowJuXNVI86pdAmdZHA7bnqNM6pScz7xaSbVbJNZRadhTMQiG7Z4wYz8emsO0xp X-Received: by 2002:a17:906:ee83:b0:94a:9f9a:b3c4 with SMTP id wt3-20020a170906ee8300b0094a9f9ab3c4mr35115815ejb.49.1687944596264; Wed, 28 Jun 2023 02:29:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687944596; cv=none; d=google.com; s=arc-20160816; b=XhWZqCAS4sKSETpfIwRtQsqRCm9hJ1Vynq9svfz36Cm36Vidz/wZEraZoiIp5eu6eA HX7pqFkydQA6gofqh0XANnWeh5sKUL5kSsQdAnHPqVKbWOj/65zpFBtSgu4sbXkPRr85 uzVmRSYm2FXV05lsldRplC+JwYAASsDE9R179TjhvIbYOO4gKaOrvn7YMNuqVaVunRva PZqekBAEhmF0+rWmfQl+oNSXqdn2mfVhtr8stY30kTEXZaRWwMmnNL1J5hpxUIw9QORx 6Q/2zxL6nPEkxM8U98tLKbQxiT0q+pc6Wx4twBPNgVb3PZgJW7cPoaN5Arur8sLe4z8o n+4g== 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=3bdC+uUyIZz0PgxeLe6K/fSeIXVXdbQUHA0MK3WxvKU=; fh=pb9OSzmJiKQjfVwpBb/znGlgmeNocRyjxyH4HLGIPFc=; b=QdBNmCm5I0lIIKhNRAL0o6zlYPMv1p9LBPps8JZLKo0hkqZcibEnG5gJ07/Ba91Dvg p5ktFDa76pIkzN1eFps2uFDawK5Oi9dcmCEnYTy+28KZTjeebN8zK7H2fhY4JdGsHYFG 6oi3gbHjOPLec3XlmDYQRLH7FfaMOowIsZX7IxuQjTF6vHgocwTdojhj5gC5thLCEen3 PMmd/2vBlYqNpXw8AHvIR/vV2SdAo1HqF0sfAXqxeyMC35Iu8aVOh2hoj/8UB52i6CzX hVxY65e2DYJ5sQZ7G9qvdl1UiD3c9iBIsHmo9bPWxxMIB9TQ4nCVPD27lGwBEHkZ7el7 Qlqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=pPiHqZEy; 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 f21-20020a170906561500b00989623654bbsi5486827ejq.363.2023.06.28.02.29.31; Wed, 28 Jun 2023 02:29:56 -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=pPiHqZEy; 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 S235779AbjF1I6u (ORCPT + 99 others); Wed, 28 Jun 2023 04:58:50 -0400 Received: from smtp-relay-internal-0.canonical.com ([185.125.188.122]:38120 "EHLO smtp-relay-internal-0.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230399AbjF1ItW (ORCPT ); Wed, 28 Jun 2023 04:49:22 -0400 Received: from mail-oi1-f199.google.com (mail-oi1-f199.google.com [209.85.167.199]) (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 ED7443F72F for ; Wed, 28 Jun 2023 05:10:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1687929002; bh=3bdC+uUyIZz0PgxeLe6K/fSeIXVXdbQUHA0MK3WxvKU=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=pPiHqZEyXktMSy2OoI57sTRe/hyUS9cEaElGEVt4J9JCmAKSJW62l//HnldyRrB2Z YMUq6KVGdWsjnyzmgwEKWwC4ua5odQ4Iw3NVR5F56MDV3BM8Bj7tD9q2lGh19tXt6j ZSrgVe5Iov+4ZSSiLzIXEAa8kObaZe7TYUVRj2pC/ZuQrNhEn2Xrlo9jZtCx69i6Gk Jras8+ux+HS1jOSJa328v5YZOouXOvOkbLQAFRXqF8CZkJK7E9Uy7hioVKlgenCa8o V6F4uYvUqUweEg/+KfffBtZxFMCGnFzhc4iiCKtUH/ijr2oWFiHGmyFFoKW9uSPeTJ vMGFUn7sxS9jA== Received: by mail-oi1-f199.google.com with SMTP id 5614622812f47-3a1bcdd0966so4643958b6e.2 for ; Tue, 27 Jun 2023 22:10:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687929001; x=1690521001; 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=3bdC+uUyIZz0PgxeLe6K/fSeIXVXdbQUHA0MK3WxvKU=; b=flnqHOm/53aD+q8uSqbM43VI/HbRupxnTgYTkG5V6TUP36A/FBzgLX2w4fJKs5Erlz r0DY5sCgtwlx8IUlEH3Ynw1GrYUNw9CRslNiTeTb7nVLMWjzfrb+daiTVtxT7CQbNNeo Wz352RVCDmn2K3fJyDlp/VwpYYKK5aco0BdjJTXCFnqvFQSUNlrJtgyeLl2MOk0SwisZ uYRjAhXGaVCzxI6yg2FN4Ps3UbTpE1kDKBTuMjtL8S6WNuuNAAgaV3JVfOVypxKObfBz Yb+DsO+dGozJdMBHq/AFJZ/z1eqDl8WaWqtXwmvj390T7G7+D1EbzGfH5CxxNuRbGtGw Nqyg== X-Gm-Message-State: AC+VfDyxhOnKddpBMdRP0PRRCf+MBdWbgm7n4gcdtAiSB7qO06Ds6iVh bp5NL81A1tG4BzYji9fFxcBQ1+qleXy3vss4AKcvQuL1E0p/ZrAGksWD7DEvXAYEBlPSh1GD4Qp 94ldeUGS8dOPVHAngWcAWuApQm8yfTMyKWu4g9HG3dz5XxsY69Nk6CVup7g== X-Received: by 2002:a05:6808:f11:b0:3a0:663d:fd18 with SMTP id m17-20020a0568080f1100b003a0663dfd18mr20647403oiw.57.1687929001316; Tue, 27 Jun 2023 22:10:01 -0700 (PDT) X-Received: by 2002:a05:6808:f11:b0:3a0:663d:fd18 with SMTP id m17-20020a0568080f1100b003a0663dfd18mr20647388oiw.57.1687929001077; Tue, 27 Jun 2023 22:10:01 -0700 (PDT) MIME-Version: 1.0 References: <20230627205417.GA366405@bhelgaas> In-Reply-To: <20230627205417.GA366405@bhelgaas> From: Kai-Heng Feng Date: Wed, 28 Jun 2023 13:09:49 +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, intel-wired-lan@osuosl.org, "Neftin, Sasha" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [+Cc Sasha and Intel Wired Lan] 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 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 wor= k > > > 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. > > 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 the > 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 change the capabilities advertised by config space because "it already works under Windows". > > > 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-time > is problematic. I don't think we can assume that all platforms have > 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 has been set, default to BIOS setting. > > It's possible we need some kind of policy that limits ASPM to the BIOS > config until date X, but I don't want to limit that forever. Desktop can have very different PCIe cards in the slots so BIOS date isn't a good indicator for ASPM support. Let alone BIOS date changes on each BIOS upgrade, this means potential regression risk. > > > > > 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. > > I'm not sure I follow this, but it sounds like you're saying PTM > doesn't work correctly with some ASPM configurations. Is this allowed > by the PCIe spec or is it a hardware defect? If the latter, maybe we > just need a quirk to disable PTM on the device. I'll leave this one to Intel folks. > > I'm not sure PTM is valuable enough to add a generic callback > mechanism to work around a defect in an individual device. Agree. Right now the issue is only observed when I225 is in a TBT dock. Kai-Heng > > Bjorn