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  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]
Date:   Sat, 16 Sep 2017 17:33:59 +0800
From:   Jun Gao <jun.gao@...iatek.com>
To:     Wolfram Sang <wsa@...-dreams.de>
CC:     <srv_heupstream@...iatek.com>, <linux-i2c@...r.kernel.org>,
        <linux-arm-kernel@...ts.infradead.org>,
        <linux-kernel@...r.kernel.org>,
        <linux-mediatek@...ts.infradead.org>, <yingjoe.chen@...iatek.com>
Subject: Re: [I2C] About warning 'DMA-API: device driver maps memory from
 stack'

On Sat, 2017-09-02 at 23:58 +0200, Wolfram Sang wrote:
> Hi,
> 
> nice to see someone else interested in the I2C & DMA topic.
> 
> Please check this series which I sent out recently:
> 
> "[RFC PATCH v4 0/6] i2c: document DMA handling and add helpers for it"
> 
> In that series, I proposed...
> 
> > 3. kmalloc data buffer instead of local variables buf in function
> > i2c_smbus_xfer_emulated(...)
> 
> ... this solution. Although I have to check Mauro's general response to
> the series first. I'd be interested in what you think of the series,
> too.
Sorry for late reply.

As you said in "[RFC,v4,3/6]i2c: add docs to clarify DMA handling". Most
i2c_msgs are register accesses and thus, small messages. And
"[RFC,v4,4/6] i2c: sh_mobile: use helper to decide if DMA is useful".

Maybe the solution as below will be better. Other drivers which will use
i2c would not have to make buffer DMA safe especially register
accesses(they like to use local variables when data_len = 1 or 2).

solution:
2. use FIFO mode when length<=fifo_depth(mtk i2c fifo_depth=8), use
the flag "I2C_M_DMA_SAFE" to check buffer for DMA mode when
length>fifo_depth in i2c-mt65xx.c .

Thanks.
> 
> Kind regards,
> 
>    Wolfram
> 


Powered by blists - more mailing lists