<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/ide/ide-floppy_ioctl.c, branch v3.1.8</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>block: autoconvert trivial BKL users to private mutex</title>
<updated>2010-10-05T13:01:10+00:00</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2010-06-02T12:28:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2a48fc0ab24241755dc93bfd4f01d68efab47f5a'/>
<id>2a48fc0ab24241755dc93bfd4f01d68efab47f5a</id>
<content type='text'>
The block device drivers have all gained new lock_kernel
calls from a recent pushdown, and some of the drivers
were already using the BKL before.

This turns the BKL into a set of per-driver mutexes.
Still need to check whether this is safe to do.

file=$1
name=$2
if grep -q lock_kernel ${file} ; then
    if grep -q 'include.*linux.mutex.h' ${file} ; then
            sed -i '/include.*&lt;linux\/smp_lock.h&gt;/d' ${file}
    else
            sed -i 's/include.*&lt;linux\/smp_lock.h&gt;.*$/include &lt;linux\/mutex.h&gt;/g' ${file}
    fi
    sed -i ${file} \
        -e "/^#include.*linux.mutex.h/,$ {
                1,/^\(static\|int\|long\)/ {
                     /^\(static\|int\|long\)/istatic DEFINE_MUTEX(${name}_mutex);

} }"  \
    -e "s/\(un\)*lock_kernel\&gt;[ ]*()/mutex_\1lock(\&amp;${name}_mutex)/g" \
    -e '/[      ]*cycle_kernel_lock();/d'
else
    sed -i -e '/include.*\&lt;smp_lock.h\&gt;/d' ${file}  \
                -e '/cycle_kernel_lock()/d'
fi

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The block device drivers have all gained new lock_kernel
calls from a recent pushdown, and some of the drivers
were already using the BKL before.

This turns the BKL into a set of per-driver mutexes.
Still need to check whether this is safe to do.

file=$1
name=$2
if grep -q lock_kernel ${file} ; then
    if grep -q 'include.*linux.mutex.h' ${file} ; then
            sed -i '/include.*&lt;linux\/smp_lock.h&gt;/d' ${file}
    else
            sed -i 's/include.*&lt;linux\/smp_lock.h&gt;.*$/include &lt;linux\/mutex.h&gt;/g' ${file}
    fi
    sed -i ${file} \
        -e "/^#include.*linux.mutex.h/,$ {
                1,/^\(static\|int\|long\)/ {
                     /^\(static\|int\|long\)/istatic DEFINE_MUTEX(${name}_mutex);

} }"  \
    -e "s/\(un\)*lock_kernel\&gt;[ ]*()/mutex_\1lock(\&amp;${name}_mutex)/g" \
    -e '/[      ]*cycle_kernel_lock();/d'
else
    sed -i -e '/include.*\&lt;smp_lock.h\&gt;/d' ${file}  \
                -e '/cycle_kernel_lock()/d'
fi

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>block: push down BKL into .locked_ioctl</title>
<updated>2010-08-07T16:25:00+00:00</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2010-07-08T08:18:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=8a6cfeb6deca3a8fefd639d898b0d163c0b5d368'/>
<id>8a6cfeb6deca3a8fefd639d898b0d163c0b5d368</id>
<content type='text'>
As a preparation for the removal of the big kernel
lock in the block layer, this removes the BKL
from the common ioctl handling code, moving it
into every single driver still using it.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Acked-by: Christoph Hellwig &lt;hch@infradead.org&gt;
Signed-off-by: Jens Axboe &lt;jaxboe@fusionio.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As a preparation for the removal of the big kernel
lock in the block layer, this removes the BKL
from the common ioctl handling code, moving it
into every single driver still using it.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Acked-by: Christoph Hellwig &lt;hch@infradead.org&gt;
Signed-off-by: Jens Axboe &lt;jaxboe@fusionio.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ide-atapi: remove pc-&gt;buf</title>
<updated>2009-05-15T04:44:38+00:00</updated>
<author>
<name>Borislav Petkov</name>
<email>petkovbb@gmail.com</email>
</author>
<published>2009-05-04T07:53:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=19f52a784f7ecb5b51cd73cc4514614b600b995a'/>
<id>19f52a784f7ecb5b51cd73cc4514614b600b995a</id>
<content type='text'>
Now after all users of pc-&gt;buf have been converted, remove the 64B buffer
embedded in each packet command.

There should be no functional change resulting from this patch.

Signed-off-by: Borislav Petkov &lt;petkovbb@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now after all users of pc-&gt;buf have been converted, remove the 64B buffer
embedded in each packet command.

