Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp863147yba; Thu, 9 May 2019 07:07:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqxuUiXW3AmiuXRy/cAMMzAp1j7MGgBa0yTqEQNUxmjRX5gKJQtRXESqdgwSL/VxljZKWdps X-Received: by 2002:a63:243:: with SMTP id 64mr5745300pgc.214.1557410870346; Thu, 09 May 2019 07:07:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557410870; cv=none; d=google.com; s=arc-20160816; b=SR4FWyQZlPYIp4urxBDNijttNNzb6cOUJPsS9j+FUylAeQ7ZaBNG7wk96qv4yaP6G5 ph/R2A5l7iFK900ACc+O0i2nJHU3UEvest9sn0hT2GZPA4eTotzZTKdnP5vzlnPQ7Bxb rJZ8GPhXVW1qli6dabcJGsQQRtvlz22FI4JOI20t+nxzSshyVrbBeM3AnnDgAS+KQzRA dX4WVJkjG5yXSzyjAJq3C//UQQnYushzy9Rfki8iSBg9vIQlNX6EKOlDofBzLobNJW4S XlV8rgKft10govBJOBF2V1AS4lklAtyKZB0yimo7DWxcpjC0J068uToH6JIvkt1R1Yj7 97Yw== 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=LDMH8wEJ184AKpYynk71nrH6jZ8CuRYvpswLI+cuJDE=; b=Y0lptac79WKP9+cDCjj74KszK0uvyP53twBtumv8EPUe8Bj9rptyEN1BC2AKjRffmx 9ZWsse88jV54xoFXmtSfvviu62SXal7+RSard+NzB74BYpX0pfXUn1Q8TXJuKNCGc/m3 TIjHoUthNRIczQDdcYgyAjylEA/cPLz6i5lgyTyLpPFSyIK7UVH5QJ52m9t6h704ZjdS 1+RYuo5RFX1/iRNE9sZY3BMVH/lmxsFrgFBXCNejigK7F/Z80a8j9o04630SFUvEqitq FxBjy1LtDF87f5XGGyhs5VpI1fMbuV9OmCMmtu+Q/XmSuVO7w55CGaoRYlV86jMt+Cn5 /jZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="zEKUSXZ/"; 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 p7si3085107pgi.276.2019.05.09.07.07.32; Thu, 09 May 2019 07:07:50 -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="zEKUSXZ/"; 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 S1726764AbfEIOD3 (ORCPT + 99 others); Thu, 9 May 2019 10:03:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:45464 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726192AbfEIOD3 (ORCPT ); Thu, 9 May 2019 10:03:29 -0400 Received: from localhost (50-81-63-4.client.mchsi.com [50.81.63.4]) (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 41EE82053B; Thu, 9 May 2019 14:03:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557410608; bh=trlSzHZslliX2aiCuWV+5Pq822etwMk/tnPXDc/ZDP8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=zEKUSXZ/qTg7Fu5pzthQsMr3B5zLt3jj5mTUV7LDP0ZyR1A8rQkDCazvpnCM1JnPz 6+4rEROACrzW5j2j5QTgmVHXdTK/E/Kn/HbSlmngLh38lvuKg1hSgnMgxMFPFSin4b NqpJiOsLhFklDj4Q4+wGDdb10Y05AEnqOcdjD56c= Date: Thu, 9 May 2019 09:03:26 -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 9/9] PCI: hotplug: Prefix ctrl_*() dmesg logs with pciehp slot name Message-ID: <20190509140326.GA88424@google.com> References: <20190503035946.23608-1-fred@fredlawl.com> <20190503035946.23608-10-fred@fredlawl.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190503035946.23608-10-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:46PM -0500, Frederick Lawler wrote: > Remove current uses of "Slot(%s)" and then prefix ctrl_*() dmesg > with pciehp slot name to include the slot name for all uses of ctrl_*() > wrappers. > > Signed-off-by: Frederick Lawler > --- > drivers/pci/hotplug/pciehp.h | 12 ++++--- > drivers/pci/hotplug/pciehp_core.c | 9 +++-- > drivers/pci/hotplug/pciehp_ctrl.c | 58 ++++++++++++------------------- > drivers/pci/hotplug/pciehp_hpc.c | 5 ++- > 4 files changed, 38 insertions(+), 46 deletions(-) > > diff --git a/drivers/pci/hotplug/pciehp.h b/drivers/pci/hotplug/pciehp.h > index 06ff9d31405e..e1cdc3565c62 100644 > --- a/drivers/pci/hotplug/pciehp.h > +++ b/drivers/pci/hotplug/pciehp.h > @@ -32,13 +32,17 @@ extern int pciehp_poll_time; > extern bool pciehp_debug; > > #define ctrl_dbg(ctrl, format, arg...) \ > - pci_dbg(ctrl->pcie->port, format, ## arg) > + pci_dbg(ctrl->pcie->port, "Slot(%s): " format, \ > + slot_name(ctrl), ## arg) This would be nice to do, but given the current code organization, I don't think it's actually feasible to use slot_name() in these wrappers because the slot name is initialized in init_slot(), but there are lots of places we can emit messages before that, especially if debug is enabled: pciehp_probe pcie_init dbg_ctrl ctrl_info # no slot yet ctrl_info("Slot #%d AttnBtn%c ...") # no slot yet if (POWER_CTRL) pciehp_get_power_status ctrl_dbg("SLOTCTRL") # no slot yet if (...) pcie_disable_notification pcie_write_cmd pcie_do_write_cmd ctrl_info("no response") # no slot yet ctrl_dbg("SLOTCTRL") # no slot yet pciehp_power_off_slot ctrl_dbg("SLOTCTRL") # no slot yet init_slot # slot valid after this returns