Re: [PATCH v2 1/5] x86: make dma_alloc_coherent() return zeroed memory if CMA is enabled

2014-01-16 Thread Akinobu Mita
2014/1/16 Konrad Rzeszutek Wilk konrad.w...@oracle.com: On Tue, Jan 14, 2014 at 11:13:46PM +0900, Akinobu Mita wrote: Calling dma_alloc_coherent() with __GFP_ZERO must return zeroed memory. But when the contiguous memory allocator (CMA) is enabled on x86 and the memory region is allocated

[PATCH v2 3/5] intel-iommu: integrate DMA CMA

2014-01-14 Thread Akinobu Mita
() is used as a fallback. Cc: Marek Szyprowski Cc: Konrad Rzeszutek Wilk Cc: David Woodhouse Cc: Don Dutile Cc: Thomas Gleixner Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: Andi Kleen Cc: x...@kernel.org Cc: io...@lists.linux-foundation.org Signed-off-by: Akinobu Mita --- No c

[PATCH v2 2/5] x86: enable DMA CMA with swiotlb

2014-01-14 Thread Akinobu Mita
(). Cc: Marek Szyprowski Cc: Konrad Rzeszutek Wilk Cc: David Woodhouse Cc: Don Dutile Cc: Thomas Gleixner Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: Andi Kleen Cc: x...@kernel.org Cc: io...@lists.linux-foundation.org Signed-off-by: Akinobu Mita Acked-by: Marek Szyprowski --- No c

[PATCH v2 5/5] cma: add placement specifier for "cma=" kernel parameter

2014-01-14 Thread Akinobu Mita
"H. Peter Anvin" Cc: Andi Kleen Cc: x...@kernel.org Cc: io...@lists.linux-foundation.org Signed-off-by: Akinobu Mita --- New patch from this version Documentation/kernel-parameters.txt | 7 +-- drivers/base/dma-contiguous.c | 42 - include/linux/dm

[PATCH v2 4/5] memblock: introduce memblock_alloc_range()

2014-01-14 Thread Akinobu Mita
Molnar Cc: "H. Peter Anvin" Cc: Andi Kleen Cc: x...@kernel.org Cc: io...@lists.linux-foundation.org Signed-off-by: Akinobu Mita --- New patch from this version include/linux/memblock.h | 2 ++ mm/memblock.c| 27 --- 2 files changed, 22 insert

[PATCH v2 1/5] x86: make dma_alloc_coherent() return zeroed memory if CMA is enabled

2014-01-14 Thread Akinobu Mita
Rzeszutek Wilk Cc: David Woodhouse Cc: Don Dutile Cc: Thomas Gleixner Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: Andi Kleen Cc: x...@kernel.org Cc: io...@lists.linux-foundation.org Signed-off-by: Akinobu Mita --- New patch from this version arch/x86/kernel/pci-dma.c | 3 +-- 1 file

[PATCH v2 0/5] enhance DMA CMA on x86

2014-01-14 Thread Akinobu Mita
or example, CMA allocates memory below 4GB by "cma=64M@0-4G", it is required for the devices only supporting 32-bit addressing on 64-bit systems without iommu. * Changes from v1 - fix dma_alloc_coherent() with __GFP_ZERO - add placement specifier for "cma=" kernel parameter

[PATCH v2 0/5] enhance DMA CMA on x86

2014-01-14 Thread Akinobu Mita
, CMA allocates memory below 4GB by cma=64M@0-4G, it is required for the devices only supporting 32-bit addressing on 64-bit systems without iommu. * Changes from v1 - fix dma_alloc_coherent() with __GFP_ZERO - add placement specifier for cma= kernel parameter Akinobu Mita (5): x86: make

[PATCH v2 1/5] x86: make dma_alloc_coherent() return zeroed memory if CMA is enabled

2014-01-14 Thread Akinobu Mita
...@lists.linux-foundation.org Signed-off-by: Akinobu Mita akinobu.m...@gmail.com --- New patch from this version arch/x86/kernel/pci-dma.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c index 872079a..9644405 100644

[PATCH v2 4/5] memblock: introduce memblock_alloc_range()

2014-01-14 Thread Akinobu Mita
...@infradead.org Cc: Don Dutile ddut...@redhat.com Cc: Thomas Gleixner t...@linutronix.de Cc: Ingo Molnar mi...@redhat.com Cc: H. Peter Anvin h...@zytor.com Cc: Andi Kleen a...@firstfloor.org Cc: x...@kernel.org Cc: io...@lists.linux-foundation.org Signed-off-by: Akinobu Mita akinobu.m...@gmail.com

[PATCH v2 5/5] cma: add placement specifier for cma= kernel parameter

2014-01-14 Thread Akinobu Mita
Gleixner t...@linutronix.de Cc: Ingo Molnar mi...@redhat.com Cc: H. Peter Anvin h...@zytor.com Cc: Andi Kleen a...@firstfloor.org Cc: x...@kernel.org Cc: io...@lists.linux-foundation.org Signed-off-by: Akinobu Mita akinobu.m...@gmail.com --- New patch from this version Documentation/kernel

[PATCH v2 2/5] x86: enable DMA CMA with swiotlb

2014-01-14 Thread Akinobu Mita
a...@firstfloor.org Cc: x...@kernel.org Cc: io...@lists.linux-foundation.org Signed-off-by: Akinobu Mita akinobu.m...@gmail.com Acked-by: Marek Szyprowski m.szyprow...@samsung.com --- No change from the previous version arch/x86/Kconfig | 2 +- arch/x86/include/asm/swiotlb.h | 7

[PATCH v2 3/5] intel-iommu: integrate DMA CMA

