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 D502BC3F68F for ; Tue, 11 Feb 2020 04:49:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B8AEC208C3 for ; Tue, 11 Feb 2020 04:49:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728095AbgBKEtn (ORCPT ); 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