stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* FAILED: patch "[PATCH] iio: adc: stm32-adc: fix device used to request dma" failed to apply to 5.4-stable tree
@ 2020-05-25 13:53 gregkh
  2020-05-25 20:52 ` Sasha Levin
  0 siblings, 1 reply; 3+ messages in thread
From: gregkh @ 2020-05-25 13:53 UTC (permalink / raw)
  To: fabrice.gasnier, Jonathan.Cameron, Stable; +Cc: stable


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 <stable@vger.kernel.org>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 52cd91c27f3908b88e8b25aed4a4d20660abcc45 Mon Sep 17 00:00:00 2001
From: Fabrice Gasnier <fabrice.gasnier@st.com>
Date: Thu, 30 Apr 2020 11:28:45 +0200
Subject: [PATCH] iio: adc: stm32-adc: 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.

Fixes: 2763ea0585c99 ("iio: adc: stm32: add optional dma support")

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

diff --git a/drivers/iio/adc/stm32-adc.c b/drivers/iio/adc/stm32-adc.c
index ae622ee6d08c..dfc3a306c667 100644
--- 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 iio_dev *indio_dev)
 	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 platform_device *pdev)
 	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;
 


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: FAILED: patch "[PATCH] iio: adc: stm32-adc: fix device used to request dma" failed to apply to 5.4-stable tree
  2020-05-25 13:53 FAILED: patch "[PATCH] iio: adc: stm32-adc: fix device used to request dma" failed to apply to 5.4-stable tree gregkh
@ 2020-05-25 20:52 ` Sasha Levin
  2020-05-26  6:59   ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Sasha Levin @ 2020-05-25 20:52 UTC (permalink / raw)
  To: gregkh; +Cc: fabrice.gasnier, Jonathan.Cameron, Stable

On Mon, May 25, 2020 at 03:53:32PM +0200, gregkh@linuxfoundation.org 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 <stable@vger.kernel.org>.
>
>thanks,
>
>greg k-h
>
>------------------ original commit in Linus's tree ------------------
>
>From 52cd91c27f3908b88e8b25aed4a4d20660abcc45 Mon Sep 17 00:00:00 2001
>From: Fabrice Gasnier <fabrice.gasnier@st.com>
>Date: Thu, 30 Apr 2020 11:28:45 +0200
>Subject: [PATCH] iio: adc: stm32-adc: 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.
>
>Fixes: 2763ea0585c99 ("iio: adc: stm32: add optional dma support")
>
>Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
>Cc: <Stable@vger.kernel.org>
>Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

I've also grabbed 735404b846df ("iio: adc: stm32-adc: Use
dma_request_chan() instead dma_request_slave_channel()") and queued both
for 5.4, 4.19, and 4.14.

-- 
Thanks,
Sasha

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: FAILED: patch "[PATCH] iio: adc: stm32-adc: fix device used to request dma" failed to apply to 5.4-stable tree
  2020-05-25 20:52 ` Sasha Levin
@ 2020-05-26  6:59   ` Greg KH
  0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2020-05-26  6:59 UTC (permalink / raw)
  To: Sasha Levin; +Cc: fabrice.gasnier, Jonathan.Cameron, Stable

On Mon, May 25, 2020 at 04:52:01PM -0400, Sasha Levin wrote:
> On Mon, May 25, 2020 at 03:53:32PM +0200, gregkh@linuxfoundation.org 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 <stable@vger.kernel.org>.
> > 
> > thanks,
> > 
> > greg k-h
> > 
> > ------------------ original commit in Linus's tree ------------------
> > 
> > > From 52cd91c27f3908b88e8b25aed4a4d20660abcc45 Mon Sep 17 00:00:00 2001
> > From: Fabrice Gasnier <fabrice.gasnier@st.com>
> > Date: Thu, 30 Apr 2020 11:28:45 +0200
> > Subject: [PATCH] iio: adc: stm32-adc: 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.
> > 
> > Fixes: 2763ea0585c99 ("iio: adc: stm32: add optional dma support")
> > 
> > Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
> > Cc: <Stable@vger.kernel.org>
> > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> I've also grabbed 735404b846df ("iio: adc: stm32-adc: Use
> dma_request_chan() instead dma_request_slave_channel()") and queued both
> for 5.4, 4.19, and 4.14.

Thanks for this, and all of the other fixups you added to the queue.

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-05-26  6:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-25 13:53 FAILED: patch "[PATCH] iio: adc: stm32-adc: fix device used to request dma" failed to apply to 5.4-stable tree gregkh
2020-05-25 20:52 ` Sasha Levin
2020-05-26  6:59   ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).