<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/lib/scatterlist.c, branch v4.12.12</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v4.12.12</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v4.12.12'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2017-02-28T02:43:46+00:00</updated>
<entry>
<title>scatterlist: do not disable IRQs in sg_copy_buffer</title>
<updated>2017-02-28T02:43:46+00:00</updated>
<author>
<name>Gilad Ben-Yossef</name>
<email>gilad@benyossef.com</email>
</author>
<published>2017-02-27T22:28:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d31712009709774506e536a3cc1f7c512f550a0c'/>
<id>urn:sha1:d31712009709774506e536a3cc1f7c512f550a0c</id>
<content type='text'>
Commit 50bed2e2862a ("sg: disable interrupts inside sg_copy_buffer")
introduced disabling interrupts in sg_copy_buffer() since atomic uses of
miter required it due to use of kmap_atomic().

However, as commit 8290e2d2dcbf ("scatterlist: atomic sg_mapping_iter()
no longer needs disabled IRQs") acknowledges disabling interrupts is no
longer needed for calls to kmap_atomic() and therefore unneeded for
miter ops either, so remove it from sg_copy_buffer().

Link: http://lkml.kernel.org/r/1486040150-14109-3-git-send-email-gilad@benyossef.com
Signed-off-by: Gilad Ben-Yossef &lt;gilad@benyossef.com&gt;
Cc: Jens Axboe &lt;axboe@kernel.dk&gt;
Cc: &lt;ofir.drang@arm.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>scatterlist: reorder compound boolean expression</title>
<updated>2017-02-28T02:43:46+00:00</updated>
<author>
<name>Gilad Ben-Yossef</name>
<email>gilad@benyossef.com</email>
</author>
<published>2017-02-27T22:28:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1d5210ef706523529d3cc16fd70be0a466253466'/>
<id>urn:sha1:1d5210ef706523529d3cc16fd70be0a466253466</id>
<content type='text'>
Test the cheaper boolean expression with no side effects first.

Link: http://lkml.kernel.org/r/1486040150-14109-2-git-send-email-gilad@benyossef.com
Signed-off-by: Gilad Ben-Yossef &lt;gilad@benyossef.com&gt;
Cc: Jens Axboe &lt;axboe@kernel.dk&gt;
Cc: &lt;ofir.drang@arm.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>scatterlist: fix a typo in comment block of sg_miter_stop()</title>
<updated>2016-02-08T18:15:17+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>yamada.masahiro@socionext.com</email>
</author>
<published>2016-02-08T07:09:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4ba6a2b28f111e4c9621487612056d10f3f4a6ca'/>
<id>urn:sha1:4ba6a2b28f111e4c9621487612056d10f3f4a6ca</id>
<content type='text'>
Fix the doubled "started" and tidy up the following sentences.

Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>scatterlist: allow limited chaining without ARCH_HAS_SG_CHAIN</title>
<updated>2015-08-17T14:12:51+00:00</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2015-08-07T16:15:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=10c95ed9aa2970e05fedb4ac8b3ce1b934dab17b'/>
<id>urn:sha1:10c95ed9aa2970e05fedb4ac8b3ce1b934dab17b</id>
<content type='text'>
There are a couple of uses of struct scatterlist that never go to
the dma_map_sg() helper and thus don't care about ARCH_HAS_SG_CHAIN
which indicates that we can map chained S/G list.

The most important one is the crypto code, which currently has
to open code a few helpers to always allow chaining.  This patch
removes a few #ifdef ARCH_HAS_SG_CHAIN statements so that we can
switch the crypto code to these common helpers.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
</entry>
<entry>
<title>drivers/scsi/scsi_debug.c: resolve sg buffer const-ness issue</title>
<updated>2015-07-01T02:44:59+00:00</updated>
<author>
<name>Dave Gordon</name>
<email>david.s.gordon@intel.com</email>
</author>
<published>2015-06-30T21:58:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=386ecb1216f9e38947ce6a2af22e5e1e47256a97'/>
<id>urn:sha1:386ecb1216f9e38947ce6a2af22e5e1e47256a97</id>
<content type='text'>
do_device_access() takes a separate parameter to indicate the direction of
data transfer, which it used to use to select the appropriate function out
of sg_pcopy_{to,from}_buffer().  However these two functions now have

So this patch makes it bypass these wrappers and call the underlying
function sg_copy_buffer() directly; this has the same calling style as
do_device_access() i.e.  a separate direction-of-transfer parameter and no
pointers-to-const, so skipping the wrappers not only eliminates the
warning, it also make the code simpler :)

[akpm@linux-foundation.org: fix very broken build]
Signed-off-by: Dave Gordon &lt;david.s.gordon@intel.com&gt;
Acked-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: James Bottomley &lt;James.Bottomley@HansenPartnership.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: mark input buffer parameters as 'const'</title>
<updated>2015-07-01T02:44:59+00:00</updated>
<author>
<name>Dave Gordon</name>
<email>david.s.gordon@intel.com</email>
</author>
<published>2015-06-30T21:58:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2a1bf8f93b33992bb0457512b28d046e279bbd7e'/>
<id>urn:sha1:2a1bf8f93b33992bb0457512b28d046e279bbd7e</id>
<content type='text'>
The 'buf' parameter of sg(p)copy_from_buffer() can and should be
const-qualified, although because of the shared implementation of
_to_buffer() and _from_buffer(), we have to cast this away internally.

