<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/ide/ide-tape.c, branch v2.6.27.6</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>ide-tape: fix vendor strings</title>
<updated>2008-09-27T17:32:17+00:00</updated>
<author>
<name>Borislav Petkov</name>
<email>petkovbb@googlemail.com</email>
</author>
<published>2008-09-27T17:32:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=801bd32e205ca6ef78dcaf80121f1eccb89b8c1e'/>
<id>801bd32e205ca6ef78dcaf80121f1eccb89b8c1e</id>
<content type='text'>
Remove superfluous two bytes from each string buffer and add proper length
format specifiers.

Signed-off-by: Borislav Petkov &lt;petkovbb@gmail.com&gt;
Tested-by: Mark de Wever &lt;koraq@xs4all.nl&gt;
Acked-by: Sergei Shtylyov &lt;sshtylyov@ru.mvista.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>
Remove superfluous two bytes from each string buffer and add proper length
format specifiers.

Signed-off-by: Borislav Petkov &lt;petkovbb@gmail.com&gt;
Tested-by: Mark de Wever &lt;koraq@xs4all.nl&gt;
Acked-by: Sergei Shtylyov &lt;sshtylyov@ru.mvista.com&gt;
Signed-off-by: Bartlomiej Zolnierkiewicz &lt;bzolnier@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ide: fix regression caused by ide_device_{get,put}() addition (take 2)</title>
<updated>2008-08-05T16:16:59+00:00</updated>
<author>
<name>Bartlomiej Zolnierkiewicz</name>
<email>bzolnier@gmail.com</email>
</author>
<published>2008-08-05T16:16:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d3e33ff59facec005e48ba3360502b73a04e4b4e'/>
<id>d3e33ff59facec005e48ba3360502b73a04e4b4e</id>
<content type='text'>
On Monday 28 July 2008, Benjamin Herrenschmidt wrote:

[...]

&gt; Vector: 300 (Data Access) at [c58b7b80]
&gt;     pc: c014f264: elv_may_queue+0x10/0x44
&gt;     lr: c0152750: get_request+0x2c/0x2c0
&gt;     sp: c58b7c30
&gt;    msr: 1032
&gt;    dar: c
&gt;  dsisr: 40000000
&gt;   current = 0xc58aaae0
&gt;     pid   = 854, comm = media-bay
&gt; enter ? for help
&gt; mon&gt; t
&gt; [c58b7c40] c0152750 get_request+0x2c/0x2c0
&gt; [c58b7c70] c0152a08 get_request_wait+0x24/0xec
&gt; [c58b7cc0] c0225674 ide_cd_queue_pc+0x58/0x1a0
&gt; [c58b7d40] c022672c ide_cdrom_packet+0x9c/0xdc
&gt; [c58b7d70] c0261810 cdrom_get_disc_info+0x60/0xd0
&gt; [c58b7dc0] c026208c cdrom_mrw_exit+0x1c/0x11c
&gt; [c58b7e30] c0260f7c unregister_cdrom+0x84/0xe8
&gt; [c58b7e50] c022395c ide_cd_release+0x80/0x84
&gt; [c58b7e70] c0163650 kref_put+0x54/0x6c
&gt; [c58b7e80] c0223884 ide_cd_put+0x40/0x5c
&gt; [c58b7ea0] c0211100 generic_ide_remove+0x28/0x3c
&gt; [c58b7eb0] c01e9d34 __device_release_driver+0x78/0xb4
&gt; [c58b7ec0] c01e9e44 device_release_driver+0x28/0x44
&gt; [c58b7ee0] c01e8f7c bus_remove_device+0xac/0xd8
&gt; [c58b7f00] c01e7424 device_del+0x104/0x198
&gt; [c58b7f20] c01e74d0 device_unregister+0x18/0x30
&gt; [c58b7f40] c02121c4 __ide_port_unregister_devices+0x6c/0x88
&gt; [c58b7f60] c0212398 ide_port_unregister_devices+0x38/0x80
&gt; [c58b7f80] c0208ca4 media_bay_step+0x1cc/0x5c0
&gt; [c58b7fb0] c0209124 media_bay_task+0x8c/0xcc
&gt; [c58b7fd0] c00485c0 kthread+0x48/0x84
&gt; [c58b7ff0] c0011b20 kernel_thread+0x44/0x60

