All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Slaby <jslaby@suse.cz>
To: Leilei Zhao <leilei.zhao@atmel.com>,
	nicolas.ferre@atmel.com, gregkh@linuxfoundation.org,
	linux-serial@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 1/5] tty/serial: at91: correct check of buf used in DMA
Date: Thu, 26 Feb 2015 10:29:54 +0100	[thread overview]
Message-ID: <54EEE792.9060706@suse.cz> (raw)
In-Reply-To: <1424933725-16242-2-git-send-email-leilei.zhao@atmel.com>

On 02/26/2015, 07:55 AM, Leilei Zhao wrote:
> We only use buf of ring In DMA rx function while using buf of xmit
> in DMA tx function. So here we need definitively to check the buf
> of ring which is corresponding to DMA rx function.
> 
> Signed-off-by: Leilei Zhao <leilei.zhao@atmel.com>
> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> ---
>  drivers/tty/serial/atmel_serial.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
> index 846552b..460903c 100644
> --- a/drivers/tty/serial/atmel_serial.c
> +++ b/drivers/tty/serial/atmel_serial.c
> @@ -1027,7 +1027,7 @@ static int atmel_prepare_rx_dma(struct uart_port *port)
>  	spin_lock_init(&atmel_port->lock_rx);
>  	sg_init_table(&atmel_port->sg_rx, 1);
>  	/* UART circular rx buffer is an aligned page. */
> -	BUG_ON((int)port->state->xmit.buf & ~PAGE_MASK);
> +	BUG_ON((int)ring->buf & ~PAGE_MASK);

Please use PAGE_ALIGNED. This will also make the bad (int) cast to dismiss.

thanks,
-- 
js
suse labs

WARNING: multiple messages have this Message-ID (diff)
From: jslaby@suse.cz (Jiri Slaby)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/5] tty/serial: at91: correct check of buf used in DMA
Date: Thu, 26 Feb 2015 10:29:54 +0100	[thread overview]
Message-ID: <54EEE792.9060706@suse.cz> (raw)
In-Reply-To: <1424933725-16242-2-git-send-email-leilei.zhao@atmel.com>

On 02/26/2015, 07:55 AM, Leilei Zhao wrote:
> We only use buf of ring In DMA rx function while using buf of xmit
> in DMA tx function. So here we need definitively to check the buf
> of ring which is corresponding to DMA rx function.
> 
> Signed-off-by: Leilei Zhao <leilei.zhao@atmel.com>
> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> ---
>  drivers/tty/serial/atmel_serial.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
> index 846552b..460903c 100644
> --- a/drivers/tty/serial/atmel_serial.c
> +++ b/drivers/tty/serial/atmel_serial.c
> @@ -1027,7 +1027,7 @@ static int atmel_prepare_rx_dma(struct uart_port *port)
>  	spin_lock_init(&atmel_port->lock_rx);
>  	sg_init_table(&atmel_port->sg_rx, 1);
>  	/* UART circular rx buffer is an aligned page. */
> -	BUG_ON((int)port->state->xmit.buf & ~PAGE_MASK);
> +	BUG_ON((int)ring->buf & ~PAGE_MASK);

Please use PAGE_ALIGNED. This will also make the bad (int) cast to dismiss.

thanks,
-- 
js
suse labs

  reply	other threads:[~2015-02-26  9:29 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-26  6:55 [PATCH 0/5] tty/serial: at91: fix bugs when using multiple serials Leilei Zhao
2015-02-26  6:55 ` Leilei Zhao
2015-02-26  6:55 ` Leilei Zhao
2015-02-26  6:55 ` [PATCH 1/5] tty/serial: at91: correct check of buf used in DMA Leilei Zhao
2015-02-26  6:55   ` Leilei Zhao
2015-02-26  6:55   ` Leilei Zhao
2015-02-26  9:29   ` Jiri Slaby [this message]
2015-02-26  9:29     ` Jiri Slaby
2015-02-27  7:38     ` Zhao, Leilei
2015-02-27  7:38       ` Zhao, Leilei
2015-02-26  6:55 ` [PATCH 2/5] tty/serial: at91: correct buffer size " Leilei Zhao
2015-02-26  6:55   ` Leilei Zhao
2015-02-26  6:55   ` Leilei Zhao
2015-02-26  6:55 ` [PATCH 3/5] tty/serial: at91: revise the return type of atmel_init_property Leilei Zhao
2015-02-26  6:55   ` Leilei Zhao
2015-02-26  6:55   ` Leilei Zhao
2015-02-26  6:55 ` [PATCH 4/5] tty/serial: at91: set ops in property init each time Leilei Zhao
2015-02-26  6:55   ` Leilei Zhao
2015-02-26  6:55   ` Leilei Zhao
2015-02-26  6:55 ` [PATCH 5/5] tty/serial: at91: correct the usage of tasklet Leilei Zhao
2015-02-26  6:55   ` Leilei Zhao
2015-02-26  6:55   ` Leilei Zhao

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=54EEE792.9060706@suse.cz \
    --to=jslaby@suse.cz \
    --cc=gregkh@linuxfoundation.org \
    --cc=leilei.zhao@atmel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=nicolas.ferre@atmel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.