There should be no functional change resulting from this patch.

Signed-off-by: Borislav Petkov &lt;petkovbb@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ide-floppy/ide_floppy_get_format_progress: use local sense buffer</title>
<updated>2009-05-15T04:44:28+00:00</updated>
<author>
<name>Borislav Petkov</name>
<email>petkovbb@gmail.com</email>
</author>
<published>2009-05-12T06:59:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=60cfab85da965035c7baf66a63f048155bb302b1'/>
<id>60cfab85da965035c7baf66a63f048155bb302b1</id>
<content type='text'>
There should be no functional change resulting from this patch.

Signed-off-by: Borislav Petkov &lt;petkovbb@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There should be no functional change resulting from this patch.

Signed-off-by: Borislav Petkov &lt;petkovbb@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ide-floppy/ide_floppy_format_unit: use local buffer</title>
<updated>2009-05-15T04:44:20+00:00</updated>
<author>
<name>Borislav Petkov</name>
<email>petkovbb@gmail.com</email>
</author>
<published>2009-05-02T08:53:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5122e5174f872c9f3120c8aff71c448f84b6f038'/>
<id>5122e5174f872c9f3120c8aff71c448f84b6f038</id>
<content type='text'>
Pass the buffer into ide_floppy_create_format_unit_cmd instead of using
pc-&gt;buf.

There should be no functional change resulting from this patch.

Signed-off-by: Borislav Petkov &lt;petkovbb@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pass the buffer into ide_floppy_create_format_unit_cmd instead of using
pc-&gt;buf.

There should be no functional change resulting from this patch.

Signed-off-by: Borislav Petkov &lt;petkovbb@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ide-floppy/ide_floppy_get_sfrp_bit: use local buffer</title>
<updated>2009-05-15T04:44:17+00:00</updated>
<author>
<name>Borislav Petkov</name>
<email>petkovbb@gmail.com</email>
</author>
<published>2009-05-02T08:45:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=802e663427b16c77368a4fb2f77c105fbfffd68c'/>
<id>802e663427b16c77368a4fb2f77c105fbfffd68c</id>
<content type='text'>
There should be no functional change resulting from this patch.

Signed-off-by: Borislav Petkov &lt;petkovbb@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There should be no functional change resulting from this patch.

Signed-off-by: Borislav Petkov &lt;petkovbb@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ide-atapi: add a buffer-arg to ide_queue_pc_tail</title>
<updated>2009-05-15T04:44:09+00:00</updated>
<author>
<name>Borislav Petkov</name>
<email>petkovbb@gmail.com</email>
</author>
<published>2009-05-02T08:26:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b13345f39dadbabdabaf8819cf6df26913da9e8d'/>
<id>b13345f39dadbabdabaf8819cf6df26913da9e8d</id>
<content type='text'>
This is in preparation of removing ide_atapi_pc. Expose the buffer as an
argument to ide_queue_pc_tail with later replacing it with local buffer
or even kmalloc'ed one if needed due to stack usage constraints.

Also, add the possibility of passing a NULL-ptr buffer for cmds which
don't transfer data besides the cdb. While at it, switch to local buffer
in idetape_get_mode_sense_results().

There should be no functional change resulting from this patch.

Signed-off-by: Borislav Petkov &lt;petkovbb@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is in preparation of removing ide_atapi_pc. Expose the buffer as an
argument to ide_queue_pc_tail with later replacing it with local buffer
or even kmalloc'ed one if needed due to stack usage constraints.

Also, add the possibility of passing a NULL-ptr buffer for cmds which
don't transfer data besides the cdb. While at it, switch to local buffer
in idetape_get_mode_sense_results().

There should be no functional change resulting from this patch.

Signed-off-by: Borislav Petkov &lt;petkovbb@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ide-atapi: add a len-parameter to ide_queue_pc_tail</title>
<updated>2009-05-15T04:44:06+00:00</updated>
<author>
<name>Borislav Petkov</name>
<email>petkovbb@gmail.com</email>
</author>
<published>2009-05-01T21:27:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5a0e43b5e2ee9a295f864c38f0e853b1a4fc3892'/>
<id>5a0e43b5e2ee9a295f864c38f0e853b1a4fc3892</id>
<content type='text'>
This is in preparation for removing ide_atapi_pc.

There should be no functional change resulting from this patch.

Signed-off-by: Borislav Petkov &lt;petkovbb@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is in preparation for removing ide_atapi_pc.

There should be no functional change resulting from this patch.

