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]
Message-ID: <677a17b6-39a6-4b1e-87f5-2c01b19bbe3f@sirena.org.uk>
Date: Fri, 15 Dec 2023 13:29:21 +0000
From: Mark Brown <broonie@...nel.org>
To: Thangaraj Samynathan <thangaraj.s@...rochip.com>
Cc: linux-spi@...r.kernel.org, linux-kernel@...r.kernel.org,
	Tharunkumar.Pasumarthi@...rochip.com,
	Kumaravel.Thiagarajan@...rochip.com, Arun.Ramadoss@...rochip.com,
	Ronnie.Kunin@...rochip.com,
	jegadheesan.gopalmanoharan@...rochip.com
Subject: Re: [PATCH SPI for-next 2/3] spi: mchp-pci1xxxx: DMA Read support
 for copying data into SPI Buf

On Fri, Dec 15, 2023 at 05:17:47PM +0530, Thangaraj Samynathan wrote:

> +	tx_dma_addr = dma_map_single(dev, (void *)xfer->tx_buf, xfer->len, DMA_TO_DEVICE);
> +	if (dma_mapping_error(NULL, tx_dma_addr)) {
> +		tx_dma_addr = 0;
> +		ret = -ENOMEM;
> +		goto error;
> +	}

The core can do all the DMA mapping for you if you provide a can_dma()
operation, this supports switching between DMA and non-DMA modes per
transfer - often you'll get better performance from PIO for smaller
lengths due to the overhead of setting up DMA and taking the interrupt
on completion.

Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