public inbox for linux-serial@vger.kernel.org
 help / color / mirror / Atom feed
From: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
To: Krzysztof Kozlowski <krzk@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jslaby@suse.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: linux-samsung-soc@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] serial: samsung: Continue to work if DMA request fails
Date: Sat, 25 Feb 2017 17:28:41 +0100	[thread overview]
Message-ID: <eaab5961-4b60-cc74-d5bc-5608face822d@math.uni-bielefeld.de> (raw)
In-Reply-To: <20170225162442.31848-1-krzk@kernel.org>

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

>  		}
>  	}
>  
> 

  reply	other threads:[~2017-02-25 16:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-25 16:24 [PATCH] serial: samsung: Continue to work if DMA request fails Krzysztof Kozlowski
2017-02-25 16:28 ` Tobias Jakobi [this message]
2017-02-25 16:34   ` Krzysztof Kozlowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=eaab5961-4b60-cc74-d5bc-5608face822d@math.uni-bielefeld.de \
    --to=tjakobi@math.uni-bielefeld.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.com \
    --cc=krzk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox