diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-09-25 11:01:52 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-09-25 11:01:52 -0400 |
commit | fc0c8146680e362ebeaed0294b869425cc18230e (patch) | |
tree | 0bb6436692fa4d601de771ac4826fd343191dd12 | |
parent | 8c0f9f5b309d627182d5da72a69246f58bde1026 (diff) | |
parent | 59d08d00d43c644ee2011d7ff1807bdd69f31fe0 (diff) |
Merge tag 'char-misc-4.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Greg (well I), wrote:
"Char/Misc driver fixes for 4.19-rc6
Here are some soundwire and intel_th (tracing) driver fixes for some
reported issues.
All of these have been in linux-next for a week with no reported issues."
* tag 'char-misc-4.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
intel_th: pci: Add Ice Lake PCH support
intel_th: Fix resource handling for ACPI glue layer
intel_th: Fix device removal logic
soundwire: Fix acquiring bus lock twice during master release
soundwire: Fix incorrect exit after configuring stream
soundwire: Fix duplicate stream state assignment
-rw-r--r-- | drivers/hwtracing/intel_th/core.c | 16 | ||||
-rw-r--r-- | drivers/hwtracing/intel_th/pci.c | 5 | ||||
-rw-r--r-- | drivers/soundwire/stream.c | 23 |
3 files changed, 35 insertions, 9 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 | ||
diff --git a/drivers/soundwire/stream.c b/drivers/soundwire/stream.c index 4b5e250e8615..e5c7e1ef6318 100644 --- a/drivers/soundwire/stream.c +++ b/drivers/soundwire/stream.c | |||
@@ -899,9 +899,10 @@ static void sdw_release_master_stream(struct sdw_stream_runtime *stream) | |||
899 | struct sdw_master_runtime *m_rt = stream->m_rt; | 899 | struct sdw_master_runtime *m_rt = stream->m_rt; |
900 | struct sdw_slave_runtime *s_rt, *_s_rt; | 900 | struct sdw_slave_runtime *s_rt, *_s_rt; |
901 | 901 | ||
902 | list_for_each_entry_safe(s_rt, _s_rt, | 902 | list_for_each_entry_safe(s_rt, _s_rt, &m_rt->slave_rt_list, m_rt_node) { |
903 | &m_rt->slave_rt_list, m_rt_node) | 903 | sdw_slave_port_release(s_rt->slave->bus, s_rt->slave, stream); |
904 | sdw_stream_remove_slave(s_rt->slave, stream); | 904 | sdw_release_slave_stream(s_rt->slave, stream); |
905 | } | ||
905 | 906 | ||
906 | list_del(&m_rt->bus_node); | 907 | list_del(&m_rt->bus_node); |
907 | } | 908 | } |
@@ -1112,7 +1113,7 @@ int sdw_stream_add_master(struct sdw_bus *bus, | |||
1112 | "Master runtime config failed for stream:%s", | 1113 | "Master runtime config failed for stream:%s", |
1113 | stream->name); | 1114 | stream->name); |
1114 | ret = -ENOMEM; | 1115 | ret = -ENOMEM; |
1115 | goto error; | 1116 | goto unlock; |
1116 | } | 1117 | } |
1117 | 1118 | ||
1118 | ret = sdw_config_stream(bus->dev, stream, stream_config, false); | 1119 | ret = sdw_config_stream(bus->dev, stream, stream_config, false); |
@@ -1123,11 +1124,11 @@ int sdw_stream_add_master(struct sdw_bus *bus, | |||
1123 | if (ret) | 1124 | if (ret) |
1124 | goto stream_error; | 1125 | goto stream_error; |
1125 | 1126 | ||
1126 | stream->state = SDW_STREAM_CONFIGURED; | 1127 | goto unlock; |
1127 | 1128 | ||
1128 | stream_error: | 1129 | stream_error: |
1129 | sdw_release_master_stream(stream); | 1130 | sdw_release_master_stream(stream); |
1130 | error: | 1131 | unlock: |
1131 | mutex_unlock(&bus->bus_lock); | 1132 | mutex_unlock(&bus->bus_lock); |
1132 | return ret; | 1133 | return ret; |
1133 | } | 1134 | } |
@@ -1141,6 +1142,10 @@ EXPORT_SYMBOL(sdw_stream_add_master); | |||
1141 | * @stream: SoundWire stream | 1142 | * @stream: SoundWire stream |
1142 | * @port_config: Port configuration for audio stream | 1143 | * @port_config: Port configuration for audio stream |
1143 | * @num_ports: Number of ports | 1144 | * @num_ports: Number of ports |
1145 | * | ||
1146 | * It is expected that Slave is added before adding Master | ||
1147 | * to the Stream. | ||
1148 | * | ||
1144 | */ | 1149 | */ |
1145 | int sdw_stream_add_slave(struct sdw_slave *slave, | 1150 | int sdw_stream_add_slave(struct sdw_slave *slave, |
1146 | struct sdw_stream_config *stream_config, | 1151 | struct sdw_stream_config *stream_config, |
@@ -1186,6 +1191,12 @@ int sdw_stream_add_slave(struct sdw_slave *slave, | |||
1186 | if (ret) | 1191 | if (ret) |
1187 | goto stream_error; | 1192 | goto stream_error; |
1188 | 1193 | ||
1194 | /* | ||
1195 | * Change stream state to CONFIGURED on first Slave add. | ||
1196 | * Bus is not aware of number of Slave(s) in a stream at this | ||
1197 | * point so cannot depend on all Slave(s) to be added in order to | ||
1198 | * change stream state to CONFIGURED. | ||
1199 | */ | ||
1189 | stream->state = SDW_STREAM_CONFIGURED; | 1200 | stream->state = SDW_STREAM_CONFIGURED; |
1190 | goto error; | 1201 | goto error; |
1191 | 1202 | ||