The guilty commit turned out to be 08da591e14cf87247ec09b17c350235157a92fc3
("ide: add ide_device_{get,put}() helpers").  ide_device_put() is called
before kref_put() in ide_cd_put() so IDE device is already gone by the time
ide_cd_release() is reached.

Fix it by calling ide_device_get() before kref_get() and ide_device_put()
after kref_put() in all affected device drivers.

v2:
Brown paper bag time.  In v1 cd-&gt;drive was referenced after dropping last
reference on cd object (which could result in OOPS in ide_device_put() as
reported/debugged by Mariusz Kozlowski).  Fix it by caching cd-&gt;drive in
the local variable (fix other device drivers too).

Reported-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Reported-by: Mariusz Kozlowski &lt;m.kozlowski@tuxland.pl&gt;
Cc: FUJITA Tomonori &lt;fujita.tomonori@lab.ntt.co.jp&gt;
Cc: Borislav Petkov &lt;petkovbb@gmail.com&gt;
Tested-by: Mariusz Kozlowski &lt;m.kozlowski@tuxland.pl&gt;
Tested-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Signed-off-by: Bartlomiej Zolnierkiewicz &lt;bzolnier@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On Monday 28 July 2008, Benjamin Herrenschmidt wrote:

[...]

&gt; Vector: 300 (Data Access) at [c58b7b80]
&gt;     pc: c014f264: elv_may_queue+0x10/0x44
&gt;     lr: c0152750: get_request+0x2c/0x2c0
&gt;     sp: c58b7c30
&gt;    msr: 1032
&gt;    dar: c
&gt;  dsisr: 40000000
&gt;   current = 0xc58aaae0
&gt;     pid   = 854, comm = media-bay
&gt; enter ? for help
&gt; mon&gt; t
&gt; [c58b7c40] c0152750 get_request+0x2c/0x2c0
&gt; [c58b7c70] c0152a08 get_request_wait+0x24/0xec
&gt; [c58b7cc0] c0225674 ide_cd_queue_pc+0x58/0x1a0
&gt; [c58b7d40] c022672c ide_cdrom_packet+0x9c/0xdc
&gt; [c58b7d70] c0261810 cdrom_get_disc_info+0x60/0xd0
&gt; [c58b7dc0] c026208c cdrom_mrw_exit+0x1c/0x11c
&gt; [c58b7e30] c0260f7c unregister_cdrom+0x84/0xe8
&gt; [c58b7e50] c022395c ide_cd_release+0x80/0x84
&gt; [c58b7e70] c0163650 kref_put+0x54/0x6c
&gt; [c58b7e80] c0223884 ide_cd_put+0x40/0x5c
&gt; [c58b7ea0] c0211100 generic_ide_remove+0x28/0x3c
&gt; [c58b7eb0] c01e9d34 __device_release_driver+0x78/0xb4
&gt; [c58b7ec0] c01e9e44 device_release_driver+0x28/0x44
&gt; [c58b7ee0] c01e8f7c bus_remove_device+0xac/0xd8
&gt; [c58b7f00] c01e7424 device_del+0x104/0x198
&gt; [c58b7f20] c01e74d0 device_unregister+0x18/0x30
&gt; [c58b7f40] c02121c4 __ide_port_unregister_devices+0x6c/0x88
&gt; [c58b7f60] c0212398 ide_port_unregister_devices+0x38/0x80
&gt; [c58b7f80] c0208ca4 media_bay_step+0x1cc/0x5c0
&gt; [c58b7fb0] c0209124 media_bay_task+0x8c/0xcc
&gt; [c58b7fd0] c00485c0 kthread+0x48/0x84
&gt; [c58b7ff0] c0011b20 kernel_thread+0x44/0x60

