Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp285569pxu; Thu, 15 Oct 2020 04:05:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzSL9yrvcctMw1ExRYLtqAU/lnh6NLgwHuryz7hQHRTaFix1AhEC+YqLEc4FrfguVq23jpp X-Received: by 2002:a17:906:b353:: with SMTP id cd19mr3779021ejb.140.1602759933534; Thu, 15 Oct 2020 04:05:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602759933; cv=none; d=google.com; s=arc-20160816; b=M4JHOYDSsVAMNv0VzhI/sk9/v8dFLrnXmUfmOFg5hKYr8dtfUrjhoWgHkVf8jKih6H J6x6CwicwpN/77Sb8MSfMF9VB5R/sTSz6V4KDJ54pNBdqfYRinWeuKMpBn60gadIRRFZ qY41LRBzfJiQje0wKojS3xIXICdalqM2IXDJViaKxpb3Y0uizaIpI28wd4NOxU/D5d7n Gwi/nJxeZDHaOTvlKgssYJEXGl47eAqp9Lt6ymrC9ITeCtSB6cjAVFH/yubEkiviOvmL LaLvXPk8IgeXiMvasAVPd+S5cHFoOG1WPZdy3P95d0AAl84K7zRMq1lTOJ7ZpfpcbqIo S0Ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=j6yfA8UT8xWaEF0uYRUzRwVGZR9uDhBP+4UPoxN1m44=; b=QpB+7Zp6p9C0WogR5/UmOJLYwJvJjvIE7ViQ4tbt/2tBLsdM4O/p+Aqn/9oYTNkg0v DMHTpIzY40K5WIFdODAl/+5LBvoccEBAXi5wzk1zouLqldMOUQM8o+OcRwqVKIUe5Cgg NUoCv5ouQeSIe/KbJunzvbEE+pntbgV4u9An/Buqx8f99hcGm5ZUmf2mQoQGBnIzafM5 gCUyljxzpSZ4wAATqPJJ6hdQiG8i6hlfoPHMOKD5B+iVji5i43FMdUMut5bPD4JZ4mFU KhnNoUHEDt7VqKw2fK+P1rouqyNfzsvIp78edAA0AHjoEp1MAREZJRk33876gJPL3Zdy 6E9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=u0D5TbT8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k3si1711065edx.575.2020.10.15.04.05.09; Thu, 15 Oct 2020 04:05:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=u0D5TbT8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729354AbgJOGw0 (ORCPT + 99 others); Thu, 15 Oct 2020 02:52:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725208AbgJOGw0 (ORCPT ); Thu, 15 Oct 2020 02:52:26 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C731CC061755; Wed, 14 Oct 2020 23:52:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=j6yfA8UT8xWaEF0uYRUzRwVGZR9uDhBP+4UPoxN1m44=; b=u0D5TbT8MHtyTx6if7jno7uKHO AQrmZQC1nsy4Nx8oqwqZrjPBdHbNJxcCJRgP8TqLRZ10J+r0sKphzFPNw37W+QsOXQ4uXyKKpk0Oy 5j1PYKs+/URTsmM7a8MrvhiM+0WaMc+iHZPORfcIPUOrBY6yhSYZJuNEBWAt7jw1zWfP50/0GumDU 6JEjzXXvwHSKOX49f+sweDCRjrdtqte9UD3fY99x2PU+C9ms2kJeUDLz11HrESovPI43AIiYwGylC RG47sYHQjF5MHhMBNqqyZsbkRtIpwFtXtiqdLeXWsVjD6U/tSSWk/VCFaE2L9gT93H7oi32Ds4MrM ad/N8GYA==; Received: from hch by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kSx7e-0003y7-RK; Thu, 15 Oct 2020 06:52:22 +0000 Date: Thu, 15 Oct 2020 07:52:22 +0100 From: Christoph Hellwig To: Kuppuswamy Sathyanarayanan Cc: bhelgaas@google.com, okaya@kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, ashok.raj@intel.com, sathyanarayanan.kuppuswamy@linux.intel.com Subject: Re: [PATCH v6 2/2] PCI/ERR: Split the fatal and non-fatal error recovery handling Message-ID: <20201015065222.GB12987@infradead.org> References: <546d346644654915877365b19ea534378db0894d.1602663397.git.sathyanarayanan.kuppuswamy@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > /* PCI error reporting and recovery */ > -pci_ers_result_t pcie_do_recovery(struct pci_dev *dev, > - pci_channel_state_t state, > +pci_ers_result_t pcie_do_nonfatal_recovery(struct pci_dev *dev); > + > +pci_ers_result_t pcie_do_fatal_recovery(struct pci_dev *dev, > pci_ers_result_t (*reset_link)(struct pci_dev *pdev)); Now that both functions have descriptive names (thanks for that!), the "_do" component of the names can be dropped. > +pci_ers_result_t pcie_do_fatal_recovery(struct pci_dev *dev, > pci_ers_result_t (*reset_link)(struct pci_dev *pdev)) > +{ > + struct pci_dev *udev; > + struct pci_bus *parent; > + struct pci_dev *pdev, *temp; > + pci_ers_result_t result; > + > + if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) > + udev = dev; > + else > + udev = dev->bus->self; > + > + parent = udev->subordinate; > + pci_walk_bus(parent, pci_dev_set_disconnected, NULL); > + > + pci_lock_rescan_remove(); > + pci_dev_get(dev); > + list_for_each_entry_safe_reverse(pdev, temp, &parent->devices, > + bus_list) { > + pci_stop_and_remove_bus_device(pdev); > + } > + > + result = reset_link(udev); Some of the indentation seems strange here, please use tab based indents everywhere.