Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1008487yba; Fri, 3 May 2019 14:18:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqw8SRoxTpmGI2UzUpjBbEh0WJ+J3Wt5F5hYR4pvT5t9++7cAAbuzixaT3zp8KKhasfN/+J4 X-Received: by 2002:aa7:93a7:: with SMTP id x7mr14232909pff.196.1556918338685; Fri, 03 May 2019 14:18:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556918338; cv=none; d=google.com; s=arc-20160816; b=T4xXf8csfGUD0tSJXKwbAEa4PPJ58pKuKew1S6Tu92eA6d3VW9EPAlWujjhOc2DKBs dyxJ4+bX+cdfKQjTjjSvsv1fGUqNCOVZxEGTol2fsnqM/u2vbtQFOlDW2usePzo7tRqg MCfC7GJDN3cvTlFfVNaGn5sYaQ1qxIkkd53BK4E/AjcqhBkcnu2uF1sm2vLvaLdLedpa nujDP3JDebulvfo28ZjYq43vXQtYex72n02XTaOAs9SF9PrZhdauB9Nx+svKAis5hdL2 LnrMYFNIN6CqrXAdyDBnfChgv3Ota/etF4UXAW/DfAyMuND/PIaXBcMXTLAqLW2kgyoe iGJg== 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:dkim-signature; bh=VzcZ+zWiT6tgVjU4OYSLBEye/ivjfsIK5s57i9Ux/H8=; b=PhEr/2XboezL5Bi1BGmSaUMsa+gl/6oUCVKyDIAijmPYcLahKYDSUW2rqk/fwVbUc+ uIn+YQGQMPZsrboAp95mUvsn5lDye7yilpcTzH+Vh/ChHAuVnS5MMiRg0NtwZ03sfGtB QhHc5hq8e/GjSk0L/xwmeVVQ4qghiZ58mhsy2/0D9Jmc1C4mkYn9pMUlEZwdn0Bmn3Is vml1iqPQ2IhKwEePiyrcnsKex/b9dDzCSWpyohr8CKv4FQQ9TH6wCsWLQIZiq19DAwrk BRDcjDEIyrvQ8PevI7f/7FRY+7/HS+cVqce8NQICJQxWg4JWUL/hax8YrtjhneCkMeY0 l0hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gcDbNnGY; 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 r5si3765039pgp.29.2019.05.03.14.18.43; Fri, 03 May 2019 14:18:58 -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; dkim=pass header.i=@kernel.org header.s=default header.b=gcDbNnGY; 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 S1726776AbfECUs4 (ORCPT + 99 others); Fri, 3 May 2019 16:48:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:37224 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726304AbfECUs4 (ORCPT ); Fri, 3 May 2019 16:48:56 -0400 Received: from localhost (unknown [69.71.4.100]) (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 E4180206E0; Fri, 3 May 2019 20:48:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556916535; bh=gdtFp7aoPyJfOJpVNUw+9lIri9+LDRR06YYdBQlCGv8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gcDbNnGYI4UvbBWeG5SuWl+5hlrkeKsTDzTY94diElbiBo3K9hR9TQrfzKrX4ChQn hoFrgh3KQaB96FZsGgNou+xa/hO8K8ad+ct3YWoV5mnkVAAEk0g8O3zF+Ip27gVgZs EGGuA25XU+RxD/5YmtYiQf09zuekV+NEJavtG6Lw= Date: Fri, 3 May 2019 15:48:52 -0500 From: Bjorn Helgaas To: Frederick Lawler Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, mika.westerberg@linux.intel.com, lukas@wunner.de, andriy.shevchenko@linux.intel.com, keith.busch@intel.com, mr.nuke.me@gmail.com, liudongdong3@huawei.com, thesven73@gmail.com Subject: Re: [PATCH v2 7/9] PCI: hotplug: Prefer CONFIG_DYNAMIC_DEBUG/DEBUG for dmesg logs Message-ID: <20190503204852.GE180403@google.com> References: <20190503035946.23608-1-fred@fredlawl.com> <20190503035946.23608-8-fred@fredlawl.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190503035946.23608-8-fred@fredlawl.com> 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 Thu, May 02, 2019 at 10:59:44PM -0500, Frederick Lawler wrote: > dbg() and ctrl_dbg() requires pciehp_debug module parameter to be set > for debug log purposes. There are niche situations in pciehp_hpc.c where > pciehp_debug is used: dbg_ctrl(), and pci_bus_check_dev(). > > Enabling CONFIG_DYNAMIC_DEBUG/DEBUG is well known for logging debug > information. Therefore, prefer pr/pci_dbg() for debug information, and > reserve pciehp_debug for niche situations. I guess by "niche situations", you mean the tests in pci_bus_check_dev() and dbg_ctrl()? I think pci_bus_check_dev() could skip the test and just use pr_dbg(). For dbg_ctrl(), we could just remove the test (and maybe reformat those strings so they match other messages). That's a one-time thing so I don't think two extra config reads that we might not print are a problem. I'd probably reorder these so you have five patches (or maybe more if I missed something): - remove pciehp_debug uses from pci_bus_check_dev() and dbg_ctrl() - convert pciehp_debug to dyndbg - convert "dev_*(&ctrl->pcie->device)" to "pci_*(ctrl->pcie->port)" - add "Slot(%s)" to wrappers (could this be done with dev_fmt?) - remove unused wrappers > Signed-off-by: Frederick Lawler > --- > drivers/pci/hotplug/pciehp.h | 11 ++--------- > 1 file changed, 2 insertions(+), 9 deletions(-) > > diff --git a/drivers/pci/hotplug/pciehp.h b/drivers/pci/hotplug/pciehp.h > index 78325c8d961e..e852aa478802 100644 > --- a/drivers/pci/hotplug/pciehp.h > +++ b/drivers/pci/hotplug/pciehp.h > @@ -32,10 +32,7 @@ extern int pciehp_poll_time; > extern bool pciehp_debug; > > #define dbg(format, arg...) \ > -do { \ > - if (pciehp_debug) \ > - pr_info(format, ## arg); \ > -} while (0) > + pr_debug(format, ## arg); > #define err(format, arg...) \ > pr_err(format, ## arg) > #define info(format, arg...) \ > @@ -44,11 +41,7 @@ do { \ > pr_warn(format, ## arg) > > #define ctrl_dbg(ctrl, format, arg...) \ > - do { \ > - if (pciehp_debug) \ > - pci_info(ctrl->pcie->port, \ > - format, ## arg); \ > - } while (0) > + pci_dbg(ctrl->pcie->port, format, ## arg) > #define ctrl_err(ctrl, format, arg...) \ > pci_err(ctrl->pcie->port, format, ## arg) > #define ctrl_info(ctrl, format, arg...) \ > -- > 2.17.1 >