2014-01-14 Thread Akinobu Mita
: Andi Kleen a...@firstfloor.org Cc: x...@kernel.org Cc: io...@lists.linux-foundation.org Signed-off-by: Akinobu Mita akinobu.m...@gmail.com --- No change from the previous version drivers/iommu/intel-iommu.c | 32 1 file changed, 24 insertions(+), 8 deletions

[PATCH 0/2] extend support for CMA CMA on x86

2013-11-29 Thread Akinobu Mita
contiguous memory with dma_alloc_coherent() and tell the base address to the device that requires it. This is why I need this change. Akinobu Mita (2): x86: enable DMA CMA with swiotlb intel-iommu: integrate DMA CMA arch/x86/Kconfig | 2 +- arch/x86/include/asm/swiotlb.h | 7

[PATCH 2/2] intel-iommu: integrate DMA CMA

2013-11-29 Thread Akinobu Mita
() is used as a fallback. Cc: Marek Szyprowski Cc: David Woodhouse Cc: io...@lists.linux-foundation.org Cc: Thomas Gleixner Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: x...@kernel.org Signed-off-by: Akinobu Mita --- drivers/iommu/intel-iommu.c | 32 1 fi

[PATCH 1/2] x86: enable DMA CMA with swiotlb

2013-11-29 Thread Akinobu Mita
(). Cc: Marek Szyprowski Cc: Konrad Rzeszutek Wilk Cc: Thomas Gleixner Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: x...@kernel.org Cc: Andi Kleen Signed-off-by: Akinobu Mita Acked-by: Marek Szyprowski --- No change from the previous version arch/x86/Kconfig | 2 +-

[PATCH 2/2] intel-iommu: integrate DMA CMA

2013-11-29 Thread Akinobu Mita
() is used as a fallback. Cc: Marek Szyprowski m.szyprow...@samsung.com Cc: David Woodhouse dw...@infradead.org Cc: io...@lists.linux-foundation.org Cc: Thomas Gleixner t...@linutronix.de Cc: Ingo Molnar mi...@redhat.com Cc: H. Peter Anvin h...@zytor.com Cc: x...@kernel.org Signed-off-by: Akinobu Mita

[PATCH 1/2] x86: enable DMA CMA with swiotlb

2013-11-29 Thread Akinobu Mita
(). Cc: Marek Szyprowski m.szyprow...@samsung.com Cc: Konrad Rzeszutek Wilk konrad.w...@oracle.com Cc: Thomas Gleixner t...@linutronix.de Cc: Ingo Molnar mi...@redhat.com Cc: H. Peter Anvin h...@zytor.com Cc: x...@kernel.org Cc: Andi Kleen a...@firstfloor.org Signed-off-by: Akinobu Mita akinobu.m

[PATCH 0/2] extend support for CMA CMA on x86

2013-11-29 Thread Akinobu Mita
contiguous memory with dma_alloc_coherent() and tell the base address to the device that requires it. This is why I need this change. Akinobu Mita (2): x86: enable DMA CMA with swiotlb intel-iommu: integrate DMA CMA arch/x86/Kconfig | 2 +- arch/x86/include/asm/swiotlb.h | 7

Re: [PATCH] x86: enable DMA CMA with swiotlb

2013-11-23 Thread Akinobu Mita
2013/11/23 H. Peter Anvin : > On 11/22/2013 04:27 AM, Akinobu Mita wrote: >> >> I'm currently working for integrating DMA CMA with intel-iommu which >> I can test. Regardless of which dma ops is actually used, I would >> like to allocate large contiguous mem

Re: [PATCH] x86: enable DMA CMA with swiotlb

2013-11-23 Thread Akinobu Mita
2013/11/23 H. Peter Anvin h...@zytor.com: On 11/22/2013 04:27 AM, Akinobu Mita wrote: I'm currently working for integrating DMA CMA with intel-iommu which I can test. Regardless of which dma ops is actually used, I would like to allocate large contiguous memory with dma_alloc_coherent

Re: [PATCH] x86: enable DMA CMA with swiotlb

2013-11-22 Thread Akinobu Mita
2013/11/22 H. Peter Anvin : > On 11/21/2013 07:02 AM, Akinobu Mita wrote: >> >> I want to use DMA CMA for the feature that requires a single huge chunk >> (about 64MB) of host memory. > > That is tautological. "I want to use the Contiguous Memory Allocator

Re: [PATCH] x86: enable DMA CMA with swiotlb

2013-11-22 Thread Akinobu Mita
2013/11/22 H. Peter Anvin h...@zytor.com: On 11/21/2013 07:02 AM, Akinobu Mita wrote: I want to use DMA CMA for the feature that requires a single huge chunk (about 64MB) of host memory. That is tautological. I want to use the Contiguous Memory Allocator to allocate contiguous memory

Re: [PATCH] x86: enable DMA CMA with swiotlb

2013-11-20 Thread Akinobu Mita
2013/11/20 Konrad Rzeszutek Wilk : > On Wed, Nov 20, 2013 at 08:32:19AM +0900, Akinobu Mita wrote: >> The DMA Contiguous Memory Allocator support on x86 is disabled when >> swiotlb config option is enabled. So DMA CMA is always disabled on >> x86_64 because swio

Re: [PATCH] x86: enable DMA CMA with swiotlb

2013-11-20 Thread Akinobu Mita
2013/11/20 Konrad Rzeszutek Wilk konrad.w...@oracle.com: On Wed, Nov 20, 2013 at 08:32:19AM +0900, Akinobu Mita wrote: The DMA Contiguous Memory Allocator support on x86 is disabled when swiotlb config option is enabled. So DMA CMA is always disabled on x86_64 because swiotlb is always

Re: [PATCH] bio: fix argument of __bio_add_page() for max_sectors > 0xffff