This means that callers who have a 'const' buffer containing the data to
be copied to the sg-list no longer have to cast away the const-ness
themselves.  It also enables improved coverage by code analysis tools.

Signed-off-by: Dave Gordon &lt;david.s.gordon@intel.com&gt;
Cc: Akinobu Mita &lt;akinobu.mita@gmail.com&gt;
Cc: "Martin K. Petersen" &lt;martin.petersen@oracle.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.c: fix kerneldoc for sg_pcopy_{to,from}_buffer()</title>
<updated>2015-07-01T02:44:59+00:00</updated>
<author>
<name>Dave Gordon</name>
<email>david.s.gordon@intel.com</email>
</author>
<published>2015-06-30T21:58:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4dc7daf843f3914c9c0c7efb71b8f251c9c4636f'/>
<id>urn:sha1:4dc7daf843f3914c9c0c7efb71b8f251c9c4636f</id>
<content type='text'>
The kerneldoc for the functions doesn't match the code; the last two
parameters (buflen, skip) have been transposed, which is confusing,
especially as they're both integral types and the compiler won't warn
about swapping them.

These functions and the kerneldoc were introduced in commit:
    df642cea lib/scatterlist: introduce sg_pcopy_from_buffer() ...
    Author: Akinobu Mita &lt;akinobu.mita@gmail.com&gt;
    Date:   Mon Jul 8 16:01:54 2013 -0700

    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 functions have the extra argument at the end, but the kerneldoc
lists it in penultimate position.

Signed-off-by: Dave Gordon &lt;david.s.gordon@intel.com&gt;
Reviewed-by: Akinobu Mita &lt;akinobu.mita@gmail.com&gt;
Cc: "Martin K. Petersen" &lt;martin.petersen@oracle.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>scatterlist: introduce sg_nents_for_len</title>
<updated>2015-06-03T02:51:27+00:00</updated>
<author>
<name>Tom Lendacky</name>
<email>thomas.lendacky@amd.com</email>
</author>
<published>2015-06-01T16:15:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=cfaed10d1f27d036b72bbdc6b1e59ea28c38ec7f'/>
<id>urn:sha1:cfaed10d1f27d036b72bbdc6b1e59ea28c38ec7f</id>
<content type='text'>
When performing a dma_map_sg() call, the number of sg entries to map is
required. Using sg_nents to retrieve the number of sg entries will
return the total number of entries in the sg list up to the entry marked
as the end. If there happen to be unused entries in the list, these will
still be counted. Some dma_map_sg() implementations will not handle the
unused entries correctly (lib/swiotlb.c) and execute a BUG_ON.

The sg_nents_for_len() function will traverse the sg list and return the
number of entries required to satisfy the supplied length argument. This
can then be supplied to the dma_map_sg() call to successfully map the
sg.

Signed-off-by: Tom Lendacky &lt;thomas.lendacky@amd.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>lib/scatterlist: fix memory leak with scsi-mq</title>
<updated>2014-10-28T16:27:10+00:00</updated>
<author>
<name>Tony Battersby</name>
<email>tonyb@cybernetics.com</email>
</author>
<published>2014-10-23T19:10:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c21e59d8dc04b2107bdb4ff0f412a9b7ae3349f3'/>
<id>urn:sha1:c21e59d8dc04b2107bdb4ff0f412a9b7ae3349f3</id>
<content type='text'>
Fix a memory leak with scsi-mq triggered by commands with large data
transfer length.

Fixes: c53c6d6a68b1 ("scatterlist: allow chaining to preallocated chunks")
Cc: &lt;stable@vger.kernel.org&gt; # 3.17.x
Signed-off-by: Tony Battersby &lt;tonyb@cybernetics.com&gt;
Reviewed-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
</entry>
<entry>
<title>lib/scatterlist: make ARCH_HAS_SG_CHAIN an actual Kconfig</title>
<updated>2014-08-08T22:57:26+00:00</updated>
<author>
<name>Laura Abbott</name>
<email>lauraa@codeaurora.org</email>
</author>
<published>2014-08-08T21:23:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=308c09f17da4adc53935115dbeb5bce4f067d8f9'/>
<id>urn:sha1:308c09f17da4adc53935115dbeb5bce4f067d8f9</id>
<content type='text'>
Rather than have architectures #define ARCH_HAS_SG_CHAIN in an
architecture specific scatterlist.h, make it a proper Kconfig option and
use that instead.  At same time, remove the header files are are now
mostly useless and just include asm-generic/scatterlist.h.

[sfr@canb.auug.org.au: powerpc files now need asm/dma.h]
Signed-off-by: Laura Abbott &lt;lauraa@codeaurora.org&gt;
Acked-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;			[x86]
Acked-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;	[powerpc]
Acked-by: Heiko Carstens &lt;heiko.carstens@de.ibm.com&gt;
Cc: Russell King &lt;linux@arm.linux.org.uk&gt;
Cc: Tony Luck &lt;tony.luck@intel.com&gt;
Cc: Fenghua Yu &lt;fenghua.yu@intel.com&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: "H. Peter Anvin" &lt;hpa@zytor.com&gt;
Cc: "James E.J. Bottomley" &lt;JBottomley@parallels.com&gt;
Cc: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
Signed-off-by: Stephen Rothwell &lt;sfr@canb.auug.org.au&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>
</feed>
