Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3442889imm; Mon, 13 Aug 2018 11:47:13 -0700 (PDT) X-Google-Smtp-Source: AA+uWPw9NJ4++PWQuMDNHMoTJFgF0KWlu6WnweTAigddDozvn0isFQfjMh/yAL6DUKF8HSMaO0JJ X-Received: by 2002:a62:455b:: with SMTP id s88-v6mr20224291pfa.203.1534186033721; Mon, 13 Aug 2018 11:47:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534186033; cv=none; d=google.com; s=arc-20160816; b=qbTVNjVFcmyeC3nL9SOOHVqXdCGp/TxqL1jo3YjGalZ0ll9k3OvUPDF1G68bINjaY0 /y2uj83TxTd5NiXGhKoyuBt2qkcgA3Hz91Pr8G5hKLbIVGytlrhX1span/0AvC9cz3xG 8LrMN7hOiOlRyDuonQJlREu9T5d+imrQ+jOYN2SLg5SR9R/tg/PFv/zJ05pKsytwF+M/ QH38lrutcoELhMkGiVINqRhaHXilV8pN7txP54TuD7TXrsJYl4ek7WiX5DtxNRRXpp17 LvRXq468QHV232en2TM0RLiWKPoGvyrxHZ/otjJrZ1H2XRjZhUvQr8dnKLdL73zbqtTy jXGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=n1O9Gwwodvzq4FZSULR3fxI6ClulvJuWQmgwRYAsWyc=; b=AC+bKkLim6Dn5TTQ2QwYWjfsLqTRfVNekGRES5HAUasnCi4E72QBF/t16rVnsOVHS8 44J4tsSTM5tqg82gcDDBffmUxidLXyEHiggLN+fjpq9Ikg5zudewE9h6/kSzJB9PyVYT bdd1lj30PbCID726rMC9J9owC2oMPm7qryVK2j+k1N+pPxZtYMw5bNKZxDhGRtoygTzF V8WH6rXEd7iVO5JOhn4bwNYCJpsyIyRHcdNOd5/yYRRDypyrYjM9Q4gXQBHZ3zb8CZhl KTzjAV8Xicr+RJ87Y0e8zhLGvNkX2U8rN84zY6ylUAkGeuZq9hFlBsa/XAWWXoGgCjbf PNow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="a/dAvLES"; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i21-v6si18012541pgg.513.2018.08.13.11.46.58; Mon, 13 Aug 2018 11:47: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=@kernel.org header.s=default header.b="a/dAvLES"; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730493AbeHMV2p (ORCPT + 99 others); Mon, 13 Aug 2018 17:28:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:47642 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730225AbeHMV2p (ORCPT ); Mon, 13 Aug 2018 17:28:45 -0400 Received: from localhost (unknown [69.71.4.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 39ABD2175A; Mon, 13 Aug 2018 18:45:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1534185919; bh=+Illrr5jh/iRRSNwV6qRhodjs5SaQKGxdOQMPOy8Dc4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=a/dAvLESRgH1t1o0YcUFXFsDIKNGeMoy+ymIDSDqWfW7p+gJnRLHgT7F2rVVNtlJX bK7jsvn+ZG9Wof6Ix+fK7v83gKZ5R6z3Iwj6kZLxW4xkN7Y+b9ZaotNSARnHzTJe7r aeqD5+TgliAajAdHk5YneZ4Ly0kZVUpIR+2Ox1XA= Date: Mon, 13 Aug 2018 13:45:16 -0500 From: Bjorn Helgaas To: joeyli Cc: "Lee, Chun-Yi" , Bjorn Helgaas , Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , x86@kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] x86/PCI: Claim the resources of firmware enabled IOAPIC before children bus Message-ID: <20180813184516.GL113140@bhelgaas-glaptop.roam.corp.google.com> References: <20180724110144.16442-1-jlee@suse.com> <20180806214807.GE30691@bhelgaas-glaptop.roam.corp.google.com> <20180808155318.GE13767@linux-l9pv.suse> <20180808212322.GF49411@bhelgaas-glaptop.roam.corp.google.com> <20180810092501.GP13767@linux-l9pv.suse> <20180810135837.GI113140@bhelgaas-glaptop.roam.corp.google.com> <20180812001413.GC3570@linux-l9pv.suse> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180812001413.GC3570@linux-l9pv.suse> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Aug 12, 2018 at 08:15:45AM +0800, joeyli wrote: > On Fri, Aug 10, 2018 at 08:58:37AM -0500, Bjorn Helgaas wrote: > > On Fri, Aug 10, 2018 at 05:25:01PM +0800, joeyli wrote: > > > On Wed, Aug 08, 2018 at 04:23:22PM -0500, Bjorn Helgaas wrote: > > > ... > [...snip] > > > hm... I have another question that it may not relates to this issue. I > > > was tracing the code path of PCI hot-remove/hotplug. Base on spec, looks > > > that the RST# should be asserted when hot-remove. And the memory decode > > > bit must be set to zero after RST# be asserted. But I didn't see that > > > any kernel PCI/ACPI code set RST#. The only possible code to set RST# is > > > in POWER architecture. Do you know who assert the RST# when hot-remove? > > > > RST# is a conventional PCI signal (not a PCIe signal). In any case, I > > would expect signals like that to be handled by hardware, not by > > software. What section of the spec are you looking at? I wouldn't > > In PCI Hot-Plug Spec v1.1 > > 2.2.1 Hot Removal > The Hot-Plug System Driver uses the Hot-Plug Controller to do the following: > a) Assert RST# to the slot and isolate the slot from the rest of the bus, in > either order. > b) Power down the slot. > c) Change the optional slot-state indicator, as defined in Section 3.1.1, to show > that the slot is off. > > In the above description, it said that "Hot-Plug System Driver" should done > the job. So I was think that kernel driver must asserts RST#, but I didn't > find that in kernel code. I don't think there's much in that spec that's still relevant unless you are using conventional PCI. Most current hardware would be using PCIe, and the PCIe spec itself covers hotplug (PCIe r4.0, sec 6.7). Prior to PCIe, hotplug wasn't directly included in the PCI spec, and there were several varieties of hotplug controllers (SHPC, Compaq hotplug controller, IBM hotplug controller, CompactPCI, etc.) The PCI Hot-Plug spec covers the high-level model but doesn't have the details of any of these controllers. There is a separate spec for the SHPC ("PCI Standard Hot-Plug Controller and Subsystem Specification", r1.0, June 20, 2001), which does talk about requirements for RST#. But even there I don't see a way for software to directly control RST#; it looks like software programs the Slot Control Logic, which in turn manages RST# based on commands from the software and hardware inputs like presence detect. > Then, in PCI Local Bus spec v2.2, it mentions: > > Table 6-1: Command Register Bits > Bit Location Description > 0 ...State after RST# is 0. > 1 ...State after RST# is 0. > > So, after hot-remove the RST# must be asserted and the IO/memory > decode bit should also be set to zero. > > I was tracing the kerenl hot-remove code for RST# because I > want to make sure that kernel didn't change the RST# state from > firmware. > ... > But I still confused about the "Hot-Plug System Driver" wording in > PCI Hot-Plug Spec. The "Hot-Plug System Driver " means a kernel > driver? I would interpret "Hot-Plug System Driver" to refer to one of the kernel PCI hotplug drivers (pciehp, shpcpd, cpqphp, ibmphp, etc.) Bjorn