Received: by 10.192.165.148 with SMTP id m20csp3354imm; Fri, 20 Apr 2018 01:53:30 -0700 (PDT) X-Google-Smtp-Source: AIpwx493ZvKQmMz19vhWbehzisUqKTjUN/K2EsnSVquYaw25itdXPHeylS9/TFXzKmgMRY+m5LTb X-Received: by 2002:a17:902:41:: with SMTP id 59-v6mr9494255pla.345.1524214410384; Fri, 20 Apr 2018 01:53:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524214410; cv=none; d=google.com; s=arc-20160816; b=rTwz7J58YB6xnrzij8hATFtd7QFamuyMJEDDfwqP6dF+rBTfPouSWrR8xsWD+EbMcD F9gAaPoQuTiHX/z6yLsH8nwse7qE1K+yUTI5FF9/uHgKMgB78Y/X1M5oTOGah4b9gEY9 baO9fxDmIZ7FvckgORBeEa1VG3IQ8eBvM7JM+gZK10WQ/Ge/j5lxsnM9LSx80nLrKxYl Oa77KZ9LnAu402LjU7jL5fnNooRT9MWMQketeWPrhNAvP9INbOf/XF5qbysJBAV9zy5e HJqGYOCTZuLKTCh3Mren5Dc+c5NcI3pCi0NyDx+HZU2cc04GelbHIu7YyX/Vq3nlPgFy P6rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=0joGzaOQMCD79gBYIQGNh+Zc3NwcTC+5heK87nCf/gE=; b=PYlZj8bC/5zQezIAU7D83joPKkhRQUyctUkqMPFNt6HbpxGvmWxWYDh16fH4L3Hvi1 Y3cAcF3phCMPDP1XCmKHXqyB/DBT82/DBrfNHvhAIi8IXXAw+il/1yRQb7PrE602dlal LxuQtPQhQVaSgpyyrAzl/ssItRvjai4AgkGfN8GDFHhl9zZgjewPZtdNYjIZXrp8BLV1 wK8poqj3JqZoItOamM9cJJj5LjYjjEQKDY0mLnDT5w7cINx2MsX11DdmU4lg29VCC/XP kF8dKCSZ6f0g1Zb4+3xHUbOSMRZ+bZCXaTRzg1b80cOr9f4MunrVWVkmhFLiwup8raX5 SCEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=JuiFSFFN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m10si4598283pge.245.2018.04.20.01.53.16; Fri, 20 Apr 2018 01:53:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=JuiFSFFN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754168AbeDTIwM (ORCPT + 99 others); Fri, 20 Apr 2018 04:52:12 -0400 Received: from mail-oi0-f66.google.com ([209.85.218.66]:43062 "EHLO mail-oi0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754035AbeDTIwH (ORCPT ); Fri, 20 Apr 2018 04:52:07 -0400 Received: by mail-oi0-f66.google.com with SMTP id p62-v6so7362471oie.10 for ; Fri, 20 Apr 2018 01:52:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=0joGzaOQMCD79gBYIQGNh+Zc3NwcTC+5heK87nCf/gE=; b=JuiFSFFNlbLP/Yg+tYwW0CfuKe9GYll7S0qR4MjagO0ndbEME7wVDNTO0AD6M5SRTd HP9wLKgnddN2b/J1sME8tiF3b9TbDudTq3LZ647d7/d1eylogbGH0n1e1L1SjhTefvQO 9/bufNNmMTNIKL/3SXt/3h3pnQI4cWQWsFQh8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=0joGzaOQMCD79gBYIQGNh+Zc3NwcTC+5heK87nCf/gE=; b=l/7te1aItzsMkVCjtSqVqC8598adThMr/I7A97wvS0YZPmm+79d2ElpDc5Bpxory02 OZuJ2QcpIh+XqUFekdfAlB1qCQesFDmUJDtX88naZ0MYXS89pE+t3A6VymWN18wQzX1Z krZ+/6ACo08g4bB/jn8PvH+dVi8loJ679voAvlrmcnE5hVMCxn76xvCaGOudt3p7b8ZF 7Narl6kZ999XzJN5UvdqrY3ifO8C4tuTFgz4p02YKxkFqln75m+Kj2O/yNPY5Xj0pf7/ zdWP0slW2D0E0qJe/UX6t+hNQTtNDpEXASbeYttTQayLjtVO/l56wgOSVFn+w9/65pM8 7WEw== X-Gm-Message-State: ALQs6tBkLUnoBgQi/gt56ehWsswDiy1pIUHmpR/G1lPc0+noieJ0Zc5m fIYmj17ZSaReyfEDMGz6bMU105F0tSAJfZaZRuAVaw== X-Received: by 2002:aca:528b:: with SMTP id g133-v6mr5780306oib.353.1524214327195; Fri, 20 Apr 2018 01:52:07 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:2cef:0:0:0:0:0 with HTTP; Fri, 20 Apr 2018 01:52:06 -0700 (PDT) In-Reply-To: <152417192976.76853.5171081412139699180.stgit@bhelgaas-glaptop.roam.corp.google.com> References: <152417080402.76853.4258398181136860884.stgit@bhelgaas-glaptop.roam.corp.google.com> <152417192976.76853.5171081412139699180.stgit@bhelgaas-glaptop.roam.corp.google.com> From: Srinath Mannam Date: Fri, 20 Apr 2018 14:22:06 +0530 Message-ID: Subject: Re: [PATCH v1 1/2] PCI/ASPM: Disable ASPM L1.2 Substate if we don't have LTR To: Bjorn Helgaas Cc: linux-pci@vger.kernel.org, "Rafael J. Wysocki" , Sinan Kaya , Rajat Jain , Ray Jui , Keith Busch , linux-acpi@vger.kernel.org, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Bjorn, I have verified this patch, it works fine for me. Thanks & Regards, Srinath. On Fri, Apr 20, 2018 at 2:35 AM, Bjorn Helgaas wrote: > From: Bjorn Helgaas > > When in the ASPM L1.0 state (but not the PCI-PM L1.0 state), the most > recent LTR value and the LTR_L1.2_THRESHOLD determines whether the link > enters the L1.2 substate. > > If we don't have LTR enabled, prevent the use of ASPM L1.2. > > PCI-PM L1.2 may still be used because it doesn't depend on > LTR_L1.2_THRESHOLD (see PCIe r4.0, sec 5.5.1). > > Signed-off-by: Bjorn Helgaas > --- > drivers/pci/pcie/aspm.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c > index f76eb7704f64..c687c817b47d 100644 > --- a/drivers/pci/pcie/aspm.c > +++ b/drivers/pci/pcie/aspm.c > @@ -400,6 +400,15 @@ static void pcie_get_aspm_reg(struct pci_dev *pdev, > info->l1ss_cap = 0; > return; > } > + > + /* > + * If we don't have LTR for the entire path from the Root Complex > + * to this device, we can't use ASPM L1.2 because it relies on the > + * LTR_L1.2_THRESHOLD. See PCIe r4.0, secs 5.5.4, 6.18. > + */ > + if (!pdev->ltr_path) > + info->l1ss_cap &= ~PCI_L1SS_CAP_ASPM_L1_2; > + > pci_read_config_dword(pdev, info->l1ss_cap_ptr + PCI_L1SS_CTL1, > &info->l1ss_ctl1); > pci_read_config_dword(pdev, info->l1ss_cap_ptr + PCI_L1SS_CTL2, >