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: <YP+wf+G8V4AoXSBq@google.com>
Date:   Tue, 27 Jul 2021 16:06:39 +0900
From:   Sergey Senozhatsky <senozhatsky@...omium.org>
To:     Dafna Hirschfeld <dafna.hirschfeld@...labora.com>
Cc:     Sergey Senozhatsky <senozhatsky@...omium.org>,
        Tomasz Figa <tfiga@...omium.org>,
        Hans Verkuil <hverkuil-cisco@...all.nl>,
        Ricardo Ribalda <ribalda@...omium.org>,
        Christoph Hellwig <hch@....de>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
        Collabora Kernel ML <kernel@...labora.com>
Subject: Re: [PATCHv3 8/8] videobuf2: handle non-contiguous DMA allocations

On (21/07/22 19:26), Dafna Hirschfeld wrote:
> >   /*********************************************/
> > @@ -139,17 +175,63 @@ static void vb2_dc_put(void *buf_priv)
> >   		sg_free_table(buf->sgt_base);
> >   		kfree(buf->sgt_base);
> >   	}
> > -	dma_free_attrs(buf->dev, buf->size, buf->cookie, buf->dma_addr,
> > -		       buf->attrs);
> > +
> > +	if (buf->coherent_mem) {
> > +		dma_free_attrs(buf->dev, buf->size, buf->cookie,
> > +			       buf->dma_addr, buf->attrs);
> > +	} else {
> > +		if (buf->vaddr)
> > +			dma_vunmap_noncontiguous(buf->dev, buf->vaddr);
> > +		dma_free_noncontiguous(buf->dev, buf->size,
> > +				       buf->dma_sgt, buf->dma_addr);
> 
> The last argument for dma_free_noncontiguous should be dma_dir.
> Also, the 'cookie' cb returns buf->dma_addr which is not initialized for
> the noncontiguous api. So it is not clear how drivers should use the new api.

Done. Thank you Dafna.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