The guilty commit turned out to be 08da591e14cf87247ec09b17c350235157a92fc3
("ide: add ide_device_{get,put}() helpers").  ide_device_put() is called
before kref_put() in ide_cd_put() so IDE device is already gone by the time
ide_cd_release() is reached.

Fix it by calling ide_device_get() before kref_get() and ide_device_put()
after kref_put() in all affected device drivers.

v2:
Brown paper bag time.  In v1 cd-&gt;drive was referenced after dropping last
reference on cd object (which could result in OOPS in ide_device_put() as
reported/debugged by Mariusz Kozlowski).  Fix it by caching cd-&gt;drive in
the local variable (fix other device drivers too).

Reported-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Reported-by: Mariusz Kozlowski &lt;m.kozlowski@tuxland.pl&gt;
Cc: FUJITA Tomonori &lt;fujita.tomonori@lab.ntt.co.jp&gt;
Cc: Borislav Petkov &lt;petkovbb@gmail.com&gt;
Tested-by: Mariusz Kozlowski &lt;m.kozlowski@tuxland.pl&gt;
Tested-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Signed-off-by: Bartlomiej Zolnierkiewicz &lt;bzolnier@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ide: ide-tape.c sparse annotations and unaligned access removal</title>
<updated>2008-07-24T20:53:33+00:00</updated>
<author>
<name>Harvey Harrison</name>
<email>harvey.harrison@gmail.com</email>
</author>
<published>2008-07-24T20:53:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=cd740ab0f69f6c94d9c7f916758e308f30a439fa'/>
<id>cd740ab0f69f6c94d9c7f916758e308f30a439fa</id>
<content type='text'>
If this is actually unaligned the access of speed/max_speed above
is already broken and needs a get_unaligned.  Otherwise it is
aligned and they can be removed.

Signed-off-by: Harvey Harrison &lt;harvey.harrison@gmail.com&gt;
Cc: Borislav Petkov &lt;petkovbb@googlemail.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>
If this is actually unaligned the access of speed/max_speed above
is already broken and needs a get_unaligned.  Otherwise it is
aligned and they can be removed.

Signed-off-by: Harvey Harrison &lt;harvey.harrison@gmail.com&gt;
Cc: Borislav Petkov &lt;petkovbb@googlemail.com&gt;
Signed-off-by: Bartlomiej Zolnierkiewicz &lt;bzolnier@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ide: add ide_device_{get,put}() helpers</title>
<updated>2008-07-24T20:53:15+00:00</updated>
<author>
<name>Bartlomiej Zolnierkiewicz</name>
<email>bzolnier@gmail.com</email>
</author>
<published>2008-07-24T20:53:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=08da591e14cf87247ec09b17c350235157a92fc3'/>
<id>08da591e14cf87247ec09b17c350235157a92fc3</id>
<content type='text'>
* Add 'struct ide_host *host' field to ide_hwif_t and set it
  in ide_host_alloc_all().

* Add ide_device_{get,put}() helpers loosely based on SCSI's
  scsi_device_{get,put}() ones.

* Convert IDE device drivers to use ide_device_{get,put}().

Signed-off-by: Bartlomiej Zolnierkiewicz &lt;bzolnier@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Add 'struct ide_host *host' field to ide_hwif_t and set it
  in ide_host_alloc_all().

* Add ide_device_{get,put}() helpers loosely based on SCSI's
  scsi_device_{get,put}() ones.

* Convert IDE device drivers to use ide_device_{get,put}().

Signed-off-by: Bartlomiej Zolnierkiewicz &lt;bzolnier@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ide-tape: convert to using the new atapi_flags</title>
<updated>2008-07-23T17:56:01+00:00</updated>
<author>
<name>Borislav Petkov</name>
<email>petkovbb@googlemail.com</email>
</author>
<published>2008-07-23T17:56:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f2e3ab52afb3b05879b9d82a05740cd924993325'/>
<id>f2e3ab52afb3b05879b9d82a05740cd924993325</id>
<content type='text'>
There should be no functionality change resulting from this patch.