2013-11-18 Thread Akinobu Mita
2013/11/19 Jens Axboe : > On 11/18/2013 06:11 AM, Akinobu Mita wrote: >> The data type of max_sectors and max_hw_sectors in queue settings are >> unsigned int. But these values are passed to __bio_add_page() as an >> argument whose data type is unsigned shor

[PATCH] btrfs: fix bio_size_ok() for max_sectors > 0xffff

2013-11-18 Thread Akinobu Mita
The data type of max_sectors in queue settings is unsigned int. But this value is stored to the local variable whose type is unsigned short in bio_size_ok(). This can cause unexpected result when max_sectors > 0x. Cc: Chris Mason Cc: linux-bt...@vger.kernel.org Signed-off-by: Akinobu M

[PATCH] bio: fix argument of __bio_add_page() for max_sectors > 0xffff

2013-11-18 Thread Akinobu Mita
Axboe Cc: Alexander Viro Signed-off-by: Akinobu Mita --- fs/bio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/bio.c b/fs/bio.c index 2bdb4e2..33d79a4 100644 --- a/fs/bio.c +++ b/fs/bio.c @@ -601,7 +601,7 @@ EXPORT_SYMBOL(bio_get_nr_vecs); static int __bio_add_page

[PATCH] bio: fix argument of __bio_add_page() for max_sectors 0xffff

2013-11-18 Thread Akinobu Mita
Axboe ax...@kernel.dk Cc: Alexander Viro v...@zeniv.linux.org.uk Signed-off-by: Akinobu Mita akinobu.m...@gmail.com --- fs/bio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/bio.c b/fs/bio.c index 2bdb4e2..33d79a4 100644 --- a/fs/bio.c +++ b/fs/bio.c @@ -601,7 +601,7

[PATCH] btrfs: fix bio_size_ok() for max_sectors 0xffff

2013-11-18 Thread Akinobu Mita
Signed-off-by: Akinobu Mita akinobu.m...@gmail.com --- This patch is only compile tested. fs/btrfs/volumes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 0db6370..92303f4 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c

Re: [PATCH] bio: fix argument of __bio_add_page() for max_sectors 0xffff

2013-11-18 Thread Akinobu Mita
2013/11/19 Jens Axboe ax...@kernel.dk: On 11/18/2013 06:11 AM, Akinobu Mita wrote: The data type of max_sectors and max_hw_sectors in queue settings are unsigned int. But these values are passed to __bio_add_page() as an argument whose data type is unsigned short. In the worst case

Re: [PATCH] scsi: fix the build warning

2013-09-20 Thread Akinobu Mita
2013/9/20 Paul Bolle : > On Thu, 2013-08-22 at 23:49 +0900, Akinobu Mita wrote: >> 2013/8/22 James Bottomley : >> > On Thu, 2013-08-22 at 21:42 +0900, Akinobu Mita wrote: >> >> Unfortunately, this warning isn't fixed in linux-next, either. >> >> Paul B

Re: [PATCH] scsi: fix the build warning

2013-09-20 Thread Akinobu Mita
2013/9/20 Paul Bolle pebo...@tiscali.nl: On Thu, 2013-08-22 at 23:49 +0900, Akinobu Mita wrote: 2013/8/22 James Bottomley jbottom...@parallels.com: On Thu, 2013-08-22 at 21:42 +0900, Akinobu Mita wrote: Unfortunately, this warning isn't fixed in linux-next, either. Paul Bolle also sent

Re: [PATCH] scsi: fix the build warning

2013-08-22 Thread Akinobu Mita
2013/8/22 James Bottomley : > On Thu, 2013-08-22 at 21:42 +0900, Akinobu Mita wrote: >> 2013/8/22 Martin K. Petersen : >> >>>>>> "Joe" == Joe Perches writes: >> > >> > Joe> I don't get this build warning in the first place and

Re: [PATCH] scsi: fix the build warning

2013-08-22 Thread Akinobu Mita
2013/8/22 Martin K. Petersen : >> "Joe" == Joe Perches writes: > > Joe> I don't get this build warning in the first place and I think the > Joe> scsi_debug file is quite old and probably doesn't need to be > Joe> changed at all. > > guard isn't a boolean, it selects the checksum algorithm

Re: [PATCH] scsi: fix the build warning

2013-08-22 Thread Akinobu Mita
2013/8/22 Martin K. Petersen martin.peter...@oracle.com: Joe == Joe Perches j...@perches.com writes: Joe I don't get this build warning in the first place and I think the Joe scsi_debug file is quite old and probably doesn't need to be Joe changed at all. guard isn't a boolean, it selects

Re: [PATCH] scsi: fix the build warning

2013-08-22 Thread Akinobu Mita
2013/8/22 James Bottomley jbottom...@parallels.com: On Thu, 2013-08-22 at 21:42 +0900, Akinobu Mita wrote: 2013/8/22 Martin K. Petersen martin.peter...@oracle.com: Joe == Joe Perches j...@perches.com writes: Joe I don't get this build warning in the first place and I think the Joe

[PATCH] ia64: use asm-generic/bitops/builtin-ffs.h

2013-08-14 Thread Akinobu Mita
The definision of ffs() for ia64 is almost same as asm-generic/bitops/builtin-ffs.h. The only difference is that it is defined as inline function or macro function. So this switches to use the header. Signed-off-by: Akinobu Mita Cc: Tony Luck Cc: Fenghua Yu Cc: linux-i...@vger.kernel.org

[PATCH] tile: use asm-generic/bitops/builtin-*.h

