Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp6085582ybv; Tue, 18 Feb 2020 09:34:34 -0800 (PST) X-Google-Smtp-Source: APXvYqxOBnHOi0ke/ML9s8G97FR7kJ6JcWI686FRGTEfvY4NQPXyb4V5cPzSJjOLrEeD2g4Av6qT X-Received: by 2002:a05:6830:15c2:: with SMTP id j2mr682978otr.351.1582047274158; Tue, 18 Feb 2020 09:34:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582047274; cv=none; d=google.com; s=arc-20160816; b=l86F+1LgXJjEIObwFYneCffhzFbLt24OT6DlBsgs4TTNd72sA57tKWb8H8yUSqCdSc u8Lo+bw8G8+pD4UjSaglkFQONn/egGcmH7ZCsDGb02SgcSlIINmQg0X5R75Ag12MRU6u 2TVYypcf6Pyz2KsUOeG76GVaAQWeIiIy9YpuHl6OHG4hbMLPuAke4HUkTRYZckPsHHk9 QKAO4XharKhh/CQjuVPTTyBQ1MWc+/YD3qTrzfQpXjsOzNdQRHcFhl6pH8jvGwu+OFVF 4yz+UsPOt2Imd13K8QUbw5JxqrlEK/Lpp6RYxkwaDVnLxI8LRTgW2SVeNRDM8IbVU9My 1AoQ== 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=b1aBNi5PsvHdQFDDuHJ4+s34WsHOJ1mVtgz+FHHPz0s=; b=cMUFyiG+8UJbzNEAE+R+1aJ4Bu0gWS8lviEWbVjFts/F3oie2veQqi0ZnZ9ctlH452 H3A/Dz25a0FfPUFvPJzTksdoD8TePxSyAawhxn80qW+esPWP27hc5kSgDmw0MAkBlJ5x XIKLAn/kSn7y/6bl3pVc+FRa9BtugYfX2NgVelwlkW+jgRajNRq3v0sHOMb8pt4rBWIw ZG6KblAZsHE5d1Q7/qenTmddsC5dlLO7wpARVTey6xtid1UVlbWpskMP0TDCWW3jmgnF MdmZl6hkTzkfluKlEV2T58oTMCav2aAX8m6SfAckET6lyQ6JNrfyUo55a+5STQ87nHyH B5dQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="G95I/cQm"; 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 u8si2070395otq.262.2020.02.18.09.34.21; Tue, 18 Feb 2020 09:34: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="G95I/cQm"; 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 S1727184AbgBRRcl (ORCPT + 99 others); Tue, 18 Feb 2020 12:32:41 -0500 Received: from mail.kernel.org ([198.145.29.99]:52838 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726638AbgBRRck (ORCPT ); Tue, 18 Feb 2020 12:32:40 -0500 Received: from localhost (odyssey.drury.edu [64.22.249.253]) (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 B2B5722B48; Tue, 18 Feb 2020 17:32:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582047159; bh=Hs3mtj72oHAhcOKlb/lLWg8W10Q2iAludK8Rt699D0Q=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=G95I/cQmNoWVRms0Y9738Q8oz3LoDZYUNq/qzUgKtlrmu5Vm3WTg8ZsgX2BYkSp9l NOcXyrcLG2zO9NMErHWJ6iN/ns0DPFTf1cYAr1HH3Ma34GyILSvyqTOdjp1iqROUi0 tjOXB1tfyMeXfRPmgv5EQASLD+dBnTq8aNAEdNn0= Date: Tue, 18 Feb 2020 11:32:38 -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: <20200218173238.GA214360@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: > > 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. Everything else we decode is *capability* bits and IBPD is another one. So by the principle of least surprise, I propose this: + ctrl_info(ctrl, "Slot #%d AttnBtn%c PwrCtrl%c MRL%c AttnInd%c PwrInd%c HotPlug%c Surprise%c Interlock%c NoCompl%c IbPresDis%c LLActRep%c%s\n", + FLAG(slot_cap2, PCI_EXP_SLTCAP2_IBPD), That works out to be the same as printing inbound_presence_disabled ? '+' : '-' because we always set inbound_presence_disabled when PCI_EXP_SLTCAP2_IBPD is supported.