Received: by 10.223.185.116 with SMTP id b49csp4177935wrg; Mon, 19 Feb 2018 12:38:36 -0800 (PST) X-Google-Smtp-Source: AH8x225/FID1uRMWfFyKzc0g6GepnFg1shmIzsCC7DIAWwBFi9xMHNuX35D7vVFhsDiJeoEd7neu X-Received: by 10.99.126.71 with SMTP id o7mr13160652pgn.446.1519072716610; Mon, 19 Feb 2018 12:38:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519072716; cv=none; d=google.com; s=arc-20160816; b=cKaU8aI0fXX1eqpoT2TI2LP/erovYOdVDsmlOlEOoPULHjx6N6MEz2yW714vI/yVeQ nlYFiAIwPZJQNSTUhe7UIhZV/fgOv2cTANDs6vfzGuZQv6QZ9eHlfU1tsOnCM6C4/vOD 3gRm8UVbeU+DdaPJOow0T8Rh0S9gW+TakxFaRh8RLPNMVQsE2czRq5eo2D/j0HBt0Nz9 nDSC/mgUuNlq1CPDvqxEayvGNDejrDjlU7qk5p9T5GsOD9HtzPtBjk6G8aRyRYhdbucS OsObCK058xNusFlgfkVtVXYw4cWUk8u4+5NXmrgat58XSDs8j9vYRELBlGgHHz76MhpP s/+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dmarc-filter:arc-authentication-results; bh=skLwcFbgh3OO2o5SWXjGKW2gJOFZSAYY9oUO8L55GNk=; b=uybaR9HPELiir9IaGS42QXKg0itXE9TI3P2TXeHdLjX10N9akZkJqw9xhDDqXeRGl0 tuKNztbO6bw0fBlh8f8s6VjVnmP6vxfbi8DY6EHX4AOXKNKpK1gP6RlFsV0h6a4PvYwi IXgIMwFsazQ6V0QUjyftWi9YMZ6gcysr2uAJliHoWarpWXBp2RfgToINKvkh+9mayjSZ 7OjL5R3RuiVDqrwObjXVVj+uj4dxnKzy9Z6xpJElUvIRQb9I7pWs2GlImnjBOjH4/S1H 2J4fu6+j0pzECjFrKhuUr9kAnhDxM4WQ52E2h2hY5uhpMMYJyClTApprUgMwEZ3i2/jX buug== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 43-v6si4985754plb.548.2018.02.19.12.38.22; Mon, 19 Feb 2018 12:38:36 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932182AbeBSUhA (ORCPT + 99 others); Mon, 19 Feb 2018 15:37:00 -0500 Received: from mail.kernel.org ([198.145.29.99]:48000 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932108AbeBSUg7 (ORCPT ); Mon, 19 Feb 2018 15:36:59 -0500 Received: from localhost (unknown [69.55.156.246]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BE4DB20C51; Mon, 19 Feb 2018 20:36:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BE4DB20C51 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=helgaas@kernel.org Date: Mon, 19 Feb 2018 14:36:57 -0600 From: Bjorn Helgaas To: "Rafael J. Wysocki" Cc: Mika Westerberg , George Cherian , George Cherian , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, bhelgaas@google.com, Jayachandran.Nair@cavium.com, Robert.Richter@cavium.com, Lorenzo Pieralisi Subject: Re: [PATCH] PCI: Add quirk for Cavium Thunder-X2 PCIe erratum #173 Message-ID: <20180219203657.GA48133@bhelgaas-glaptop.roam.corp.google.com> References: <1517554846-16703-1-git-send-email-george.cherian@cavium.com> <2323301.ORZpb3hFRe@aspire.rjw.lan> <20180216203434.GC11014@bhelgaas-glaptop.roam.corp.google.com> <2858019.9TUCWsDpTB@aspire.rjw.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2858019.9TUCWsDpTB@aspire.rjw.lan> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 19, 2018 at 12:21:56PM +0100, Rafael J. Wysocki wrote: > On Friday, February 16, 2018 9:34:34 PM CET Bjorn Helgaas wrote: > > On Fri, Feb 16, 2018 at 01:40:37PM +0100, Rafael J. Wysocki wrote: > > > On Friday, February 16, 2018 12:39:00 AM CET Bjorn Helgaas wrote: > > > > My questions are basically "What does the PCI core need to do > > > > to make sure a device is in D0 before it operates on it? And > > > > where do we need to do that?" > > > > > > > > > Unused ports are autosuspended after 100ms as per > > > > > pcie_portdrv_probe(). > > > > > > > > So I guess this is only done for PCIe bridges, not for > > > > conventional PCI bridges. Is this because autosuspend depends > > > > on a PCIe-only feature? > > > > > > Yes, that's PCIe-only. > > > > What PCIe feature does this depend on? > > It doesn't depend on any PCIe feature in particular, but we don't > need to do it for PCI-to-PCI bridges in general. > > > I see the PCIe test in pci_bridge_d3_possible(), added by > > 9d26d3a8f1b0 ("PCI: Put PCIe ports into D3 during suspend"), but > > unfortunately that commit doesn't say *why* we only do this for > > PCIe, or only for BIOS dates of 2015 or newer. > > The reason why we need this is related to deep low-power states on > new SoCs that only can be entered if PCIe root ports are in D3 (that > is, if the root ports are not in D3, the whole SoC cannot enter some > of its deep low-power states and that may exted to package C-states > for processors). > > That also is the reason why we do it for PCIe only. > > The reason for the cut-off date is because we know it for a fact > that PCIe port PM doesn't work on some older platforms due to > hardware issues and, again, it only really needs to be done on > recent SoCs. > > I believe that all of the above was mentioned during discussions on > the patches that ended up as commit 9d26d3a8f1b0 and so on. OK. I should have made sure more of this was captured in the code comments. The code doesn't match the spec and unless you happen to remember all that history, you'd have no idea why, which makes maintenance a bit of a hassle. I'll propose a patch to add some comments. Bjorn