Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1588157 > unrolled thread

[PATCH] serial: samsung: Continue to work if DMA request fails

Started byKrzysztof Kozlowski <krzk@kernel.org>
First post2017-02-25 17:30 +0100
Last post2017-02-25 17:50 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] serial: samsung: Continue to work if DMA request fails Krzysztof Kozlowski <krzk@kernel.org> - 2017-02-25 17:30 +0100
    Re: [PATCH] serial: samsung: Continue to work if DMA request fails Krzysztof Kozlowski <krzk@kernel.org> - 2017-02-25 17:40 +0100
    Re: [PATCH] serial: samsung: Continue to work if DMA request fails Tobias Jakobi <tjakobi@math.uni-bielefeld.de> - 2017-02-25 17:50 +0100

#1588157 — [PATCH] serial: samsung: Continue to work if DMA request fails

FromKrzysztof Kozlowski <krzk@kernel.org>
Date2017-02-25 17:30 +0100
Subject[PATCH] serial: samsung: Continue to work if DMA request fails
Message-ID<teNom-23w-15@gated-at.bofh.it>
If DMA is not available (even when configured in DeviceTree), the driver
will fail the startup procedure thus making serial console not
available.

For example this causes boot failure on QEMU ARMv7 (Exynos4210, SMDKC210):
    [    1.302575] OF: amba_device_add() failed (-19) for /amba/pdma@12680000
    ...
    [   11.435732] samsung-uart 13800000.serial: DMA request failed
    [   72.963893] samsung-uart 13800000.serial: DMA request failed
    [   73.143361] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000

DMA is not necessary for serial to work, so continue with UART startup
after emitting a warning.

Fixes: Fixes: 62c37eedb74c ("serial: samsung: add dma reqest/release functions")
Cc: <stable@vger.kernel.org>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/tty/serial/samsung.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
index b4f86c219db1..7a17aedbf902 100644
--- a/drivers/tty/serial/samsung.c
+++ b/drivers/tty/serial/samsung.c
@@ -1031,8 +1031,10 @@ static int s3c64xx_serial_startup(struct uart_port *port)
 	if (ourport->dma) {
 		ret = s3c24xx_serial_request_dma(ourport);
 		if (ret < 0) {
-			dev_warn(port->dev, "DMA request failed\n");
-			return ret;
+			dev_warn(port->dev,
+				 "DMA request failed, DMA will not be used\n");
+			devm_kfree(port->dev, ourport->dma);
+			ourport->dma = NULL;
 		}
 	}
 
-- 
2.9.3

[toc] | [next] | [standalone]


#1588161

FromKrzysztof Kozlowski <krzk@kernel.org>
Date2017-02-25 17:40 +0100
Message-ID<teNy2-27E-27@gated-at.bofh.it>
In reply to#1588157
On Sat, Feb 25, 2017 at 05:28:41PM +0100, Tobias Jakobi wrote:
> Hello Krzysztof,
> 
> Krzysztof Kozlowski wrote:
> > If DMA is not available (even when configured in DeviceTree), the driver
> > will fail the startup procedure thus making serial console not
> > available.
> > 
> > For example this causes boot failure on QEMU ARMv7 (Exynos4210, SMDKC210):
> >     [    1.302575] OF: amba_device_add() failed (-19) for /amba/pdma@12680000
> >     ...
> >     [   11.435732] samsung-uart 13800000.serial: DMA request failed
> >     [   72.963893] samsung-uart 13800000.serial: DMA request failed
> >     [   73.143361] Kernel panic - not syncing: Attempted to kill init! exitcode=00000000
> > 
> > DMA is not necessary for serial to work, so continue with UART startup
> > after emitting a warning.
> > 
> > Fixes: Fixes: 62c37eedb74c ("serial: samsung: add dma reqest/release functions")
> > Cc: <stable@vger.kernel.org>
> > Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> > ---
> >  drivers/tty/serial/samsung.c | 6 ++++--
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
> > index b4f86c219db1..7a17aedbf902 100644
> > --- a/drivers/tty/serial/samsung.c
> > +++ b/drivers/tty/serial/samsung.c
> > @@ -1031,8 +1031,10 @@ static int s3c64xx_serial_startup(struct uart_port *port)
> >  	if (ourport->dma) {
> >  		ret =3c24xx_serial_request_dma(ourport);
> >  		if (ret < 0) {
> > -			dev_warn(port->dev, "DMA request failed\n");
> > -			return ret;
> > +			dev_warn(port->dev,
> > +				 "DMA request failed, DMA will not be used\n");
> > +			devm_kfree(port->dev, ourport->dma);
> > +			ourport->dma =ULL;
> This line looks odd. Did you want to assign NULL here?
> Also, whitespace on both sides of '='?

Ugh, I must ate it by mistake somehow because my git contains proper
"NULL" here.

Thanks for pointing this, I'll resend v3.


Best regards,
Krzysztof

[toc] | [prev] | [next] | [standalone]


#1588163

FromTobias Jakobi <tjakobi@math.uni-bielefeld.de>
Date2017-02-25 17:50 +0100
Message-ID<teNy2-27E-29@gated-at.bofh.it>
In reply to#1588157
Hello Krzysztof,

Krzysztof Kozlowski wrote:
> If DMA is not available (even when configured in DeviceTree), the driver
> will fail the startup procedure thus making serial console not
> available.
> 
> For example this causes boot failure on QEMU ARMv7 (Exynos4210, SMDKC210):
>     [    1.302575] OF: amba_device_add() failed (-19) for /amba/pdma@12680000
>     ...
>     [   11.435732] samsung-uart 13800000.serial: DMA request failed
>     [   72.963893] samsung-uart 13800000.serial: DMA request failed
>     [   73.143361] Kernel panic - not syncing: Attempted to kill init! exitcode=00000000
> 
> DMA is not necessary for serial to work, so continue with UART startup
> after emitting a warning.
> 
> Fixes: Fixes: 62c37eedb74c ("serial: samsung: add dma reqest/release functions")
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> ---
>  drivers/tty/serial/samsung.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
> index b4f86c219db1..7a17aedbf902 100644
> --- a/drivers/tty/serial/samsung.c
> +++ b/drivers/tty/serial/samsung.c
> @@ -1031,8 +1031,10 @@ static int s3c64xx_serial_startup(struct uart_port *port)
>  	if (ourport->dma) {
>  		ret =3c24xx_serial_request_dma(ourport);
>  		if (ret < 0) {
> -			dev_warn(port->dev, "DMA request failed\n");
> -			return ret;
> +			dev_warn(port->dev,
> +				 "DMA request failed, DMA will not be used\n");
> +			devm_kfree(port->dev, ourport->dma);
> +			ourport->dma =ULL;
This line looks odd. Did you want to assign NULL here?
Also, whitespace on both sides of '='?

- Tobias

>  		}
>  	}
>  
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web