From: Greg Kroah-Hartman Date: Mon, 25 May 2020 13:58:20 +0000 (+0200) Subject: 5.6-stable patches X-Git-Tag: v4.4.225~26 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=740284135e0c12ba2443034f6131319c98dfffd6;p=thirdparty%2Fkernel%2Fstable-queue.git 5.6-stable patches added patches: driver-core-fix-handling-of-sync_state_only-stateless-device-links.patch driver-core-fix-sync_state_only-device-link-implementation.patch iio-adc-stm32-adc-fix-device-used-to-request-dma.patch iio-adc-stm32-dfsdm-fix-device-used-to-request-dma.patch iio-adc-ti-ads8344-fix-channel-selection.patch iio-dac-vf610-fix-an-error-handling-path-in-vf610_dac_probe.patch iio-sca3000-remove-an-erroneous-get_device.patch mei-release-me_cl-object-reference.patch misc-rtsx-add-short-delay-after-exit-from-aspm.patch staging-greybus-fix-uninitialized-scalar-variable.patch staging-iio-ad2s1210-fix-spi-reading.patch staging-kpc2000-fix-error-return-code-in-kp2000_pcie_probe.patch staging-wfx-unlock-on-error-path.patch tty-serial-add-missing-spin_lock_init-for-sifive-serial-console.patch --- diff --git a/queue-5.6/driver-core-fix-handling-of-sync_state_only-stateless-device-links.patch b/queue-5.6/driver-core-fix-handling-of-sync_state_only-stateless-device-links.patch new file mode 100644 index 00000000000..8861ef0a0b8 --- /dev/null +++ b/queue-5.6/driver-core-fix-handling-of-sync_state_only-stateless-device-links.patch @@ -0,0 +1,50 @@ +From 44e960490ddf868fc9135151c4a658936e771dc2 Mon Sep 17 00:00:00 2001 +From: Saravana Kannan +Date: Tue, 19 May 2020 21:36:26 -0700 +Subject: driver core: Fix handling of SYNC_STATE_ONLY + STATELESS device links + +From: Saravana Kannan + +commit 44e960490ddf868fc9135151c4a658936e771dc2 upstream. + +Commit 21c27f06587d ("driver core: Fix SYNC_STATE_ONLY device link +implementation") didn't completely fix STATELESS + SYNC_STATE_ONLY +handling. + +What looks like an optimization in that commit is actually a bug that +causes an if condition to always take the else path. This prevents +reordering of devices in the dpm_list when a DL_FLAG_STATELESS device +link is create on top of an existing DL_FLAG_SYNC_STATE_ONLY device +link. + +Fixes: 21c27f06587d ("driver core: Fix SYNC_STATE_ONLY device link implementation") +Signed-off-by: Saravana Kannan +Cc: stable +Reviewed-by: Rafael J. Wysocki +Link: https://lore.kernel.org/r/20200520043626.181820-1-saravanak@google.com +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/base/core.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +--- a/drivers/base/core.c ++++ b/drivers/base/core.c +@@ -360,12 +360,14 @@ struct device_link *device_link_add(stru + + if (flags & DL_FLAG_STATELESS) { + kref_get(&link->kref); +- link->flags |= DL_FLAG_STATELESS; + if (link->flags & DL_FLAG_SYNC_STATE_ONLY && +- !(link->flags & DL_FLAG_STATELESS)) ++ !(link->flags & DL_FLAG_STATELESS)) { ++ link->flags |= DL_FLAG_STATELESS; + goto reorder; +- else ++ } else { ++ link->flags |= DL_FLAG_STATELESS; + goto out; ++ } + } + + /* diff --git a/queue-5.6/driver-core-fix-sync_state_only-device-link-implementation.patch b/queue-5.6/driver-core-fix-sync_state_only-device-link-implementation.patch new file mode 100644 index 00000000000..82d5c88238d --- /dev/null +++ b/queue-5.6/driver-core-fix-sync_state_only-device-link-implementation.patch @@ -0,0 +1,184 @@ +From 21c27f06587d2c18150d27ca2382a509ec55c482 Mon Sep 17 00:00:00 2001 +From: Saravana Kannan +Date: Mon, 18 May 2020 23:30:00 -0700 +Subject: driver core: Fix SYNC_STATE_ONLY device link implementation + +From: Saravana Kannan + +commit 21c27f06587d2c18150d27ca2382a509ec55c482 upstream. + +When SYNC_STATE_ONLY support was added in commit 05ef983e0d65 ("driver +core: Add device link support for SYNC_STATE_ONLY flag"), +device_link_add() incorrectly skipped adding the new SYNC_STATE_ONLY +device link to the supplier's and consumer's "device link" list. + +This causes multiple issues: +- The device link is lost forever from driver core if the caller + didn't keep track of it (caller typically isn't expected to). This is + a memory leak. +- The device link is also never visible to any other code path after + device_link_add() returns. + +If we fix the "device link" list handling, that exposes a bunch of +issues. + +1. The device link "status" state management code rightfully doesn't +handle the case where a DL_FLAG_MANAGED device link exists between a +supplier and consumer, but the consumer manages to probe successfully +before the supplier. The addition of DL_FLAG_SYNC_STATE_ONLY links break +this assumption. This causes device_links_driver_bound() to throw a +warning when this happens. + +Since DL_FLAG_SYNC_STATE_ONLY device links are mainly used for creating +proxy device links for child device dependencies and aren't useful once +the consumer device probes successfully, this patch just deletes +DL_FLAG_SYNC_STATE_ONLY device links once its consumer device probes. +This way, we avoid the warning, free up some memory and avoid +complicating the device links "status" state management code. + +2. Creating a DL_FLAG_STATELESS device link between two devices that +already have a DL_FLAG_SYNC_STATE_ONLY device link will result in the +DL_FLAG_STATELESS flag not getting set correctly. This patch also fixes +this. + +Lastly, this patch also fixes minor whitespace issues. + +Cc: stable@vger.kernel.org +Fixes: 05ef983e0d65 ("driver core: Add device link support for SYNC_STATE_ONLY flag") +Signed-off-by: Saravana Kannan +Reviewed-by: Rafael J. Wysocki +Link: https://lore.kernel.org/r/20200519063000.128819-1-saravanak@google.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/base/core.c | 61 +++++++++++++++++++++++++++++++++------------------- + 1 file changed, 39 insertions(+), 22 deletions(-) + +--- a/drivers/base/core.c ++++ b/drivers/base/core.c +@@ -360,13 +360,12 @@ struct device_link *device_link_add(stru + + if (flags & DL_FLAG_STATELESS) { + kref_get(&link->kref); ++ link->flags |= DL_FLAG_STATELESS; + if (link->flags & DL_FLAG_SYNC_STATE_ONLY && +- !(link->flags & DL_FLAG_STATELESS)) { +- link->flags |= DL_FLAG_STATELESS; ++ !(link->flags & DL_FLAG_STATELESS)) + goto reorder; +- } else { ++ else + goto out; +- } + } + + /* +@@ -433,12 +432,16 @@ struct device_link *device_link_add(stru + flags & DL_FLAG_PM_RUNTIME) + pm_runtime_resume(supplier); + ++ list_add_tail_rcu(&link->s_node, &supplier->links.consumers); ++ list_add_tail_rcu(&link->c_node, &consumer->links.suppliers); ++ + if (flags & DL_FLAG_SYNC_STATE_ONLY) { + dev_dbg(consumer, + "Linked as a sync state only consumer to %s\n", + dev_name(supplier)); + goto out; + } ++ + reorder: + /* + * Move the consumer and all of the devices depending on it to the end +@@ -449,12 +452,9 @@ reorder: + */ + device_reorder_to_tail(consumer, NULL); + +- list_add_tail_rcu(&link->s_node, &supplier->links.consumers); +- list_add_tail_rcu(&link->c_node, &consumer->links.suppliers); +- + dev_dbg(consumer, "Linked as a consumer to %s\n", dev_name(supplier)); + +- out: ++out: + device_pm_unlock(); + device_links_write_unlock(); + +@@ -829,6 +829,13 @@ static void __device_links_supplier_defe + list_add_tail(&sup->links.defer_sync, &deferred_sync); + } + ++static void device_link_drop_managed(struct device_link *link) ++{ ++ link->flags &= ~DL_FLAG_MANAGED; ++ WRITE_ONCE(link->status, DL_STATE_NONE); ++ kref_put(&link->kref, __device_link_del); ++} ++ + /** + * device_links_driver_bound - Update device links after probing its driver. + * @dev: Device to update the links for. +@@ -842,7 +849,7 @@ static void __device_links_supplier_defe + */ + void device_links_driver_bound(struct device *dev) + { +- struct device_link *link; ++ struct device_link *link, *ln; + LIST_HEAD(sync_list); + + /* +@@ -882,18 +889,35 @@ void device_links_driver_bound(struct de + else + __device_links_queue_sync_state(dev, &sync_list); + +- list_for_each_entry(link, &dev->links.suppliers, c_node) { ++ list_for_each_entry_safe(link, ln, &dev->links.suppliers, c_node) { ++ struct device *supplier; ++ + if (!(link->flags & DL_FLAG_MANAGED)) + continue; + +- WARN_ON(link->status != DL_STATE_CONSUMER_PROBE); +- WRITE_ONCE(link->status, DL_STATE_ACTIVE); ++ supplier = link->supplier; ++ if (link->flags & DL_FLAG_SYNC_STATE_ONLY) { ++ /* ++ * When DL_FLAG_SYNC_STATE_ONLY is set, it means no ++ * other DL_MANAGED_LINK_FLAGS have been set. So, it's ++ * save to drop the managed link completely. ++ */ ++ device_link_drop_managed(link); ++ } else { ++ WARN_ON(link->status != DL_STATE_CONSUMER_PROBE); ++ WRITE_ONCE(link->status, DL_STATE_ACTIVE); ++ } + ++ /* ++ * This needs to be done even for the deleted ++ * DL_FLAG_SYNC_STATE_ONLY device link in case it was the last ++ * device link that was preventing the supplier from getting a ++ * sync_state() call. ++ */ + if (defer_sync_state_count) +- __device_links_supplier_defer_sync(link->supplier); ++ __device_links_supplier_defer_sync(supplier); + else +- __device_links_queue_sync_state(link->supplier, +- &sync_list); ++ __device_links_queue_sync_state(supplier, &sync_list); + } + + dev->links.status = DL_DEV_DRIVER_BOUND; +@@ -903,13 +927,6 @@ void device_links_driver_bound(struct de + device_links_flush_sync_list(&sync_list, dev); + } + +-static void device_link_drop_managed(struct device_link *link) +-{ +- link->flags &= ~DL_FLAG_MANAGED; +- WRITE_ONCE(link->status, DL_STATE_NONE); +- kref_put(&link->kref, __device_link_del); +-} +- + /** + * __device_links_no_driver - Update links of a device without a driver. + * @dev: Device without a drvier. diff --git a/queue-5.6/iio-adc-stm32-adc-fix-device-used-to-request-dma.patch b/queue-5.6/iio-adc-stm32-adc-fix-device-used-to-request-dma.patch new file mode 100644 index 00000000000..829262d5cbc --- /dev/null +++ b/queue-5.6/iio-adc-stm32-adc-fix-device-used-to-request-dma.patch @@ -0,0 +1,64 @@ +From 52cd91c27f3908b88e8b25aed4a4d20660abcc45 Mon Sep 17 00:00:00 2001 +From: Fabrice Gasnier +Date: Thu, 30 Apr 2020 11:28:45 +0200 +Subject: iio: adc: stm32-adc: fix device used to request dma + +From: Fabrice Gasnier + +commit 52cd91c27f3908b88e8b25aed4a4d20660abcc45 upstream. + +DMA channel request should use device struct from platform device struct. +Currently it's using iio device struct. But at this stage when probing, +device struct isn't yet registered (e.g. device_register is done in +iio_device_register). Since commit 71723a96b8b1 ("dmaengine: Create +symlinks between DMA channels and slaves"), a warning message is printed +as the links in sysfs can't be created, due to device isn't yet registered: +- Cannot create DMA slave symlink +- Cannot create DMA dma:rx symlink + +Fix this by using device struct from platform device to request dma chan. + +Fixes: 2763ea0585c99 ("iio: adc: stm32: add optional dma support") + +Signed-off-by: Fabrice Gasnier +Cc: +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/iio/adc/stm32-adc.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +--- a/drivers/iio/adc/stm32-adc.c ++++ b/drivers/iio/adc/stm32-adc.c +@@ -1812,18 +1812,18 @@ static int stm32_adc_chan_of_init(struct + return 0; + } + +-static int stm32_adc_dma_request(struct iio_dev *indio_dev) ++static int stm32_adc_dma_request(struct device *dev, struct iio_dev *indio_dev) + { + struct stm32_adc *adc = iio_priv(indio_dev); + struct dma_slave_config config; + int ret; + +- adc->dma_chan = dma_request_chan(&indio_dev->dev, "rx"); ++ adc->dma_chan = dma_request_chan(dev, "rx"); + if (IS_ERR(adc->dma_chan)) { + ret = PTR_ERR(adc->dma_chan); + if (ret != -ENODEV) { + if (ret != -EPROBE_DEFER) +- dev_err(&indio_dev->dev, ++ dev_err(dev, + "DMA channel request failed with %d\n", + ret); + return ret; +@@ -1930,7 +1930,7 @@ static int stm32_adc_probe(struct platfo + if (ret < 0) + return ret; + +- ret = stm32_adc_dma_request(indio_dev); ++ ret = stm32_adc_dma_request(dev, indio_dev); + if (ret < 0) + return ret; + diff --git a/queue-5.6/iio-adc-stm32-dfsdm-fix-device-used-to-request-dma.patch b/queue-5.6/iio-adc-stm32-dfsdm-fix-device-used-to-request-dma.patch new file mode 100644 index 00000000000..49651db9e76 --- /dev/null +++ b/queue-5.6/iio-adc-stm32-dfsdm-fix-device-used-to-request-dma.patch @@ -0,0 +1,109 @@ +From b455d06e6fb3c035711e8aab1ca18082ccb15d87 Mon Sep 17 00:00:00 2001 +From: Fabrice Gasnier +Date: Thu, 30 Apr 2020 11:28:46 +0200 +Subject: iio: adc: stm32-dfsdm: fix device used to request dma + +From: Fabrice Gasnier + +commit b455d06e6fb3c035711e8aab1ca18082ccb15d87 upstream. + +DMA channel request should use device struct from platform device struct. +Currently it's using iio device struct. But at this stage when probing, +device struct isn't yet registered (e.g. device_register is done in +iio_device_register). Since commit 71723a96b8b1 ("dmaengine: Create +symlinks between DMA channels and slaves"), a warning message is printed +as the links in sysfs can't be created, due to device isn't yet registered: +- Cannot create DMA slave symlink +- Cannot create DMA dma:rx symlink + +Fix this by using device struct from platform device to request dma chan. + +Fixes: eca949800d2d ("IIO: ADC: add stm32 DFSDM support for PDM microphone") + +Signed-off-by: Fabrice Gasnier +Cc: +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/iio/adc/stm32-dfsdm-adc.c | 21 +++++++++++---------- + 1 file changed, 11 insertions(+), 10 deletions(-) + +--- a/drivers/iio/adc/stm32-dfsdm-adc.c ++++ b/drivers/iio/adc/stm32-dfsdm-adc.c +@@ -62,7 +62,7 @@ enum sd_converter_type { + + struct stm32_dfsdm_dev_data { + int type; +- int (*init)(struct iio_dev *indio_dev); ++ int (*init)(struct device *dev, struct iio_dev *indio_dev); + unsigned int num_channels; + const struct regmap_config *regmap_cfg; + }; +@@ -1365,11 +1365,12 @@ static void stm32_dfsdm_dma_release(stru + } + } + +-static int stm32_dfsdm_dma_request(struct iio_dev *indio_dev) ++static int stm32_dfsdm_dma_request(struct device *dev, ++ struct iio_dev *indio_dev) + { + struct stm32_dfsdm_adc *adc = iio_priv(indio_dev); + +- adc->dma_chan = dma_request_chan(&indio_dev->dev, "rx"); ++ adc->dma_chan = dma_request_chan(dev, "rx"); + if (IS_ERR(adc->dma_chan)) { + int ret = PTR_ERR(adc->dma_chan); + +@@ -1425,7 +1426,7 @@ static int stm32_dfsdm_adc_chan_init_one + &adc->dfsdm->ch_list[ch->channel]); + } + +-static int stm32_dfsdm_audio_init(struct iio_dev *indio_dev) ++static int stm32_dfsdm_audio_init(struct device *dev, struct iio_dev *indio_dev) + { + struct iio_chan_spec *ch; + struct stm32_dfsdm_adc *adc = iio_priv(indio_dev); +@@ -1452,10 +1453,10 @@ static int stm32_dfsdm_audio_init(struct + indio_dev->num_channels = 1; + indio_dev->channels = ch; + +- return stm32_dfsdm_dma_request(indio_dev); ++ return stm32_dfsdm_dma_request(dev, indio_dev); + } + +-static int stm32_dfsdm_adc_init(struct iio_dev *indio_dev) ++static int stm32_dfsdm_adc_init(struct device *dev, struct iio_dev *indio_dev) + { + struct iio_chan_spec *ch; + struct stm32_dfsdm_adc *adc = iio_priv(indio_dev); +@@ -1499,17 +1500,17 @@ static int stm32_dfsdm_adc_init(struct i + init_completion(&adc->completion); + + /* Optionally request DMA */ +- ret = stm32_dfsdm_dma_request(indio_dev); ++ ret = stm32_dfsdm_dma_request(dev, indio_dev); + if (ret) { + if (ret != -ENODEV) { + if (ret != -EPROBE_DEFER) +- dev_err(&indio_dev->dev, ++ dev_err(dev, + "DMA channel request failed with %d\n", + ret); + return ret; + } + +- dev_dbg(&indio_dev->dev, "No DMA support\n"); ++ dev_dbg(dev, "No DMA support\n"); + return 0; + } + +@@ -1622,7 +1623,7 @@ static int stm32_dfsdm_adc_probe(struct + adc->dfsdm->fl_list[adc->fl_id].sync_mode = val; + + adc->dev_data = dev_data; +- ret = dev_data->init(iio); ++ ret = dev_data->init(dev, iio); + if (ret < 0) + return ret; + diff --git a/queue-5.6/iio-adc-ti-ads8344-fix-channel-selection.patch b/queue-5.6/iio-adc-ti-ads8344-fix-channel-selection.patch new file mode 100644 index 00000000000..054e8920315 --- /dev/null +++ b/queue-5.6/iio-adc-ti-ads8344-fix-channel-selection.patch @@ -0,0 +1,69 @@ +From bcfa1e253d2e329e1ebab5c89f3c73f6dd17606c Mon Sep 17 00:00:00 2001 +From: Gregory CLEMENT +Date: Thu, 30 Apr 2020 15:05:47 +0200 +Subject: iio: adc: ti-ads8344: Fix channel selection + +From: Gregory CLEMENT + +commit bcfa1e253d2e329e1ebab5c89f3c73f6dd17606c upstream. + +During initial submission the selection of the channel was done using +the scan_index member of the iio_chan_spec structure. It was an abuse +because this member is supposed to be used with a buffer so it was +removed. + +However there was still the need to be able to known how to select a +channel, the correct member to store this information is address. + +Thanks to this it is possible to select any other channel than the +channel 0. + +Fixes: 8dd2d7c0fed7 ("iio: adc: Add driver for the TI ADS8344 A/DC chips") +Signed-off-by: Gregory CLEMENT +Cc: +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/iio/adc/ti-ads8344.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +--- a/drivers/iio/adc/ti-ads8344.c ++++ b/drivers/iio/adc/ti-ads8344.c +@@ -32,16 +32,17 @@ struct ads8344 { + u8 rx_buf[3]; + }; + +-#define ADS8344_VOLTAGE_CHANNEL(chan, si) \ ++#define ADS8344_VOLTAGE_CHANNEL(chan, addr) \ + { \ + .type = IIO_VOLTAGE, \ + .indexed = 1, \ + .channel = chan, \ + .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \ + .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ ++ .address = addr, \ + } + +-#define ADS8344_VOLTAGE_CHANNEL_DIFF(chan1, chan2, si) \ ++#define ADS8344_VOLTAGE_CHANNEL_DIFF(chan1, chan2, addr) \ + { \ + .type = IIO_VOLTAGE, \ + .indexed = 1, \ +@@ -50,6 +51,7 @@ struct ads8344 { + .differential = 1, \ + .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \ + .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ ++ .address = addr, \ + } + + static const struct iio_chan_spec ads8344_channels[] = { +@@ -105,7 +107,7 @@ static int ads8344_read_raw(struct iio_d + switch (mask) { + case IIO_CHAN_INFO_RAW: + mutex_lock(&adc->lock); +- *value = ads8344_adc_conversion(adc, channel->scan_index, ++ *value = ads8344_adc_conversion(adc, channel->address, + channel->differential); + mutex_unlock(&adc->lock); + if (*value < 0) diff --git a/queue-5.6/iio-dac-vf610-fix-an-error-handling-path-in-vf610_dac_probe.patch b/queue-5.6/iio-dac-vf610-fix-an-error-handling-path-in-vf610_dac_probe.patch new file mode 100644 index 00000000000..0780dc993f2 --- /dev/null +++ b/queue-5.6/iio-dac-vf610-fix-an-error-handling-path-in-vf610_dac_probe.patch @@ -0,0 +1,31 @@ +From aad4742fbf0a560c25827adb58695a4497ffc204 Mon Sep 17 00:00:00 2001 +From: Christophe JAILLET +Date: Sun, 26 Apr 2020 21:44:03 +0200 +Subject: iio: dac: vf610: Fix an error handling path in 'vf610_dac_probe()' + +From: Christophe JAILLET + +commit aad4742fbf0a560c25827adb58695a4497ffc204 upstream. + +A call to 'vf610_dac_exit()' is missing in an error handling path. + +Fixes: 1b983bf42fad ("iio: dac: vf610_dac: Add IIO DAC driver for Vybrid SoC") +Signed-off-by: Christophe JAILLET +Cc: +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/iio/dac/vf610_dac.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/iio/dac/vf610_dac.c ++++ b/drivers/iio/dac/vf610_dac.c +@@ -223,6 +223,7 @@ static int vf610_dac_probe(struct platfo + return 0; + + error_iio_device_register: ++ vf610_dac_exit(info); + clk_disable_unprepare(info->clk); + + return ret; diff --git a/queue-5.6/iio-sca3000-remove-an-erroneous-get_device.patch b/queue-5.6/iio-sca3000-remove-an-erroneous-get_device.patch new file mode 100644 index 00000000000..600d01f1c70 --- /dev/null +++ b/queue-5.6/iio-sca3000-remove-an-erroneous-get_device.patch @@ -0,0 +1,36 @@ +From 928edefbc18cd8433f7df235c6e09a9306e7d580 Mon Sep 17 00:00:00 2001 +From: Christophe JAILLET +Date: Wed, 6 May 2020 05:52:06 +0200 +Subject: iio: sca3000: Remove an erroneous 'get_device()' + +From: Christophe JAILLET + +commit 928edefbc18cd8433f7df235c6e09a9306e7d580 upstream. + +This looks really unusual to have a 'get_device()' hidden in a 'dev_err()' +call. +Remove it. + +While at it add a missing \n at the end of the message. + +Fixes: 574fb258d636 ("Staging: IIO: VTI sca3000 series accelerometer driver (spi)") +Signed-off-by: Christophe JAILLET +Cc: +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/iio/accel/sca3000.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/iio/accel/sca3000.c ++++ b/drivers/iio/accel/sca3000.c +@@ -980,7 +980,7 @@ static int sca3000_read_data(struct sca3 + st->tx[0] = SCA3000_READ_REG(reg_address_high); + ret = spi_sync_transfer(st->us, xfer, ARRAY_SIZE(xfer)); + if (ret) { +- dev_err(get_device(&st->us->dev), "problem reading register"); ++ dev_err(&st->us->dev, "problem reading register\n"); + return ret; + } + diff --git a/queue-5.6/mei-release-me_cl-object-reference.patch b/queue-5.6/mei-release-me_cl-object-reference.patch new file mode 100644 index 00000000000..9228008eefd --- /dev/null +++ b/queue-5.6/mei-release-me_cl-object-reference.patch @@ -0,0 +1,45 @@ +From fc9c03ce30f79b71807961bfcb42be191af79873 Mon Sep 17 00:00:00 2001 +From: Alexander Usyskin +Date: Wed, 13 May 2020 01:31:40 +0300 +Subject: mei: release me_cl object reference +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Alexander Usyskin + +commit fc9c03ce30f79b71807961bfcb42be191af79873 upstream. + +Allow me_cl object to be freed by releasing the reference +that was acquired by one of the search functions: +__mei_me_cl_by_uuid_id() or __mei_me_cl_by_uuid() + +Cc: +Reported-by: 亿一 +Signed-off-by: Alexander Usyskin +Signed-off-by: Tomas Winkler +Link: https://lore.kernel.org/r/20200512223140.32186-1-tomas.winkler@intel.com +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/misc/mei/client.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/misc/mei/client.c ++++ b/drivers/misc/mei/client.c +@@ -266,6 +266,7 @@ void mei_me_cl_rm_by_uuid(struct mei_dev + down_write(&dev->me_clients_rwsem); + me_cl = __mei_me_cl_by_uuid(dev, uuid); + __mei_me_cl_del(dev, me_cl); ++ mei_me_cl_put(me_cl); + up_write(&dev->me_clients_rwsem); + } + +@@ -287,6 +288,7 @@ void mei_me_cl_rm_by_uuid_id(struct mei_ + down_write(&dev->me_clients_rwsem); + me_cl = __mei_me_cl_by_uuid_id(dev, uuid, id); + __mei_me_cl_del(dev, me_cl); ++ mei_me_cl_put(me_cl); + up_write(&dev->me_clients_rwsem); + } + diff --git a/queue-5.6/misc-rtsx-add-short-delay-after-exit-from-aspm.patch b/queue-5.6/misc-rtsx-add-short-delay-after-exit-from-aspm.patch new file mode 100644 index 00000000000..97d7618b7cd --- /dev/null +++ b/queue-5.6/misc-rtsx-add-short-delay-after-exit-from-aspm.patch @@ -0,0 +1,42 @@ +From 7a839dbab1be59f5ed3b3b046de29e166784c9b4 Mon Sep 17 00:00:00 2001 +From: Klaus Doth +Date: Fri, 22 May 2020 12:56:04 +0200 +Subject: misc: rtsx: Add short delay after exit from ASPM + +From: Klaus Doth + +commit 7a839dbab1be59f5ed3b3b046de29e166784c9b4 upstream. + +DMA transfers to and from the SD card stall for 10 seconds and run into +timeout on RTS5260 card readers after ASPM was enabled. + +Adding a short msleep after disabling ASPM fixes the issue on several +Dell Precision 7530/7540 systems I tested. + +This function is only called when waking up after the chip went into +power-save after not transferring data for a few seconds. The added +msleep does therefore not change anything in data transfer speed or +induce any excessive waiting while data transfers are running, or the +chip is sleeping. Only the transition from sleep to active is affected. + +Signed-off-by: Klaus Doth +Cc: stable +Link: https://lore.kernel.org/r/4434eaa7-2ee3-a560-faee-6cee63ebd6d4@doth.eu +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/misc/cardreader/rtsx_pcr.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/misc/cardreader/rtsx_pcr.c ++++ b/drivers/misc/cardreader/rtsx_pcr.c +@@ -142,6 +142,9 @@ static void rtsx_comm_pm_full_on(struct + + rtsx_disable_aspm(pcr); + ++ /* Fixes DMA transfer timout issue after disabling ASPM on RTS5260 */ ++ msleep(1); ++ + if (option->ltr_enabled) + rtsx_set_ltr_latency(pcr, option->ltr_active_latency); + diff --git a/queue-5.6/series b/queue-5.6/series index 95e3b4388ea..a61307fa555 100644 --- a/queue-5.6/series +++ b/queue-5.6/series @@ -88,3 +88,17 @@ revert-amba-initialize-dma_parms-for-amba-devices.patch revert-driver-core-platform-initialize-dma_parms-for.patch tools-bootconfig-fix-apply_xbc-to-return-zero-on-suc.patch kbuild-remove-debug-info-from-kallsyms-linking.patch +staging-iio-ad2s1210-fix-spi-reading.patch +staging-wfx-unlock-on-error-path.patch +staging-kpc2000-fix-error-return-code-in-kp2000_pcie_probe.patch +staging-greybus-fix-uninitialized-scalar-variable.patch +iio-adc-stm32-adc-fix-device-used-to-request-dma.patch +iio-adc-stm32-dfsdm-fix-device-used-to-request-dma.patch +iio-sca3000-remove-an-erroneous-get_device.patch +iio-dac-vf610-fix-an-error-handling-path-in-vf610_dac_probe.patch +iio-adc-ti-ads8344-fix-channel-selection.patch +driver-core-fix-sync_state_only-device-link-implementation.patch +driver-core-fix-handling-of-sync_state_only-stateless-device-links.patch +misc-rtsx-add-short-delay-after-exit-from-aspm.patch +tty-serial-add-missing-spin_lock_init-for-sifive-serial-console.patch +mei-release-me_cl-object-reference.patch diff --git a/queue-5.6/staging-greybus-fix-uninitialized-scalar-variable.patch b/queue-5.6/staging-greybus-fix-uninitialized-scalar-variable.patch new file mode 100644 index 00000000000..9ffe1c52b2d --- /dev/null +++ b/queue-5.6/staging-greybus-fix-uninitialized-scalar-variable.patch @@ -0,0 +1,42 @@ +From 34625c1931f8204c234c532b446b9f53c69f4b68 Mon Sep 17 00:00:00 2001 +From: Oscar Carter +Date: Sun, 10 May 2020 12:14:26 +0200 +Subject: staging: greybus: Fix uninitialized scalar variable + +From: Oscar Carter + +commit 34625c1931f8204c234c532b446b9f53c69f4b68 upstream. + +In the "gb_tty_set_termios" function the "newline" variable is declared +but not initialized. So the "flow_control" member is not initialized and +the OR / AND operations with itself results in an undefined value in +this member. + +The purpose of the code is to set the flow control type, so remove the +OR / AND self operator and set the value directly. + +Addresses-Coverity-ID: 1374016 ("Uninitialized scalar variable") +Fixes: e55c25206d5c9 ("greybus: uart: Handle CRTSCTS flag in termios") +Signed-off-by: Oscar Carter +Cc: stable +Link: https://lore.kernel.org/r/20200510101426.23631-1-oscar.carter@gmx.com +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/staging/greybus/uart.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/staging/greybus/uart.c ++++ b/drivers/staging/greybus/uart.c +@@ -537,9 +537,9 @@ static void gb_tty_set_termios(struct tt + } + + if (C_CRTSCTS(tty) && C_BAUD(tty) != B0) +- newline.flow_control |= GB_SERIAL_AUTO_RTSCTS_EN; ++ newline.flow_control = GB_SERIAL_AUTO_RTSCTS_EN; + else +- newline.flow_control &= ~GB_SERIAL_AUTO_RTSCTS_EN; ++ newline.flow_control = 0; + + if (memcmp(&gb_tty->line_coding, &newline, sizeof(newline))) { + memcpy(&gb_tty->line_coding, &newline, sizeof(newline)); diff --git a/queue-5.6/staging-iio-ad2s1210-fix-spi-reading.patch b/queue-5.6/staging-iio-ad2s1210-fix-spi-reading.patch new file mode 100644 index 00000000000..9cd6b4b2030 --- /dev/null +++ b/queue-5.6/staging-iio-ad2s1210-fix-spi-reading.patch @@ -0,0 +1,63 @@ +From 5e4f99a6b788047b0b8a7496c2e0c8f372f6edf2 Mon Sep 17 00:00:00 2001 +From: Dragos Bogdan +Date: Wed, 29 Apr 2020 10:21:29 +0300 +Subject: staging: iio: ad2s1210: Fix SPI reading + +From: Dragos Bogdan + +commit 5e4f99a6b788047b0b8a7496c2e0c8f372f6edf2 upstream. + +If the serial interface is used, the 8-bit address should be latched using +the rising edge of the WR/FSYNC signal. + +This basically means that a CS change is required between the first byte +sent, and the second one. +This change splits the single-transfer transfer of 2 bytes into 2 transfers +with a single byte, and CS change in-between. + +Note fixes tag is not accurate, but reflects a point beyond which there +are too many refactors to make backporting straight forward. + +Fixes: b19e9ad5e2cb ("staging:iio:resolver:ad2s1210 general driver cleanup.") +Signed-off-by: Dragos Bogdan +Signed-off-by: Alexandru Ardelean +Cc: +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/staging/iio/resolver/ad2s1210.c | 17 ++++++++++++----- + 1 file changed, 12 insertions(+), 5 deletions(-) + +--- a/drivers/staging/iio/resolver/ad2s1210.c ++++ b/drivers/staging/iio/resolver/ad2s1210.c +@@ -130,17 +130,24 @@ static int ad2s1210_config_write(struct + static int ad2s1210_config_read(struct ad2s1210_state *st, + unsigned char address) + { +- struct spi_transfer xfer = { +- .len = 2, +- .rx_buf = st->rx, +- .tx_buf = st->tx, ++ struct spi_transfer xfers[] = { ++ { ++ .len = 1, ++ .rx_buf = &st->rx[0], ++ .tx_buf = &st->tx[0], ++ .cs_change = 1, ++ }, { ++ .len = 1, ++ .rx_buf = &st->rx[1], ++ .tx_buf = &st->tx[1], ++ }, + }; + int ret = 0; + + ad2s1210_set_mode(MOD_CONFIG, st); + st->tx[0] = address | AD2S1210_MSB_IS_HIGH; + st->tx[1] = AD2S1210_REG_FAULT; +- ret = spi_sync_transfer(st->sdev, &xfer, 1); ++ ret = spi_sync_transfer(st->sdev, xfers, 2); + if (ret < 0) + return ret; + diff --git a/queue-5.6/staging-kpc2000-fix-error-return-code-in-kp2000_pcie_probe.patch b/queue-5.6/staging-kpc2000-fix-error-return-code-in-kp2000_pcie_probe.patch new file mode 100644 index 00000000000..207bb2a89dc --- /dev/null +++ b/queue-5.6/staging-kpc2000-fix-error-return-code-in-kp2000_pcie_probe.patch @@ -0,0 +1,50 @@ +From b17884ccf29e127b16bba6aea1438c851c9f5af1 Mon Sep 17 00:00:00 2001 +From: Wei Yongjun +Date: Wed, 6 May 2020 13:47:35 +0000 +Subject: staging: kpc2000: fix error return code in kp2000_pcie_probe() + +From: Wei Yongjun + +commit b17884ccf29e127b16bba6aea1438c851c9f5af1 upstream. + +Fix to return a negative error code from the error handling +case instead of 0, as done elsewhere in this function. Also +removed var 'rv' since we can use 'err' instead. + +Fixes: 7dc7967fc39a ("staging: kpc2000: add initial set of Daktronics drivers") +Signed-off-by: Wei Yongjun +Cc: stable +Reviewed-by: Dan Carpenter +Link: https://lore.kernel.org/r/20200506134735.102041-1-weiyongjun1@huawei.com +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/staging/kpc2000/kpc2000/core.c | 9 ++++----- + 1 file changed, 4 insertions(+), 5 deletions(-) + +--- a/drivers/staging/kpc2000/kpc2000/core.c ++++ b/drivers/staging/kpc2000/kpc2000/core.c +@@ -298,7 +298,6 @@ static int kp2000_pcie_probe(struct pci_ + { + int err = 0; + struct kp2000_device *pcard; +- int rv; + unsigned long reg_bar_phys_addr; + unsigned long reg_bar_phys_len; + unsigned long dma_bar_phys_addr; +@@ -445,11 +444,11 @@ static int kp2000_pcie_probe(struct pci_ + if (err < 0) + goto err_release_dma; + +- rv = request_irq(pcard->pdev->irq, kp2000_irq_handler, IRQF_SHARED, +- pcard->name, pcard); +- if (rv) { ++ err = request_irq(pcard->pdev->irq, kp2000_irq_handler, IRQF_SHARED, ++ pcard->name, pcard); ++ if (err) { + dev_err(&pcard->pdev->dev, +- "%s: failed to request_irq: %d\n", __func__, rv); ++ "%s: failed to request_irq: %d\n", __func__, err); + goto err_disable_msi; + } + diff --git a/queue-5.6/staging-wfx-unlock-on-error-path.patch b/queue-5.6/staging-wfx-unlock-on-error-path.patch new file mode 100644 index 00000000000..18ca6275dc7 --- /dev/null +++ b/queue-5.6/staging-wfx-unlock-on-error-path.patch @@ -0,0 +1,39 @@ +From f0b9d875faa4499afe3381404c3795e9da84bc00 Mon Sep 17 00:00:00 2001 +From: Dan Carpenter +Date: Tue, 12 May 2020 11:36:56 +0300 +Subject: staging: wfx: unlock on error path +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Dan Carpenter + +commit f0b9d875faa4499afe3381404c3795e9da84bc00 upstream. + +We need to release the tx_lock on the error path before returning. + +Fixes: d1c015b4ef6f ("staging: wfx: rewrite wfx_hw_scan()") +Signed-off-by: Dan Carpenter +Cc: stable +Reviewed-by: Jérôme Pouiller +Link: https://lore.kernel.org/r/20200512083656.GA251760@mwanda +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/staging/wfx/scan.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/staging/wfx/scan.c ++++ b/drivers/staging/wfx/scan.c +@@ -57,8 +57,10 @@ static int send_scan_req(struct wfx_vif + wvif->scan_abort = false; + reinit_completion(&wvif->scan_complete); + timeout = hif_scan(wvif, req, start_idx, i - start_idx); +- if (timeout < 0) ++ if (timeout < 0) { ++ wfx_tx_unlock(wvif->wdev); + return timeout; ++ } + ret = wait_for_completion_timeout(&wvif->scan_complete, timeout); + if (req->channels[start_idx]->max_power != wvif->vif->bss_conf.txpower) + hif_set_output_power(wvif, wvif->vif->bss_conf.txpower); diff --git a/queue-5.6/tty-serial-add-missing-spin_lock_init-for-sifive-serial-console.patch b/queue-5.6/tty-serial-add-missing-spin_lock_init-for-sifive-serial-console.patch new file mode 100644 index 00000000000..e983f1d8c1d --- /dev/null +++ b/queue-5.6/tty-serial-add-missing-spin_lock_init-for-sifive-serial-console.patch @@ -0,0 +1,41 @@ +From 17b4efdf4e4867079012a48ca10d965fe9d68822 Mon Sep 17 00:00:00 2001 +From: Sagar Shrikant Kadam +Date: Sat, 9 May 2020 03:24:12 -0700 +Subject: tty: serial: add missing spin_lock_init for SiFive serial console + +From: Sagar Shrikant Kadam + +commit 17b4efdf4e4867079012a48ca10d965fe9d68822 upstream. + +An uninitialised spin lock for sifive serial console raises a bad +magic spin_lock error as reported and discussed here [1]. +Initialising the spin lock resolves the issue. + +The fix is tested on HiFive Unleashed A00 board with Linux 5.7-rc4 +and OpenSBI v0.7 + +[1] https://lore.kernel.org/linux-riscv/b9fe49483a903f404e7acc15a6efbef756db28ae.camel@wdc.com + +Fixes: 45c054d0815b ("tty: serial: add driver for the SiFive UART") +Reported-by: Atish Patra +Signed-off-by: Sagar Shrikant Kadam +Reviewed-by: Palmer Dabbelt +Acked-by: Palmer Dabbelt +Cc: stable +Link: https://lore.kernel.org/r/1589019852-21505-2-git-send-email-sagar.kadam@sifive.com +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/tty/serial/sifive.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/tty/serial/sifive.c ++++ b/drivers/tty/serial/sifive.c +@@ -840,6 +840,7 @@ console_initcall(sifive_console_init); + + static void __ssp_add_console_port(struct sifive_serial_port *ssp) + { ++ spin_lock_init(&ssp->port.lock); + sifive_serial_console_ports[ssp->port.line] = ssp; + } +