<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/lib/scatterlist.c, branch v3.16</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v3.16</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v3.16'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2013-12-09T01:56:37Z</updated>
<entry>
<title>lib/scatterlist: export sg_miter_skip()</title>
<updated>2013-12-09T01:56:37Z</updated>
<author>
<name>Ming Lei</name>
<email>ming.lei@canonical.com</email>
</author>
<published>2013-11-26T04:43:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0d6077f8b48ed2dce8f2466a76c0d574a3b4dbe9'/>
<id>urn:sha1:0d6077f8b48ed2dce8f2466a76c0d574a3b4dbe9</id>
<content type='text'>
sg_copy_buffer() can't meet demand for some drrivers(such usb
mass storage), so we have to use the sg_miter_* APIs to access
sg buffer, then need export sg_miter_skip() for these drivers.

The API is needed for converting to sg_miter_* APIs in USB storage
driver for accessing sg buffer.

Acked-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: FUJITA Tomonori &lt;fujita.tomonori@lab.ntt.co.jp&gt;
Cc: Jens Axboe &lt;axboe@kernel.dk&gt;
Signed-off-by: Ming Lei &lt;ming.lei@canonical.com&gt;
Reviewed-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>lib/scatterlist.c: don't flush_kernel_dcache_page on slab page</title>
<updated>2013-10-31T23:58:13Z</updated>
<author>
<name>Ming Lei</name>
<email>ming.lei@canonical.com</email>
</author>
<published>2013-10-31T23:34:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3d77b50c5874b7e923be946ba793644f82336b75'/>
<id>urn:sha1:3d77b50c5874b7e923be946ba793644f82336b75</id>
<content type='text'>
Commit b1adaf65ba03 ("[SCSI] block: add sg buffer copy helper
functions") introduces two sg buffer copy helpers, and calls
flush_kernel_dcache_page() on pages in SG list after these pages are
written to.

Unfortunately, the commit may introduce a potential bug:

 - Before sending some SCSI commands, kmalloc() buffer may be passed to
   block layper, so flush_kernel_dcache_page() can see a slab page
   finally

 - According to cachetlb.txt, flush_kernel_dcache_page() is only called
   on "a user page", which surely can't be a slab page.

 - ARCH's implementation of flush_kernel_dcache_page() may use page
   mapping information to do optimization so page_mapping() will see the
   slab page, then VM_BUG_ON() is triggered.

Aaro Koskinen reported the bug on ARM/kirkwood when DEBUG_VM is enabled,
and this patch fixes the bug by adding test of '!PageSlab(miter-&gt;page)'
before calling flush_kernel_dcache_page().

Signed-off-by: Ming Lei &lt;ming.lei@canonical.com&gt;
Reported-by: Aaro Koskinen &lt;aaro.koskinen@iki.fi&gt;
Tested-by: Simon Baatz &lt;gmbnomis@gmail.com&gt;
Cc: Russell King - ARM Linux &lt;linux@arm.linux.org.uk&gt;
Cc: Will Deacon &lt;will.deacon@arm.com&gt;
Cc: Aaro Koskinen &lt;aaro.koskinen@iki.fi&gt;
Acked-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Cc: FUJITA Tomonori &lt;fujita.tomonori@lab.ntt.co.jp&gt;
Cc: Tejun Heo &lt;tj@kernel.org&gt;
Cc: "James E.J. Bottomley" &lt;JBottomley@parallels.com&gt;
Cc: Jens Axboe &lt;axboe@kernel.dk&gt;
Cc: &lt;stable@vger.kernel.org&gt;	[3.2+]
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lib/scatterlist: error handling in __sg_alloc_table()</title>
<updated>2013-07-09T17:33:31Z</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2013-07-08T23:01:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=27daabd9b6a157c34a6e7a7f509fa26866e6420f'/>
<id>urn:sha1:27daabd9b6a157c34a6e7a7f509fa26866e6420f</id>
<content type='text'>
I was reviewing code which I suspected might allocate a zero size SG
table.  That will cause memory corruption.  Also we can't return before
doing the memset or we could end up using uninitialized memory in the
cleanup path.

Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Cc: Akinobu Mita &lt;akinobu.mita@gmail.com&gt;
Cc: Imre Deak &lt;imre.deak@intel.com&gt;
Cc: Tejun Heo &lt;tj@kernel.org&gt;
Cc: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Cc: Maxim Levitsky &lt;maximlevitsky@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lib/scatterlist: introduce sg_pcopy_from_buffer() and sg_pcopy_to_buffer()</title>
<updated>2013-07-09T17:33:30Z</updated>
<author>
<name>Akinobu Mita</name>
<email>akinobu.mita@gmail.com</email>
</author>
<published>2013-07-08T23:01:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=df642cea25c90dc7d5dcd9d3b480b6b59de7d787'/>
<id>urn:sha1:df642cea25c90dc7d5dcd9d3b480b6b59de7d787</id>
<content type='text'>
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 &lt;akinobu.mita@gmail.com&gt;
Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
Cc: "James E.J. Bottomley" &lt;JBottomley@parallels.com&gt;
Cc: Douglas Gilbert &lt;dgilbert@interlog.com&gt;
Cc: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Cc: Horia Geanta &lt;horia.geanta@freescale.com&gt;
Cc: Imre Deak &lt;imre.deak@intel.com&gt;
Acked-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lib/scatterlist: factor out sg_miter_get_next_page() from sg_miter_next()</title>
<updated>2013-07-09T17:33:30Z</updated>
<author>
<name>Akinobu Mita</name>
<email>akinobu.mita@gmail.com</email>
</author>
<published>2013-07-08T23:01:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1105200480b4faeb673d1b23658650b003302c06'/>
<id>urn:sha1:1105200480b4faeb673d1b23658650b003302c06</id>
<content type='text'>
This patchset introduces sg_pcopy_from_buffer() and sg_pcopy_to_buffer(),
which copy data between a linear buffer and an SG list.

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.

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().

This patch:

sg_miter_get_next_page() 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 &lt;akinobu.mita@gmail.com&gt;
Acked-by: Tejun Heo &lt;tj@kernel.org&gt;
Cc: Tejun Heo &lt;tj@kernel.org&gt;
Cc: Imre Deak &lt;imre.deak@intel.com&gt;
Cc: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
Cc: "James E.J. Bottomley" &lt;JBottomley@parallels.com&gt;
Cc: Douglas Gilbert &lt;dgilbert@interlog.com&gt;
Cc: Horia Geanta &lt;horia.geanta@freescale.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lib/scatterlist: sg_page_iter: support sg lists w/o backing pages</title>
<updated>2013-03-27T16:13:44Z</updated>
<author>
<name>Imre Deak</name>
<email>imre.deak@intel.com</email>
</author>
<published>2013-03-26T13:14:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2db76d7c3c6db93058f983c8240f7c7c25e87ee6'/>
<id>urn:sha1:2db76d7c3c6db93058f983c8240f7c7c25e87ee6</id>
<content type='text'>
The i915 driver uses sg lists for memory without backing 'struct page'
pages, similarly to other IO memory regions, setting only the DMA
address for these. It does this, so that it can program the HW MMU
tables in a uniform way both for sg lists with and without backing pages.

Without a valid page pointer we can't call nth_page to get the current
page in __sg_page_iter_next, so add a helper that relevant users can
call separately. Also add a helper to get the DMA address of the current
page (idea from Daniel).

Convert all places in i915, to use the new API.

Signed-off-by: Imre Deak &lt;imre.deak@intel.com&gt;
Reviewed-by: Damien Lespiau &lt;damien.lespiau@intel.com&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
</content>
</entry>
<entry>
<title>lib/scatterlist: use page iterator in the mapping iterator</title>
<updated>2013-02-28T03:10:10Z</updated>
<author>
<name>Imre Deak</name>
<email>imre.deak@intel.com</email>
</author>
<published>2013-02-28T01:02:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4225fc8555a992c7f91d174ef424384d6781e144'/>
<id>urn:sha1:4225fc8555a992c7f91d174ef424384d6781e144</id>
<content type='text'>
For better code reuse use the newly added page iterator to iterate
through the pages.  The offset, length within the page is still
calculated by the mapping iterator as well as the actual mapping.  Idea
from Tejun Heo.

Signed-off-by: Imre Deak &lt;imre.deak@intel.com&gt;
Cc: Maxim Levitsky &lt;maximlevitsky@gmail.com&gt;
Cc: Tejun Heo &lt;tj@kernel.org&gt;
Cc: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Cc: James Hogan &lt;james.hogan@imgtec.com&gt;
Cc: Stephen Warren &lt;swarren@wwwdotorg.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lib/scatterlist: add simple page iterator</title>
<updated>2013-02-28T03:10:10Z</updated>
<author>
<name>Imre Deak</name>
<email>imre.deak@intel.com</email>
</author>
<published>2013-02-28T01:02:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a321e91b6d73ed011ffceed384c40d2785cf723b'/>
<id>urn:sha1:a321e91b6d73ed011ffceed384c40d2785cf723b</id>
<content type='text'>
Add an iterator to walk through a scatter list a page at a time starting
at a specific page offset.  As opposed to the mapping iterator this is
meant to be small, performing well even in simple loops like collecting
all pages on the scatterlist into an array or setting up an iommu table
based on the pages' DMA address.

Signed-off-by: Imre Deak &lt;imre.deak@intel.com&gt;
Cc: Maxim Levitsky &lt;maximlevitsky@gmail.com&gt;
Cc: Tejun Heo &lt;tj@kernel.org&gt;
Cc: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Tested-by: Stephen Warren &lt;swarren@wwwdotorg.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>scatterlist: don't BUG when we can trivially return a proper error.</title>
<updated>2012-12-18T01:15:28Z</updated>
<author>
<name>Nick Bowler</name>
<email>nbowler@elliptictech.com</email>
</author>
<published>2012-12-18T00:05:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6fd59a83b9261fa53eaf98fb5514abba504a3ea3'/>
<id>urn:sha1:6fd59a83b9261fa53eaf98fb5514abba504a3ea3</id>
<content type='text'>
There is absolutely no reason to crash the kernel when we have a
perfectly good return value already available to use for conveying
failure status.

Let's return an error code instead of crashing the kernel: that sounds
like a much better plan.

[akpm@linux-foundation.org: s/E2BIG/EINVAL/]
Signed-off-by: Nick Bowler &lt;nbowler@elliptictech.com&gt;
Cc: Maxim Levitsky &lt;maximlevitsky@gmail.com&gt;
Cc: Tejun Heo &lt;tj@kernel.org&gt;
Cc: Jens Axboe &lt;axboe@kernel.dk&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Merge branch 'for-3.7/core' of git://git.kernel.dk/linux-block</title>
<updated>2012-10-11T00:04:23Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2012-10-11T00:04:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ce40be7a820bb393ac4ac69865f018d2f4038cf0'/>
<id>urn:sha1:ce40be7a820bb393ac4ac69865f018d2f4038cf0</id>
<content type='text'>
Pull block IO update from Jens Axboe:
 "Core block IO bits for 3.7.  Not a huge round this time, it contains:

   - First series from Kent cleaning up and generalizing bio allocation
     and freeing.

   - WRITE_SAME support from Martin.

   - Mikulas patches to prevent O_DIRECT crashes when someone changes
     the block size of a device.

   - Make bio_split() work on data-less bio's (like trim/discards).

   - A few other minor fixups."

Fixed up silent semantic mis-merge as per Mikulas Patocka and Andrew
Morton.  It is due to the VM no longer using a prio-tree (see commit
6b2dbba8b6ac: "mm: replace vma prio_tree with an interval tree").

So make set_blocksize() use mapping_mapped() instead of open-coding the
internal VM knowledge that has changed.

* 'for-3.7/core' of git://git.kernel.dk/linux-block: (26 commits)
  block: makes bio_split support bio without data
  scatterlist: refactor the sg_nents
  scatterlist: add sg_nents
  fs: fix include/percpu-rwsem.h export error
  percpu-rw-semaphore: fix documentation typos
  fs/block_dev.c:1644:5: sparse: symbol 'blkdev_mmap' was not declared
  blockdev: turn a rw semaphore into a percpu rw semaphore
  Fix a crash when block device is read and block size is changed at the same time
  block: fix request_queue-&gt;flags initialization
  block: lift the initial queue bypass mode on blk_register_queue() instead of blk_init_allocated_queue()
  block: ioctl to zero block ranges
  block: Make blkdev_issue_zeroout use WRITE SAME
  block: Implement support for WRITE SAME
  block: Consolidate command flag and queue limit checks for merges
  block: Clean up special command handling logic
  block/blk-tag.c: Remove useless kfree
  block: remove the duplicated setting for congestion_threshold
  block: reject invalid queue attribute values
  block: Add bio_clone_bioset(), bio_clone_kmalloc()
  block: Consolidate bio_alloc_bioset(), bio_kmalloc()
  ...
</content>
</entry>
</feed>
