linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: <Tudor.Ambarus@microchip.com>
To: <jiri.prchal@aksignal.cz>, <Ludovic.Desroches@microchip.com>,
	<linux-arm-kernel@lists.infradead.org>,
	<dmaengine@vger.kernel.org>
Cc: Claudiu.Beznea@microchip.com
Subject: Re: atmel usart and dma tx
Date: Thu, 14 Jul 2022 07:13:09 +0000	[thread overview]
Message-ID: <c0ca74a3-448f-7f00-41d8-99b2cd7c5b86@microchip.com> (raw)
In-Reply-To: <611a4f8c-917e-a0ba-c5d9-25651afa2a04@aksignal.cz>

Hi, Jiří,

On 4/28/22 12:08, Jiří Prchal wrote:
> [Some people who received this message don't often get email from jiri.prchal@aksignal.cz. Learn why this is important at http://aka.ms/LearnAboutSenderIdentification.]
> 
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> Hi everybody,
> with kernel 5.17, at91sam9g25 running at 400MHz I discovered drop outs
> while I write data (64 to 128B) to ttyS by one call of write(). At speed
> 230400 or 115200 Baud. It is not transmitted at once, there are random
> spaces long 200us to 1ms. It should use DMA so I think it could be
> transmitted at once.
> Is there everything OK with DMA or some special setting needed?

There are some concurrency problems with at-hdmac that happen at high
loads (check [1]), but I don't think it's related to your problem.
Can you do a flame graph to verify where in the code is the stall? Why
do you assume it's at the DMA level? Have you tried using usart without
DMA and verify if the stalling is still there?

> 
> dmesg:
> [    1.636666] bus: 'platform': __driver_probe_device: matched device
> f801c000.serial with driver at91_usart_mode
> [    1.636666] bus: 'platform': really_probe: probing driver
> at91_usart_mode with device f801c000.serial
> [    1.636666] pinctrl-at91 ahb:apb:pinctrl@fffff400: usart0-0: 2 0:0
> [    1.636666] pinctrl-at91 ahb:apb:pinctrl@fffff400: maps: function
> usart0 group usart0-0 num 3
> [    1.636666] pinctrl-at91 ahb:apb:pinctrl@fffff400: usart0_rts-0: 1 0:2
> [    1.636666] pinctrl-at91 ahb:apb:pinctrl@fffff400: maps: function
> usart0 group usart0_rts-0 num 2
> [    1.636666] pinctrl-at91 ahb:apb:pinctrl@fffff400: found group
> selector 4 for usart0-0
> [    1.636666] pinctrl-at91 ahb:apb:pinctrl@fffff400: found group
> selector 5 for usart0_rts-0
> [    1.636666] at91_usart_mode f801c000.serial: no init pinctrl state
> [    1.636666] pinctrl-at91 ahb:apb:pinctrl@fffff400: enable function
> usart0 group usart0-0
> [    1.636666] pinctrl-at91 ahb:apb:pinctrl@fffff400: enable function
> usart0 group usart0_rts-0
> [    1.639999] at91_usart_mode f801c000.serial: no sleep pinctrl state
> [    1.643333] at91_usart_mode f801c000.serial: no idle pinctrl state
> [    1.643333] Registering platform device 'atmel_usart_serial.1.auto'.
> Parent at f801c000.serial
> [    1.643333] device: 'atmel_usart_serial.1.auto': device_add
> [    1.643333] bus: 'platform': add device atmel_usart_serial.1.auto
> [    1.643333] bus: 'platform': __driver_probe_device: matched device
> atmel_usart_serial.1.auto with driver atmel_usart_serial
> [    1.643333] bus: 'platform': really_probe: probing driver
> atmel_usart_serial with device atmel_usart_serial.1.auto
> [    1.643333] atmel_usart_serial atmel_usart_serial.1.auto: no of_node;
> not parsing pinctrl DT
> [    1.643333] atmel_usart_serial atmel_usart_serial.1.auto: no default
> pinctrl state
> [    1.643333] atmel_usart_serial atmel_usart_serial.1.auto: GPIO lookup
> for consumer rs485-term
> [    1.643333] atmel_usart_serial atmel_usart_serial.1.auto: using
> device tree for GPIO lookup
> [    1.646666] atmel_usart_serial atmel_usart_serial.1.auto: using
> lookup tables for GPIO lookup
> [    1.646666] atmel_usart_serial atmel_usart_serial.1.auto: No GPIO
> consumer rs485-term found
> [    1.649999] atmel_usart_serial.1.auto: ttyS2 at MMIO 0xf801c000 (irq
> = 24, base_baud = 8333333) is a ATMEL_SERIAL
> [    1.656666] driver: 'atmel_usart_serial': driver_bound: bound to
> device 'atmel_usart_serial.1.auto'
> [    1.656666] bus: 'platform': really_probe: bound device
> atmel_usart_serial.1.auto to driver atmel_usart_serial
> [    1.656666] driver: 'at91_usart_mode': driver_bound: bound to device
> 'f801c000.serial'
> [    1.656666] bus: 'platform': really_probe: bound device
> f801c000.serial to driver at91_usart_mode
> 
> [   41.606666] atmel_usart_serial atmel_usart_serial.1.auto: using
> dma0chan6 for rx DMA transfers
> [   41.613333] atmel_usart_serial atmel_usart_serial.1.auto: using
> dma0chan7 for tx DMA transfers
> 

What should I see in this log?

Thanks,
ta

[1] https://lore.kernel.org/lkml/13c6c9a2-6db5-c3bf-349b-4c127ad3496a@axentia.se/

> With kernel 4.5 spaces are there too, but shorter and less frequent.
> Thanks for any help,
> Jiri

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

           reply	other threads:[~2022-07-14  7:14 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <611a4f8c-917e-a0ba-c5d9-25651afa2a04@aksignal.cz>]

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=c0ca74a3-448f-7f00-41d8-99b2cd7c5b86@microchip.com \
    --to=tudor.ambarus@microchip.com \
    --cc=Claudiu.Beznea@microchip.com \
    --cc=Ludovic.Desroches@microchip.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=jiri.prchal@aksignal.cz \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).