Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5073120ybv; Tue, 11 Feb 2020 08:41:24 -0800 (PST) X-Google-Smtp-Source: APXvYqxpDO2atYMVUgaBAONn9StPryrBOgRUVGadzyNQ/OLSlnfQdpBnlnPeWThs2QJ2CpblymOt X-Received: by 2002:a54:4895:: with SMTP id r21mr3544920oic.107.1581439284844; Tue, 11 Feb 2020 08:41:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581439284; cv=none; d=google.com; s=arc-20160816; b=kd7KCAbPK9I0BoClAPgA1C15o+32R7ijXnqk429OJAHes5I2+uy28u/hU8BbxHG3Om UU36004n7HDHa8sL7fSnQMqswP8dQHG5vmN51xHO3iMMPoKblNEipi0U+KmYJ6lF9wVT GBRmm71jSbiz88HS0Dh1GvdFIrpPDPUWbaqLKfZLPro8m1YeQlCnAmMdM2VzSbCOgfrs kRWv9yCZKAQNikb4PbYCbR8terK86yeghatIiT2wQrAqtpU72C5bLfbKTU4KnBuJcrQk LC93ZYyCkZZ3emMux16gJ4ZTjknFgPDEKY7wZ66brxo69xEqKu1zgyNBMLRxsqtRJcjV ZwhA== 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; bh=pNuCLeOcVTybJ84nt617mvMOcGSkcMB/C0hsBRi+27Q=; b=bsQH5dDZ3Zsxnnczqby9IspqaHLkOIoK4S/+707GCH6m+TrkCcqEdcejr+5G62dIS2 zRi3tmkT/rjySKA9DfSHazW+aBA6W384OQHomTCLKzAdkkhLjkIj4h5sliKKMKQnA+Iz it9Pmyyy1weCEOol0qzh58om8TMTdI8zmLHUp9w2NClsIy1YoHxlvBN3Bwf/GxNEBatX dSt14TbXW5rrbnioyhGJ8HaAQ1kNfoqHk/zuKDuC3k9xEKeHFwGT05w+EkJQCWk4dyVW c7vMkqnoC2BgzIpOzunxEILnVM1zK1V/GZxzqHSW7SODCOQ4QVUtmdPXkb36S8ubxaTw ih/w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x20si1865758oix.155.2020.02.11.08.41.12; Tue, 11 Feb 2020 08:41:24 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730143AbgBKOcF (ORCPT + 99 others); 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