Received: by 2002:a17:90a:c8b:0:0:0:0 with SMTP id v11csp2290800pja; Fri, 19 Apr 2019 11:23:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqz92ibHCdvLOHfCsmIFfUI4R55kkl+OxMrHKfWgd8mBmznbxg01A0GHYSHs6M9I3yzho/zh X-Received: by 2002:a63:5b24:: with SMTP id p36mr5114333pgb.84.1555698184650; Fri, 19 Apr 2019 11:23:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555698184; cv=none; d=google.com; s=arc-20160816; b=baxrQg8EZWl2Mm+a8GhMomFCh4z472QhbaErmTiAvu3s2kJuPZKZz8pS6Qm8RBjCwQ 1GmxaN+h11SSnZi3KtJ9ikym+9xAPPTScS+ywDumR8DCNVptLJUcIew6hBhJWu5hviD7 NMa/Q0/XYgDl6Dua4KZJbMxU3DmW9ZTCWFie91X+WH3/Q6L9vQDmmbbtiM/ZyfNa+Kb4 bHK4C0EkrLs22WkpoWsjiwtRI6y8+/xIFCRCV2Bcz+nk0CbhTwXMeH/IP4pI0H+FlsHP u/6267+FouAIAtNYh95so4T2kJI0mn9lYBlyRsyqZz2M1QlNAfvDUbmOHRDzYK/BzzTb Spkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ipjuS9qwCBATwNCfiYQ7UMxrBp0CW7IGZyik2RLkA8k=; b=Ru3QDxQEOmAIF8jpTufNcAdFdQOvO89X0dy1UHuXoPjpM8YDXMRPs/ckRPLRHQmTil TruLvBPr+DPd5/a+s/ZNhsm0E0QYd2GYkm7EnkF5NfXbMUFtvqLrDp2fqEV3/WVE83/m vzQQH/wuFfj8VD7lpwgXZCZtl7ImTtyoeub19FdzS4vQL88GS9q5r5Jo9rz0Vit1lFNa jMHtggoPC+arYKDCPDJJX/pQPlUZZ41DLS5v39HB8TPtYpfJF4b/9flockPgWlrksuIn 3HjTQagbBMOeDfss+LCzaRi4L6ewzQHrHrpxRX1xOJ/3WFEkm94I+SgaBFase/kq3Nx6 KEKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BCvw4Vlg; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o12si5182715pgp.94.2019.04.19.11.22.49; Fri, 19 Apr 2019 11:23:04 -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=@gmail.com header.s=20161025 header.b=BCvw4Vlg; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727377AbfDSSU0 (ORCPT + 99 others); Fri, 19 Apr 2019 14:20:26 -0400 Received: from mail-ot1-f66.google.com ([209.85.210.66]:46286 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726866AbfDSSUU (ORCPT ); Fri, 19 Apr 2019 14:20:20 -0400 Received: by mail-ot1-f66.google.com with SMTP id s24so4919835otk.13; Fri, 19 Apr 2019 11:20:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ipjuS9qwCBATwNCfiYQ7UMxrBp0CW7IGZyik2RLkA8k=; b=BCvw4Vlg+myPyQWBJ2S3QoHoQcZKQVipkBr29A0k8XZovUaQSdNFIbceNqG82T02CQ KEC+jflXwJqTev+PKU4uJrmlHB/VSKdv42J/kXoQDVkKYl8nM14rUMcoiCp9Eev3Lvvt Rq60STu0ds5xhk/B+nJgGJe+3WI/RgSgkt8m3rzjJC7yOg6Gc1Y/D3Pp9bSG0xeDXil4 24admgq16mUBdqzqaYjpQkE03jqAB8LKbvZnY7o0hwArtHc5U+Ib6UTaE0Myiyi+Ez4B 7dWe1+zJSzNUk32+Ik4CBOkCXMHHy5W3Z9e6HQY+uPOV19vt+KmD9R5ORsGiYGnGlFV7 Lq+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ipjuS9qwCBATwNCfiYQ7UMxrBp0CW7IGZyik2RLkA8k=; b=L2FHZZhRTEn1VUHBBhmQXpmb5qSPYcMdCLKOvpDl6k2yepSk6m2RLup9q4aMcdariP uiO3pgxK0LQqHGgrMMaE12ggzdCBtkziCIMFrjOX0BrOHaE6xkvuY9rMWaWLz0AI8uQR kwZD6LY3429/LfsYPh3ptHknoaXjMAQf86Rk9k9HwLBUw31ZeCGqN74Uvt5H4Fo4JsZO ltqwx81OeXHqAC9/yjDHk6D1yvt4XhLFqan1rxsFV0SuYdXr4yZJeLVDE4lW+NgzVu3F DXd99b8kRUlMDbQxFhv+7mjoWnAgPFJe7wwk8ZiAVoUHwGIbmKmOqcCppmZ5XUDPzmXD 9cNg== X-Gm-Message-State: APjAAAViuHCa7U8tsIzfkdrzo3ObrWOo05EvJGuLicGScW0TWqqaYRhA 8YCW6vdhMwyJW66piApwDMVIYLtTKV8= X-Received: by 2002:a9d:19cd:: with SMTP id k71mr2433184otk.267.1555687368735; Fri, 19 Apr 2019 08:22:48 -0700 (PDT) Received: from nuclearis2-1.lan (c-98-195-139-126.hsd1.tx.comcast.net. [98.195.139.126]) by smtp.gmail.com with ESMTPSA id y9sm1981723otk.20.2019.04.19.08.22.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 19 Apr 2019 08:22:47 -0700 (PDT) From: Alexandru Gagniuc To: bhelgaas@google.com Cc: austin_bolen@dell.com, alex_gagniuc@dellteam.com, keith.busch@intel.com, Shyam_Iyer@Dell.com, lukas@wunner.de, Alexandru Gagniuc , "Rafael J. Wysocki" , Mika Westerberg , Andy Shevchenko , "Gustavo A. R. Silva" , Sinan Kaya , Oza Pawandeep , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 0/4] PCI: pciehp: Do not turn off slot if presence comes up after link Date: Fri, 19 Apr 2019 10:22:22 -0500 Message-Id: <20190419152238.12251-1-mr.nuke.me@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190419000148.GI126710@google.com> References: <20190419000148.GI126710@google.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org According to the old PCIe spec, PDS would always have to come up with or before DLLLA. For various reasons, not all OEMs followed this requirement. As a result, in PCIe 4.0(*), there is a new way to disable in-band presence reporting, such that PDS always reports the status of the out-of-band presence (if implemented). For us, this means it is legal to get a Card Present event after the link is active, and the driver was loaded. This causes an erroneous removal of the device driver, followed by immediate re-probing. In a fully PCIe-compliant world, we could leave inband presence enabled and not require any software changes. However, certain OEMs simply disable inband presence without implementing the requisite query and control bits. I present two solutions to resolve this. The first and last patch in the series are required. Of the remaining two, only one is required to complete the series. Since we don't yet have a go/no-go on which method to use, both solutions are included: - 2/4: Try to wait for PDS _before_ loading the driver - 3/4: Load as usual, and recognize the delayed PDS event as such (*) ECN was approved in Nov 2018, and is normative spec text. A lot of the leaked PCIe 4.0 specs do not have this change. Changes since v2: * Dropped [RFC] from title * Addressed style issue found by Lukas Alexandru Gagniuc (4): PCI: hotplug: Add support for disabling in-band presence PCI: pciehp: Do not turn off slot if presence comes up after link PCI: hotplug: Wait for PDS when in-band presence is disabled PCI: hotplug: Add quirk For Dell nvme pcie switches drivers/pci/hotplug/pciehp.h | 1 + drivers/pci/hotplug/pciehp_ctrl.c | 24 ++++++++++++++ drivers/pci/hotplug/pciehp_hpc.c | 52 ++++++++++++++++++++++++++++++- include/linux/pci.h | 1 + include/uapi/linux/pci_regs.h | 2 ++ 5 files changed, 79 insertions(+), 1 deletion(-) -- 2.20.1