[bart: IDE_FLAG_* -&gt; IDE_AFLAG_*, dev_flags -&gt; atapi_flags]

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>
There should be no functionality change resulting from this patch.

[bart: IDE_FLAG_* -&gt; IDE_AFLAG_*, dev_flags -&gt; atapi_flags]

Signed-off-by: Borislav Petkov &lt;petkovbb@gmail.com&gt;
Signed-off-by: Bartlomiej Zolnierkiewicz &lt;bzolnier@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ide-tape: pass packet command in rq-&gt;cmd</title>
<updated>2008-07-23T17:56:00+00:00</updated>
<author>
<name>Borislav Petkov</name>
<email>petkovbb@googlemail.com</email>
</author>
<published>2008-07-23T17:56:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0014c75be31d9fa7435105afa9960374a82cc55c'/>
<id>0014c75be31d9fa7435105afa9960374a82cc55c</id>
<content type='text'>
Make a redundant copy of the packet command bits into rq-&gt;cmd. Later, after
all drivers have been converted, it'll be switched to use that in the
common code instead of pc-&gt;c. While at it, simplify ide_tape_create_rw_cmd.

There should be no functionality change resulting from this patch.

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>
Make a redundant copy of the packet command bits into rq-&gt;cmd. Later, after
all drivers have been converted, it'll be switched to use that in the
common code instead of pc-&gt;c. While at it, simplify ide_tape_create_rw_cmd.

There should be no functionality change resulting from this patch.

Signed-off-by: Borislav Petkov &lt;petkovbb@gmail.com&gt;
Signed-off-by: Bartlomiej Zolnierkiewicz &lt;bzolnier@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ide-tape: make room for packet command ids in rq-&gt;cmd</title>
<updated>2008-07-23T17:56:00+00:00</updated>
<author>
<name>Borislav Petkov</name>
<email>petkovbb@googlemail.com</email>
</author>
<published>2008-07-23T17:56:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=83dd573513471c67f9cc93a88795c25a91ebf4b3'/>
<id>83dd573513471c67f9cc93a88795c25a91ebf4b3</id>
<content type='text'>
ide-tape uses rq-&gt;cmd for special commands from the chrdev interface so move
those to byte 13 (BLK_MAX_CDB = 16) since a packet cmd is max 12 bytes.

There should be no functionality change resulting from this patch.

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>
ide-tape uses rq-&gt;cmd for special commands from the chrdev interface so move
those to byte 13 (BLK_MAX_CDB = 16) since a packet cmd is max 12 bytes.

There should be no functionality change resulting from this patch.

Signed-off-by: Borislav Petkov &lt;petkovbb@gmail.com&gt;
Signed-off-by: Bartlomiej Zolnierkiewicz &lt;bzolnier@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ide-tape: use drive-&gt;pc_callback instead of pc-&gt;callback</title>
<updated>2008-07-23T17:55:59+00:00</updated>
<author>
<name>Borislav Petkov</name>
<email>petkovbb@googlemail.com</email>
</author>
<published>2008-07-23T17:55:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=776bb0270ea72c40f95347dcac868c9f602dcb3e'/>
<id>776bb0270ea72c40f95347dcac868c9f602dcb3e</id>
<content type='text'>
The if-else block in the IRQ handler is only temporary so that bisect searches
don't break and it'll be removed after converting the remainder of the drivers.

There should be no functionality change resulting from this patch.

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>
The if-else block in the IRQ handler is only temporary so that bisect searches
don't break and it'll be removed after converting the remainder of the drivers.

There should be no functionality change resulting from this patch.

