<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/ide/ide-disk.c, branch v2.6.27.12</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-disk: remove stale init_idedisk_capacity() documentation</title>
<updated>2008-09-02T18:18:47+00:00</updated>
<author>
<name>Bartlomiej Zolnierkiewicz</name>
<email>bzolnier@gmail.com</email>
</author>
<published>2008-09-02T18:18:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ab1b67a6230648cf65b0342d9887fee890160ca8'/>
<id>ab1b67a6230648cf65b0342d9887fee890160ca8</id>
<content type='text'>
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>
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: 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: remove dead Virtual DMA support</title>
<updated>2008-07-23T17:55:55+00:00</updated>
<author>
<name>Bartlomiej Zolnierkiewicz</name>
<email>bzolnier@gmail.com</email>
</author>
<published>2008-07-23T17:55:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ba4b2e607e4e9eaa929935325dafd5c86d3b5262'/>
<id>ba4b2e607e4e9eaa929935325dafd5c86d3b5262</id>
<content type='text'>
Lets remove dead Virtual DMA support for now so it doesn't clutter
core IDE code (it can be bring back when there is a need for it):

* Remove IDE_HFLAG_VDMA host flag.

* Remove ide_drive_t.vdma flag.

* cs5520.c: remove stale FIXMEs, cs5520_dma_host_set() and cs5520_dma_ops
  (also there is no longer a need to set IDE_HFLAG_NO_ATAPI_DMA).

There should be no functional changes caused by this patch.

Cc: TAKADA Yoshihito &lt;takada@mbf.nifty.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>
Lets remove dead Virtual DMA support for now so it doesn't clutter
core IDE code (it can be bring back when there is a need for it):

* Remove IDE_HFLAG_VDMA host flag.

* Remove ide_drive_t.vdma flag.

* cs5520.c: remove stale FIXMEs, cs5520_dma_host_set() and cs5520_dma_ops
  (also there is no longer a need to set IDE_HFLAG_NO_ATAPI_DMA).

There should be no functional changes caused by this patch.

Cc: TAKADA Yoshihito &lt;takada@mbf.nifty.com&gt;
Signed-off-by: Bartlomiej Zolnierkiewicz &lt;bzolnier@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>IDE: Remove unused code</title>
<updated>2008-07-16T18:33:48+00:00</updated>
<author>
<name>Elias Oltmanns</name>
<email>eo@nebensachen.de</email>
</author>
<published>2008-07-16T18:33:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=3ef5eb424ebf0cd981192a416358fd707a9f959b'/>
<id>3ef5eb424ebf0cd981192a416358fd707a9f959b</id>
<content type='text'>
Remove some code which has been made obsolete and hasn't worked properly
before anyway.  Part of the infrastructure may be reintroduced in a
follow up patch to implement a working command aborting facility.

Signed-off-by: Elias Oltmanns &lt;eo@nebensachen.de&gt;
Cc: "Alan Cox" &lt;alan@lxorguk.ukuu.org.uk&gt;
Cc: "Randy Dunlap" &lt;randy.dunlap@oracle.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 some code which has been made obsolete and hasn't worked properly
before anyway.  Part of the infrastructure may be reintroduced in a
follow up patch to implement a working command aborting facility.

Signed-off-by: Elias Oltmanns &lt;eo@nebensachen.de&gt;
Cc: "Alan Cox" &lt;alan@lxorguk.ukuu.org.uk&gt;
Cc: "Randy Dunlap" &lt;randy.dunlap@oracle.com&gt;
Signed-off-by: Bartlomiej Zolnierkiewicz &lt;bzolnier@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ide: remove IDE_TFLAG_NO_SELECT_MASK taskfile flag</title>
<updated>2008-07-15T19:21:48+00:00</updated>
<author>
<name>Bartlomiej Zolnierkiewicz</name>
<email>bzolnier@gmail.com</email>
</author>
<published>2008-07-15T19:21:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9a410e79b552bacb4481f85618aa7333b7776ed7'/>
<id>9a410e79b552bacb4481f85618aa7333b7776ed7</id>
<content type='text'>
Always call SELECT_MASK(..., 0) in ide_tf_load() (needs to be done
to match ide_set_irq(..., 1)) and then remove IDE_TFLAG_NO_SELECT_MASK
taskfile flag.

This change should only affect hpt366 and icside host drivers since
-&gt;maskproc(..., 0) for sgiioc4 is equivalent to ide_set_irq(..., 1).

