From patchwork Mon Dec 16 16:10:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ilpo_J=C3=A4rvinen?= X-Patchwork-Id: 13909945 X-Patchwork-Delegate: bhelgaas@google.com Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0D66114A095; Mon, 16 Dec 2024 16:10:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734365431; cv=none; b=lNXrO4tyHBrx6/pr/Ip4sPCMo1Ze6p1Du5hS0TMFSkT02XKCRtmz3StDf12nODnTjk+BDhexayDam9KFxUOjWnL+3ltTqiMaIzM5aFpC0hlTYPuWsgkMDDaePRr9Y4dOCliKfABOtmh+dM7bWbmpJs33NsWr251TjjkhCSgOaxo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734365431; c=relaxed/simple; bh=M8Snydld+G3bzzI1y2e+peBZwEHDa69ZjkPqObx7NeE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=WwCoyJ8+PcTj9PPc9kLgAdLaMi5CtO2lMJv8009D/02Zv+ghbj9F7QkZo5/qh1tVlDtFGfhG3KyDZji604YhY1MQcVAhlMCUB/uHdbwXZfaqCkGt/+cmjev07yK5uafC5vx8YisJtgA/Dkvev9PaqUTR5sYK48wJFNj3racHjNQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=aFMkEtzC; arc=none smtp.client-ip=198.175.65.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="aFMkEtzC" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1734365430; x=1765901430; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=M8Snydld+G3bzzI1y2e+peBZwEHDa69ZjkPqObx7NeE=; b=aFMkEtzCJY8r4FkcR+xp63jNJgwajNnlnn1FTQssEIAl+WqYZwZ1/GS6 kL0tSmp0m8IMNcEffykYP96FRCsIwGsBIrhejKtbwFlaFHaqF5hApLley 6kpR0hbop6gxUtj3J19FCmfd/y79M3ZV3xWwxzuvbQF75rmaw8UPCfQCn Thj+jQOOR3GWocMG2IWJ/cczBzBxFx5448pQ+s1dYjz97jI5xDW3rxDP9 bl+QZjHf5/aze5KoOsx0HOoz+IWG8k88egjXP+ijGJK1p8v5UgXxD9XWi UfEI2No0AwQ5RZFQsDqHIRUIwPq1w5v/NQxuzCCYy2G34DJBnqHJZIiK0 Q==; X-CSE-ConnectionGUID: /cQ0N9JWSe65dUUeeNA42g== X-CSE-MsgGUID: Apup2XRbTpGy2eot151/gg== X-IronPort-AV: E=McAfee;i="6700,10204,11288"; a="34904197" X-IronPort-AV: E=Sophos;i="6.12,239,1728975600"; d="scan'208";a="34904197" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Dec 2024 08:10:29 -0800 X-CSE-ConnectionGUID: Q2+nlaXYSGGEBgO8/PGPZQ== X-CSE-MsgGUID: d3bwhLe9RBuIaEBQXi8GsA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,239,1728975600"; d="scan'208";a="97120727" Received: from ijarvine-mobl1.ger.corp.intel.com (HELO localhost) ([10.245.245.29]) by fmviesa007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Dec 2024 08:10:26 -0800 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: Bjorn Helgaas , linux-pci@vger.kernel.org, Karolina Stolarek , linux-kernel@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org, Mahesh J Salgaonkar , "Oliver O'Halloran" , =?utf-8?q?Ilpo_J=C3=A4rvinen?= Subject: [PATCH 1/4] PCI: shpchp: Remove logging from module init/exit functions Date: Mon, 16 Dec 2024 18:10:09 +0200 Message-Id: <20241216161012.1774-2-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241216161012.1774-1-ilpo.jarvinen@linux.intel.com> References: <20241216161012.1774-1-ilpo.jarvinen@linux.intel.com> Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The logging in shpchp module init/exit functions is not very useful. Remove it. Signed-off-by: Ilpo Järvinen --- drivers/pci/hotplug/shpchp_core.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/pci/hotplug/shpchp_core.c b/drivers/pci/hotplug/shpchp_core.c index a92e28b72908..a10ce7be7f51 100644 --- a/drivers/pci/hotplug/shpchp_core.c +++ b/drivers/pci/hotplug/shpchp_core.c @@ -324,20 +324,12 @@ static struct pci_driver shpc_driver = { static int __init shpcd_init(void) { - int retval; - - retval = pci_register_driver(&shpc_driver); - dbg("%s: pci_register_driver = %d\n", __func__, retval); - info(DRIVER_DESC " version: " DRIVER_VERSION "\n"); - - return retval; + return pci_register_driver(&shpc_driver); } static void __exit shpcd_cleanup(void) { - dbg("unload_shpchpd()\n"); pci_unregister_driver(&shpc_driver); - info(DRIVER_DESC " version: " DRIVER_VERSION " unloaded\n"); } module_init(shpcd_init); From patchwork Mon Dec 16 16:10:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ilpo_J=C3=A4rvinen?= X-Patchwork-Id: 13909946 X-Patchwork-Delegate: bhelgaas@google.com Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9D70B14A095; Mon, 16 Dec 2024 16:10:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734365439; cv=none; b=jIS11jjU8MYDH1pJJqjPYaxnCJOYFGKQ581P7bLLBs34ufp9QVfASoxYgfRZ2iqf1/ZQlVSZIKIkGSfOTSRQmAbIKU+tA9R6ONNSf72ieOaF4eXjX0Gl0MdrYCM2dkEyc42VA8E0o0EWUuWpFUfHKaFfnd+2Hjc2eIZ+rytbGxw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734365439; c=relaxed/simple; bh=3hz0/nYgnvrHJgscQWPwOkskKUx41Z8jhLGgWfFgNb4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=ohu/JN4EHvG8XJmVUULBo24tzF4MomAkEsb6jBcrV6sdtpDBxQzCkkvwO00f/NK+Ik2XRbOohvYU5GiUcxIAm0yq8aEw4sM2ZTsddxSB7eaifZiLdCFGNU58CHSkAiPKTdaplBGpXh7PjsF8bwQOGZUJNNVaa7Pnekzc+Qurs84= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=D5P7tjg0; arc=none smtp.client-ip=198.175.65.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="D5P7tjg0" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1734365437; x=1765901437; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=3hz0/nYgnvrHJgscQWPwOkskKUx41Z8jhLGgWfFgNb4=; b=D5P7tjg0bwuGHrGjb6d1aCQJmEy+fiLrvCwcICgAZlNOE8zVbjandQml i2o61X/QnPtg+cdLp78NkksSLAT7UpBzAC4n7aUvDqk51t8Ipl+pgvQgF ysusgAuVGzsWc3z6rZhySyPpkF8hf8aLmNwUp6EAMYrnv6qVA8HcxHCh5 1XpfhBePqKVQFiGR+P+ZJiVpKw9kCx4CNV6oKqgtfgMDfRit0g0Df2d8E 8l1Pgprj4ebPKqhA6UVbMp/JHVsabSDlu8QvMjpQZtookDINghnw4DCOX HRCRyXDHIKss6gqFHOrd6s5oNcEhxd8oLlXdmw8/AV7qrMHG1vqP2Uihx g==; X-CSE-ConnectionGUID: p7TU28iVQlScJhPTZ6OJRg== X-CSE-MsgGUID: uFc+kdIOQrayfpvxASQs3g== X-IronPort-AV: E=McAfee;i="6700,10204,11282"; a="45761342" X-IronPort-AV: E=Sophos;i="6.12,224,1728975600"; d="scan'208";a="45761342" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Dec 2024 08:10:37 -0800 X-CSE-ConnectionGUID: lowAW4FST+qbUd2YLKLfkw== X-CSE-MsgGUID: C/7acEIVTPeZUtgaoDRAVg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,239,1728975600"; d="scan'208";a="97015500" Received: from ijarvine-mobl1.ger.corp.intel.com (HELO localhost) ([10.245.245.29]) by fmviesa006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Dec 2024 08:10:34 -0800 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: Bjorn Helgaas , linux-pci@vger.kernel.org, Karolina Stolarek , linux-kernel@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org, Mahesh J Salgaonkar , "Oliver O'Halloran" , =?utf-8?q?Ilpo_J=C3=A4rvinen?= Subject: [PATCH 2/4] PCI: shpchp: Change dbg() -> ctrl_dbg() Date: Mon, 16 Dec 2024 18:10:10 +0200 Message-Id: <20241216161012.1774-3-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241216161012.1774-1-ilpo.jarvinen@linux.intel.com> References: <20241216161012.1774-1-ilpo.jarvinen@linux.intel.com> Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Convert the last user of dbg() to use ctrl_dbg(). Signed-off-by: Ilpo Järvinen --- drivers/pci/hotplug/shpchp_hpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/hotplug/shpchp_hpc.c b/drivers/pci/hotplug/shpchp_hpc.c index 012b9e3fe5b0..bfbec7c1a6b1 100644 --- a/drivers/pci/hotplug/shpchp_hpc.c +++ b/drivers/pci/hotplug/shpchp_hpc.c @@ -675,7 +675,7 @@ static int shpc_get_cur_bus_speed(struct controller *ctrl) out: bus->cur_bus_speed = bus_speed; - dbg("Current bus speed = %d\n", bus_speed); + ctrl_dbg(ctrl, "Current bus speed = %d\n", bus_speed); return retval; } From patchwork Mon Dec 16 16:10:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ilpo_J=C3=A4rvinen?= X-Patchwork-Id: 13909947 X-Patchwork-Delegate: bhelgaas@google.com Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3DC83193430; Mon, 16 Dec 2024 16:10:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734365446; cv=none; b=rVvbhoZVpNmLi27TKW/6S9No1zLuCQcFhGNgY4S5lk2JR0HvD7/4ogUwR093YCFTYa5nxgNjWAIyb0EJdaUJuCeQQgkW61ctG66zB3KbBsrXzokxM71flZTVNsafqdbqF8G42yoIBTBVLy+k+QlIpXJRNth/Pwurid4mwcrmNGk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734365446; c=relaxed/simple; bh=3pgiIp1ZgAgTA1StdehyboBWAMBtoT+jkzi2UeAtxoE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=DHsX7h03odLwy6Ej3CpdpTMiiPBVMd6XijywhzZ7+5HHWJMtuIupsstaaMvDYYZOWOnyOVKaXt+mG5ZB63IvM+sYcPW7L6eiy5nSbRCMG5oe+/vnhQX8TgKCq6VyW6R3X96mUVt9p+FVDF4bFeF35yD48vetvWa/z5PApxP4VKk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=gZUP1DBW; arc=none smtp.client-ip=198.175.65.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="gZUP1DBW" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1734365445; x=1765901445; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=3pgiIp1ZgAgTA1StdehyboBWAMBtoT+jkzi2UeAtxoE=; b=gZUP1DBW8u8PWdfV/RNuGbjQ2v55CGGpKdRu2wnwuZl9TY1UoxDSM7rM 8559RcHppcYF7NjGkwaDx/sK36vcPclceIL1tSI+SKAIqbPtEb3CTgoE8 6qoUzoGFCxJwWHF+g8XUE/tPA7Fk1jAMg0rZfrXzY7gDS6RYNqUszKTWF oZRq5QyTW921cEw8ckePOUOphAREMJ6MMgg9fRDgri9wWabHCtNToIr2n TzdZvS9rUq9X/0SpN/HOnmHTQAkn4SdDfEaxT9Sn2NdrQpXeE48zvyw1c z+EUgKHoRXqicwLVxet3ICrwcajHkNi3bDGr45v8QklKa9hg9m5XH93XQ A==; X-CSE-ConnectionGUID: H+L3Mf4+TWGBHj3vyGX4AQ== X-CSE-MsgGUID: BRJdhZaIRoWO4jOL43DVzw== X-IronPort-AV: E=McAfee;i="6700,10204,11282"; a="45761362" X-IronPort-AV: E=Sophos;i="6.12,224,1728975600"; d="scan'208";a="45761362" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Dec 2024 08:10:44 -0800 X-CSE-ConnectionGUID: FIKKxg6uQFidlzOQxQBWDA== X-CSE-MsgGUID: 7mBoGB7gQVuGvk/jIrgGow== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,239,1728975600"; d="scan'208";a="97015516" Received: from ijarvine-mobl1.ger.corp.intel.com (HELO localhost) ([10.245.245.29]) by fmviesa006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Dec 2024 08:10:42 -0800 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: Bjorn Helgaas , linux-pci@vger.kernel.org, Karolina Stolarek , linux-kernel@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org, Mahesh J Salgaonkar , "Oliver O'Halloran" , =?utf-8?q?Ilpo_J=C3=A4rvinen?= Subject: [PATCH 3/4] PCI: shpchp: Cleanup logging and debug wrappers Date: Mon, 16 Dec 2024 18:10:11 +0200 Message-Id: <20241216161012.1774-4-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241216161012.1774-1-ilpo.jarvinen@linux.intel.com> References: <20241216161012.1774-1-ilpo.jarvinen@linux.intel.com> Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The shpchp hotplug driver defines logging wrappers ctrl_*() and another set of wrappers with generic names which are just duplicates of existing generic printk() wrappers. Only the former are useful to preserve as they handle the controller dereferencing (the latter are also unused). The "shpchp_debug" module parameter is used to enable debug logging. The generic ability to turn on/off debug prints dynamically covers this usecase already so there is no need to module specific debug handling. The ctrl_dbg() wrapper also uses a low-level pci_printk() despite always using KERN_DEBUG level. Convert ctrl_dbg() to use the pci_dbg() and remove "shpchp_debug" check from it. Removing the non-ctrl variants of logging wrappers and "shpchp_debug" module parameter as they are no longer used. Signed-off-by: Ilpo Järvinen --- drivers/pci/hotplug/shpchp.h | 18 +----------------- drivers/pci/hotplug/shpchp_core.c | 3 --- 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/drivers/pci/hotplug/shpchp.h b/drivers/pci/hotplug/shpchp.h index f0e2d2d54d71..f9e57dce010b 100644 --- a/drivers/pci/hotplug/shpchp.h +++ b/drivers/pci/hotplug/shpchp.h @@ -33,24 +33,8 @@ extern bool shpchp_poll_mode; extern int shpchp_poll_time; extern bool shpchp_debug; -#define dbg(format, arg...) \ -do { \ - if (shpchp_debug) \ - printk(KERN_DEBUG "%s: " format, MY_NAME, ## arg); \ -} while (0) -#define err(format, arg...) \ - printk(KERN_ERR "%s: " format, MY_NAME, ## arg) -#define info(format, arg...) \ - printk(KERN_INFO "%s: " format, MY_NAME, ## arg) -#define warn(format, arg...) \ - printk(KERN_WARNING "%s: " format, MY_NAME, ## arg) - #define ctrl_dbg(ctrl, format, arg...) \ - do { \ - if (shpchp_debug) \ - pci_printk(KERN_DEBUG, ctrl->pci_dev, \ - format, ## arg); \ - } while (0) + pci_dbg(ctrl->pci_dev, format, ## arg); #define ctrl_err(ctrl, format, arg...) \ pci_err(ctrl->pci_dev, format, ## arg) #define ctrl_info(ctrl, format, arg...) \ diff --git a/drivers/pci/hotplug/shpchp_core.c b/drivers/pci/hotplug/shpchp_core.c index a10ce7be7f51..0c341453afc6 100644 --- a/drivers/pci/hotplug/shpchp_core.c +++ b/drivers/pci/hotplug/shpchp_core.c @@ -22,7 +22,6 @@ #include "shpchp.h" /* Global variables */ -bool shpchp_debug; bool shpchp_poll_mode; int shpchp_poll_time; @@ -33,10 +32,8 @@ int shpchp_poll_time; MODULE_AUTHOR(DRIVER_AUTHOR); MODULE_DESCRIPTION(DRIVER_DESC); -module_param(shpchp_debug, bool, 0644); module_param(shpchp_poll_mode, bool, 0644); module_param(shpchp_poll_time, int, 0644); -MODULE_PARM_DESC(shpchp_debug, "Debugging mode enabled or not"); MODULE_PARM_DESC(shpchp_poll_mode, "Using polling mechanism for hot-plug events or not"); MODULE_PARM_DESC(shpchp_poll_time, "Polling mechanism frequency, in seconds"); From patchwork Mon Dec 16 16:10:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ilpo_J=C3=A4rvinen?= X-Patchwork-Id: 13909948 X-Patchwork-Delegate: bhelgaas@google.com Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6599413B2AF; Mon, 16 Dec 2024 16:10:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734365455; cv=none; b=HA9+H6y8xUf6ToWPfCVhTXGvM8okRUU0DnEC4R4VErEToNSkIc/nvS5CGbol3cHmRYePTEiW6rLL0YQQDbmwmkDJxTuYj3mENX4EFEDfp5TKLhRlyd+2cqVdG5RCPGHqjXO1E5VAuPedCj3/kY/UJY568bM5nSXV/2+9v572u5c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734365455; c=relaxed/simple; bh=j/8R7WJoDO6RfNflWfXR5RXnV1qmNJGf5O3f1LCn+y0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=ocw+QYZCmQZrkb+jk0mWBrcIJ0o2NwVXo+XrTiDEILJhbewvWs9LRH6jBxaRirNlS2pU8OCTde3kQmKUB5ulaIJ+8W3o9CBrrGHiiaxO1SEgWCzDQm8rp+MDLT6oW1rt4Ws8ilyiLAg+gPzeTAyg//WqngmiFwcjXXwzIrX5fAM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Na7cekmS; arc=none smtp.client-ip=198.175.65.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Na7cekmS" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1734365453; x=1765901453; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=j/8R7WJoDO6RfNflWfXR5RXnV1qmNJGf5O3f1LCn+y0=; b=Na7cekmSEvp1b/4hKEXBXVdTkqb+1ZuF7JswJ2FuNrMgthuinxn2gDI9 fqd4GVMLkCIMB7xqZdvxOls7bArylY65yKAh8yj4ir99cSAK25RhIKjMM 25YZStPBWYHK3jJZ2+fs8FIBXJK2MVxceVK5p9OBH91cfib/d7OBw/M7v lStjlH1FY6M42GXmIZ+wN3OEjTBEFUQHPm+mAWGUTXYOgu6RuuYs+Fnhd TEg65urglZMOil1gFgmodrJKxMVziyfQK0uuHDS1wuvCBxacGzSK4A6IX VOzT5IFIpY3JWI3FFNlj6znraWNp0PrtScuAsaPa9CuWST8qhdU3jnlYW Q==; X-CSE-ConnectionGUID: eeG3cFVDSqeJp7ajcPhqQg== X-CSE-MsgGUID: hvdUOasZTPOaNLeGQgNdfQ== X-IronPort-AV: E=McAfee;i="6700,10204,11282"; a="45761392" X-IronPort-AV: E=Sophos;i="6.12,224,1728975600"; d="scan'208";a="45761392" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Dec 2024 08:10:53 -0800 X-CSE-ConnectionGUID: wrjHuh+eSAuFg8ggGOFU2Q== X-CSE-MsgGUID: 7efW7r51SWaBvrsH3B67mA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,239,1728975600"; d="scan'208";a="97015539" Received: from ijarvine-mobl1.ger.corp.intel.com (HELO localhost) ([10.245.245.29]) by fmviesa006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Dec 2024 08:10:50 -0800 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: Bjorn Helgaas , linux-pci@vger.kernel.org, Karolina Stolarek , Mahesh J Salgaonkar , "Oliver O'Halloran" , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Cc: =?utf-8?q?Ilpo_J=C3=A4rvinen?= Subject: [PATCH 4/4] PCI: Descope pci_printk() to aer_printk() Date: Mon, 16 Dec 2024 18:10:12 +0200 Message-Id: <20241216161012.1774-5-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241216161012.1774-1-ilpo.jarvinen@linux.intel.com> References: <20241216161012.1774-1-ilpo.jarvinen@linux.intel.com> Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 include/linux/pci.h provides low-level pci_printk() interface that is only used by AER because it needs to print the same message with different levels depending on the error severity. No other PCI code uses that functionality and calls pci_() logging functions directly with the appropriate level. Descope pci_printk() into AER as aer_printk(). Signed-off-by: Ilpo Järvinen --- drivers/pci/pcie/aer.c | 10 +++++++--- include/linux/pci.h | 3 --- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c index 80c5ba8d8296..bfc6b94dad4d 100644 --- a/drivers/pci/pcie/aer.c +++ b/drivers/pci/pcie/aer.c @@ -17,6 +17,7 @@ #include #include +#include #include #include #include @@ -35,6 +36,9 @@ #include "../pci.h" #include "portdrv.h" +#define aer_printk(level, pdev, fmt, arg...) \ + dev_printk(level, &(pdev)->dev, fmt, ##arg) + #define AER_ERROR_SOURCES_MAX 128 #define AER_MAX_TYPEOF_COR_ERRS 16 /* as per PCI_ERR_COR_STATUS */ @@ -692,7 +696,7 @@ static void __aer_print_error(struct pci_dev *dev, if (!errmsg) errmsg = "Unknown Error Bit"; - pci_printk(level, dev, " [%2d] %-22s%s\n", i, errmsg, + aer_printk(level, dev, " [%2d] %-22s%s\n", i, errmsg, info->first_error == i ? " (First)" : ""); } pci_dev_aer_stats_incr(dev, info); @@ -715,11 +719,11 @@ void aer_print_error(struct pci_dev *dev, struct aer_err_info *info) level = (info->severity == AER_CORRECTABLE) ? KERN_WARNING : KERN_ERR; - pci_printk(level, dev, "PCIe Bus Error: severity=%s, type=%s, (%s)\n", + aer_printk(level, dev, "PCIe Bus Error: severity=%s, type=%s, (%s)\n", aer_error_severity_string[info->severity], aer_error_layer[layer], aer_agent_string[agent]); - pci_printk(level, dev, " device [%04x:%04x] error status/mask=%08x/%08x\n", + aer_printk(level, dev, " device [%04x:%04x] error status/mask=%08x/%08x\n", dev->vendor, dev->device, info->status, info->mask); __aer_print_error(dev, info); diff --git a/include/linux/pci.h b/include/linux/pci.h index db9b47ce3eef..02d23e795915 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -2685,9 +2685,6 @@ void pci_uevent_ers(struct pci_dev *pdev, enum pci_ers_result err_type); #include -#define pci_printk(level, pdev, fmt, arg...) \ - dev_printk(level, &(pdev)->dev, fmt, ##arg) - #define pci_emerg(pdev, fmt, arg...) dev_emerg(&(pdev)->dev, fmt, ##arg) #define pci_alert(pdev, fmt, arg...) dev_alert(&(pdev)->dev, fmt, ##arg) #define pci_crit(pdev, fmt, arg...) dev_crit(&(pdev)->dev, fmt, ##arg)