From patchwork Wed Mar 14 15:50:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oza Pawandeep X-Patchwork-Id: 10282571 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 920D8602C2 for ; Wed, 14 Mar 2018 15:51:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 838F828236 for ; Wed, 14 Mar 2018 15:51:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 77F8728249; Wed, 14 Mar 2018 15:51:55 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable 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 F004628236 for ; Wed, 14 Mar 2018 15:51:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751741AbeCNPvf (ORCPT ); Wed, 14 Mar 2018 11:51:35 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:60426 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751495AbeCNPvc (ORCPT ); Wed, 14 Mar 2018 11:51:32 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 6493560C55; Wed, 14 Mar 2018 15:51:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1521042692; bh=naF7wU/IHPMLzPAyeJEtx0auROzCo5Vn0kE16BqE7m0=; h=From:To:Cc:Subject:Date:From; b=A6/IwC0XJ27I02gyRE/3oYMWMwcofjMADkwaBxR6m8iTXdRCEOv4Fl0AAL191pM4X HTgdKz6FzomZSnx6gCNFH64MDPFRBEjeLgDcZjQo0IR8koudVuwIi6JrQ2+cPrhsSB Vpnia89SfeMmaIiqxg1J68pewPqp2ph5upk210JQ= Received: from blr-ubuntu-poza.qualcomm.com (blr-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.18.19]) (using TLSv1.1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: poza@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 076A060592; Wed, 14 Mar 2018 15:51:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1521042691; bh=naF7wU/IHPMLzPAyeJEtx0auROzCo5Vn0kE16BqE7m0=; h=From:To:Cc:Subject:Date:From; b=lLg1bjgtRXnQdpxcNwY4Bj0t0Sveq6z5IOFGSkqskWUd6R5AE9O2iiilRX5g9fcvi dvBwRdp6dj8sVVGSpjI3QibEAm/QORkSyNu7ZZwECrlu2eUVd4n8wnhqffJ8ewsOyQ FMIVwDDfEkCaDECQjC4wnbA1o/MuF0Us3YKJNW+g= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 076A060592 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=poza@codeaurora.org From: Oza Pawandeep To: 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 Cc: Oza Pawandeep Subject: [PATCH v2] PCI/DPC: Fix PCI legacy interrupt acknowledgement Date: Wed, 14 Mar 2018 21:20:48 +0530 Message-Id: <1521042648-20522-1-git-send-email-poza@codeaurora.org> X-Mailer: git-send-email 1.9.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 Current DPC driver acknowledges the interrupt in deferred work, which works since MSI are edge triggered. But when MSI is disabled (e.g. pci=nomsi boot option) port service driver falls back to PCI legacy INT interrupt. With current code we do not acknowledge the interrupt back in dpc_irq() and we get dpc interrupt storm. This patch acknowledges the interrupt in interrupt handler. Signed-off-by: Oza Pawandeep Reviewed-by: Keith Busch diff --git a/drivers/pci/pcie/pcie-dpc.c b/drivers/pci/pcie/pcie-dpc.c index 38e40c6..9c05120 100644 --- a/drivers/pci/pcie/pcie-dpc.c +++ b/drivers/pci/pcie/pcie-dpc.c @@ -112,7 +112,7 @@ static void dpc_work(struct work_struct *work) } pci_write_config_word(pdev, cap + PCI_EXP_DPC_STATUS, - PCI_EXP_DPC_STATUS_TRIGGER | PCI_EXP_DPC_STATUS_INTERRUPT); + PCI_EXP_DPC_STATUS_TRIGGER); pci_read_config_word(pdev, cap + PCI_EXP_DPC_CTL, &ctl); pci_write_config_word(pdev, cap + PCI_EXP_DPC_CTL, @@ -222,6 +222,9 @@ static irqreturn_t dpc_irq(int irq, void *context) if (dpc->rp_extensions && reason == 3 && ext_reason == 0) dpc_process_rp_pio_error(dpc); + pci_write_config_word(pdev, cap + PCI_EXP_DPC_STATUS, + PCI_EXP_DPC_STATUS_INTERRUPT); + schedule_work(&dpc->work); return IRQ_HANDLED;