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:	Fri, 20 Sep 2013 00:41:06 +0100
From:	Russell King <rmk+kernel@....linux.org.uk>
To:	alsa-devel@...a-project.org, b43-dev@...ts.infradead.org,
	devel@...verdev.osuosl.org, devicetree@...r.kernel.org,
	dri-devel@...ts.freedesktop.org, e1000-devel@...ts.sourceforge.net,
	linux-arm-kernel@...ts.infradead.org, linux-crypto@...r.kernel.org,
	linux-doc@...r.kernel.org, linux-fbdev@...r.kernel.org,
	linux-ide@...r.kernel.org, linux-media@...r.kernel.org,
	linux-mmc@...r.kernel.org, linux-nvme@...ts.infradead.org,
	linux-omap@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
	linux-samsung-soc@...r.kernel.org, linux-scsi@...r.kernel.org,
	linux-tegra@...r.kernel.org, linux-usb@...r.kernel.org,
	linux-wireless@...r.kernel.org, netdev@...r.kernel.org,
	Solarflare linux maintainers <linux-net-drivers@...arflare.com>,
	uclinux-dist-devel@...ckfin.uclinux.org
Cc:	Vinod Koul <vinod.koul@...el.com>,
	Dan Williams <dan.j.williams@...el.com>,
	Jens Axboe <axboe@...nel.dk>
Subject: [PATCH 48/51] ARM: 7795/1: mm: dma-mapping: Add dma_max_pfn(dev)
 helper function

From: Santosh Shilimkar <santosh.shilimkar@...com>

Most of the kernel assumes that PFN0 is the start of the physical
memory (RAM). This assumptions is not true on most of the ARM SOCs
and hence and if one try to update the ARM port to follow the assumptions,
we end of breaking the dma bounce limit for few block layer drivers.
One such example is trying to unify the meaning of max*_pfn on ARM
as the bootmem layer expects, breaks few block layer driver dma
bounce limit.

To fix this problem, we introduce dma_max_pfn(dev) generic helper with
a possibility of override from the architecture code. The helper converts
a DMA bitmask of bits to a block PFN number. In all the generic cases,
it is just  "dev->dma_mask >> PAGE_SHIFT" and hence default behavior
is maintained as is.

Subsequent patches will make use of the helper. No functional change.

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@...com>
Signed-off-by: Russell King <rmk+kernel@....linux.org.uk>
---
 include/linux/dma-mapping.h |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index 27d1421..fd4aee2 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -153,6 +153,13 @@ static inline int dma_set_seg_boundary(struct device *dev, unsigned long mask)
 		return -EIO;
 }
 
+#ifndef dma_max_pfn
+static inline unsigned long dma_max_pfn(struct device *dev)
+{
+	return *dev->dma_mask >> PAGE_SHIFT;
+}
+#endif
+
 static inline void *dma_zalloc_coherent(struct device *dev, size_t size,
 					dma_addr_t *dma_handle, gfp_t flag)
 {
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