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: 796103 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3xM6lt2qCkz9tWN for ; Tue, 1 Aug 2017 17:05:30 +1000 (AEST) 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 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)