Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3353650imm; Tue, 17 Jul 2018 03:27:59 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcTO9nqdh0P0TmJTglGupPHuO3NoUcNPIp8S7PffIMDcCOevfOsDmCDAb6fYWqvfjro3IHx X-Received: by 2002:a62:828a:: with SMTP id w132-v6mr62565pfd.121.1531823279770; Tue, 17 Jul 2018 03:27:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531823279; cv=none; d=google.com; s=arc-20160816; b=fJFYD4dEy0c9mEBIXbZ1Ih8FcphQEC77nZi75YYybBTagnoWQrYNCiDU4w12lP5E2x 8mpLASC7ecq+V08l/9sRsEdcySzkGVE+sDWigKAfrtQkyoZRmoXqHo1yx4bsuO4EVQNZ jITAj5NOTLQVVZ/CikF8UYDHYW1lsY55qAUDQ72y5T29DV7eYL+EIQUH5fuozzkc27i7 VBPW5QhDucXQSSkUO6iKy2PfLFpwQ2SV8JGsIIqB0koXOYYbTuLJHeXS9o4pdYBofaUo qg+vUN+dZ5lLRjKZ1HzaRKWsM9+KgSBa9pweieIYgJ3M9lH9JO8BWF1pw6gNQHdi7xLp J09g== 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=pcAbE7+FIvZ/A6SQCiGxKoverX+yNa/lA2Fw/9Wd33w=; b=BXstKA1Ij9KZ8WPeFJKrLM8LXHC8NSNgCcT5GxVoGwSKgcHlNhg0L6m3o0Wk7ha990 Rxrs4XYtaIcaxuFxk7l5PWuCV59R5oKJhDm7Ay5vmyPRRtURtU7ljPcwmENCYHj/X58r LZdeLP1dsoz1kviGtINeWQaElu72ITbssOaHUPKJk+LtdT8/e+LVC/yIqiypxWvQSI3t WksmF8n++2Y6q8mGeqQCiv4sZOPiweylZWYTrMmop+X89fKe5bDCuuI5LHCv394cIUpA RmxGOK+of5UjMUxxpNNHXJ68O5MVdhlyQddeYaBqoqIJW9w8onHQRzUaApngHh8Nbxfm NmCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=dqHwLuci; 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 o32-v6si535961pld.440.2018.07.17.03.27.44; Tue, 17 Jul 2018 03:27:59 -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=dqHwLuci; 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 S1731123AbeGQK62 (ORCPT + 99 others); Tue, 17 Jul 2018 06:58:28 -0400 Received: from us01smtprelay-2.synopsys.com ([198.182.60.111]:39973 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729665AbeGQK61 (ORCPT ); Tue, 17 Jul 2018 06:58:27 -0400 Received: from mailhost.synopsys.com (mailhost3.synopsys.com [10.12.238.238]) by smtprelay.synopsys.com (Postfix) with ESMTP id 8F9F110C16DC; Tue, 17 Jul 2018 03:26:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1531823191; bh=8ZLvA1uAinWLLjKxeY4pyOQwCMeXjD+E5QZF3XlIHQU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:In-Reply-To: References:From; b=dqHwLuciJhe7O4MJM56S04pr8tUwkWx/PcIOU/zqDajc9DOHI4kVZ5L4cyXs1r72G +4X7ayF8H0jYT74Cq+LQ8trtfnwFrfpI62qLaUDNldz2TRdvIOCaYRzu8zMWwp6l1B vO9SbzlGr7eXCD7gq4wabx1g9z5wNG3F9R5dKhz1KI92DgfiaZm/hE/f+Fri2j96jX Iqv60+q1v0eI+ctBCYnDMoc7gAT2Iyuop27v/V/+P3ypgMdxuq2o3m6/ypTOxB54Fd FaN76zMr4Q7wplbzPO52d2V52KraL3hrWMs1BR5RzyB9VWn3rP3E2C+Hk3cn4rvEBL aDfeBLLy33dPQ== Received: from de02.synopsys.com (germany.internal.synopsys.com [10.225.17.21]) by mailhost.synopsys.com (Postfix) with ESMTP id 38011350A; Tue, 17 Jul 2018 03:26:31 -0700 (PDT) Received: from de02dwia024.internal.synopsys.com (de02dwia024.internal.synopsys.com [10.225.19.81]) by de02.synopsys.com (Postfix) with ESMTP id 6B5813C32C; Tue, 17 Jul 2018 12:26:29 +0200 (CEST) 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, shawn.lin@rock-chips.com Cc: linux-pci@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Gustavo Pimentel Subject: [PATCH v13 06/12] PCI: dwc: Add legacy interrupt callback handler Date: Tue, 17 Jul 2018 12:26:21 +0200 Message-Id: <3579a0b9b6eefcf306af4ccfd5cd3396df4d8f63.1531822532.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. Change v3->v4: - Rebased to Lorenzo's master branch v4.18-rc1. Change v4->v5: - Nothing changed, just to follow the patch set version. Change v5->v6: - Nothing changed, just to follow the patch set version. Change v6->v7: - Nothing changed, just to follow the patch set version. Change v7->v8: - Re-sending the patch series. Change v8->v9: - Nothing changed, just to follow the patch set version. Change v9->v10: - Nothing changed, just to follow the patch set version. Change v10->v11: - Nothing changed, just to follow the patch set version. Change v11->v12: - Nothing changed, just to follow the patch set version. Change v12->v13: - Re-sending the patch series. drivers/pci/controller/dwc/pcie-designware-ep.c | 10 ++++++++++ drivers/pci/controller/dwc/pcie-designware-plat.c | 3 +-- drivers/pci/controller/dwc/pcie-designware.h | 6 ++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-designware-ep.c b/drivers/pci/controller/dwc/pcie-designware-ep.c index dd9c366..1e7b022 100644 --- a/drivers/pci/controller/dwc/pcie-designware-ep.c +++ b/drivers/pci/controller/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/controller/dwc/pcie-designware-plat.c b/drivers/pci/controller/dwc/pcie-designware-plat.c index 8bb2ecb..160714d 100644 --- a/drivers/pci/controller/dwc/pcie-designware-plat.c +++ b/drivers/pci/controller/dwc/pcie-designware-plat.c @@ -87,8 +87,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/controller/dwc/pcie-designware.h b/drivers/pci/controller/dwc/pcie-designware.h index e8b97f5..96126fd 100644 --- a/drivers/pci/controller/dwc/pcie-designware.h +++ b/drivers/pci/controller/dwc/pcie-designware.h @@ -348,6 +348,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, @@ -367,6 +368,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