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.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, 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 5DFE1C3B187 for ; Tue, 11 Feb 2020 14:32:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 361DC20870 for ; Tue, 11 Feb 2020 14:32:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730227AbgBKOcF (ORCPT ); Tue, 11 Feb 2020 09:32:05 -0500 Received: from bmailout2.hostsharing.net ([83.223.78.240]:45505 "EHLO bmailout2.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729822AbgBKOcF (ORCPT ); Tue, 11 Feb 2020 09:32:05 -0500 Received: from h08.hostsharing.net (h08.hostsharing.net [IPv6:2a01:37:1000::53df:5f1c:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.hostsharing.net", Issuer "COMODO RSA Domain Validation Secure Server CA" (not verified)) by bmailout2.hostsharing.net (Postfix) with ESMTPS id 091892800A28D; Tue, 11 Feb 2020 15:32:03 +0100 (CET) Received: by h08.hostsharing.net (Postfix, from userid 100393) id B9D48286F3E; Tue, 11 Feb 2020 15:32:02 +0100 (CET) Date: Tue, 11 Feb 2020 15:32:02 +0100 From: Lukas Wunner To: Bjorn Helgaas 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: <20200211143202.2sgryye4m234pymq@wunner.de> References: <20200211044940.72z4vcgbgxwbc7po@wunner.de> <20200211141443.GA204966@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200211141443.GA204966@google.com> User-Agent: NeoMutt/20170113 (1.7.2) 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 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"). > Feels like sort of a > double-negative situation, too. Obviously the hardware bit has to be > "1 means disabled" to be compatible with previous spec versions, but > the code is usually easier to read if we test for something being > *enabled*. It's a similar situation with the "DisINTx" bit in the Command register, which, if disabled, is shown as "DisINTx-" in lspci even though the more intuitive notion is that INTx is *enabled*. I think you did the right thing by showing it as "IbPresDis-" because it's consistent with how it's done elsewhere for similar bits. Thanks, Lukas