Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp659138imm; Fri, 1 Jun 2018 07:29:34 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKA2Tr4QPhyQ4irLFss8yODh9HxDI91IIPIG2pCXJfE6eTR1q4vXIwapw0Xi+O0YkfhBxmH X-Received: by 2002:a17:902:6bca:: with SMTP id m10-v6mr11345278plt.6.1527863374672; Fri, 01 Jun 2018 07:29:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527863374; cv=none; d=google.com; s=arc-20160816; b=s+SBjFiK+Ky1cjzgKcErXIP6+QafuEj5xIeAdbm6OmIR447ZsoQfdJjfASWqPKFrUI 06P3kK8LEoLalcx4vN4NStMFQTZH6nCYrrrelbA5Z0uS6dw+ECUlRMEQC7AFoz/gA+9O bq6JeEI30aYjlaDUcE+bZ6L8llytfLb0lkn+FW/wmAOLtVCJXAgSXQEhxcUELjUxrbkZ hibNURxEYzaWQKbx1k6rIHME7XrDMlpChyAiVvZvn0B7qjntUY3IzQ+jcAAgbHdbzV8y yxbQYjdave2ZS8lvfAT2emGQOGXj8SvhN3U1GAsoT2hc4AQ7vwcekrsrDRzeAsM8a4tS Fs0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=9UxLJPOflF9N0T9MS5ibAefmblWjnTMuN6XCvWUI3S8=; b=WidOb9Zx3vqwwgJ+OQnTZkJiocbzqjneNWoeKSEwk4BQj6JhaSQsrfKxAb0hTpeGrk kxPhV6cSMamwTg7oDIX2fm5iVYn/T3NV4G3bD1JE4AYcX3Cv91Xc9ynCwER+jR7XXA/+ YMIwEzNuT6thr/pmYzsjQdLKB1vsR9OpVW+/pogqtY1jP4Yd4+jyIio4/yOL6jbjisJ7 prfUBJf+n10Y/+RtTQ+r/vYIIXMuWTtRWD7DIz4qA49DxIggcH0NwUl7uANnFFEwmJ83 MNJp1JnAsfrZlWcOomzEsD98C+/y5EqUlwHJvlSlcolEVmE6OY+GmBMmvg2t/L2EH+Kd Bcrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=B4kNgE2p; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b12-v6si10361519pgn.308.2018.06.01.07.29.20; Fri, 01 Jun 2018 07:29:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=B4kNgE2p; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752629AbeFAO10 (ORCPT + 99 others); Fri, 1 Jun 2018 10:27:26 -0400 Received: from smtprelay.synopsys.com ([198.182.37.59]:42599 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751512AbeFAOZF (ORCPT ); Fri, 1 Jun 2018 10:25:05 -0400 Received: from mailhost.synopsys.com (mailhost2.synopsys.com [10.13.184.66]) by smtprelay.synopsys.com (Postfix) with ESMTP id BA10A1E137A; Fri, 1 Jun 2018 16:25:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1527863103; bh=hwoxD3CoYJXBahMfwl5D+DVmJ2wjlKzA1jZvUCY0FPg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:In-Reply-To: References:From; b=B4kNgE2pOXJeff/OPKB3//bBsIXwMPlGUKUeFSysy43r+mOMPDZFKKBmp4p//sYa/ p4c3chpgHQp2GBTB4YkojG/+6/+vsWhVQhoJ9SMdBOiXxYOnMPDPw6mFW7eU7Owkh0 7aDXtIiwLupdEuEBkItKtsbocpEKBV3vY0ylUKMIBBz/WDqq9nlpxvW8pXXDmXisPK W3hj8Ws/DvRbZeAl4cQ/p3oB9GRgd615KZeAW6BipbAvNugLjrcxtHMI6gFJBz/wcp 0d/JCS4teeSwyGNzae7Ct+rByQWRr5kR8rwENd+tDbmii1HF+JZkbFWO30hZ74Je7e yhedLxBclZcbw== Received: from pt02.synopsys.com (pt02.internal.synopsys.com [10.107.23.240]) by mailhost.synopsys.com (Postfix) with ESMTP id E7F753152; Fri, 1 Jun 2018 07:25:01 -0700 (PDT) Received: from UbuntuMate-64Bits.internal.synopsys.com (gustavo-e7480.internal.synopsys.com [10.107.25.102]) by pt02.synopsys.com (Postfix) with ESMTP id 6170B3D793; Fri, 1 Jun 2018 15:25:00 +0100 (WEST) From: Gustavo Pimentel To: bhelgaas@google.com, lorenzo.pieralisi@arm.com, Joao.Pinto@synopsys.com, jingoohan1@gmail.com, kishon@ti.com, adouglas@cadence.com, jesper.nilsson@axis.com Cc: linux-pci@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Gustavo Pimentel Subject: [PATCH v3 05/10] PCI: dwc: Add legacy interrupt callback handler Date: Fri, 1 Jun 2018 15:24:47 +0100 Message-Id: <8c34b249752c37e5729fd4ac100961d334d46ff7.1527862777.git.gustavo.pimentel@synopsys.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add a legacy interrupt callback handler. Currently DesignWare IP don't allow trigger legacy interrupts. Signed-off-by: Gustavo Pimentel Acked-by: Kishon Vijay Abraham I --- Change v1->v2: - Nothing changed, just to follow the patch set version. Change v2->v3: - Nothing changed, just to follow the patch set version. drivers/pci/dwc/pcie-designware-ep.c | 10 ++++++++++ drivers/pci/dwc/pcie-designware-plat.c | 3 +-- drivers/pci/dwc/pcie-designware.h | 6 ++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/drivers/pci/dwc/pcie-designware-ep.c b/drivers/pci/dwc/pcie-designware-ep.c index 3ba7059..6fa363c 100644 --- a/drivers/pci/dwc/pcie-designware-ep.c +++ b/drivers/pci/dwc/pcie-designware-ep.c @@ -370,6 +370,16 @@ static const struct pci_epc_ops epc_ops = { .stop = dw_pcie_ep_stop, }; +int dw_pcie_ep_raise_legacy_irq(struct dw_pcie_ep *ep, u8 func_no) +{ + struct dw_pcie *pci = to_dw_pcie_from_ep(ep); + struct device *dev = pci->dev; + + dev_err(dev, "EP cannot trigger legacy IRQs\n"); + + return -EINVAL; +} + int dw_pcie_ep_raise_msi_irq(struct dw_pcie_ep *ep, u8 func_no, u8 interrupt_num) { diff --git a/drivers/pci/dwc/pcie-designware-plat.c b/drivers/pci/dwc/pcie-designware-plat.c index 654dcb5..90a8c95 100644 --- a/drivers/pci/dwc/pcie-designware-plat.c +++ b/drivers/pci/dwc/pcie-designware-plat.c @@ -84,8 +84,7 @@ static int dw_plat_pcie_ep_raise_irq(struct dw_pcie_ep *ep, u8 func_no, switch (type) { case PCI_EPC_IRQ_LEGACY: - dev_err(pci->dev, "EP cannot trigger legacy IRQs\n"); - return -EINVAL; + return dw_pcie_ep_raise_legacy_irq(ep, func_no); case PCI_EPC_IRQ_MSI: return dw_pcie_ep_raise_msi_irq(ep, func_no, interrupt_num); case PCI_EPC_IRQ_MSIX: diff --git a/drivers/pci/dwc/pcie-designware.h b/drivers/pci/dwc/pcie-designware.h index a0ab12f..69e6e17 100644 --- a/drivers/pci/dwc/pcie-designware.h +++ b/drivers/pci/dwc/pcie-designware.h @@ -350,6 +350,7 @@ static inline int dw_pcie_allocate_domains(struct pcie_port *pp) void dw_pcie_ep_linkup(struct dw_pcie_ep *ep); int dw_pcie_ep_init(struct dw_pcie_ep *ep); void dw_pcie_ep_exit(struct dw_pcie_ep *ep); +int dw_pcie_ep_raise_legacy_irq(struct dw_pcie_ep *ep, u8 func_no); int dw_pcie_ep_raise_msi_irq(struct dw_pcie_ep *ep, u8 func_no, u8 interrupt_num); int dw_pcie_ep_raise_msix_irq(struct dw_pcie_ep *ep, u8 func_no, @@ -369,6 +370,11 @@ static inline void dw_pcie_ep_exit(struct dw_pcie_ep *ep) { } +static inline int dw_pcie_ep_raise_legacy_irq(struct dw_pcie_ep *ep, u8 func_no) +{ + return 0; +} + static inline int dw_pcie_ep_raise_msi_irq(struct dw_pcie_ep *ep, u8 func_no, u8 interrupt_num) { -- 2.7.4