From patchwork Thu Oct 17 19:32:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stuart Hayes X-Patchwork-Id: 1178976 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="pAQ5G7XD"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 46vK8C1QVFz9sPT for ; Fri, 18 Oct 2019 06:33:15 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2436640AbfJQTdM (ORCPT ); Thu, 17 Oct 2019 15:33:12 -0400 Received: from mail-oi1-f196.google.com ([209.85.167.196]:40433 "EHLO mail-oi1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2436526AbfJQTdK (ORCPT ); Thu, 17 Oct 2019 15:33:10 -0400 Received: by mail-oi1-f196.google.com with SMTP id k9so3173687oib.7; Thu, 17 Oct 2019 12:33:08 -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=/kc+SMypV+pC805s4yI+AQvbHp3a7EeT/I+X+XRBtGo=; b=pAQ5G7XDzcnZ/mp1uMSL9Sa/CRRBV+JqURcKMNDrTCP1l6yAAaab6lNJ7P+3WNWwBT s9UT4QrGTI/fsMkySKe6ieUXUkMxMpL+88GxZEjvEUkuDYl6fSaM1bC+4UfSweWaCTRt /EEHjn7rmsSufZDEbjktWqnrHB4ERKbixYGH81upSwt7beq/kZVBRNE6KvzWWvYqkoeA ESUJOhDFBaJ4tnmUuabA6HVXFN2jgQv8BTBCKqimyXhF+k65avR0yL7UT9dFdKIiHdjF wa7VRxvcTEwHZUe1jVQxcj7NEn8dlAQEj2/WRCLSlaMkKiqSVEqSRzOaAqEGBbaZpHqB R0kA== 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=/kc+SMypV+pC805s4yI+AQvbHp3a7EeT/I+X+XRBtGo=; b=EEiHusxyjkxXQPIQm5AJV1/WX0/+jukSQ+MmAjQ4MHgvJVg3VuP7pV0ocF6nX7lSGO daCoDeXHmyIpy9DvCWoCMLPyapgYFv/GMhyk2d6YRir8/HE6C8/VDrSIGXCmNQsmyVFG Sj9BrA52pee/YV5fqKgUELIaDP7hsXBSIWVTp3ik/CQkM/RU520lEVHyYIG4tx4wRrJ0 zh58qxPwxFxdWCUsjnSfDEy1KElD6eJ+lj7j7jkc9hihTFS8oNQFBDF2jrSgeMJmO7oN XpSlHhFI4s3MWCKFlKIkV29qxmmoJtXmEPVRh3yZ3Xd1IYrkoniFXC9EjKrPrVD/FvNp DJFw== X-Gm-Message-State: APjAAAU7fuxZX+MK6LlIwxvPE01hc+axdui2bvBzhlijXeAuqW0xuVvl Zr40byohiGSH4RiIk00rpFo= X-Google-Smtp-Source: APXvYqwbOKXhiSCFjbCVSy4my7vj1z6Kp2WpTQm5E37lRrRSClRHZVDMrfIRAuiKQUch8OM8bM+T6A== X-Received: by 2002:aca:5d8a:: with SMTP id r132mr4480225oib.119.1571340788316; Thu, 17 Oct 2019 12:33:08 -0700 (PDT) Received: from localhost.localdomain ([143.166.81.254]) by smtp.gmail.com with ESMTPSA id z12sm823273oth.71.2019.10.17.12.33.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Oct 2019 12:33:07 -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 v3 3/3] PCI: pciehp: Add dmi table for in-band presence disabled Date: Thu, 17 Oct 2019 15:32:56 -0400 Message-Id: <20191017193256.3636-4-stuart.w.hayes@gmail.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20191017193256.3636-1-stuart.w.hayes@gmail.com> References: <20191017193256.3636-1-stuart.w.hayes@gmail.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@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 --- drivers/pci/hotplug/pciehp_hpc.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c index 02eb811a014f..4d377a2a62ce 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,16 @@ #include "../pci.h" #include "pciehp.h" +static const struct dmi_system_id inband_presence_disabled_dmi_table[] = { + { + .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 +906,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.