Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp88125imj; Wed, 13 Feb 2019 05:12:49 -0800 (PST) X-Google-Smtp-Source: AHgI3IaNe4Z/Ap4FaxQH6jjSN5KugdMfIh8/6l33KblUAT3svOGPKZ5qqwV90KMH6cA7NmmeFGRR X-Received: by 2002:a63:d904:: with SMTP id r4mr400661pgg.207.1550063568922; Wed, 13 Feb 2019 05:12:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550063568; cv=none; d=google.com; s=arc-20160816; b=svSle7Cyj1LcB9u+ebUymKvSvsL5x0/Z19CYYK9X+1tBZQbcYO6+5Ki5XqaDMe/0PJ jleaaxFPmIixd/RNibviKAPJXybdms9vM4uWZWyXeFSGgkoHPSqzeJ+BPCwO4em9qmOF eNUR661h2QR7K25zZKErmyoRE8fG8m9DT3UnZxqaPwNjVuaCbDgdoNA43bBhw68rHdnW usz7Gamw4YFpSeuZtr/J58efeizRNZQPXULQqjFTglWThDtRi+Yy628/WbZcafnzSnSH JFDwjRzk92elx8iTTkk/270x9jhjwlrFbtZNHo6NDcQhdgURQxVwSp7xpceu08Yv+rAH zVJA== 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; bh=izu0B3IkJf0YVBYdTFUUOS78zGFbFSukBaPoHJBwGHQ=; b=rooM1/N7rGgg6UUpsZ9eg8nodLdhJ6ii5NTmNc9fUcH7Y3kcjj0UwzHSen9KX1Dmfr ildBMsFS/g6i08tYbJ1+uarUlSvzRJ/WChEuRSmzoX3bUedKUvJ/EKOsLQs2Q6nHLaMO rbmghiZ3GET/b5pdAxlueyE3LQiMvyGB44GqqkR+3rUVRzcEbU6JzHz0iXPqGpe155SB dmCNRJwveGS05e3Z97kWh9B5yWWa6dMO/ghDza2M/wyTOgrxX08bY1jXsTQWG2yhz24/ YR8D5+wZbgYJ3Z0ioAS77x7EJVHaaq+l5v/NRAIvLUidULp0wVfaC2/p2ZIzX/v5LzJB kOLA== 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 11si2788825pfh.90.2019.02.13.05.12.32; Wed, 13 Feb 2019 05:12:48 -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 S2389490AbfBMIqK (ORCPT + 99 others); Wed, 13 Feb 2019 03:46:10 -0500 Received: from mailout2.hostsharing.net ([83.223.90.233]:40147 "EHLO mailout2.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732843AbfBMIqK (ORCPT ); Wed, 13 Feb 2019 03:46:10 -0500 X-Greylist: delayed 574 seconds by postgrey-1.27 at vger.kernel.org; Wed, 13 Feb 2019 03:46:09 EST Received: from h08.hostsharing.net (h08.hostsharing.net [IPv6:2a01:37:1000::53df:5f1c:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.hostsharing.net", Issuer "COMODO RSA Domain Validation Secure Server CA" (not verified)) by mailout2.hostsharing.net (Postfix) with ESMTPS id 03D1B10189CEE; Wed, 13 Feb 2019 09:36:34 +0100 (CET) Received: from localhost (p57BD742B.dip0.t-ipconnect.de [87.189.116.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by h08.hostsharing.net (Postfix) with ESMTPSA id 87C36603E21B; Wed, 13 Feb 2019 09:36:33 +0100 (CET) Date: Wed, 13 Feb 2019 09:36:32 +0100 From: Lukas Wunner To: Alex_Gagniuc@Dellteam.com Cc: mr.nuke.me@gmail.com, bhelgaas@google.com, Austin.Bolen@dell.com, keith.busch@intel.com, Shyam.Iyer@dell.com, gustavo@embeddedor.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] PCI: pciehp: Do not turn off slot if presence comes up after link Message-ID: <20190213083632.GA3387@wunner.de> References: <20190205210701.25387-1-mr.nuke.me@gmail.com> <20190209115849.244u67h7wmn3eb7o@wunner.de> <52afa1c45f684dbda6a8771b65583a22@ausx13mps321.AMER.DELL.COM> <20190212083031.2no7mzn5xug7nba3@wunner.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 12, 2019 at 11:57:55PM +0000, Alex_Gagniuc@Dellteam.com wrote: > The recommendation is to set the "in-band PD disable" bit, and it's > possible that platform firmware may have set it at boot time Ok, then I'd suggest to check in pcie_init() whether the feature is supported and enable it if so. And store that fact in a flag, either in struct pci_dev or struct controller. > (*) A bit hypothetical: There is no hardware yet implementing the ECN. Hm, this contradicts Austin Bolen's e-mail of Jan 25 that "Yes, this platform disables in-band presence" (when asked whether your host controller already adheres to the ECN). > I'm > not sure that there is a spec-justifiable reason to not access a device > whose DLL is up, but PD isn't. Austin asked in an e-mail of Jan 24 whether "the hot-inserted device's config space [is] accessed immediately after waiting this 20 + 100 ms delay", which sounded to me like you'd prefer the device not to be accessed until PDS is 1. This can be achieved by polling PDS in pcie_wait_for_link() if in-band presence is disabled, which is why I suggested it. > > Be mindful however that pcie_wait_for_link() is also called from the > > DPC driver. Keith should be able to judge whether a change to that > > function breaks DPC. > > That's why I went for ammending pciehp_handle_presence_or_link_change(). > Smaller bug surface ;). What I'm thinking at this point is, keep the > patch as is, but, also check for in-band PD disable before aborting the > shutdown. Old behavior stays the same. I'm worried that amending pciehp_handle_presence_or_link_change() makes the event handling logic more difficult to understand. Polling PDS in pcie_wait_for_link() or disabling either PDC or DLLSC if in-band presence is disabled seems simpler to reason about. > in-band PD disable (what's a good acronym for that, BTW?) I don't know, maybe inband_presence_disabled? Thanks, Lukas