Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp331949lqd; Wed, 24 Apr 2024 03:58:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU1FQccf5CeVhQ09SUMWRs/AvbZahk0C3u5Xfxxk2GcUU4zrWqiimQ7Ffzay5Uy6eNr2r819fNGZwN/Eb089B7u5Q8TTUm7EtVp2cv4SQ== X-Google-Smtp-Source: AGHT+IEgW/yVknlLErWw8sgt86KOXXuEUksms8xjQ9kuoK7/scVySB1BnD2s3qn3YiU9IUBinC1z X-Received: by 2002:a50:d597:0:b0:56d:f637:4515 with SMTP id v23-20020a50d597000000b0056df6374515mr1312265edi.42.1713956331011; Wed, 24 Apr 2024 03:58:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713956330; cv=pass; d=google.com; s=arc-20160816; b=lHYrYlgY9nhd4UsQBtZdPvvExIvo/nrhg0R83wL2KV85ws2w3csZvmFEk8UEt46z1F sLf3iJNJKI7Z9oiJb5OWvar0H//QOX/JuZ+OucGhqoiqLPVZqXAq1yZkiI+0S8palTyz 5WeX8eRl4njhQa+vaiRyGokS/AjAqc32d67RzOOFtfpIoWi5w0ncmPIht1U4YMX83UCp IK11XVlA0SZBfdZAQKm1tpM1eayMi+ETLOxuUALei6yf0GIrmRY7CIhhYZWeF5TLiOIp F9wJBwrNUK2e3IlW99Xi/1daDHBUp0GS2EWCdDsGzdlr316tNawiR2HEYBL7lG3fst0O vRIQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=kRfjSJt5RkWOkpKr1nWCFYWHFIH729SNz+JrUUaI0rQ=; fh=OPzzg3LFKBC8G8cub7lYpFgmBNykTZ5aaPpxW8VEb9s=; b=gHWrbHPnJxl29p2937zDUosvNZ6KtUROju+d/w+EKOuRKNEVZBi5USt3H7tIx3hoBZ h4ka217xY+RXDteyzVDFj6X1g4Xc2eAX18h5/P941NndNi1Wr+qF8xGX11RrWO2ncbL9 2vJzKKo/I10ngIylw0SOiDXCjrOnq3I2JKvZFyCTtVigcbJWoi7d2tKaG+hFJxOrsydM mi6egut8kXjehVzkstWEr70kA8KLHHJmIlKoE3BqJi0imTin3dY+THYnGHrRTq0vfC8P cntR/9tJFO+rfRny11FZzHC0W0trbkxBXojld7v35T/0/SFQMGY17dNwUHbkdfvWYZrW 8/+A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@endlessos.org header.s=google header.b=hYjytBgs; arc=pass (i=1 spf=pass spfdomain=endlessos.org dkim=pass dkdomain=endlessos.org dmarc=pass fromdomain=endlessos.org); spf=pass (google.com: domain of linux-kernel+bounces-156764-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-156764-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=endlessos.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id dj17-20020a05640231b100b00568d7509819si8287680edb.197.2024.04.24.03.58.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 03:58:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-156764-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@endlessos.org header.s=google header.b=hYjytBgs; arc=pass (i=1 spf=pass spfdomain=endlessos.org dkim=pass dkdomain=endlessos.org dmarc=pass fromdomain=endlessos.org); spf=pass (google.com: domain of linux-kernel+bounces-156764-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-156764-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=endlessos.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id BBA431F22E9A for ; Wed, 24 Apr 2024 10:58:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3BA5F1598FA; Wed, 24 Apr 2024 10:58:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=endlessos.org header.i=@endlessos.org header.b="hYjytBgs" Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 29E1913DDD9 for ; Wed, 24 Apr 2024 10:58:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713956323; cv=none; b=fVqotjiMHS3X5HVCP9qLMwgd+NO+LJOBlPhkpDMu0VlirTxCDfSDW2QCq3s5RgFpCHC4ZKbJURXrhgF5EahFKiMMn9I+wr3XpsL969G5CuCR/CzJtTTWJAbD/bSKaDmhdWUChh4opXSHOi3n+aZObgZRoLPgQWf5qeoNcnamqGI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713956323; c=relaxed/simple; bh=kD/apsZpQUjTX7GTpEZPSs6owgYA8C9LjrS5GfwTJcI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=TLrMkSdhi0qPLSgIp105h4zZvuOBt9rDGxTa0+Dzq+MAxFmuz9e+76wn21/9P3kUOjXpoxubYfQ0WME90OjoYxd+5QkOHGXG3IobcirBPYDvOwo60FH00uGv5lQ0zqxrrGk8x/0/Qg/G/7s5N/1XanqvbYaN0wgL+j1Co7XUkaw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=endlessos.org; spf=pass smtp.mailfrom=endlessos.org; dkim=pass (2048-bit key) header.d=endlessos.org header.i=@endlessos.org header.b=hYjytBgs; arc=none smtp.client-ip=209.85.216.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=endlessos.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=endlessos.org Received: by mail-pj1-f48.google.com with SMTP id 98e67ed59e1d1-2a58209b159so4495020a91.3 for ; Wed, 24 Apr 2024 03:58:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=endlessos.org; s=google; t=1713956321; x=1714561121; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=kRfjSJt5RkWOkpKr1nWCFYWHFIH729SNz+JrUUaI0rQ=; b=hYjytBgsUxKlNk/qnPTBZX40M22NkvcFBcmI8ueiotcO2917/SDH7T9FpBcp+zn+e0 Wxw//VpBsJ5JEO0ETnBF0S55ZkbClQbdW3jTEO2o5bnAXECLS8hiORKvlcU7a6UUGs0R CB0PieFb50sA9MEgutret3WmRn9gqxyQr6tZvo3RZRrQ0q437Gmep4Y3I5T9vPBYkvtW CuC2TLrpCa8Z1BMdFcAW4dPBMYYbQa8kGLWpVV9NgI2CJrOGQ5fduQl945i9zskUed1i 0iHwXJsm3aRbBh1Z3U+AAYbtG+HiQq12aX33VrqzSYjCltDTUU+hj/Rx2Be1ILsAoZzA a/Qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713956321; x=1714561121; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=kRfjSJt5RkWOkpKr1nWCFYWHFIH729SNz+JrUUaI0rQ=; b=QHpy2roaO7MN8BpY2ZCAFqzOW7/XZYvlwuUJo+5YS07fhysI3+A6t9lJEjncjZrTlt foDI4wTawGIBZUwtcEs1r/bfeT5+P/ObTG12/mAgIXPLzByu9iPDwfyYRAFLoFp/PuLi ykar6hVCa1d+b2jOZyr6BYhJAFnm6yTPLhTCc9rIdCsErxTegwihljJSSx8XN4hfT//V 63wZNiWIHTh4s2bzvZBBZi9bT9YMdjJm9eTBqvE9KzX1BThYobvm8+g3CvaAaTGKbIOs RDUXni+p3+DHRXCXJojlNy1dBDsnDEJGwl3XNRbqpV0TzUIESOxNNtZdtgJaO56U+Oyp Ba4A== X-Forwarded-Encrypted: i=1; AJvYcCXgOXgbj6FFetR9giIp5m+S/YeZQjDkUgm1EpYNzYj7sfBOpAXDz9JGSDVrk1w9mfx9EgO3x+tfWm6AihUM/lQWIi0EWmZq+05bjudv X-Gm-Message-State: AOJu0YxzAgkce7TBY0KV4TJSnd1PcY71TTLcvRELOeDOjTXWTPt1HYI/ vn0yIa0LTeuNm+cJRUL/zjqTZdPD4UkxoGvwX0nqCB7+sXaLTVK4lyLr2Z4V+KU= X-Received: by 2002:a17:90b:b14:b0:2a8:1fdf:b1b0 with SMTP id bf20-20020a17090b0b1400b002a81fdfb1b0mr1729628pjb.29.1713956321493; Wed, 24 Apr 2024 03:58:41 -0700 (PDT) Received: from localhost.localdomain ([123.51.167.56]) by smtp.googlemail.com with ESMTPSA id cu22-20020a17090afa9600b002ac5335f554sm957852pjb.1.2024.04.24.03.58.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 03:58:40 -0700 (PDT) From: Jian-Hong Pan To: Bjorn Helgaas Cc: Johan Hovold , David Box , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Kuppuswamy Sathyanarayanan , Mika Westerberg , Damien Le Moal , Nirmal Patel , Jonathan Derrick , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Jian-Hong Pan Subject: [PATCH v5 0/4] PCI: vmd: Enable PCI PM's L1 substates of remapped PCIe Root Port and NVMe Date: Wed, 24 Apr 2024 18:58:15 +0800 Message-ID: <20240424105814.21690-2-jhp@endlessos.org> X-Mailer: git-send-email 2.44.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Re-send for the version information. Notice the VMD remapped PCIe Root Port and NVMe have PCI PM L1 substates capability, but they are disabled originally. Here is a failed example on ASUS B1400CEAE with enabled VMD: 10000:e0:06.0 PCI bridge: Intel Corporation 11th Gen Core Processor PCIe Controller (rev 01) (prog-if 00 [Normal decode]) ... Capabilities: [200 v1] L1 PM Substates L1SubCap: PCI-PM_L1.2+ PCI-PM_L1.1+ ASPM_L1.2+ ASPM_L1.1+ L1_PM_Substates+ PortCommonModeRestoreTime=45us PortTPowerOnTime=50us L1SubCtl1: PCI-PM_L1.2- PCI-PM_L1.1- ASPM_L1.2+ ASPM_L1.1- T_CommonMode=45us LTR1.2_Threshold=101376ns L1SubCtl2: T_PwrOn=50us 10000:e1:00.0 Non-Volatile memory controller: Sandisk Corp WD Blue SN550 NVMe SSD (rev 01) (prog-if 02 [NVM Express]) ... Capabilities: [900 v1] L1 PM Substates L1SubCap: PCI-PM_L1.2+ PCI-PM_L1.1- ASPM_L1.2+ ASPM_L1.1- L1_PM_Substates+ PortCommonModeRestoreTime=32us PortTPowerOnTime=10us L1SubCtl1: PCI-PM_L1.2- PCI-PM_L1.1- ASPM_L1.2+ ASPM_L1.1- T_CommonMode=0us LTR1.2_Threshold=0ns L1SubCtl2: T_PwrOn=10us According to "PCIe r6.0, sec 5.5.4", to config the link between the PCIe Root Port and the child device correctly: * Ensure both devices are in D0 before enabling PCI-PM L1 PM Substates. * Ensure L1.2 parameters: Common_Mode_Restore_Times, T_POWER_ON and LTR_L1.2_THRESHOLD are programmed properly on both devices before enable bits for L1.2. Prepare this series to fix that. Jian-Hong Pan (4): PCI: vmd: Set PCI devices to D0 before enable PCI PM's L1 substates PCI/ASPM: Add notes about enabling PCI-PM L1SS to pci_enable_link_state(_locked) PCI/ASPM: Introduce aspm_get_l1ss_cap() PCI/ASPM: Fix L1.2 parameters when enable link state drivers/pci/controller/vmd.c | 13 ++++++++---- drivers/pci/pcie/aspm.c | 41 ++++++++++++++++++++++++++++-------- 2 files changed, 41 insertions(+), 13 deletions(-) -- 2.44.0