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] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 9 Mar 2021 10:49:27 +0000
From:   Sanket Parmar <sparmar@...ence.com>
To:     Christoph Hellwig <hch@...radead.org>
CC:     "peter.chen@...nel.org" <peter.chen@...nel.org>,
        Pawel Laszczak <pawell@...ence.com>,
        "a-govindraju@...com" <a-govindraju@...com>,
        "linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Rahul Kumar <kurahul@...ence.com>,
        "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
        "kishon@...com" <kishon@...com>
Subject: RE: [PATCH 2/2] usb: cdns3: Optimize DMA request buffer allocation

> On Tue, Mar 09, 2021 at 10:18:43AM +0000, Sanket Parmar wrote:
> > > On Tue, Mar 09, 2021 at 06:19:40AM +0100, Sanket Parmar wrote:
> > > > dma_alloc_coherent() might fail on the platform with a small DMA
> region.
> > > >
> > > > To avoid such failure in cdns3_prepare_aligned_request_buf(),
> > > > dma_alloc_coherent() is replaced with kmalloc and dma_map API to
> > > > allocate aligned request buffer of dynamic length.
> > >
> > > dma_alloc_noncoherent is the proper API instead of using kmalloc, which
> > > can lead to unaddressable memory that might require bounce buffering.
> >
> > cdns3 device required DMA coherent buffer to perform operations. So
> > dma_alloc_noncoherent will not help here.
> >
> > Also all gadget classes(except g_ether) use kmalloc to allocated request
> buffer,
> > and device driver uses usb_gadget_map_request_by_dev to map the
> request
> > buffer. Similar approach is used to allocate aligned buffer.
> 
> If you can use kmalloc and dma_map_single you can use
> dma_alloc_noncoherent per definition.

Okay. I was not aware of it. I will test it. 
Thank you for your feedback.

--
Sanket

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