Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp4527962imj; Tue, 12 Feb 2019 18:36:01 -0800 (PST) X-Google-Smtp-Source: AHgI3Iav4bg1nmAZj8Rs/3X/Vm203q5DSVQZzdd6cqbuJJO3Bsyfe9zCiB8c0XLT8p0V9bEGmpz4 X-Received: by 2002:a63:d157:: with SMTP id c23mr6623686pgj.170.1550025361118; Tue, 12 Feb 2019 18:36:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550025361; cv=none; d=google.com; s=arc-20160816; b=0fCSXB6bfJPtKxOpTUE9MkO1JWJn16TwrO6ed2K2BmZ7MAqW8QajLD3ebrPDA9F8SA FuIrrgcLLKMZLAJ0OLH33u/SawX5Jg6Dm6tLHFdxNPTk/91SnSdKSaKieJCJbugC4TkF EgPnpaRynCEJbT+g8wWpHCbYVirkZK4956ksM09+Ooa6LqfrlhucVpW1WUl7QaPEVDzo +duastD0vyFZnJui7yAjhrGYGcsYH2isvMZ7nhTXjtxJ0Bn+wyZcY9mV1xJbgc8YlMJb BdWiqKOG5Oki5oLFj7FFpJ2uZHN+Mooiw6Q4Y/CvanZpMvAbJahOosVEkbO0ux5qDjPn Vong== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:references:message-id:date :thread-index:thread-topic:subject:to:from:cc:dkim-signature; bh=y7KhCcP1ZXBLANEuR+CE7bwP5wz8dDkbuI4mdKi8X4E=; b=AXpqltX48wrkq5DtpaYi1cr+M4ct0B2F3S1pv8/YPoslTcAQzMMRnW10yBc2eTDD/D mZI5mRAHZac2DvrN3F04gdnFDklusCJmkk+GbxWGHj4vs2YijOEnOfpRmgD5huJV9HmB 4t6F5bcToER56MN+xEYVhLmjLlQkMJryWffZA6TitHlOvq+qjbFqXS2mJYKltS0uFCbO RBP7Pqj9Gw3i2P24Thib4tun18hgtM2M7fq0U/DoOWDE/zXnJFj7f73Br6aLRU8azA7C OsAibatELrcwBzMxG2R3Yiq4im+QNYsEMC/bDbaruJaaheiRFVqjIfpk0NsEOTYhdovs MsKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@dellteam.com header.s=smtpout header.b=IrVGRhG+; 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 k123si7733692pgc.280.2019.02.12.18.35.45; Tue, 12 Feb 2019 18:36:01 -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; dkim=fail header.i=@dellteam.com header.s=smtpout header.b=IrVGRhG+; 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 S1732582AbfBMAH2 (ORCPT + 99 others); Tue, 12 Feb 2019 19:07:28 -0500 Received: from esa8.dell-outbound.iphmx.com ([68.232.149.218]:1705 "EHLO esa8.dell-outbound.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728789AbfBMAH1 (ORCPT ); Tue, 12 Feb 2019 19:07:27 -0500 X-Greylist: delayed 566 seconds by postgrey-1.27 at vger.kernel.org; Tue, 12 Feb 2019 19:07:26 EST DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dellteam.com; i=@dellteam.com; q=dns/txt; s=smtpout; t=1550016446; x=1581552446; h=cc:from:to:subject:date:message-id:references: content-transfer-encoding:mime-version; bh=4i6tT/j0epsZwWvUMo0P86JYbjHMAjxumLjbiTLVauQ=; b=IrVGRhG+7XaidtP9f+PeLudU7MpWuSPbTx8F86J/XwdcClFHcFp7xxl0 VzzqJxqOMqAMv7nFU5pG2pgdr6XG0n1sO/l6QjPmdK4GpjG54qBJC1yg1 UDZO4q6z5pZxIVvpvSVGtlh4hkIv+yHeRs4gR1tgyqZv/WUbs3fQTTqZK o=; X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2EbAADUXGNchiWd50NjGwEBAQEDAQE?= =?us-ascii?q?BBwMBAQGBVAMBAQELAYJZgRQxjHOLEoINgX2YEQsBASyEQINIIjcGDQEDAQE?= =?us-ascii?q?CAQECAQECEAEBAQoJCwgpL4I6IoJvAQEBAwESKD8FCwIBCBgeEFcCBBsTB4M?= =?us-ascii?q?CgXoInls9Am2BAYkHAQEBgh6KLIxDghaBEYJkLoUBTYUTAol7ggaXHgkFkkM?= =?us-ascii?q?hkmCcFQIEAgQFAhSBXIF5cIM9gicOCY4eQYFZjV4BgR4BAQ?= X-IPAS-Result: =?us-ascii?q?A2EbAADUXGNchiWd50NjGwEBAQEDAQEBBwMBAQGBVAMBA?= =?us-ascii?q?QELAYJZgRQxjHOLEoINgX2YEQsBASyEQINIIjcGDQEDAQECAQECAQECEAEBA?= =?us-ascii?q?QoJCwgpL4I6IoJvAQEBAwESKD8FCwIBCBgeEFcCBBsTB4MCgXoInls9Am2BA?= =?us-ascii?q?YkHAQEBgh6KLIxDghaBEYJkLoUBTYUTAol7ggaXHgkFkkMhkmCcFQIEAgQFA?= =?us-ascii?q?hSBXIF5cIM9gicOCY4eQYFZjV4BgR4BAQ?= Received: from mx0b-00154901.pphosted.com ([67.231.157.37]) by esa8.dell-outbound.iphmx.com with ESMTP/TLS/AES256-SHA256; 12 Feb 2019 17:57:59 -0600 Received: from pps.filterd (m0144103.ppops.net [127.0.0.1]) by mx0b-00154901.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x1CNllV4113570; Tue, 12 Feb 2019 18:57:58 -0500 Received: from esa2.dell-outbound2.iphmx.com (esa2.dell-outbound2.iphmx.com [68.232.153.202]) by mx0b-00154901.pphosted.com with ESMTP id 2qm310sm2s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 12 Feb 2019 18:57:58 -0500 Cc: , , , , , , , Received: from ausxippc106.us.dell.com ([143.166.85.156]) by esa2.dell-outbound2.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA256; 13 Feb 2019 05:56:42 +0600 X-LoopCount0: from 10.166.134.84 X-IronPort-AV: E=Sophos;i="5.58,364,1544508000"; d="scan'208";a="352948300" From: To: Subject: Re: [PATCH] PCI: pciehp: Do not turn off slot if presence comes up after link Thread-Topic: [PATCH] PCI: pciehp: Do not turn off slot if presence comes up after link Thread-Index: AQHUvZbN4kEiyNA8xUGy+Uw4G87SXw== Date: Tue, 12 Feb 2019 23:57:55 +0000 Message-ID: References: <20190205210701.25387-1-mr.nuke.me@gmail.com> <20190209115849.244u67h7wmn3eb7o@wunner.de> <52afa1c45f684dbda6a8771b65583a22@ausx13mps321.AMER.DELL.COM> <20190212083031.2no7mzn5xug7nba3@wunner.de> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [143.166.11.234] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-02-12_13:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1902120161 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/12/19 2:30 AM, Lukas Wunner wrote:=0A= > The PCI SIG=0A= > should probably consider granting access to specs to open source=0A= > developers to ease adoption of new features in Linux et al.=0A= =0A= Don't get me started on just how ridiculous I think PCI-SIG's policy is =0A= with respect to public availability of standards.=0A= =0A= >>> Table 4-14 in sec 4.2.6 is also important because it shows the differen= ce=0A= >>> between Link Up and in-band presence.=0A= >>=0A= >> So, we'd expect PD to come up at the same time or before DLL?=0A= > =0A= > Per table 4-14 and figure 4-23 (immediately below the table) in r4.0,=0A= > PDC ought to be signaled before DLLSC. As said, Linux can handle PDC=0A= > after DLLSC if they're not too far apart (100 ms, see pcie_wait_for_link(= )).=0A= > =0A= > =0A= >> I'd like a generic solution. I suspect supporting 'in-band PD disabled'= =0A= >> and quirking for that would be a saner way to do things. If we support= =0A= >> it, then we need to handle PDSC after DLLSC scenarios anyway.=0A= > =0A= > I agree, having support for this new ECN would be great.=0A= > =0A= > If you look at struct controller in drivers/pci/hotplug/pciehp.h,=0A= > there's a section labelled /* capabilities and quirks */. An idea=0A= > would be to add an unsigned int there to indicate whether in-band=0A= > presence is disabled. An alternative would be to add a flag to=0A= > struct pci_dev.=0A= =0A= > Instead of modifying the logic in pciehp_handle_presence_or_link_change()= ,=0A= > you could amend pcie_wait_for_link() to poll PDS until it's set, in=0A= > addition to DLLLA. The rationale would be that although the link is up,= =0A= > the hot-added device cannot really be considered accessible until PDS=0A= > is also set. Unfortunately we cannot do this for all devices because=0A= > (as I've said before), some broken devices hardwire PDS to zero. But=0A= > it should be safe to constrain it to those which can disable in-band=0A= > presence.=0A= =0A= =0A= The recommendation is to set the "in-band PD disable" bit, and it's =0A= possible that platform firmware may have set it at boot time (*). I'm =0A= not sure that there is a spec-justifiable reason to not access a device =0A= whose DLL is up, but PD isn't.=0A= =0A= (*) A bit hypothetical: There is no hardware yet implementing the ECN.=0A= =0A= > Be mindful however that pcie_wait_for_link() is also called from the=0A= > DPC driver. Keith should be able to judge whether a change to that=0A= > function breaks DPC.=0A= =0A= That's why I went for ammending pciehp_handle_presence_or_link_change(). = =0A= Smaller bug surface ;). What I'm thinking at this point is, keep the =0A= patch as is, but, also check for in-band PD disable before aborting the =0A= shutdown. Old behavior stays the same.=0A= =0A= I'll rework this a little bit for in-band PD disable (what's a good =0A= acronym for that, BTW?), and then quirk those machines that are known to = =0A= 'disable' this in hardware.=0A= =0A= Alex=0A=