Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4530204ybv; Mon, 10 Feb 2020 21:51:17 -0800 (PST) X-Google-Smtp-Source: APXvYqxN8APaSl3qX6WGLzbnqEzqY2xDwuu0tP0mwfVVUHA4Fv1rb6417ubeywgzmp1RJhVkHwRE X-Received: by 2002:aca:b183:: with SMTP id a125mr1868447oif.83.1581400277049; Mon, 10 Feb 2020 21:51:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581400277; cv=none; d=google.com; s=arc-20160816; b=MD3zIBCHqXgsI1E4bO5+cdMlg2t+2GqMs6ySXu95ovrs3Ufv3/jWjGRP2JS30PvSzO 7gBum9ip/WCQF7QSifakFKOiXsbGLQoRDqXLT6c6J5AsqXA2kwH6OMjbKP8s1pn3DiaF huARs3VULGH3xZcyhC3GuFg7JlRY8hJpc2hxIm8YxUSBoZRYn53GkFc0jxdRU4vX//DX ybtcZ5y9xpq/9zq6EakMz2WJXcILYfxu5zwwKRZ0RBYtw6j+FMHQXxi4rzdwUTqHVNoV SVGBlSCVI+pi594h1l/m4rDudUmUIPSv8SeJChN7UF7vh2UGsO0renE+1cw8Gu/Ambg1 kujQ== 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=NWUdVAGt45zMiGXF19tNuJ6tpnG94XM8lolNySI92Qo=; b=tFYnto7d/NisNHMuwpTCztvX5xWBJop6m6IwFDFexL5/zZVbsrbqMyFVav2ITz1v5G nNTB4HXM8Wp+6kYOBQXEU+qPLcTV8PQR6Efrw7jkJBi2m/e/fnkO6Szhs8KevHPCm+wL XHBp4FeyydMsnavkJgUsM3d55vJw+fEq4jYoRQ1klOFnBDEjh4t1jbHia9pi2JRS8Lu6 HtRYBy5oYTaozrgGNCEyQ/FflPBKvFzYrpILRuJyH+Iw9OqD6Q+F9GpyNKUVrlzYexdv z4+bQ2yn7m2X3dfJ0kLcvMTe8IVYb8ollRgegFzHa6T8kOGfAS9PgSZfO2YvQN3nBePL MKdw== 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 u16si1269723oic.66.2020.02.10.21.51.05; Mon, 10 Feb 2020 21:51:17 -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 S1728009AbgBKEtn (ORCPT + 99 others); Mon, 10 Feb 2020 23:49:43 -0500 Received: from bmailout2.hostsharing.net ([83.223.78.240]:33757 "EHLO bmailout2.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727121AbgBKEtm (ORCPT ); Mon, 10 Feb 2020 23:49:42 -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 752DA2800BB55; Tue, 11 Feb 2020 05:49:40 +0100 (CET) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 44C58DD1F; Tue, 11 Feb 2020 05:49:40 +0100 (CET) Date: Tue, 11 Feb 2020 05:49:40 +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: <20200211044940.72z4vcgbgxwbc7po@wunner.de> References: <20191025190047.38130-1-stuart.w.hayes@gmail.com> <20200211000816.GA89075@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200211000816.GA89075@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 Mon, Feb 10, 2020 at 06:08:16PM -0600, Bjorn Helgaas wrote: > used ctrl_info() instead of pci_info() (I would actually like to change > the whole driver to use pci_info(), but better to be consistent for now) Most of the ctrl_info() calls prepend "Slot(%s): " to the message. However that prefix can only be used once pci_hp_initialize() has been called. It would probably make sense to change ctrl_info() to always include the prefix and change those invocations of ctrl_info() which happen when the slot is not yet or no longer registered, to pci_info(). > @@ -930,7 +940,7 @@ struct controller *pcie_init(struct pcie_device *dev) > PCI_EXP_SLTSTA_MRLSC | PCI_EXP_SLTSTA_CC | > PCI_EXP_SLTSTA_DLLSC | PCI_EXP_SLTSTA_PDC); > > - ctrl_info(ctrl, "Slot #%d AttnBtn%c PwrCtrl%c MRL%c AttnInd%c PwrInd%c HotPlug%c Surprise%c Interlock%c NoCompl%c LLActRep%c%s\n", > + 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", > (slot_cap & PCI_EXP_SLTCAP_PSN) >> 19, > FLAG(slot_cap, PCI_EXP_SLTCAP_ABP), > FLAG(slot_cap, PCI_EXP_SLTCAP_PCP), > @@ -941,19 +951,10 @@ struct controller *pcie_init(struct pcie_device *dev) > FLAG(slot_cap, PCI_EXP_SLTCAP_HPS), > FLAG(slot_cap, PCI_EXP_SLTCAP_EIP), > FLAG(slot_cap, PCI_EXP_SLTCAP_NCCS), > + ctrl->inband_presence_disabled, > FLAG(link_cap, PCI_EXP_LNKCAP_DLLLARC), > pdev->broken_cmd_compl ? " (with Cmd Compl erratum)" : ""); I've just reviewed the resulting commits on pci/hotplug once more and think there's a small issue here: If ctrl->inband_presence_disabled is 0, the string will contain ASCII character 0 (end of string) and if it's 1 it will contain ASCII character 1 (start of header). A possible solution would be FLAG(ctrl->inband_presence_disabled, 1). (The real solution would probably to have a printk format for this kind of thing.) Thanks, Lukas