2013-08-14 Thread Akinobu Mita
The definisions of __ffs(), __fls(), and ffs() for tile are almost same as asm-generic/bitops-*.h. The only difference is that it is defined as __always_inline or inline. So this switches to use those headers. Signed-off-by: Akinobu Mita Cc: Chris Metcalf --- arch/tile/include/asm/bitops.h

[PATCH] tile: use asm-generic/bitops/builtin-*.h

2013-08-14 Thread Akinobu Mita
The definisions of __ffs(), __fls(), and ffs() for tile are almost same as asm-generic/bitops-*.h. The only difference is that it is defined as __always_inline or inline. So this switches to use those headers. Signed-off-by: Akinobu Mita akinobu.m...@gmail.com Cc: Chris Metcalf cmetc

[PATCH] ia64: use asm-generic/bitops/builtin-ffs.h

2013-08-14 Thread Akinobu Mita
The definision of ffs() for ia64 is almost same as asm-generic/bitops/builtin-ffs.h. The only difference is that it is defined as inline function or macro function. So this switches to use the header. Signed-off-by: Akinobu Mita akinobu.m...@gmail.com Cc: Tony Luck tony.l...@intel.com Cc

[PATCH 2/2] cris: fix return type of ffs()

2013-08-07 Thread Akinobu Mita
("bits in OOB size: %u\n",ffs(ns->geom.oobsz) - 1); But removing this warning by casting to 'int' looks odd, so I suggest unifying the return type of ffs() on all architectures. Signed-off-by: Akinobu Mita Reported-by: Fengguang Wu Cc: Mikael Starvik Cc: Jesper Nilsson Cc: l

[PATCH 1/2] hexagon: fix return type of ffs()

2013-08-07 Thread Akinobu Mita
("bits in OOB size: %u\n",ffs(ns->geom.oobsz) - 1); But removing this warning by casting to 'int' looks odd, so I suggest unifying the return type of ffs() on all architectures. Signed-off-by: Akinobu Mita Reported-by: Fengguang Wu Cc: Mikael Starvik Cc: Jesper Nilsson Cc: l

[PATCH 1/2] hexagon: fix return type of ffs()

2013-08-07 Thread Akinobu Mita
(bits in OOB size: %u\n,ffs(ns-geom.oobsz) - 1); But removing this warning by casting to 'int' looks odd, so I suggest unifying the return type of ffs() on all architectures. Signed-off-by: Akinobu Mita akinobu.m...@gmail.com Reported-by: Fengguang Wu fengguang...@intel.com Cc: Mikael

[PATCH 2/2] cris: fix return type of ffs()

2013-08-07 Thread Akinobu Mita
(bits in OOB size: %u\n,ffs(ns-geom.oobsz) - 1); But removing this warning by casting to 'int' looks odd, so I suggest unifying the return type of ffs() on all architectures. Signed-off-by: Akinobu Mita akinobu.m...@gmail.com Reported-by: Fengguang Wu fengguang...@intel.com Cc: Mikael

Re: [PATCH v2] [SCSI] scsi_debug: silence GCC warning

2013-07-16 Thread Akinobu Mita
2013/7/17 Paul Bolle : > On Wed, 2013-07-17 at 00:21 +0900, Akinobu Mita wrote: >> This one looks good to me. > > Thanks. > >> It would be much better if this commit >> log had a reference to the commit that introduced this warning as >> you described afte

Re: [PATCH v2] [SCSI] scsi_debug: silence GCC warning

2013-07-16 Thread Akinobu Mita
2013/7/16 Paul Bolle : > Building scsi_debug.o triggers a GCC warning: > drivers/scsi/scsi_debug.c: In function ‘dif_verify’: > drivers/scsi/scsi_debug.c:1755:3: warning: ‘csum’ may be used > uninitialized in this function [-Wmaybe-uninitialized] > > This is a false positive. But if we

Re: [PATCH v2] [SCSI] scsi_debug: silence GCC warning

2013-07-16 Thread Akinobu Mita
2013/7/16 Paul Bolle pebo...@tiscali.nl: Building scsi_debug.o triggers a GCC warning: drivers/scsi/scsi_debug.c: In function ‘dif_verify’: drivers/scsi/scsi_debug.c:1755:3: warning: ‘csum’ may be used uninitialized in this function [-Wmaybe-uninitialized] This is a false positive.

Re: [PATCH v2] [SCSI] scsi_debug: silence GCC warning

2013-07-16 Thread Akinobu Mita
2013/7/17 Paul Bolle pebo...@tiscali.nl: On Wed, 2013-07-17 at 00:21 +0900, Akinobu Mita wrote: This one looks good to me. Thanks. It would be much better if this commit log had a reference to the commit that introduced this warning as you described after '---' in v1 patch. Do you mean

[PATCH v3 4/4] scsi_debug: fix do_device_access() with wrap around range

2013-06-23 Thread Akinobu Mita
ake care to decrease sdb->resid if fill_from_dev_buffer() is called more than once. Signed-off-by: Akinobu Mita Cc: "James E.J. Bottomley" Cc: Douglas Gilbert Cc: linux-s...@vger.kernel.org --- * No change from v2 drivers/scsi/scsi_debug.c | 48 ++

[PATCH v3 2/4] lib/scatterlist: introduce sg_pcopy_from_buffer() and sg_pcopy_to_buffer()

2013-06-23 Thread Akinobu Mita
The only difference between sg_pcopy_{from,to}_buffer() and sg_copy_{from,to}_buffer() is an additional argument that specifies the number of bytes to skip the SG list before copying. Signed-off-by: Akinobu Mita Cc: Tejun Heo Cc: Imre Deak Cc: Herbert Xu Cc: "David S. Miller" Cc:

[PATCH v3 1/4] lib/scatterlist: factor out sg_miter_get_next_page() from sg_miter_next()