Cc: Sergei Shtylyov &lt;sshtylyov@ru.mvista.com&gt;
Cc: Russell King &lt;rmk@arm.linux.org.uk&gt;
Signed-off-by: Bartlomiej Zolnierkiewicz &lt;bzolnier@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Always call SELECT_MASK(..., 0) in ide_tf_load() (needs to be done
to match ide_set_irq(..., 1)) and then remove IDE_TFLAG_NO_SELECT_MASK
taskfile flag.

This change should only affect hpt366 and icside host drivers since
-&gt;maskproc(..., 0) for sgiioc4 is equivalent to ide_set_irq(..., 1).

Cc: Sergei Shtylyov &lt;sshtylyov@ru.mvista.com&gt;
Cc: Russell King &lt;rmk@arm.linux.org.uk&gt;
Signed-off-by: Bartlomiej Zolnierkiewicz &lt;bzolnier@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ide-disk: convert ide_do_drive_cmd path to use blk_execute_rq</title>
<updated>2008-07-15T19:21:43+00:00</updated>
<author>
<name>FUJITA Tomonori</name>
<email>fujita.tomonori@lab.ntt.co.jp</email>
</author>
<published>2008-07-15T19:21:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=dd47087bc173a84e8c42644b315d38b30dc02263'/>
<id>dd47087bc173a84e8c42644b315d38b30dc02263</id>
<content type='text'>
This converts the ide_do_drive_cmd path using ide_wait to use
blk_execute_rq.

Signed-off-by: FUJITA Tomonori &lt;fujita.tomonori@lab.ntt.co.jp&gt;
Cc: Borislav Petkov &lt;petkovbb@gmail.com&gt;
Cc: Jens Axboe &lt;jens.axboe@oracle.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 converts the ide_do_drive_cmd path using ide_wait to use
blk_execute_rq.

Signed-off-by: FUJITA Tomonori &lt;fujita.tomonori@lab.ntt.co.jp&gt;
Cc: Borislav Petkov &lt;petkovbb@gmail.com&gt;
Cc: Jens Axboe &lt;jens.axboe@oracle.com&gt;
Signed-off-by: Bartlomiej Zolnierkiewicz &lt;bzolnier@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ide-disk: fix issues found by checkpatch.pl</title>
<updated>2008-04-26T15:36:37+00:00</updated>
<author>
<name>Bartlomiej Zolnierkiewicz</name>
<email>bzolnier@gmail.com</email>
</author>
<published>2008-04-26T15:36:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9841654949f0a3f1289b6b95b2ab56cd99fb5360'/>
<id>9841654949f0a3f1289b6b95b2ab56cd99fb5360</id>
<content type='text'>
There are no changes to the resulting drivers/ide/ide-disk.o binary file
(md5sum-s after and before the patch match).

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>
There are no changes to the resulting drivers/ide/ide-disk.o binary file
(md5sum-s after and before the patch match).

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-disk: add proc_idedisk_read_smart() helper</title>
<updated>2008-04-26T15:36:37+00:00</updated>
<author>
<name>Bartlomiej Zolnierkiewicz</name>
<email>bzolnier@gmail.com</email>
</author>
<published>2008-04-26T15:36:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=799ee57ac83f019f035024614d95067ce583bc2b'/>
<id>799ee57ac83f019f035024614d95067ce583bc2b</id>
<content type='text'>
* Factor out common code from proc_idedisk_read_smart_{thresholds,values}()
  to proc_idedisk_read_smart() helper.

* Rename proc_idedisk_read_smart_thresholds() to proc_idedisk_read_st()
  and proc_idedisk_read_smart_values() to proc_idedisk_read_sv().

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>
* Factor out common code from proc_idedisk_read_smart_{thresholds,values}()
  to proc_idedisk_read_smart() helper.

* Rename proc_idedisk_read_smart_thresholds() to proc_idedisk_read_st()
  and proc_idedisk_read_smart_values() to proc_idedisk_read_sv().

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz &lt;bzolnier@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ide-disk: add missing printk() KERN_* levels</title>
<updated>2008-02-26T20:50:36+00:00</updated>
<author>
<name>Bartlomiej Zolnierkiewicz</name>
<email>bzolnier@gmail.com</email>
</author>
<published>2008-02-26T20:50:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d12faa2736ebdee025a9aa07b2683c5fa8c86553'/>
<id>d12faa2736ebdee025a9aa07b2683c5fa8c86553</id>
<content type='text'>
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>
Acked-by: Sergei Shtylyov &lt;sshtylyov@ru.mvista.com&gt;
Signed-off-by: Bartlomiej Zolnierkiewicz &lt;bzolnier@gmail.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
