From patchwork Sat Jul 28 09:13:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 10548093 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 691FF14E2 for ; Sun, 29 Jul 2018 00:04:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 57EF22AAA7 for ; Sun, 29 Jul 2018 00:04:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4B03E2AAD2; Sun, 29 Jul 2018 00:04:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DATE_IN_PAST_12_24, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4126D2AAA7 for ; Sun, 29 Jul 2018 00:04:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731746AbeG2Bce (ORCPT ); Sat, 28 Jul 2018 21:32:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:48218 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731744AbeG2Bce (ORCPT ); Sat, 28 Jul 2018 21:32:34 -0400 Received: from sinan-ubuntu.cust.blueprintrf.com (unknown [209.119.211.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C6CB420893; Sun, 29 Jul 2018 00:04:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1532822655; bh=lolLz+J8BhPeIqL1BR4BRo+ZcKIN3Kyp/Pl6pUQOO00=; h=From:To:Cc:Subject:Date:From; b=u1ysIpaPO24DcENm+dyyoET/3otzxG81AIf4wO1Hpfbt3CFkRlI3P7Q2W51Byxz29 oUWt/GnCfmodHqVE2zF7LUw9pSttsmrvU4v1mejoHa4mRkCgKn9956LmxrRu5j7y/u oyqQBsHlAx3MwFPQA8ICwGjgrsVETMfhavOB566c= From: Sinan Kaya To: linux-pci@vger.kernel.org Cc: Sinan Kaya Subject: [PATCH v6 0/1] PCI: Mask and unmask hotplug interrupts during reset Date: Sat, 28 Jul 2018 02:13:23 -0700 Message-Id: <20180728091324.154795-1-okaya@kernel.org> X-Mailer: git-send-email 2.17.1 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If a bridge supports hotplug and observes a PCIe fatal error, the following events happen: 1. AER driver removes the devices from PCI tree on fatal error 2. AER driver brings down the link by issuing a secondary bus reset waits for the link to come up. 3. Hotplug driver observes a link down interrupt 4. Hotplug driver tries to remove the devices waiting for the rescan lock but devices are already removed by the AER driver and AER driver is waiting for the link to come back up. 5. AER driver tries to re-enumerate devices after polling for the link state to go up. 6. Hotplug driver obtains the lock and tries to remove the devices again. Ignore link events caused by fatal error in hotplug driver. Note that surprise link down fatal error is a hotplug event. Sinan Kaya (1): PCI: pciehp: Ignore link events when there is a fatal error pending drivers/pci/hotplug/pciehp_hpc.c | 13 ++++++++---- drivers/pci/pci.h | 1 + drivers/pci/pcie/err.c | 35 ++++++++++++++++++++++++++++++++ 3 files changed, 45 insertions(+), 4 deletions(-)