2013-06-23 Thread Akinobu Mita
This function is used to proceed page iterator to the next page if necessary, and will be used to implement the variants of sg_copy_{from,to}_buffer() later. Signed-off-by: Akinobu Mita Acked-by: Tejun Heo Cc: Tejun Heo Cc: Imre Deak Cc: Herbert Xu Cc: "David S. Miller" Cc:

[PATCH v3 3/4] crypto: talitos: use sg_pcopy_to_buffer()

2013-06-23 Thread Akinobu Mita
Use sg_pcopy_to_buffer() which is better than the function previously used. Because it doesn't do kmap/kunmap for skipped pages. Signed-off-by: Akinobu Mita Cc: Herbert Xu Cc: Horia Geanta Cc: "David S. Miller" Cc: linux-cry...@vger.kernel.org --- * No change from v2 driv

[PATCH v3 0/4] introduce sg_pcopy_from_buffer() and sg_pcopy_to_buffer()

2013-06-23 Thread Akinobu Mita
- Simplify the assignment of sdb->resid in fill_from_dev_buffer() in scsi_debug Akinobu Mita (4): lib/scatterlist: factor out sg_miter_get_next_page() from sg_miter_next() lib/scatterlist: introduce sg_pcopy_from_buffer() and sg_pcopy_to_buffer() crypto: talitos: use sg_pcopy_to_buffer()

[PATCH v3 0/4] introduce sg_pcopy_from_buffer() and sg_pcopy_to_buffer()

2013-06-23 Thread Akinobu Mita
the assignment of sdb-resid in fill_from_dev_buffer() in scsi_debug Akinobu Mita (4): lib/scatterlist: factor out sg_miter_get_next_page() from sg_miter_next() lib/scatterlist: introduce sg_pcopy_from_buffer() and sg_pcopy_to_buffer() crypto: talitos: use sg_pcopy_to_buffer() scsi_debug: fix

[PATCH v3 1/4] lib/scatterlist: factor out sg_miter_get_next_page() from sg_miter_next()

2013-06-23 Thread Akinobu Mita
This function is used to proceed page iterator to the next page if necessary, and will be used to implement the variants of sg_copy_{from,to}_buffer() later. Signed-off-by: Akinobu Mita akinobu.m...@gmail.com Acked-by: Tejun Heo t...@kernel.org Cc: Tejun Heo t...@kernel.org Cc: Imre Deak imre.d

[PATCH v3 3/4] crypto: talitos: use sg_pcopy_to_buffer()

2013-06-23 Thread Akinobu Mita
Use sg_pcopy_to_buffer() which is better than the function previously used. Because it doesn't do kmap/kunmap for skipped pages. Signed-off-by: Akinobu Mita akinobu.m...@gmail.com Cc: Herbert Xu herb...@gondor.apana.org.au Cc: Horia Geanta horia.gea...@freescale.com Cc: David S. Miller da

[PATCH v3 4/4] scsi_debug: fix do_device_access() with wrap around range

2013-06-23 Thread Akinobu Mita
care to decrease sdb-resid if fill_from_dev_buffer() is called more than once. Signed-off-by: Akinobu Mita akinobu.m...@gmail.com Cc: James E.J. Bottomley jbottom...@parallels.com Cc: Douglas Gilbert dgilb...@interlog.com Cc: linux-s...@vger.kernel.org --- * No change from v2 drivers/scsi

[PATCH v3 2/4] lib/scatterlist: introduce sg_pcopy_from_buffer() and sg_pcopy_to_buffer()

2013-06-23 Thread Akinobu Mita
The only difference between sg_pcopy_{from,to}_buffer() and sg_copy_{from,to}_buffer() is an additional argument that specifies the number of bytes to skip the SG list before copying. Signed-off-by: Akinobu Mita akinobu.m...@gmail.com Cc: Tejun Heo t...@kernel.org Cc: Imre Deak imre.d

Re: [PATCH v2 2/4] lib/scatterlist: introduce sg_pcopy_from_buffer() and sg_pcopy_to_buffer()

