Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4135360ybg; Fri, 25 Oct 2019 13:54:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqxGZukTWhiSosbaDk7Zr5mBhqMo1qTrB+gZFZ9JiMsZs/tQU6QLXNJDrX4GQK/UIGChvoaS X-Received: by 2002:a05:6402:1255:: with SMTP id l21mr6264712edw.41.1572036853537; Fri, 25 Oct 2019 13:54:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572036853; cv=none; d=google.com; s=arc-20160816; b=ISw4k/xrNCMghcBYdmDBIZgSs5az2CTSira3qozn3X8UByHqWJZT4RHhFmwjmXahbM PNyyfWxpPmIjDC23ee1wz3VcWdf18Fs9JICdoIRk2LiiQ8OB5TrzOnQxcefjcvV95UDL l9V2EQqF2PK4IoqfsSQcCThnUQNZcU4BDhqp4VDIzi+tH1qp8k4LDHgMnNKmB+Po3iXq jkHz6dU8OO1cl8Vo0I0rOeiVGAyDizMJKfVvBoB7f4o+DPThMkTAEriDXvfFhEbJntcn YTFy6lumSyvx31H89c/KGnIufNcJwSEVSHWXbIaiG2Ao0ijSo9qmNupceYFNZTHysn6N c2eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=ZGAwrWZgsty9clvwOGUkdUA2YOhaXXaSo85YzV6o32E=; b=gLAZBnsGZwHmIDfm01AJmwTMv1hwN+Rpu4juJQbEz2Gi2XdbgO5tPi+8MTTV0IeBOL r6Pk17QWIPDsdoJfwN62McS4cu7xDFx4va8koqZ3XMpyvHJIiFnYPQCVgkEr+sCR3/Cu CvXsk282B5ozjOoDDhPvPWzT+elStmvCWS85Q5Se4V/SD9AwkYHsv7wxmuJqw/huCgY7 boma1J4BfJ7KhyDCfCiFbZEa8eOLM3oN/SEKb+hta98OsJWs1i4Iw1HGDe/o3Y5Ls5MI gCiyvo5tN8E5V+U64x2KlsClJX9A2f2gQvkW+PCsXcSriAZmDH8+prrFC+ErZWbQHl3s zEFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TD84hYL8; 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 f3si2120287eda.251.2019.10.25.13.53.50; Fri, 25 Oct 2019 13:54:13 -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=TD84hYL8; 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 S1729459AbfJYTBC (ORCPT + 99 others); Fri, 25 Oct 2019 15:01:02 -0400 Received: from mail-oi1-f196.google.com ([209.85.167.196]:42309 "EHLO mail-oi1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725865AbfJYTBB (ORCPT ); Fri, 25 Oct 2019 15:01:01 -0400 Received: by mail-oi1-f196.google.com with SMTP id i185so2288571oif.9; Fri, 25 Oct 2019 12:01:01 -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; bh=ZGAwrWZgsty9clvwOGUkdUA2YOhaXXaSo85YzV6o32E=; b=TD84hYL8dXownyhIRGQ6Lz4qNy9OtOmSZU+TYDoXgBajq4NuVqDdXxeFw0SBNFEers Kcl3RScDT239I30Ii+h9a5rpckGd5FkRFVvI000RC83BlNy+Tqfo/h0p71VMPlceqNp5 uIZYP2GDPePDXaL4Z+D8oyZM5qeJFbIGliYlh+meiR/rpSIzQU1NbhuPW9YSnSRZV96L j6iBYDZtqXze0vk9LGIQsDkodL/uM41qLWFX8+ksCy9dTaB4yu+QJY2MTi2+4GggqGcw 5MUsgXScor/zbCIrveB+Nblwt1ScpJAFZ+dnAvpHH6l898AjgREfH1f+YsE7t8LF/kgq 470Q== 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; bh=ZGAwrWZgsty9clvwOGUkdUA2YOhaXXaSo85YzV6o32E=; b=jFT7RJtlH6ml6869lcdWApd6++LyHkZqJ7I6sK9LuWGlQwVHXQGdCzTEMTZrE9xo5+ TGwk43BKZLhf3QVoCGD8HuwwlCEOmyrJfMYVlxn/X69xV47kobbDOtnWdqxVbpdjjxjL zZEWo55g4y7mVn7dOEv2uPoKUNHWR3Wc8MVmtOca+W6ppnDVtHKX8yA5hAMGXQNwR4hj XGxREk7ETMOA5/roilv3y5z1n8xovxZtjgwKk+EdRlxK850JwJcl4UmZ2oxT1AporsD1 c/szV3rgGRhk9PlsCRc1WihAL+7g0JyK21aJxQ360jeKSnpWd9diX/KDUFcl62nWDxJa 54PQ== X-Gm-Message-State: APjAAAXw9ZVj2a88G3jxzm7EtQw4wObHnCm6pKWonEkEexwmc7PzzVrw CsDA6h6UCv6HvUQ2/PWIWxM= X-Received: by 2002:aca:3305:: with SMTP id z5mr4393147oiz.68.1572030060624; Fri, 25 Oct 2019 12:01:00 -0700 (PDT) Received: from localhost.localdomain ([143.166.81.254]) by smtp.gmail.com with ESMTPSA id 21sm748039oix.31.2019.10.25.12.00.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2019 12:01:00 -0700 (PDT) From: Stuart Hayes To: Bjorn Helgaas Cc: Austin Bolen , keith.busch@intel.com, 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, lukas@wunner.de, Stuart Hayes Subject: [PATCH v4 3/3] PCI: pciehp: Add dmi table for in-band presence disabled Date: Fri, 25 Oct 2019 15:00:47 -0400 Message-Id: <20191025190047.38130-4-stuart.w.hayes@gmail.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20191025190047.38130-1-stuart.w.hayes@gmail.com> References: <20191025190047.38130-1-stuart.w.hayes@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some systems have in-band presence detection disabled for hot-plug PCI slots, but do not report this in the slot capabilities 2 (SLTCAP2) register. On these systems, presence detect can become active well after the link is reported to be active, which can cause the slots to be disabled after a device is connected. Add a dmi table to flag these systems as having in-band presence disabled. Signed-off-by: Stuart Hayes --- v4 add comment to dmi table drivers/pci/hotplug/pciehp_hpc.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c index 02d95ab27a12..9541735bd0aa 100644 --- a/drivers/pci/hotplug/pciehp_hpc.c +++ b/drivers/pci/hotplug/pciehp_hpc.c @@ -14,6 +14,7 @@ #define dev_fmt(fmt) "pciehp: " fmt +#include #include #include #include @@ -26,6 +27,24 @@ #include "../pci.h" #include "pciehp.h" +static const struct dmi_system_id inband_presence_disabled_dmi_table[] = { + /* + * Match all Dell systems, as some Dell systems have inband + * presence disabled on NVMe slots (but don't support the bit to + * report it). Setting inband presence disabled should have no + * negative effect, except on broken hotplug slots that never + * assert presence detect--and those will still work, they will + * just have a bit of extra delay before being probed. + */ + { + .ident = "Dell System", + .matches = { + DMI_MATCH(DMI_OEM_STRING, "Dell System"), + }, + }, + {} +}; + static inline struct pci_dev *ctrl_dev(struct controller *ctrl) { return ctrl->pcie->port; @@ -895,6 +914,9 @@ struct controller *pcie_init(struct pcie_device *dev) ctrl->inband_presence_disabled = 1; } + if (dmi_first_match(inband_presence_disabled_dmi_table)) + ctrl->inband_presence_disabled = 1; + /* * If empty slot's power status is on, turn power off. The IRQ isn't * requested yet, so avoid triggering a notification with this command. -- 2.18.1