From patchwork Thu Aug 4 22:09:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keith Busch X-Patchwork-Id: 9264393 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 1577B60839 for ; Thu, 4 Aug 2016 22:09:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0679B27E78 for ; Thu, 4 Aug 2016 22:09:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EFACE28395; Thu, 4 Aug 2016 22:09:34 +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 954D227E78 for ; Thu, 4 Aug 2016 22:09:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966144AbcHDWJd (ORCPT ); Thu, 4 Aug 2016 18:09:33 -0400 Received: from mga09.intel.com ([134.134.136.24]:42827 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965241AbcHDWJd (ORCPT ); Thu, 4 Aug 2016 18:09:33 -0400 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 04 Aug 2016 15:09:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,471,1464678000"; d="scan'208";a="1029971843" Received: from dcgshare.lm.intel.com ([10.232.118.254]) by orsmga002.jf.intel.com with ESMTP; 04 Aug 2016 15:09:23 -0700 Received: by dcgshare.lm.intel.com (Postfix, from userid 1017) id 1B94BE0C6D; Thu, 4 Aug 2016 16:09:23 -0600 (MDT) From: Keith Busch To: linux-pci@vger.kernel.org, Bjorn Helgaas Cc: Jon Derrick , Keith Busch Subject: [PATCH 1/2] vmd: Fix infinite loop executing irq's Date: Thu, 4 Aug 2016 16:09:08 -0600 Message-Id: <1470348549-10855-1-git-send-email-keith.busch@intel.com> X-Mailer: git-send-email 1.7.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 We can't initialize the list head on deletion as this causes the node to point to itself, looping infinitely if the vmd IRQ handler happens to be servicing that node. The list initialization supposed to fix a bug from multiple calls to disable the same IRQ. We can fix this instead just checking if the previous pointer indicates it was already deleted. Signed-off-by: Keith Busch --- arch/x86/pci/vmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/pci/vmd.c b/arch/x86/pci/vmd.c index e88b417..2294907 100644 --- a/arch/x86/pci/vmd.c +++ b/arch/x86/pci/vmd.c @@ -136,8 +136,8 @@ static void vmd_irq_disable(struct irq_data *data) data->chip->irq_mask(data); raw_spin_lock_irqsave(&list_lock, flags); - list_del_rcu(&vmdirq->node); - INIT_LIST_HEAD_RCU(&vmdirq->node); + if (vmdirq->node.prev != LIST_POISON2) + list_del_rcu(&vmdirq->node); raw_spin_unlock_irqrestore(&list_lock, flags); }