Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2048713yba; Sat, 27 Apr 2019 13:04:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqwcFLaNpoX0UPKSUUewCM/JcNjw3MrkqG1fNLeWfv/JQ6ZWk+BoyvTx1s06BL2uBX6XjNxU X-Received: by 2002:a17:902:e285:: with SMTP id cf5mr16719246plb.77.1556395457841; Sat, 27 Apr 2019 13:04:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556395457; cv=none; d=google.com; s=arc-20160816; b=jiJ/7k0LAYvqboHwF5nmUSB/R5bqbnKdXBxpputqLJcbLuioGtZBY0Xp+L/ZVyz0yc Sy6uTftRng/+AxRTZ4sdJ6PtXxWw84wTnw99lDU9wuUfQSQ3P6PfHL8L9bwuxXH0nWt9 YTiuHX4xPJm9OW4ExDwumLRIYSBJcCVIu134bXWak6Qq9jbDWfl0dI7IRiote/5rxY+/ We2SVR/5u/ZXPACq/Qa5zfiomtYBOAA4jIAf7nDuDzpmIpqlAJemnQOWsSYhIGkBeBz/ AToWBcdjI1hv9HwRqdBHWd4zulAvufntgq8vQzGHHGv8DrcMOGMtF0WqOtFMKbgMCIOQ 8Y2Q== 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=uNHpg1By6E7yLKIUtqtPRlbGlshKuOJI1V1v2b3w/qk=; b=DYmCVHtHHNxZC88UZM3ZKdO67fu1uZLfDfdodWF1RS+nUBtVt6ZIW9mtIXiRpejtkQ 5D6PJAUlaUyOH3uAs/E0TzfTZW9DRZMFusqL42ZNohVkjnQKKyBo0+ILy1ZikSt1Qudy TcSwSy6cu05ZmLThJTJsPaTXAo3ISaR/RCiGM6eoYJOnCz+MvW55kpnLEjBz3lkrggtK 8VJ2WKzEQd0MoAgk3doPEW2UvfsqbQa5LEZG0yxmGo8NQvxQGoiaetSL4q4qrr1ngx0f v72ZmPgoAqKWvM+rArtYxT9gE3l+Jp9wGGAcjzzuYQ/wP92rBLL3YVx4lo0A2hIBg8PZ 5DcA== 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 e6si22045162pga.251.2019.04.27.13.04.03; Sat, 27 Apr 2019 13:04:17 -0700 (PDT) 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 S1726403AbfD0UDE (ORCPT + 99 others); Sat, 27 Apr 2019 16:03:04 -0400 Received: from bmailout3.hostsharing.net ([176.9.242.62]:51821 "EHLO bmailout3.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726030AbfD0UDE (ORCPT ); Sat, 27 Apr 2019 16:03:04 -0400 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 bmailout3.hostsharing.net (Postfix) with ESMTPS id D1CA110295D2C; Sat, 27 Apr 2019 22:03:01 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 86BDD24F2EF; Sat, 27 Apr 2019 22:03:01 +0200 (CEST) Date: Sat, 27 Apr 2019 22:03:01 +0200 From: Lukas Wunner To: fred@fredlawl.com Cc: bhelgaas@google.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, mika.westerberg@linux.intel.com, andriy.shevchenko@linux.intel.com, keith.busch@intel.com, mr.nuke.me@gmail.com, liudongdong3@huawei.com, thesven73@gmail.com Subject: Re: [PATCH 2/4] PCI: pciehp: Replace ctrl_*() with pci_*() Message-ID: <20190427200301.tujp2535jxmlqttr@wunner.de> References: <20190427191304.32502-1-fred@fredlawl.com> <20190427191304.32502-3-fred@fredlawl.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190427191304.32502-3-fred@fredlawl.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 Sat, Apr 27, 2019 at 02:13:02PM -0500, fred@fredlawl.com wrote: > Hotplug useses custom ctrl_*() dev_*() printk wrappers for logging > messages. To make hotplug conform to pci logging, replace uses of these > wrappers with pci_*() printk wrappers. In addition, replace any > printk() calls with pr_*() wrappers. A lot of pciehp's messages are preceded by "Slot(%s): ", where %s is replaced by the Physical Slot Number in the Slot Capabilities register (which is cached in struct controller) plus an optional suffix if the same PSN is used by multiple slots. For some reason (probably a historic artefact), this prefix is included only in *some* of the messages. I think it would be useful to make the messages consistent by *always* including the "Slot(%s): " prefix. However the prefix is unknown until pci_hp_initialize() has been called. I'd solve this by keeping the ctrl_*() wrappers and amending them to print the "Slot(%s): " prefix, then making sure that ctrl_*() is not called before pci_hp_initialize(). (pci_*() has to be used instead). > @@ -182,39 +184,39 @@ static int pciehp_probe(struct pcie_device *dev) > > if (!dev->port->subordinate) { > /* Can happen if we run out of bus numbers during probe */ > - dev_err(&dev->device, > - "Hotplug bridge without secondary bus, ignoring\n"); > + pci_err(dev->port, "Hotplug bridge without secondary bus, ignoring\n"); Hm, the string was likely deliberately put on a new line to avoid exceeding 80 chars, so I'd keep it that way. Thanks, Lukas