lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <VI1PR0402MB36002FFAFC4904D8D5A890DAFF130@VI1PR0402MB3600.eurprd04.prod.outlook.com>
Date:   Thu, 20 Sep 2018 10:54:04 +0000
From:   Andy Duan <fugang.duan@....com>
To:     Lucas Stach <l.stach@...gutronix.de>,
        Robin Gong <yibin.gong@....com>,
        Uwe Kleine-König 
        <u.kleine-koenig@...gutronix.de>
CC:     "linux-serial@...r.kernel.org" <linux-serial@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        dl-linux-imx <linux-imx@....com>,
        "kernel@...gutronix.de" <kernel@...gutronix.de>,
        "jslaby@...e.com" <jslaby@...e.com>
Subject: RE: [PATCH v1] tty: serial: imx: enable IDDMAEN for the last tail
 data

From: Lucas Stach <l.stach@...gutronix.de> Sent: 2018年9月20日 18:42
> Am Donnerstag, den 20.09.2018, 10:33 +0000 schrieb Andy Duan:
> > From: Lucas Stach <l.stach@...gutronix.de> Sent: 2018年9月20日
> 17:40
> > > Am Donnerstag, den 20.09.2018, 08:39 +0000 schrieb Robin Gong:
> > > > > -----Original Message-----
> > > > > From: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
> > > > > Sent: 2018年9月20日 15:55
> > > > > To: Robin Gong <yibin.gong@....com>
> > > > > Cc: jslaby@...e.com; Andy Duan <fugang.duan@....com>;
> > > > > linux-serial@...r.kernel.org; linux-kernel@...r.kernel.org; dl-
> > > > > linux-imx <linux-imx@....com>; kernel@...gutronix.de
> > > > > Subject: Re: [PATCH v1] tty: serial: imx: enable IDDMAEN for the
> > > > > last tail data
> > > > >
> > > > > Hello,
> > > > >
> > > > > On Thu, Sep 20, 2018 at 11:26:00PM +0800, Robin Gong wrote:
> > > > > > enable IDDMAEN in UCR4 to let sdma script has the chance to
> > > > > > detect the idle status and transfer the last tail data with
> > > > > > the interrupt notifying uart driver.Otherwise, the last dma
> > > > > > done interrupt of the tail data in rxfifo whose size is less
> > > > > > than watermark may never be received by uart driver.
> > > > >
> > > > > Is this a theoretic issue? Or does it fix a real problem?
> > > > >
> > > > > If the former I'd say UCR1_ATDMAEN being set should prevent this
> > > > > stall.
> > > >
> > > > It's a real fix, you will see 'timeout We read 0 byte' with the
> > > > attached stress test running on i.mx7d or i.mx6 if no this patch
> > > > applied.
> > > > ' while [ 1 ]; do /unit_tests/UART/mxc_uart_stress_test.out
> > > > /dev/ttymxc5 2000000 D L 100 100 L; done &'
> > > > Please make sure dma enabled on ttymxcX for your test, and sdma
> > > > firmware setup in your rootfs /lib/firmware/imx/sdma/sdma-
> > > > imx6q.bin
> > >
> > > or
> > > > /lib/firmware/imx/sdma/sdma- imx7d.bin.
> > > > You can get sdma firmware from below:
> > > >
> > >
> > >
> https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2F
> > > gi
> > > t
> > > > .kernel.org%2Fpub%2Fscm%2Flinux%2Fkernel%2Fgit%2Ffirmware%2
> Flin
> > >
> > > ux-&amp
> > > > ;data=02%7C01%7Cfugang.duan%40nxp.com%7C213076f6d111414
> 8b5
> > >
> > > ce08d61edcfb
> > > >
> > >
> > >
> 88%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C636730331
> > > 814804545&amp
> > > > ;sdata=d0uZMjLc%2FrIae3Wd6PWtX2gEGlvZcUjPBVqKK9550jg%3D&
> amp
> > >
> > > ;reserved=0
> > > > firmware.git/tree/imx/sdma
> > >
> > > Please see commit 905c0decad28402aa166975023fb88c8f62f93c8
> on why
> > > using the idle detect together with with SDMA is wrong. We don't
> > > want to re- introduce the broken behavior.
> > >
> >
> > The patch just want to use idle timer to stop SDMA transfer using the
> > new ram script, whose action is not the same as rom script.
> > Sdma rom script how to stop sdma transfer if only one byte in rx FIFO
> > that trigger SDMA request ?
> 
> Right, and using the idle detect doesn't work with the ROM script as this
> doesn't read the remaining bytes in the FIFO when the idle detect
> condition is hit.
> 
> Instead with the ROM script the aging timer is used to terminate the DMA
> transfer. So if 1 byte is sitting in the FIFO below the watermark level, the
> serial core will trigger a DMA request when the aging time is hit. The ROM
> script checks the aging status and reads the remaining bytes from the FIFO,
> then terminates the transfer. This is all documented in the reference
> manual.
> 
> I fail to see why this shouldn't work with the RAM script. If it doesn't work
> with the RAM firmware, this script is violating the interface between the
> serial core and the script in an incompatible way and needs fixing.
> 
If rom script stop DMA transfer when SDMA is triggered by aging timer,  then idler timer is not needed. And the data copy action should have no problem. I will do stress test with SDMA rom script.
For ram script, there have many changes and different action with rom script. Aging timer trigger cannot stop current SDMA transfer, so use idler timer as the stop condition trigger source. 
We will do more test on rom script, if pass our all test cases, we can align ram script with rom script.
Thanks.

Andy

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