Signed-off-by: Borislav Petkov &lt;petkovbb@gmail.com&gt;
Signed-off-by: Bartlomiej Zolnierkiewicz &lt;bzolnier@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drivers/ide/ide-tape.c: remove double kfree</title>
<updated>2008-07-23T17:55:59+00:00</updated>
<author>
<name>Darren Jenkins</name>
<email>darrenrjenkins@gmail.com</email>
</author>
<published>2008-07-23T17:55:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=4b5075050072ed7c4730ee547ae80117c4fa8513'/>
<id>4b5075050072ed7c4730ee547ae80117c4fa8513</id>
<content type='text'>
Coverity CID: 2336 USE_AFTER_FREE

drivers/ide/ide-tape.c ide_tape_kfree_buffer() double free's a pointer
(hint freed by an alias in first outer loop).

This patch simply removes the superfluous kfree().

Signed-off-by: Darren Jenkins &lt;darrenrjenkins@gmailcom&gt;
Acked-by: Borislav Petkov &lt;petkovbb@gmail.com&gt;
Cc: gadio@netvision.net.il
Signed-off-by: Bartlomiej Zolnierkiewicz &lt;bzolnier@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Coverity CID: 2336 USE_AFTER_FREE

drivers/ide/ide-tape.c ide_tape_kfree_buffer() double free's a pointer
(hint freed by an alias in first outer loop).

This patch simply removes the superfluous kfree().

Signed-off-by: Darren Jenkins &lt;darrenrjenkins@gmailcom&gt;
Acked-by: Borislav Petkov &lt;petkovbb@gmail.com&gt;
Cc: gadio@netvision.net.il
Signed-off-by: Bartlomiej Zolnierkiewicz &lt;bzolnier@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ide: add struct ide_tp_ops (take 2)</title>
<updated>2008-07-23T17:55:56+00:00</updated>
<author>
<name>Bartlomiej Zolnierkiewicz</name>
<email>bzolnier@gmail.com</email>
</author>
<published>2008-07-23T17:55:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=374e042c3e767ac2e5a40b78529220e0b3de793c'/>
<id>374e042c3e767ac2e5a40b78529220e0b3de793c</id>
<content type='text'>
* Add struct ide_tp_ops for transport methods.

* Add 'const struct ide_tp_ops *tp_ops' to struct ide_port_info
  and ide_hwif_t.

* Set the default hwif-&gt;tp_ops in ide_init_port_data().

* Set host driver specific hwif-&gt;tp_ops in ide_init_port().

* Export ide_exec_command(), ide_read_status(), ide_read_altstatus(),
  ide_read_sff_dma_status(), ide_set_irq(), ide_tf_{load,read}()
  and ata_{in,out}put_data().

* Convert host drivers and core code to use struct ide_tp_ops.

* Remove no longer needed default_hwif_transport().

* Cleanup ide_hwif_t from methods that are now in struct ide_tp_ops.

While at it:

* Use struct ide_port_info in falconide.c and q40ide.c.

* Rename ata_{in,out}put_data() to ide_{in,out}put_data().

v2:

* Fix missing convertion in ns87415.c.

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz &lt;bzolnier@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Add struct ide_tp_ops for transport methods.

* Add 'const struct ide_tp_ops *tp_ops' to struct ide_port_info
  and ide_hwif_t.

* Set the default hwif-&gt;tp_ops in ide_init_port_data().

* Set host driver specific hwif-&gt;tp_ops in ide_init_port().

* Export ide_exec_command(), ide_read_status(), ide_read_altstatus(),
  ide_read_sff_dma_status(), ide_set_irq(), ide_tf_{load,read}()
  and ata_{in,out}put_data().

* Convert host drivers and core code to use struct ide_tp_ops.

* Remove no longer needed default_hwif_transport().

* Cleanup ide_hwif_t from methods that are now in struct ide_tp_ops.

While at it:

* Use struct ide_port_info in falconide.c and q40ide.c.

* Rename ata_{in,out}put_data() to ide_{in,out}put_data().

v2:

* Fix missing convertion in ns87415.c.

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz &lt;bzolnier@gmail.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