2013-06-19 Thread Akinobu Mita
2013/6/18 Tejun Heo : > On Tue, Jun 18, 2013 at 10:31:32PM +0900, Akinobu Mita wrote: >> /** >> + * sg_miter_seek - reposition mapping iterator >> + * @miter: sg mapping iter to be seeked >> + * @offset: number of bytes to plus the current location >> + *

Re: [PATCH v2 2/4] lib/scatterlist: introduce sg_pcopy_from_buffer() and sg_pcopy_to_buffer()

2013-06-19 Thread Akinobu Mita
2013/6/18 Tejun Heo t...@kernel.org: On Tue, Jun 18, 2013 at 10:31:32PM +0900, Akinobu Mita wrote: /** + * sg_miter_seek - reposition mapping iterator + * @miter: sg mapping iter to be seeked + * @offset: number of bytes to plus the current location + * + * Description: + * Sets

[PATCH v2 2/4] lib/scatterlist: introduce sg_pcopy_from_buffer() and sg_pcopy_to_buffer()

2013-06-18 Thread Akinobu Mita
The only difference between sg_pcopy_{from,to}_buffer() and sg_copy_{from,to}_buffer() is an additional argument that specifies the number of bytes to skip the SG list before copying. Signed-off-by: Akinobu Mita Cc: Tejun Heo Cc: Imre Deak Cc: Herbert Xu Cc: "David S. Miller" Cc:

[PATCH v2 1/4] lib/scatterlist: factor out sg_miter_get_next_page() from sg_miter_next()

2013-06-18 Thread Akinobu Mita
This function is used to proceed page iterator to the next page if necessary, and will be used to implement the variants of sg_copy_{from,to}_buffer() later. Signed-off-by: Akinobu Mita Cc: Tejun Heo Cc: Imre Deak Cc: Herbert Xu Cc: "David S. Miller" Cc: linux-cry...@vger.ker

[PATCH v2 3/4] crypto: talitos: use sg_pcopy_to_buffer()

2013-06-18 Thread Akinobu Mita
Use sg_pcopy_to_buffer() which is better than the function previously used. Because it doesn't do kmap/kunmap for skipped pages. Signed-off-by: Akinobu Mita Cc: Herbert Xu Cc: Horia Geanta Cc: "David S. Miller" Cc: linux-cry...@vger.kernel.org --- * No change from v1 driv

[PATCH v2 4/4] scsi_debug: fix do_device_access() with wrap around range

2013-06-18 Thread Akinobu Mita
ake care to decrease sdb->resid if fill_from_dev_buffer() is called more than once. Signed-off-by: Akinobu Mita Cc: "James E.J. Bottomley" Cc: Douglas Gilbert Cc: linux-s...@vger.kernel.org --- * Change from v2 - Simplify the assignment of sdb->resid in fill_from_dev_buff

[PATCH v2 0/4] introduce sg_pcopy_from_buffer() and sg_pcopy_to_buffer()

2013-06-18 Thread Akinobu Mita
the patch "introduce sg_pcopy_from_buffer() and sg_pcopy_to_buffer()" - Add function comment for internal function sg_miter_seek() - Simplify the assignment of sdb->resid in fill_from_dev_buffer() in scsi_debug Akinobu Mita (4): lib/scatterlist: factor out sg_miter_get_nex

[PATCH v2 0/4] introduce sg_pcopy_from_buffer() and sg_pcopy_to_buffer()

2013-06-18 Thread Akinobu Mita
the patch introduce sg_pcopy_from_buffer() and sg_pcopy_to_buffer() - Add function comment for internal function sg_miter_seek() - Simplify the assignment of sdb-resid in fill_from_dev_buffer() in scsi_debug Akinobu Mita (4): lib/scatterlist: factor out sg_miter_get_next_page() from

[PATCH v2 4/4] scsi_debug: fix do_device_access() with wrap around range

2013-06-18 Thread Akinobu Mita
care to decrease sdb-resid if fill_from_dev_buffer() is called more than once. Signed-off-by: Akinobu Mita akinobu.m...@gmail.com Cc: James E.J. Bottomley jbottom...@parallels.com Cc: Douglas Gilbert dgilb...@interlog.com Cc: linux-s...@vger.kernel.org --- * Change from v2 - Simplify the assignment

[PATCH v2 3/4] crypto: talitos: use sg_pcopy_to_buffer()

2013-06-18 Thread Akinobu Mita
Use sg_pcopy_to_buffer() which is better than the function previously used. Because it doesn't do kmap/kunmap for skipped pages. Signed-off-by: Akinobu Mita akinobu.m...@gmail.com Cc: Herbert Xu herb...@gondor.apana.org.au Cc: Horia Geanta horia.gea...@freescale.com Cc: David S. Miller da

[PATCH v2 1/4] lib/scatterlist: factor out sg_miter_get_next_page() from sg_miter_next()

2013-06-18 Thread Akinobu Mita
This function is used to proceed page iterator to the next page if necessary, and will be used to implement the variants of sg_copy_{from,to}_buffer() later. Signed-off-by: Akinobu Mita akinobu.m...@gmail.com Cc: Tejun Heo t...@kernel.org Cc: Imre Deak imre.d...@intel.com Cc: Herbert Xu herb

[PATCH v2 2/4] lib/scatterlist: introduce sg_pcopy_from_buffer() and sg_pcopy_to_buffer()

2013-06-18 Thread Akinobu Mita
The only difference between sg_pcopy_{from,to}_buffer() and sg_copy_{from,to}_buffer() is an additional argument that specifies the number of bytes to skip the SG list before copying. Signed-off-by: Akinobu Mita akinobu.m...@gmail.com Cc: Tejun Heo t...@kernel.org Cc: Imre Deak imre.d

Re: [PATCH 1/3] lib/scatterlist: introduce sg_pcopy_from_buffer() and sg_pcopy_to_buffer()

2013-06-08 Thread Akinobu Mita
2013/6/7 Tejun Heo : > Hello, > > On Thu, Jun 06, 2013 at 09:52:56PM +0900, Akinobu Mita wrote: >> +static bool sg_miter_get_next_page(struct sg_mapping_iter *miter) >> +{ >> + if (!miter->__remaining) { >> + struct scatterlist *sg; >

Re: [PATCH 1/3] lib/scatterlist: introduce sg_pcopy_from_buffer() and sg_pcopy_to_buffer()

2013-06-08 Thread Akinobu Mita
2013/6/6 Imre Deak : > Looks ok to me, perhaps adding the seek functionality to the mapping > iterator would make things more generic and the mapping iterator more > resemble the page iterator. So we'd have a new sg_miter_start_offset and > call it here something like: > > sg_miter_start_offset(,

Re: [PATCH 1/3] lib/scatterlist: introduce sg_pcopy_from_buffer() and sg_pcopy_to_buffer()

2013-06-08 Thread Akinobu Mita
2013/6/6 Imre Deak imre.d...@intel.com: Looks ok to me, perhaps adding the seek functionality to the mapping iterator would make things more generic and the mapping iterator more resemble the page iterator. So we'd have a new sg_miter_start_offset and call it here something like:

Re: [PATCH 1/3] lib/scatterlist: introduce sg_pcopy_from_buffer() and sg_pcopy_to_buffer()

2013-06-08 Thread Akinobu Mita
2013/6/7 Tejun Heo t...@kernel.org: Hello, On Thu, Jun 06, 2013 at 09:52:56PM +0900, Akinobu Mita wrote: +static bool sg_miter_get_next_page(struct sg_mapping_iter *miter) +{ + if (!miter-__remaining) { + struct scatterlist *sg; + unsigned long pgoffset

[PATCH 2/3] crypto: talitos: use sg_pcopy_to_buffer()

2013-06-06 Thread Akinobu Mita
Use sg_pcopy_to_buffer() which is better than the function previously used. Because it doesn't do kmap/kunmap for skipped pages. Signed-off-by: Akinobu Mita Cc: Herbert Xu Cc: Horia Geanta Cc: "David S. Miller" Cc: linux-cry...@vger.kernel.org --- drivers/crypto/tali

[PATCH 3/3] scsi_debug: fix do_device_access() with wrap around range

2013-06-06 Thread Akinobu Mita
correctly. This fixes it by using sg_pcopy_{from,to}_buffer() that can copy from/to the middle of SG list. Signed-off-by: Akinobu Mita Cc: "James E.J. Bottomley" Cc: Douglas Gilbert Cc: linux-s...@vger.kernel.org --- drivers/scsi/scsi_debug.c | 43

[PATCH 0/3] introduce sg_pcopy_from_buffer() and sg_pcopy_to_buffer()

2013-06-06 Thread Akinobu Mita
list before copying. The main reason for introducing these functions is to fix a problem in scsi_debug module. And there is a local function in crypto/talitos module, which can be replaced by sg_pcopy_to_buffer(). Akinobu Mita (3): lib/scatterlist: introduce sg_pcopy_from_buffer

[PATCH 1/3] lib/scatterlist: introduce sg_pcopy_from_buffer() and sg_pcopy_to_buffer()

2013-06-06 Thread Akinobu Mita
The only difference between sg_pcopy_{from,to}_buffer() and sg_copy_{from,to}_buffer() is an additional argument that specifies the number of bytes to skip the SG list before copying. Signed-off-by: Akinobu Mita Cc: Tejun Heo Cc: Imre Deak Cc: Herbert Xu Cc: "David S. Miller" Cc:

[PATCH 1/3] lib/scatterlist: introduce sg_pcopy_from_buffer() and sg_pcopy_to_buffer()

2013-06-06 Thread Akinobu Mita
The only difference between sg_pcopy_{from,to}_buffer() and sg_copy_{from,to}_buffer() is an additional argument that specifies the number of bytes to skip the SG list before copying. Signed-off-by: Akinobu Mita akinobu.m...@gmail.com Cc: Tejun Heo t...@kernel.org Cc: Imre Deak imre.d

[PATCH 0/3] introduce sg_pcopy_from_buffer() and sg_pcopy_to_buffer()

2013-06-06 Thread Akinobu Mita
list before copying. The main reason for introducing these functions is to fix a problem in scsi_debug module. And there is a local function in crypto/talitos module, which can be replaced by sg_pcopy_to_buffer(). Akinobu Mita (3): lib/scatterlist: introduce sg_pcopy_from_buffer

[PATCH 3/3] scsi_debug: fix do_device_access() with wrap around range

2013-06-06 Thread Akinobu Mita
correctly. This fixes it by using sg_pcopy_{from,to}_buffer() that can copy from/to the middle of SG list. Signed-off-by: Akinobu Mita akinobu.m...@gmail.com Cc: James E.J. Bottomley jbottom...@parallels.com Cc: Douglas Gilbert dgilb...@interlog.com Cc: linux-s...@vger.kernel.org --- drivers/scsi

[PATCH 2/3] crypto: talitos: use sg_pcopy_to_buffer()

2013-06-06 Thread Akinobu Mita
Use sg_pcopy_to_buffer() which is better than the function previously used. Because it doesn't do kmap/kunmap for skipped pages. Signed-off-by: Akinobu Mita akinobu.m...@gmail.com Cc: Herbert Xu herb...@gondor.apana.org.au Cc: Horia Geanta horia.gea...@freescale.com Cc: David S. Miller da

[PATCH] frontswap: fix incorrect zeroing and allocation size for frontswap_map

2013-06-01 Thread Akinobu Mita
systems, the allocation size is smaller than requeired if the number of bits is not a multiple of BITS_PER_LONG. Signed-off-by: Akinobu Mita Cc: Konrad Rzeszutek Wilk --- mm/frontswap.c | 2 +- mm/swapfile.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/frontswap.c b/mm

[PATCH] frontswap: fix incorrect zeroing and allocation size for frontswap_map

2013-06-01 Thread Akinobu Mita
systems, the allocation size is smaller than requeired if the number of bits is not a multiple of BITS_PER_LONG. Signed-off-by: Akinobu Mita akinobu.m...@gmail.com Cc: Konrad Rzeszutek Wilk konrad.w...@oracle.com --- mm/frontswap.c | 2 +- mm/swapfile.c | 2 +- 2 files changed, 2 insertions(+), 2

[PATCH -mmotm resend] brcm80211: fix the misaligned indentation

2013-03-29 Thread Akinobu Mita
This fixes the misaligned indentation introduced by drivers-net-rename-random32-to-prandom_u32.patch in the -mm tree. This also remove unneeded parentheses in order not to cause line over 80 characters. Signed-off-by: Akinobu Mita Cc: "John W. Linville" Cc: "David S. Miller&quo

[PATCH] notifier-error-inject: fix module names in Kconfig

2013-03-29 Thread Akinobu Mita
The Kconfig help text for MEMORY_NOTIFIER_ERROR_INJECT and OF_RECONFIG_NOTIFIER_ERROR_INJECT has mismatched module names. Signed-off-by: Akinobu Mita --- lib/Kconfig.debug | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 28be08c

[PATCH] notifier-error-inject: fix module names in Kconfig

2013-03-29 Thread Akinobu Mita
The Kconfig help text for MEMORY_NOTIFIER_ERROR_INJECT and OF_RECONFIG_NOTIFIER_ERROR_INJECT has mismatched module names. Signed-off-by: Akinobu Mita akinobu.m...@gmail.com --- lib/Kconfig.debug | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Kconfig.debug b/lib

[PATCH -mmotm resend] brcm80211: fix the misaligned indentation

2013-03-29 Thread Akinobu Mita
This fixes the misaligned indentation introduced by drivers-net-rename-random32-to-prandom_u32.patch in the -mm tree. This also remove unneeded parentheses in order not to cause line over 80 characters. Signed-off-by: Akinobu Mita akinobu.m...@gmail.com Cc: John W. Linville linvi

Re: [PATCH -mmotm] scsi: fix the wrong position of the comment

2013-03-13 Thread Akinobu Mita
2013/3/12 : > On Sun, 10 Mar 2013 17:09:50 +0900, Akinobu Mita said: >> This fixes the wrong position of the comment introduced by >> scsi-rename-random32-to-prandom_u32.patch in the -mm tree. >> >> Signed-off-by: Akinobu Mita >> Cc: "James

Re: [PATCH -mmotm] scsi: fix the wrong position of the comment

2013-03-13 Thread Akinobu Mita
2013/3/12 valdis.kletni...@vt.edu: On Sun, 10 Mar 2013 17:09:50 +0900, Akinobu Mita said: This fixes the wrong position of the comment introduced by scsi-rename-random32-to-prandom_u32.patch in the -mm tree. Signed-off-by: Akinobu Mita akinobu.m...@gmail.com Cc: James E.J. Bottomley jbottom

[PATCH -mmotm] brcm80211: fix the misaligned indentation

2013-03-10 Thread Akinobu Mita
This fixes the misaligned indentation introduced by drivers-net-rename-random32-to-prandom_u32.patch in the -mm tree. This also remove unneeded parentheses in order not to cause line over 80 characters. Signed-off-by: Akinobu Mita Cc: "David S. Miller" Cc: Brett Rudley Cc: Arend

[PATCH -mmotm] scsi: fix the wrong position of the comment

2013-03-10 Thread Akinobu Mita
This fixes the wrong position of the comment introduced by scsi-rename-random32-to-prandom_u32.patch in the -mm tree. Signed-off-by: Akinobu Mita Cc: "James E.J. Bottomley" Cc: Andrew Vasquez --- drivers/scsi/qla2xxx/qla_attr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletion

[PATCH -mmotm] scsi: fix the wrong position of the comment

2013-03-10 Thread Akinobu Mita
This fixes the wrong position of the comment introduced by scsi-rename-random32-to-prandom_u32.patch in the -mm tree. Signed-off-by: Akinobu Mita akinobu.m...@gmail.com Cc: James E.J. Bottomley jbottom...@parallels.com Cc: Andrew Vasquez andrew.vasq...@qlogic.com --- drivers/scsi/qla2xxx

[PATCH -mmotm] brcm80211: fix the misaligned indentation

2013-03-10 Thread Akinobu Mita
This fixes the misaligned indentation introduced by drivers-net-rename-random32-to-prandom_u32.patch in the -mm tree. This also remove unneeded parentheses in order not to cause line over 80 characters. Signed-off-by: Akinobu Mita akinobu.m...@gmail.com Cc: David S. Miller da...@davemloft.net Cc

[PATCH resend] gfs2: use memchr_inv

2013-03-07 Thread Akinobu Mita
Use memchr_inv to verify that the specified memory range is cleared. Signed-off-by: Akinobu Mita Cc: Steven Whitehouse Cc: cluster-de...@redhat.com Cc: Christine Caulfield Cc: David Teigland --- fs/gfs2/lock_dlm.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/fs

Re: [PATCH -v2] gfs2: fix bitmap declaration

2013-03-07 Thread Akinobu Mita
2013/3/7 Steven Whitehouse : > Hi, > > This doesn't apply over the patch which Dave just sent. Can you redo > this against the current GFS2 -nmw tree if it is still required? Thanks, I checked Dave's patch. It fixes the same issue that I was trying to fix. So this -v2 patch is not needed

Re: [PATCH -v2] gfs2: fix bitmap declaration

2013-03-07 Thread Akinobu Mita
2013/3/7 Steven Whitehouse swhit...@redhat.com: Hi, This doesn't apply over the patch which Dave just sent. Can you redo this against the current GFS2 -nmw tree if it is still required? Thanks, I checked Dave's patch. It fixes the same issue that I was trying to fix. So this -v2 patch is not

[PATCH resend] gfs2: use memchr_inv

2013-03-07 Thread Akinobu Mita
Use memchr_inv to verify that the specified memory range is cleared. Signed-off-by: Akinobu Mita akinobu.m...@gmail.com Cc: Steven Whitehouse swhit...@redhat.com Cc: cluster-de...@redhat.com Cc: Christine Caulfield ccaul...@redhat.com Cc: David Teigland teigl...@redhat.com --- fs/gfs2/lock_dlm.c

[PATCH -v2] gfs2: fix bitmap declaration

2013-03-06 Thread Akinobu Mita
MAP_OFFSET from bytes to bits in order to reduce the conversion of the unit. Signed-off-by: Akinobu Mita Cc: Steven Whitehouse Cc: cluster-de...@redhat.com Cc: Christine Caulfield Cc: David Teigland --- * Change from v1 - fix wrong offsets caused by the change of type of the 'lvb_bits' (detected

<    1   2   3   4   5   6   7   8   9   10   >