From patchwork Tue Aug 1 07:11:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keith Busch X-Patchwork-Id: 9873745 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8ECAF6038F for ; Tue, 1 Aug 2017 07:05:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7645D28675 for ; Tue, 1 Aug 2017 07:05:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6B21C2867E; Tue, 1 Aug 2017 07:05:30 +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=-6.9 required=2.0 tests=BAYES_00,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 EB51C28675 for ; Tue, 1 Aug 2017 07:05:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751918AbdHAHF2 (ORCPT ); Tue, 1 Aug 2017 03:05:28 -0400 Received: from mga14.intel.com ([192.55.52.115]:57345 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751914AbdHAHF2 (ORCPT ); Tue, 1 Aug 2017 03:05:28 -0400 Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Aug 2017 00:05:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,305,1498546800"; d="scan'208";a="131872877" Received: from unknown (HELO localhost.lm.intel.com) ([10.232.112.96]) by orsmga005.jf.intel.com with ESMTP; 01 Aug 2017 00:05:26 -0700 From: Keith Busch To: linux-pci@vger.kernel.org, Bjorn Helgaas , linux-kernel@vger.kernel.org Cc: Keith Busch , , Mayurkumar Patel Subject: [PATCH] pciehp: Fix infinite interupt handler loop Date: Tue, 1 Aug 2017 03:11:52 -0400 Message-Id: <1501571512-8362-1-git-send-email-keith.busch@intel.com> X-Mailer: git-send-email 2.5.5 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 We've encountered a particular platform that under some circumstances always has the power fault detected status raised. The pciehp irq handler would loop forever because it thinks it is handling new events when in fact the power fault is not new. This patch fixes that by masking off the power fault status from new events if the driver hasn't seen the power fault clear from the previous handling attempt. Fixes: fad214b0aa72 ("PCI: pciehp: Process all hotplug events before looking for new ones") Cc: # 4.9+ Cc: Mayurkumar Patel Signed-off-by: Keith Busch --- Resending due to send-email setup error; this patch may appear twice for some. drivers/pci/hotplug/pciehp_hpc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c index 026830a..8ecbc13 100644 --- a/drivers/pci/hotplug/pciehp_hpc.c +++ b/drivers/pci/hotplug/pciehp_hpc.c @@ -583,7 +583,9 @@ static irqreturn_t pciehp_isr(int irq, void *dev_id) * Slot Status contains plain status bits as well as event * notification bits; right now we only want the event bits. */ - events = status & (PCI_EXP_SLTSTA_ABP | PCI_EXP_SLTSTA_PFD | + events = status & (PCI_EXP_SLTSTA_ABP | + (ctrl->power_fault_detected ? + 0 : PCI_EXP_SLTSTA_PFD) | PCI_EXP_SLTSTA_PDC | PCI_EXP_SLTSTA_CC | PCI_EXP_SLTSTA_DLLSC); if (!events)