Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp386865ybn; Tue, 1 Oct 2019 23:07:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqw0BapAPBSp8il1kt/mEg4AAv5WCqsRhCyhqreqvUE9j0YWqLq7K63QFV+2712/MAPhkis4 X-Received: by 2002:a17:906:4b07:: with SMTP id y7mr1587206eju.126.1569996423329; Tue, 01 Oct 2019 23:07:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569996423; cv=none; d=google.com; s=arc-20160816; b=rmPnruSfAZhL9V0U6312o7x+a6vsmFHBk+zdxRD4KpOZsld54JDPRCYLnvHp0wc91a 0DHSGSC1JHuR9Rl9DMieqTqVZ38eRZuhB+b8wbE2t+aj6G3WVNIuX/qJMkzgPeXm8UHT SuIR0uBNEHMUmoWHHn/rjJsk26KSTve/iEPWooIeXEALobznAwTdG936AffQDPt5Fp8F JSqlypIMmfSJNmN+ePw+QEg5Wty2cdpIVqYF+wyMVzF1OtiW5d3A71WVTbHtJOC1eIez PCQXRr5EsDn4Ux1IUj0OEnpmHLgBO3pcaYhGpoVIy4tAUicRZu6IHd0sDRnJFbPh43dJ 43DA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=fytjfeL2hboW36P5ZuUGnqHSPo8QfeVFETfrBcqUG5k=; b=W+3cE9YZaVMPacjGneS6271CX1aWmmYcr1QTu0QYj6YsHwRmEdJi/i6TvIzp8ScRpM 9lGuw77PrMxldpHuphvBlo8ByU59FRgfV6fwLzKZzZadzu/3ArRH0uFB1bGszpQ155OI kVHEHClaOnc/MRr+pxi2q0FlLS4ULXYDnedPre00RJVNJ1giSD4uc6XSwWfHAm5cMLru +Gjwzft5SiR31n5H58W2k2yTk9REuDvAfa4u9e7N4ZGw4/5Me18/mkeZE2f5izC58mJW Kc3n5ktVMQbRWGyim052UD1kI0y05HwFclYJ4Cl1eA+5rvjdb5KiCQUrJTOz9sv1NjFV bBDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZTGpaP2g; 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 b16si9643459ejb.165.2019.10.01.23.06.38; Tue, 01 Oct 2019 23:07:03 -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=ZTGpaP2g; 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 S1726808AbfJAXG0 (ORCPT + 99 others); Tue, 1 Oct 2019 19:06:26 -0400 Received: from mail-ot1-f65.google.com ([209.85.210.65]:33873 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726050AbfJAXGZ (ORCPT ); Tue, 1 Oct 2019 19:06:25 -0400 Received: by mail-ot1-f65.google.com with SMTP id m19so13130499otp.1; Tue, 01 Oct 2019 16:06:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=fytjfeL2hboW36P5ZuUGnqHSPo8QfeVFETfrBcqUG5k=; b=ZTGpaP2g4NMZOIs14s7NeYu98JVG+DdiPC2DrhYdw0NmT1LIaAPI5iTpREmTgsLPdp HGu9TEyjKdC0OTGR1OrigUrTyvZ5dwS6mIPygsz+72Vrr1iyJC0Q9U141rTy1QjqrnTV ydZVxuUx2q9hvwThFYZ2nyl7Yg8+S88jj8j8nl010bU568L6ctG554GKEBw9L03a56ry jHeZVx5qFKacKkog2Kt3adYCp+itsdoXRl3uMai8yuMo0w99IwyBVIk8EEtHe6d97uy5 bZgWwweRtHhMoS9lV/N21m/4wYFybZhl1VuN+8gJ56vSV5WYMTO9g1XK/9hjqp8wSPnL Y+Yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fytjfeL2hboW36P5ZuUGnqHSPo8QfeVFETfrBcqUG5k=; b=UsUF7zUhrMp4CouyCVBvQP4xFE6wD+kxhf5vGtI9vFoen3mPp7ExAU5S2DDQi2xLay ENBwCyzFtUdFnZYOgEQ31Pl/gX+lho1rnXOrsZhrKFBE9IrWVJ4cIhqrybU3UGtQZxb8 NiJNdlm3HY3mqR+Y38RShZ6/Notav6O7WFYb9DOBPehO/BnMc0LNncE6dr6wkuTM3+ll d9OQni0/BJ0hpN0aWpzhAnQ2UxB4ygr24B2EN+HleV4B/WDcZg2xNZOTZVVVq83i8qDD SpREdOsxIerllflkpjbQ/lyt52mKTKVcxcQ5khgErHRbR8OekNg8l403oopGrnyu+4dp sR/w== X-Gm-Message-State: APjAAAXt1FOgtdTgiKHz4o57TXt2BkvJRvzMPSu2gciAib6tT/xUmAEO tvyfl5UbX+twPuUCfVvJoTL0Fw+hgOESupDqsgM= X-Received: by 2002:a9d:6a59:: with SMTP id h25mr344859otn.324.1569971184510; Tue, 01 Oct 2019 16:06:24 -0700 (PDT) MIME-Version: 1.0 References: <20191001211419.11245-1-stuart.w.hayes@gmail.com> <20191001211419.11245-4-stuart.w.hayes@gmail.com> In-Reply-To: From: Stuart Hayes Date: Tue, 1 Oct 2019 18:06:12 -0500 Message-ID: Subject: Re: [PATCH 3/3] PCI: pciehp: Add dmi table for in-band presence disabled To: "Alex G." Cc: Bjorn Helgaas , Austin Bolen , keith.busch@intel.com, "Rafael J . Wysocki" , Mika Westerberg , Andy Shevchenko , "Gustavo A . R . Silva" , Sinan Kaya , Oza Pawandeep , linux-pci@vger.kernel.org, Linux Kernel Mailing List , lukas@wunner.de Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 1, 2019 at 4:36 PM Alex G. wrote: > > > > On 10/1/19 4:14 PM, Stuart Hayes wrote: > > 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 1282641c6458..1dd01e752587 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_SYS_VENDOR, "Dell Inc"), > > + }, > > + }, > > + {} > > +}; > > + > > I'm not sure that all Dell systems that were ever made or will be made > have in-band presence disabled on all their hotplug slots. > > This was a problem with the NVMe hot-swap bays on 14G servers. I can't > guarantee that any other slot or machine will need this workaround. The > best way I found to implement this is to check for the PCI-ID of the > switches behind the port. > > Alex That is definitely true, not all Dell systems actually disable in-band presence detect and need this. However, we have a number of systems that need this, and we don't have the PCI IDs for all of these yet, so we decided it was preferable to just make all Dell systems wait for presence detect to go active. Since all of our systems support presence detect (either in-band or out-of-band), it shouldn't have any negative effects--on systems that support in-band presence, it will already be active and it won't spend any extra time waiting for it. If someone plugs in a device that has hot-plug slots with no support for presence detect at all (even though Dell doesn't support any), it should still work--it'll just take an extra second for them to come up.