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 Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7DFD3C54E71 for ; Tue, 20 May 2025 22:27:01 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4b28LD0Nppz2yr1; Wed, 21 May 2025 08:27:00 +1000 (AEST) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip=192.198.163.14 ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1747780019; cv=none; b=JmP761uoiWaJEShtDklkWw2M7OjQWw6aNKDrC900ztrh0Tx6BZe4/KsS1NOpqd3lrqsULijh/+eR2IDL+5CRUFtDkbnvW8jwYrez3GQqTFBAI4Yr0Pw6yShPYOLzpQKa0GSq67Np0XzhkIPKx7NSpkF72245xGxOa4kwUPsNOx27unC8T/oHhbJaWzdFWHTLKQoAG3YOCW7oTyCWzlFk0H5Bcrl/+KpaARRdCuWCbL1Fdbwaxe/LuEZlocGvyDl2KBKWkLrq+b5DSQKaMrwu5yDW9TAJWCSVcivEo0oVMj+UtQEte7qMw8XxtTjd1RuS8/g94vlVP5KtU6LQioQqPw== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1747780019; c=relaxed/relaxed; bh=Gh6z/F9J5IqF5rLjv8rxhqmsr/GLUDLqhJtB+KsJqgM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Dpc5KSe6Lhf54L7AzgSarMC6Fam/PqHhVFL2+Bodz1ZRDPaCVoZukUYjP+sDHRcMZM8qjFwXCAAjpWvmwEYvD9DWQ9mDla6sI3tXaTOKocxekbQVxtOyyLyMZ8VEIPUzHClL5XzRyXj8IZIMSTFSvrmktBn6M3SDhL1WUGqiaTHARzwLPZpGGixhcCqreM6rTnmz6rgn+MjENH7icT0cNcYbQtU6jPlFAVvQxl6BMGUTUAeSc14X57Jf8RW1S34i3458MAtjr2G3XuT3euli0OSomZV9YuaPzVmi68doT6IHyN7ntUKfGVihHeELWVNvM4vniqngqCbVehT8FTUxeA== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=oFhfpASq; dkim-atps=neutral; spf=none (client-ip=192.198.163.14; helo=mgamail.intel.com; envelope-from=sathyanarayanan.kuppuswamy@linux.intel.com; receiver=lists.ozlabs.org) smtp.mailfrom=linux.intel.com Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=oFhfpASq; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=linux.intel.com (client-ip=192.198.163.14; helo=mgamail.intel.com; envelope-from=sathyanarayanan.kuppuswamy@linux.intel.com; receiver=lists.ozlabs.org) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4b28L940Tyz2yql for ; Wed, 21 May 2025 08:26:56 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1747780018; x=1779316018; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=8tFeW05/7XCVuFCJ6OwQew4Gt09wQRdhiAtl6NZm4Vs=; b=oFhfpASqHkpxjaIZ8ZpKH+w6C6ngpEC8lMbLFnE3O1cg0THt+P5faVL2 /Jt8un7hvzYf9GULfW4Me+HKwDrJ26Uwb+KvHc5vHSq0j965M3x8/mvy5 vpbzKEYQoQF7yUyUM3CkKKDbhyvJbeeuSWTMsFD0Uyz4BcD2LLUFdhLkt eN33Jffg7Ze2dhoAAN/Oub/Ri5JKCByr4ZZJK0DpoQnC06Fa8tr9W5RIv 0ytrbBGIM2Fk+LQ6r4yG9eWbJBzbDzyH/ttS/BRorlZjL96jHUMSPqnh8 x/roa4s2egcqfUQynFQrdKV1MQg/LhHByVSdYyzDsWJGeGYOW9vH4TOI0 g==; X-CSE-ConnectionGUID: IznHIOwGQQOyInkcpnQd/Q== X-CSE-MsgGUID: fIMB0wAnR2WLoNdECSCedg== X-IronPort-AV: E=McAfee;i="6700,10204,11439"; a="49835304" X-IronPort-AV: E=Sophos;i="6.15,303,1739865600"; d="scan'208";a="49835304" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 May 2025 15:26:52 -0700 X-CSE-ConnectionGUID: DEx49EBDSU2K0eC3jg1jlw== X-CSE-MsgGUID: ZKAIxYD7Rsq5IwWloIgvsQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,303,1739865600"; d="scan'208";a="144786555" Received: from iweiny-desk3.amr.corp.intel.com (HELO [10.124.222.89]) ([10.124.222.89]) by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 May 2025 15:26:50 -0700 Message-ID: Date: Tue, 20 May 2025 15:26:49 -0700 X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v7 03/17] PCI/AER: Factor COR/UNCOR error handling out from aer_isr_one_error() To: Bjorn Helgaas , linux-pci@vger.kernel.org Cc: Jon Pan-Doh , Karolina Stolarek , Weinan Liu , Martin Petersen , Ben Fuller , Drew Walton , Anil Agrawal , Tony Luck , =?UTF-8?Q?Ilpo_J=C3=A4rvinen?= , Lukas Wunner , Jonathan Cameron , Sargun Dhillon , "Paul E . McKenney" , Mahesh J Salgaonkar , Oliver O'Halloran , Kai-Heng Feng , Keith Busch , Robert Richter , Terry Bowman , Shiju Jose , Dave Jiang , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Bjorn Helgaas References: <20250520215047.1350603-1-helgaas@kernel.org> <20250520215047.1350603-4-helgaas@kernel.org> Content-Language: en-US From: Sathyanarayanan Kuppuswamy In-Reply-To: <20250520215047.1350603-4-helgaas@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 5/20/25 2:50 PM, Bjorn Helgaas wrote: > From: Bjorn Helgaas > > aer_isr_one_error() duplicates the Error Source ID logging and AER error > processing for Correctable Errors and Uncorrectable Errors. Factor out the > duplicated code to aer_isr_one_error_type(). > > aer_isr_one_error() doesn't need the struct aer_rpc pointer, so pass it the > Root Port or RCEC pci_dev pointer instead. > > Signed-off-by: Bjorn Helgaas > --- Reviewed-by: Kuppuswamy Sathyanarayanan > drivers/pci/pcie/aer.c | 36 +++++++++++++++++++++++------------- > 1 file changed, 23 insertions(+), 13 deletions(-) > > diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c > index a1cf8c7ef628..568229288ca3 100644 > --- a/drivers/pci/pcie/aer.c > +++ b/drivers/pci/pcie/aer.c > @@ -1273,17 +1273,32 @@ static inline void aer_process_err_devices(struct aer_err_info *e_info) > } > > /** > - * aer_isr_one_error - consume an error detected by Root Port > - * @rpc: pointer to the Root Port which holds an error > + * aer_isr_one_error_type - consume a Correctable or Uncorrectable Error /s/cosume/Consume/ > + * detected by Root Port or RCEC > + * @root: pointer to Root Port or RCEC that signaled AER interrupt > + * @info: pointer to AER error info > + */ > +static void aer_isr_one_error_type(struct pci_dev *root, > + struct aer_err_info *info) > +{ > + aer_print_port_info(root, info); > + > + if (find_source_device(root, info)) > + aer_process_err_devices(info); > +} > + > +/** > + * aer_isr_one_error - consume error(s) signaled by an AER interrupt from > + * Root Port or RCEC > + * @root: pointer to Root Port or RCEC that signaled AER interrupt > * @e_src: pointer to an error source > */ > -static void aer_isr_one_error(struct aer_rpc *rpc, > +static void aer_isr_one_error(struct pci_dev *root, > struct aer_err_source *e_src) > { > - struct pci_dev *pdev = rpc->rpd; > struct aer_err_info e_info; > > - pci_rootport_aer_stats_incr(pdev, e_src); > + pci_rootport_aer_stats_incr(root, e_src); > > /* > * There is a possibility that both correctable error and > @@ -1297,10 +1312,8 @@ static void aer_isr_one_error(struct aer_rpc *rpc, > e_info.multi_error_valid = 1; > else > e_info.multi_error_valid = 0; > - aer_print_port_info(pdev, &e_info); > > - if (find_source_device(pdev, &e_info)) > - aer_process_err_devices(&e_info); > + aer_isr_one_error_type(root, &e_info); > } > > if (e_src->status & PCI_ERR_ROOT_UNCOR_RCV) { > @@ -1316,10 +1329,7 @@ static void aer_isr_one_error(struct aer_rpc *rpc, > else > e_info.multi_error_valid = 0; > > - aer_print_port_info(pdev, &e_info); > - > - if (find_source_device(pdev, &e_info)) > - aer_process_err_devices(&e_info); > + aer_isr_one_error_type(root, &e_info); > } > } > > @@ -1340,7 +1350,7 @@ static irqreturn_t aer_isr(int irq, void *context) > return IRQ_NONE; > > while (kfifo_get(&rpc->aer_fifo, &e_src)) > - aer_isr_one_error(rpc, &e_src); > + aer_isr_one_error(rpc->rpd, &e_src); > return IRQ_HANDLED; > } > -- Sathyanarayanan Kuppuswamy Linux Kernel Developer