Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp978347imm; Fri, 11 May 2018 09:12:09 -0700 (PDT) X-Google-Smtp-Source: AB8JxZojnB+fZqL58tUmFnsPMmkX4AjHoBKh8VywwZ8/cU6UzzUtM5kZHsG5NRBW8JPb0tgMUcq4 X-Received: by 2002:a17:902:8f82:: with SMTP id z2-v6mr6103869plo.350.1526055129707; Fri, 11 May 2018 09:12:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526055129; cv=none; d=google.com; s=arc-20160816; b=SiJhxIIGCryOUjXWN4SBtZVDLw8U/xlxq8q8hlfKMS9LwB4Rye3mE0wzdxkVL15+LU jp4szbIiIp4+Acg574aW+HcfjJ2OAQ7ZBZYz16wAOKDvtJ65IBb0l7GlSmje1V6xmqe0 bou5fJCN52e/eJkNbdcJo+NUxZpygj/EEKbfRfcLvvQYXG83TVqJqSuQfgzsixRV2a7b vmKrVhN/BvJxDa1KCFvMD39qKGCNTFkfgmaPkdIVShWKR4K5Unr9cJKj0CtkPgOafJ5D bsAWiVP+/B4d8Rr9NcLiOpIPEPU8wAJvzCcr3/p+CM8ufzGQDW5ZE6M42qLjn1Q/acSb HU3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature:dkim-signature :arc-authentication-results; bh=lhpXCwwaxshKPWafHJpZUTUZ1Ob+HxadHkwD+/Wq3Y0=; b=zEVl5iQKcHN+2n+iwS3I0UMt80iuLQQfXzX8MRuvNVJgEpqCVh3NCtTLByNlOqVVet wH5J2xBf4rIdg4HG8wGfj10ov5iQC6qzpVXEDGQl4nhol5uCkEVYdYumXa3ZmnCZ7E44 FRCSnRDrxjFZXJ4BH7NTtXCLLyDuLdYnvVpf3oxV0VPCeOvAGgOao1HMwjLV87X7KFOc DXLX1tD0mgyazQL8lIAHzQNSOhn/7Sp8sO/PdlYIHojbjhp/tmoFYmV6fd0o2losI/ZY uF5G8lgHZOWe/tfLL0BU+EPEasRPtNHEsVsEuEcCc9d4CbCou2PUpdBKwmhTlEHA9a2z CmLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=PXg+mkp4; dkim=pass header.i=@codeaurora.org header.s=default header.b=dTl6fp2i; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c30-v6si2012891pgn.553.2018.05.11.09.11.54; Fri, 11 May 2018 09:12:09 -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=@codeaurora.org header.s=default header.b=PXg+mkp4; dkim=pass header.i=@codeaurora.org header.s=default header.b=dTl6fp2i; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751698AbeEKQL0 (ORCPT + 99 others); Fri, 11 May 2018 12:11:26 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:48004 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750746AbeEKQLY (ORCPT ); Fri, 11 May 2018 12:11:24 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 01EB660881; Fri, 11 May 2018 16:11:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1526055084; bh=QdXW5y5lE43wWGUGVBUk6f6QJ/I5hSoJmwtnkHgYqQo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=PXg+mkp4wwN0Mi/LEAmimdsH9l9JRZmJEh9oeaK1Cg2zt/CMzKh4Z4eEYLSsIY5oN JTP4wa/BEyHSm4KomzI1Amcg48PbV7RXMXpNAvv/BZBxyI1azWUlzDSTL5+fuTNCRe 3wd3o/cphhFLmhYRSzjF4b9LTOc2IDSGFv643DSE= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id C84C86079C; Fri, 11 May 2018 16:11:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1526055082; bh=QdXW5y5lE43wWGUGVBUk6f6QJ/I5hSoJmwtnkHgYqQo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=dTl6fp2itM4NKZANktQEL7k8cFYED9RAxeDdeinxrSuJz9ownT9sD/Dgn9SUOosqb dSZIld7+YfNZH4a1MXkfYLoadwlBPhMszyDgk6YyFPC8qxFf/k+SHv1hSU0gkzeHXI RQk7iNekhJTXL30nQtoD8NbpDQg9qxUVWpiTUfls= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 11 May 2018 21:41:22 +0530 From: poza@codeaurora.org To: Lukas Wunner Cc: Bjorn Helgaas , Philippe Ombredanne , Thomas Gleixner , Greg Kroah-Hartman , Kate Stewart , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Dongdong Liu , Keith Busch , Wei Zhang , Sinan Kaya , Timur Tabi Subject: Re: [PATCH v16 5/9] PCI/AER: Factor out error reporting from AER In-Reply-To: <20180511155422.GA333@wunner.de> References: <1526035408-31328-1-git-send-email-poza@codeaurora.org> <1526035408-31328-6-git-send-email-poza@codeaurora.org> <20180511125857.GA23225@wunner.de> <7317531a7a85404d590008a27131955f@codeaurora.org> <20180511155422.GA333@wunner.de> Message-ID: <78a5edb7e5f785a14dd4241f53b69933@codeaurora.org> X-Sender: poza@codeaurora.org User-Agent: Roundcube Webmail/1.2.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-05-11 21:24, Lukas Wunner wrote: > On Fri, May 11, 2018 at 09:04:36PM +0530, poza@codeaurora.org wrote: >> On 2018-05-11 18:28, Lukas Wunner wrote: >> >On Fri, May 11, 2018 at 06:43:24AM -0400, Oza Pawandeep wrote: >> >>+void pcie_do_fatal_recovery(struct pci_dev *dev) >> >>+{ >> >>+ struct pci_dev *udev; >> >>+ struct pci_bus *parent; >> >>+ struct pci_dev *pdev, *temp; >> >>+ pci_ers_result_t result = PCI_ERS_RESULT_RECOVERED; >> >>+ struct aer_broadcast_data result_data; >> >>+ >> >>+ if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) >> >>+ udev = dev; >> >>+ else >> >>+ udev = dev->bus->self; >> >>+ >> >>+ parent = udev->subordinate; >> >>+ pci_lock_rescan_remove(); >> >>+ list_for_each_entry_safe_reverse(pdev, temp, &parent->devices, >> >>+ bus_list) { >> >>+ pci_dev_get(pdev); >> >>+ pci_dev_set_disconnected(pdev, NULL); >> >>+ if (pci_has_subordinate(pdev)) >> >>+ pci_walk_bus(pdev->subordinate, >> >>+ pci_dev_set_disconnected, NULL); >> >>+ pci_stop_and_remove_bus_device(pdev); >> >>+ pci_dev_put(pdev); >> >>+ } >> > >> >Any reason not to simply call >> > >> > pci_walk_bus(udev->subordinate, pci_dev_set_disconnected, NULL); >> > >> >before the list_for_each_entry_safe_reverse() iteration, instead of >> >calling it for each device on the subordinate bus and for each >> >device's children? Should be semantically identical, saves 3 LoC >> >and saves wasted cycles of acquiring pci_bus_sem over and over again >> >for each device on the subordinate bus. >> >> Well this is borrowed code from DPC driver, hence I thought to keep >> the >> same. >> but to me it looks like its taking care of PCIe switch where is goes >> through >> all the subordinates, and which could turn out to be more swicthes >> down the >> line, and son on... >> it goes all the way down to the tree > > ... which is precisely what the one line I suggested above does. > > You don't need to respin for this alone as far as I'm concerned, > but please post a follow-up refactoring patch. I have a patch > in the pipeline which makes the same change in pciehp, hence this > caught my eye. > > Thanks, > > Lukas Thanks Lukas, I will keep this in my pipeline as an optimization. appreciate your input. Regards, Oza.