FAILED: patch "[PATCH] iio: adc: stm32-dfsdm: fix device used to request dma" failed to apply to 5.4-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 5.4-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From b455d06e6fb3c035711e8aab1ca18082ccb15d87 Mon Sep 17 00:00:00 2001
From: Fabrice Gasnier <[email protected]>
Date: Thu, 30 Apr 2020 11:28:46 +0200
Subject: [PATCH] iio: adc: stm32-dfsdm: fix device used to request dma
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.
drivers/iio/adc/stm32-dfsdm-adc.c +11 -10
@@ -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(struct iio_dev *indio_dev) } } -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(struct iio_dev *indio_dev, &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 iio_dev *indio_dev) 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 iio_dev *indio_dev)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 platform_device *pdev) 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;
Sasha Levin
maintainerQuoted 26 lines · On Mon, May 25, 2020 at 03:54:00PM +0200, [email protected] wrote:
The patch below does not apply to the 5.4-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From
b455d06e6fb3c035711e8aab1ca18082ccb15d87Mon Sep 17 00:00:00 2001
From: Fabrice Gasnier <[email protected]>
Date: Thu, 30 Apr 2020 11:28:46 +0200
Subject: [PATCH] iio: adc: stm32-dfsdm: fix device used to request dmaDMA 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_registeris done iniio_device_register). Since commit71723a96b8b1("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
Quoted 7 lines
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 <[email protected]>Cc <[email protected]>Signed-off-by Jonathan Cameron <[email protected]>
I've also grabbed a9ab624edd91 ("iio: adc: stm32-dfsdm: Use dma_request_chan() instead dma_request_slave_channel()") and queued both for 5.4 and 4.19.
Signature · 2 lines
Thanks, Sasha