Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5330678ybv; Tue, 11 Feb 2020 13:39:35 -0800 (PST) X-Google-Smtp-Source: APXvYqziVgUiJPBQLWxMt6ZmkmkQSkcTjYviCNScgPniBd00cqkN5lrGjycbDz9CpC5hrLre3AMk X-Received: by 2002:aca:1708:: with SMTP id j8mr4207340oii.166.1581457174828; Tue, 11 Feb 2020 13:39:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581457174; cv=none; d=google.com; s=arc-20160816; b=theETFZKLUnKdXikDDIt8Put7DFl7cxUy4XpPkhr/fAGRPvVI8vrt+UnRpHzjEL2Xq l2lolYD+wcbKD7OprfTb9er6Ey+qdfKWOH37uzV2/VoAMwuxn1yPn8i1eGg70RWjPuEi lfXE4OHfBc+lAkLHSIQ5ehvHAVPr8LC9pNXf+e78vMo7hsIlGYPoHbV7K07R5bq3RhGI DQmoYqKK0ADxO7Q53caI0MsF4hi2VYa3fednEVxopQBbxW09JwpAN3FZ6y2/78wgVMAR D5JlZ20I5OGWFT5oyxaaia2O/bYXQiClX6AcXUnZNBouHuARheqgKuP9w382jwJPSv6Q vvww== 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:message-id:subject:cc:to:from:date :dkim-signature; bh=qWb9KpdW42hF/0lvRuP8s4/G0qjylCIYzZsxdSygK8Q=; b=RUWiC6kOQg2Yez8g3wQpt95SRTW6t/3LvD2jdLvTyOnxYPPFDuaEx1HJdp1jCwc+Fd KUwHNzqEBweg2Q8zSrR61nq/dlH2H6gfNoOGiuBRUtYITjlt8W6T8Lk/KlgpQBrKrZbb IksrnjOGMu8tVCwfoANmaPb3zRZMsklCbG5/tkuaArsgRH8aYlWGTwrkrBCD55m9O679 b5vRgHRLtotxbD0iuUms2SC5+fqmnxjFNzLf5Mw7zJ9Hw4hYqkWTRqyTxgdcqIaWK7vx uD1TQOseMoRSATeWPEmdp7ub6Z1nL7EHW1dHn7g2BLCAw0DX+GGrnGZ1ZOuFILlePDo8 2apg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="i/iFTTtA"; 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 c22si2491840otr.97.2020.02.11.13.39.23; Tue, 11 Feb 2020 13:39:34 -0800 (PST) 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="i/iFTTtA"; 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 S1731680AbgBKTbh (ORCPT + 99 others); Tue, 11 Feb 2020 14:31:37 -0500 Received: from mail.kernel.org ([198.145.29.99]:39944 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728202AbgBKTbg (ORCPT ); Tue, 11 Feb 2020 14:31:36 -0500 Received: from localhost (mobile-166-175-186-165.mycingular.net [166.175.186.165]) (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 A4DB120708; Tue, 11 Feb 2020 19:31:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581449496; bh=r7k/XMqw3qY2ty8pnv4vptYRuDKiNSxERWglxSVb+RU=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=i/iFTTtAtW7jaP7DtT7TPE82Dal8u5Lwr/KfVJcxzdq4932X4z1POjZk63pSp9os2 uQq814+X0GnMHoZtR7xB2mimHftCb3PlprWlt+RpiE/x5O7cqf9vHLKZ6dWJbTu8NG DZyRvOUoPBNWeydeovDHf49HRrfZN+J+V+uio9sY= Date: Tue, 11 Feb 2020 13:31:32 -0600 From: Bjorn Helgaas To: Lukas Wunner Cc: Stuart Hayes , 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, Libor Pechacek Subject: Re: [PATCH v4 0/3] PCI: pciehp: Do not turn off slot if presence comes up after link Message-ID: <20200211193132.GA228644@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200211143202.2sgryye4m234pymq@wunner.de> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 11, 2020 at 03:32:02PM +0100, Lukas Wunner wrote: > On Tue, Feb 11, 2020 at 08:14:44AM -0600, Bjorn Helgaas wrote: > > I'm a little confused about why pci_hp_initialize()/ > > __pci_hp_initialize()/pci_hp_register()/__pci_hp_register() is such a > > rat's nest with hotplug drivers using a mix of them. > > This is modeled after device registration, which can be done either > in two steps (device_initialize() + device_add()) or in 1 step > (device_register()). > > So it's either pci_hp_initialize() + pci_hp_add() or pci_hp_register(). > > The rationale is provided in the commit message of 51bbf9bee34f > ("PCI: hotplug: Demidlayer registration with the core"). Thanks for the pointer. I wrote that down in case I ever try to figure that out in the future. Obviously I haven't looked at this in any detail, but it seems like the sort of thing that all the hotplug drivers should do the same way regardless of their internal structure, and the slot concept seems pretty integral to the bridge leading to it. Maybe this is a somehow a consequence of the hotplug drivers being separated from the enumeration path. Or maybe the slot part could be split out from the hotplug drivers and done during enumeration. Just blue sky thinking, I don't pretend to have done any actual research here. Bjorn