aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwtracing/intel_th/pci.c
diff options
context:
space:
mode:
authorAlexander Shishkin <alexander.shishkin@linux.intel.com>2019-05-03 11:44:39 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-05-03 18:14:29 +0200
commit62a593022c32380d040303a5e3d6b67fd9c415bc (patch)
tree0db3d3817feaa05653f5db434584b5ebe5fb19d6 /drivers/hwtracing/intel_th/pci.c
parentintel_th: Add "rtit" source device (diff)
downloadlinux-dev-62a593022c32380d040303a5e3d6b67fd9c415bc.tar.xz
linux-dev-62a593022c32380d040303a5e3d6b67fd9c415bc.zip
intel_th: Communicate IRQ via resource
Currently, the IRQ is passed between the glue layers and the core as a separate argument, while the MMIO resources are passed as resources. This also limits the number of IRQs thus used to one, while the current versions of Intel TH use a different MSI vector for each interrupt triggering event, of which there are 7. Change this to pass IRQ in the resources array. Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to '')
-rw-r--r--drivers/hwtracing/intel_th/pci.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/hwtracing/intel_th/pci.c b/drivers/hwtracing/intel_th/pci.c
index fd8267bbaf2c..03d6894cd9c9 100644
--- a/drivers/hwtracing/intel_th/pci.c
+++ b/drivers/hwtracing/intel_th/pci.c
@@ -72,7 +72,7 @@ static int intel_th_pci_probe(struct pci_dev *pdev,
const struct pci_device_id *id)
{
struct intel_th_drvdata *drvdata = (void *)id->driver_data;
- struct resource resource[TH_MMIO_END] = {
+ struct resource resource[TH_MMIO_END + 1] = {
[TH_MMIO_CONFIG] = pdev->resource[TH_PCI_CONFIG_BAR],
[TH_MMIO_SW] = pdev->resource[TH_PCI_STH_SW_BAR],
};
@@ -92,7 +92,12 @@ static int intel_th_pci_probe(struct pci_dev *pdev,
r++;
}
- th = intel_th_alloc(&pdev->dev, drvdata, resource, r, pdev->irq);
+ if (pdev->irq > 0) {
+ resource[r].flags = IORESOURCE_IRQ;
+ resource[r++].start = pdev->irq;
+ }
+
+ th = intel_th_alloc(&pdev->dev, drvdata, resource, r);
if (IS_ERR(th))
return PTR_ERR(th);