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=-1.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_PASS,T_DKIMWL_WL_HIGH autolearn=ham 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 333E7C1B0F2 for ; Wed, 20 Jun 2018 13:28:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DED8020020 for ; Wed, 20 Jun 2018 13:28:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="Fr4xsnwb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DED8020020 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754514AbeFTN24 (ORCPT ); Wed, 20 Jun 2018 09:28:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:34272 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752884AbeFTN2y (ORCPT ); Wed, 20 Jun 2018 09:28:54 -0400 Received: from localhost (173-25-171-118.client.mchsi.com [173.25.171.118]) (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 8E0BA20020; Wed, 20 Jun 2018 13:28:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1529501333; bh=0pn2B04MKDDIbCu0np3CKciflfCpQQEm1mM7eGwkI5g=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Fr4xsnwbA4LdVRLh3ZGVYCPVr7Bp1Y9E9psQ8CHXkUrIp/6GgkEsPn4YLfG3EAPd0 7j2r1jPkcODMXvCQYjN4YmzAVw3++plyUZAhbUQtJmKnQeY/xAS1UYrvN1pm17RRRI midsHfz8auI7V7hWp6Z439t5IfeiaWZ54lb5bdKo= Date: Wed, 20 Jun 2018 08:28:52 -0500 From: Bjorn Helgaas To: Joe Perches Cc: Bjorn Helgaas , linux-pci , LKML , Frederick Lawler Subject: Re: pci: pci_printk use Message-ID: <20180620132852.GA108993@bhelgaas-glaptop.roam.corp.google.com> References: <9bd45007ddfe2c32b6ee5097e427aabdc267ce53.camel@perches.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9bd45007ddfe2c32b6ee5097e427aabdc267ce53.camel@perches.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 19, 2018 at 09:33:18PM -0700, Joe Perches wrote: > All the pci_printk uses are at KERN_DEBUG which is always > emitted into the kernel logging whenever the console log > level is high enough. > > Are any of these appropriate for conversion to pci_dbg > to allow these only to be emitted via dynamic_debug or > if necessary via a #define DEBUG during compilation? I think pci_printk(KERN_DEBUG) is a little ugly to read. My preference would be to remove them (and pci_dbg() uses) completely or convert them to pci_info(). Most of these are boot-time or low frequency messages, so I doubt the loglevel differentiation of DEBUG/INFO is really necessary. Using pci_dbg() means the messages depend on the kernel config and the dynamic debug config, which is a bit of a hassle. When I get bug reports, I'd much rather simply ask for a dmesg log than ask people to reproduce it with a different config or figure out the right dynamic debug option. > $ git grep -w -n pci_printk drivers > drivers/pci/bus.c:291: pci_printk(KERN_DEBUG, dev, "%pR clipped to %pR\n", > drivers/pci/hotplug/shpchp.h:51: pci_printk(KERN_DEBUG, ctrl->pci_dev, \ > drivers/pci/pci.c:2484: pci_printk(KERN_DEBUG, dev, "supports%s%s\n", > drivers/pci/pci.c:2491: pci_printk(KERN_DEBUG, dev, "PME# supported from%s%s%s%s%s\n", > drivers/pci/pci.c:2655: pci_printk(KERN_DEBUG, dev, "BAR %d: %pR (from Enhanced Allocation, properties %#02x)\n", > drivers/pci/pci.c:2658: pci_printk(KERN_DEBUG, dev, "ROM: %pR (from Enhanced Allocation, properties %#02x)\n", > drivers/pci/pci.c:2661: pci_printk(KERN_DEBUG, dev, "VF BAR %d: %pR (from Enhanced Allocation, properties %#02x)\n", > drivers/pci/pci.c:2664: pci_printk(KERN_DEBUG, dev, "BEI %d res: %pR (from Enhanced Allocation, properties %#02x)\n", > drivers/pci/pci.c:3775: pci_printk(KERN_DEBUG, dev, "cache line size of %d is not supported\n", > drivers/pci/pcie/aer.c:775: pci_printk(KERN_DEBUG, parent, "can't find device of ID%04x\n", > drivers/pci/pcie/aer.c:1317: pci_printk(KERN_DEBUG, dev, "Root Port link has been reset\n"); > drivers/pci/pcie/err.c:75: pci_printk(KERN_DEBUG, dev, "device has %s\n", > drivers/pci/pcie/err.c:179: pci_printk(KERN_DEBUG, dev, "downstream link has been reset\n"); > drivers/pci/pcie/err.c:205: pci_printk(KERN_DEBUG, dev, "no link-reset support at upstream device %s\n", > drivers/pci/pcie/err.c:211: pci_printk(KERN_DEBUG, dev, "link reset at upstream device %s failed\n", > drivers/pci/pcie/err.c:237: pci_printk(KERN_DEBUG, dev, "broadcast %s message\n", error_mesg); > drivers/pci/probe.c:321: pci_printk(KERN_DEBUG, dev, "reg 0x%x: %pR\n", pos, res); > drivers/pci/probe.c:388: pci_printk(KERN_DEBUG, dev, " bridge window %pR\n", res); > drivers/pci/probe.c:410: pci_printk(KERN_DEBUG, dev, " bridge window %pR\n", res); > drivers/pci/probe.c:463: pci_printk(KERN_DEBUG, dev, " bridge window %pR\n", res); > drivers/pci/probe.c:493: pci_printk(KERN_DEBUG, dev, > drivers/pci/probe.c:1598: pci_printk(KERN_DEBUG, dev, "[%04x:%04x] type %02x class %#08x\n", > drivers/pci/setup-bus.c:258: pci_printk(KERN_DEBUG, add_res->dev, > drivers/pci/setup-bus.c:954: pci_printk(KERN_DEBUG, bus->self, "bridge window %pR to %pR add_size %llx\n", > drivers/pci/setup-bus.c:1101: pci_printk(KERN_DEBUG, bus->self, "bridge window %pR to %pR add_size %llx add_align %llx\n", > drivers/pci/setup-bus.c:1569: pci_printk(KERN_DEBUG, dev, "resource %d %pR released\n", >