aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwtracing
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-09-30 11:06:14 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-09-30 11:06:14 -0400
commit29c222d1a9f503de4d26d8de8e955be190526adf (patch)
treeb924723f1eeb43cfb2a080af56b4aaab26877036 /drivers/hwtracing
parentef92ab3001c4656d3b9a7c4a8044b5bc08f6f6ef (diff)
parent17b57b1883c1285f3d0dc2266e8f79286a7bef38 (diff)
Merge 4.19-rc6
We want those fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hwtracing')
-rw-r--r--drivers/hwtracing/intel_th/core.c16
-rw-r--r--drivers/hwtracing/intel_th/pci.c5
2 files changed, 18 insertions, 3 deletions
diff --git a/drivers/hwtracing/intel_th/core.c b/drivers/hwtracing/intel_th/core.c
index da962aa2cef5..fc6b7f8b62fb 100644
--- a/drivers/hwtracing/intel_th/core.c
+++ b/drivers/hwtracing/intel_th/core.c
@@ -139,7 +139,8 @@ static int intel_th_remove(struct device *dev)
139 th->thdev[i] = NULL; 139 th->thdev[i] = NULL;
140 } 140 }
141 141
142 th->num_thdevs = lowest; 142 if (lowest >= 0)
143 th->num_thdevs = lowest;
143 } 144 }
144 145
145 if (thdrv->attr_group) 146 if (thdrv->attr_group)
@@ -487,7 +488,7 @@ static const struct intel_th_subdevice {
487 .flags = IORESOURCE_MEM, 488 .flags = IORESOURCE_MEM,
488 }, 489 },
489 { 490 {
490 .start = TH_MMIO_SW, 491 .start = 1, /* use resource[1] */
491 .end = 0, 492 .end = 0,
492 .flags = IORESOURCE_MEM, 493 .flags = IORESOURCE_MEM,
493 }, 494 },
@@ -580,6 +581,7 @@ intel_th_subdevice_alloc(struct intel_th *th,
580 struct intel_th_device *thdev; 581 struct intel_th_device *thdev;
581 struct resource res[3]; 582 struct resource res[3];
582 unsigned int req = 0; 583 unsigned int req = 0;
584 bool is64bit = false;
583 int r, err; 585 int r, err;
584 586
585 thdev = intel_th_device_alloc(th, subdev->type, subdev->name, 587 thdev = intel_th_device_alloc(th, subdev->type, subdev->name,
@@ -589,12 +591,18 @@ intel_th_subdevice_alloc(struct intel_th *th,
589 591
590 thdev->drvdata = th->drvdata; 592 thdev->drvdata = th->drvdata;
591 593
594 for (r = 0; r < th->num_resources; r++)
595 if (th->resource[r].flags & IORESOURCE_MEM_64) {
596 is64bit = true;
597 break;
598 }
599
592 memcpy(res, subdev->res, 600 memcpy(res, subdev->res,
593 sizeof(struct resource) * subdev->nres); 601 sizeof(struct resource) * subdev->nres);
594 602
595 for (r = 0; r < subdev->nres; r++) { 603 for (r = 0; r < subdev->nres; r++) {
596 struct resource *devres = th->resource; 604 struct resource *devres = th->resource;
597 int bar = TH_MMIO_CONFIG; 605 int bar = 0; /* cut subdevices' MMIO from resource[0] */
598 606
599 /* 607 /*
600 * Take .end == 0 to mean 'take the whole bar', 608 * Take .end == 0 to mean 'take the whole bar',
@@ -603,6 +611,8 @@ intel_th_subdevice_alloc(struct intel_th *th,
603 */ 611 */
604 if (!res[r].end && res[r].flags == IORESOURCE_MEM) { 612 if (!res[r].end && res[r].flags == IORESOURCE_MEM) {
605 bar = res[r].start; 613 bar = res[r].start;
614 if (is64bit)
615 bar *= 2;
606 res[r].start = 0; 616 res[r].start = 0;
607 res[r].end = resource_size(&devres[bar]) - 1; 617 res[r].end = resource_size(&devres[bar]) - 1;
608 } 618 }
diff --git a/drivers/hwtracing/intel_th/pci.c b/drivers/hwtracing/intel_th/pci.c
index c2e55e5d97f6..1cf6290d6435 100644
--- a/drivers/hwtracing/intel_th/pci.c
+++ b/drivers/hwtracing/intel_th/pci.c
@@ -160,6 +160,11 @@ static const struct pci_device_id intel_th_pci_id_table[] = {
160 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x18e1), 160 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x18e1),
161 .driver_data = (kernel_ulong_t)&intel_th_2x, 161 .driver_data = (kernel_ulong_t)&intel_th_2x,
162 }, 162 },
163 {
164 /* Ice Lake PCH */
165 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x34a6),
166 .driver_data = (kernel_ulong_t)&intel_th_2x,
167 },
163 { 0 }, 168 { 0 },
164}; 169};
165 170