From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FAKE_REPLY_C,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00ED5C3B187 for ; Tue, 11 Feb 2020 19:31:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CED3B24649 for ; Tue, 11 Feb 2020 19:31:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581449497; bh=r7k/XMqw3qY2ty8pnv4vptYRuDKiNSxERWglxSVb+RU=; h=Date:From:To:Cc:Subject:In-Reply-To:List-ID:From; b=icIm3jTHMl/jea2TBY7us+LKXxbyqQV+Bsv++ZHJc4OX1DKL7yzj+HRXepl9rQNde KZvQqBC9qK4XtAIXTbAggw5XXh2nkdUUu7VG3FIuSJv54A3tlz/40Bx9ugaUORuMFB TiXG8/vYQztShHYHu7pGftaYvce5z4iDy2Qr8Qxs= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731686AbgBKTbh (ORCPT ); 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