Signed-off-by: Borislav Petkov &lt;petkovbb@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ide: decrease size of -&gt;pc_buf field in struct ide_atapi_pc</title>
<updated>2009-03-31T18:15:25+00:00</updated>
<author>
<name>Bartlomiej Zolnierkiewicz</name>
<email>bzolnier@gmail.com</email>
</author>
<published>2009-03-31T18:15:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=41fa9f863baacd32dd049daf8050d55a0c9e6f1a'/>
<id>41fa9f863baacd32dd049daf8050d55a0c9e6f1a</id>
<content type='text'>
struct ide_atapi_pc is often allocated on the stack and size of -&gt;pc_buf
size is 256 bytes.  However since only ide_floppy_create_read_capacity_cmd()
and idetape_create_inquiry_cmd() require such size allocate buffers for
these pc-s explicitely and decrease -&gt;pc_buf size to 64 bytes.

Cc: Borislav Petkov &lt;petkovbb@gmail.com&gt;
Signed-off-by: Bartlomiej Zolnierkiewicz &lt;bzolnier@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
struct ide_atapi_pc is often allocated on the stack and size of -&gt;pc_buf
size is 256 bytes.  However since only ide_floppy_create_read_capacity_cmd()
and idetape_create_inquiry_cmd() require such size allocate buffers for
these pc-s explicitely and decrease -&gt;pc_buf size to 64 bytes.

Cc: Borislav Petkov &lt;petkovbb@gmail.com&gt;
Signed-off-by: Bartlomiej Zolnierkiewicz &lt;bzolnier@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ide-floppy: allocate only toplevel packet commands</title>
<updated>2009-01-02T15:12:51+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2009-01-02T15:12:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=07bd3f4731f9c7ebcbab90905ca4ad6fc6825f96'/>
<id>07bd3f4731f9c7ebcbab90905ca4ad6fc6825f96</id>
<content type='text'>
This makes the top-level function just allocate a single pc entry, and then
pass it down as a pointer to all the helper functions that also need one
of those "struct ide_atapi_pc" things. As far as I can tell, the use of
these things never overlaps each other, BUT I DID NOT CHECK VERY CLOSELY!

So I'm not guaranteeing this is correct, and I don't have the hardware. It
would be good for somebody who knows the code more, and has the hardware,
could please test this?

With this, ide-floppy still has fairly big stack usage, but instead of

	idefloppy_ioctl [vmlinux]:              1208
	ide_floppy_get_capacity [vmlinux]:      872
	idefloppy_release [vmlinux]:            408
	idefloppy_open [vmlinux]:               408

where those two first ones are at the very top of the list of stack users
for me, it's now

	ide_floppy_get_capacity [vmlinux]:           404
	ide_floppy_ioctl [vmlinux]:                  364

ie they are still high, but they are no longer at the top.

Borislav: Since ide_floppy_get_capacity is passed as a function pointer to other
parts of the kernel (e.g., block layer) we need that ide_atapi_pc to be created
on stack. Also, redid stack users numbers above. The two functions missing from
Linus' original 'make stackusage' output are due to ide being
rewritten/reorganized atm.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Borislav Petkov &lt;petkovbb@gmail.com&gt;
Signed-off-by: Bartlomiej Zolnierkiewicz &lt;bzolnier@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This makes the top-level function just allocate a single pc entry, and then
pass it down as a pointer to all the helper functions that also need one
of those "struct ide_atapi_pc" things. As far as I can tell, the use of
these things never overlaps each other, BUT I DID NOT CHECK VERY CLOSELY!

So I'm not guaranteeing this is correct, and I don't have the hardware. It
would be good for somebody who knows the code more, and has the hardware,
could please test this?

With this, ide-floppy still has fairly big stack usage, but instead of

	idefloppy_ioctl [vmlinux]:              1208
	ide_floppy_get_capacity [vmlinux]:      872
	idefloppy_release [vmlinux]:            408
	idefloppy_open [vmlinux]:               408

where those two first ones are at the very top of the list of stack users
for me, it's now

	ide_floppy_get_capacity [vmlinux]:           404
	ide_floppy_ioctl [vmlinux]:                  364

ie they are still high, but they are no longer at the top.

Borislav: Since ide_floppy_get_capacity is passed as a function pointer to other
parts of the kernel (e.g., block layer) we need that ide_atapi_pc to be created
on stack. Also, redid stack users numbers above. The two functions missing from
Linus' original 'make stackusage' output are due to ide being
rewritten/reorganized atm.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Borislav Petkov &lt;petkovbb@gmail.com&gt;
Signed-off-by: Bartlomiej Zolnierkiewicz &lt;bzolnier@gmail.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
