public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* linux-next-20090225: ide-cd triggers BUG at arch/x86/mm/ioremap.c:80!
@ 2009-02-26  2:29 Tetsuo Handa
  2009-02-26 14:29 ` Bartlomiej Zolnierkiewicz
  0 siblings, 1 reply; 10+ messages in thread
From: Tetsuo Handa @ 2009-02-26  2:29 UTC (permalink / raw)
  To: linux-kernel

2.6.29-rc6 is OK.

Removing IDE CDROM drive solves this problem.

Full log is at http://I-love.SAKURA.ne.jp/tmp/dmesg-2.6.29-rc6-next-20090225.txt

[    0.000000] Linux version 2.6.29-rc6-next-20090225 (root@tomoyo) (gcc version 3.3.5 (Debian 1:3.3.5-13)) #1 SMP Thu Feb 26 09:48:39 JST 2009
(...snipped...)
[    2.448739] Uniform Multi-Platform E-IDE driver
[    2.452036] piix 0000:00:07.1: IDE controller (0x8086:0x7111 rev 0x01)
[    2.455202] piix 0000:00:07.1: IDE port disabled
[    2.458046] piix 0000:00:07.1: not 100% native mode: will probe irqs later
[    2.460836]     ide0: BM-DMA at 0x10e8-0x10ef
[    3.200762] hda: VMware Virtual IDE CDROM Drive, ATAPI CD/DVD-ROM drive
[    3.542671] hda: UDMA/33 mode selected
[    3.544877] ide0 at 0x170-0x177,0x376 on irq 15
[    3.550967] ide_generic: please use "probe_mask=0x3f" module parameter for probing all legacy ISA IDE ports
[    3.554908] ide-gd driver 1.18
[    3.557199] ide-cd driver 5.00
[    3.564266] ide-cd: hda: ATAPI 1X CD-ROM drive, 32kB Cache
[    3.567031] Uniform CD-ROM driver Revision: 3.20
[    3.569938] ------------[ cut here ]------------
[    3.571751] kernel BUG at arch/x86/mm/ioremap.c:80!
[    3.572605] invalid opcode: 0000 [#1] SMP DEBUG_PAGEALLOC
[    3.572605] last sysfs file: 
[    3.572605] Modules linked in:
[    3.572605] 
[    3.572605] Pid: 1, comm: swapper Not tainted (2.6.29-rc6-next-20090225 #1) VMware Virtual Platform
[    3.572605] EIP: 0060:[<c011e402>] EFLAGS: 00010213 CPU: 0
[    3.572605] EIP is at __phys_addr+0x52/0x70
[    3.572605] EAX: 00000000 EBX: 00000000 ECX: 00000018 EDX: 00000000
[    3.572605] ESI: f69f4060 EDI: 00000000 EBP: f700f930 ESP: f700f930
[    3.572605]  DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068
[    3.572605] Process swapper (pid: 1, ti=f700f000 task=f7030000 task.ti=f700f000)
[    3.572605] Stack:
[    3.572605]  f700f944 c027dd73 f69f4060 f700f960 f700f9a0 f700f954 c02e7c82 f6570840
[    3.572605]  f700f960 f700f9ac c02f5a71 f6b7e5b0 00000000 00000000 00000000 00000000
[    3.572605]  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[    3.572605] Call Trace:
[    3.572605]  [<c027dd73>] ? sg_init_one+0x23/0x90
[    3.572605]  [<c02e7c82>] ? ide_map_sg+0x42/0x70
[    3.572605]  [<c02f5a71>] ? ide_cd_do_request+0x101/0x150
[    3.572605]  [<c02e7e48>] ? start_request+0xa8/0x160
[    3.572605]  [<c015d85b>] ? trace_hardirqs_on+0xb/0x10
[    3.572605]  [<c02e809b>] ? do_ide_request+0x16b/0x250
[    3.572605]  [<c02646f5>] ? blk_remove_plug+0x75/0xf0
[    3.572605]  [<c02658c0>] ? blk_start_queueing+0x20/0x30
[    3.572605]  [<c026340e>] ? elv_insert+0x17e/0x1b0
[    3.572605]  [<c02645a8>] ? blk_plug_device+0x88/0x120
[    3.572605]  [<c02634c2>] ? __elv_add_request+0x82/0xc0
[    3.572605]  [<c0269c20>] ? blk_execute_rq_nowait+0x60/0xb0
[    3.572605]  [<c0269d06>] ? blk_execute_rq+0x96/0xd0
[    3.572605]  [<c0269b90>] ? blk_end_sync_rq+0x0/0x30
[    3.572605]  [<c02656ec>] ? get_request_wait+0x2c/0x160
[    3.572605]  [<c0160359>] ? __lock_acquired+0x109/0x1c0
[    3.572605]  [<c0265844>] ? blk_get_request+0x24/0x80
[    3.572605]  [<c02f5276>] ? ide_cd_queue_pc+0xb6/0x140
[    3.572605]  [<c01a9764>] ? trace+0x14/0x90
[    3.572605]  [<c01a935a>] ? check_object+0xaa/0x1c0
[    3.572605]  [<c01a8f84>] ? init_object+0x14/0x90
[    3.572605]  [<c01a99a4>] ? alloc_debug_processing+0xf4/0x120
[    3.572605]  [<c02f5b84>] ? cdrom_check_status+0x84/0x90
[    3.572605]  [<c015d85b>] ? trace_hardirqs_on+0xb/0x10
[    3.572605]  [<c02f5d31>] ? ide_cd_read_toc+0x41/0x420
[    3.572605]  [<c02f1fc1>] ? ide_add_proc_entries+0x31/0x60
[    3.572605]  [<c02f6921>] ? ide_cdrom_setup+0x101/0x130
[    3.572605]  [<c027aa0c>] ? sprintf+0x1c/0x20
[    3.572605]  [<c02f6d7e>] ? ide_cd_probe+0xee/0x140
[    3.572605]  [<c01fb106>] ? sysfs_addrm_finish+0x16/0xa0
[    3.572605]  [<c01fbb40>] ? sysfs_do_create_link+0xc0/0x150
[    3.572605]  [<c015a424>] ? lock_release_holdtime+0x74/0xc0
[    3.572605]  [<c01fbbe7>] ? sysfs_create_link+0x17/0x20
[    3.572605]  [<c02e6cc4>] ? generic_ide_probe+0x24/0x30
[    3.572605]  [<c02c483c>] ? really_probe+0x8c/0x110
[    3.572605]  [<c02c493c>] ? driver_probe_device+0x1c/0x30
[    3.572605]  [<c01515df>] ? down+0x2f/0x50
[    3.572605]  [<c02c4a84>] ? __driver_attach+0x74/0x80
[    3.572605]  [<c02c37b5>] ? bus_for_each_dev+0x55/0x70
[    3.572605]  [<c02c4aae>] ? driver_attach+0x1e/0x30
[    3.572605]  [<c02c4a10>] ? __driver_attach+0x0/0x80
[    3.572605]  [<c02c3f36>] ? bus_add_driver+0xb6/0x1a0
[    3.572605]  [<c02e6d00>] ? generic_ide_shutdown+0x0/0x30
[    3.572605]  [<c02e6d00>] ? generic_ide_shutdown+0x0/0x30
[    3.572605]  [<c02c4f50>] ? driver_register+0x70/0xd0
[    3.572605]  [<c0137efd>] ? printk+0x1d/0x30
[    3.572605]  [<c058fef0>] ? ide_cdrom_init+0x0/0x20
[    3.572605]  [<c058ff0c>] ? ide_cdrom_init+0x1c/0x20
[    3.572605]  [<c0101042>] ? do_one_initcall+0x32/0x1d0
[    3.572605]  [<c011f54f>] ? __change_page_attr_set_clr+0x2f/0x70
[    3.572605]  [<c015ca8c>] ? validate_chain+0x3fc/0x540
[    3.572605]  [<c015ca8c>] ? validate_chain+0x3fc/0x540
[    3.572605]  [<c015e95c>] ? __lock_acquire+0x29c/0x8b0
[    3.572605]  [<c01a9008>] ? check_bytes+0x8/0x20
[    3.572605]  [<c01a9099>] ? check_bytes_and_report+0x29/0xc0
[    3.572605]  [<c0198574>] ? page_address+0x14/0xe0
[    3.572605]  [<c01a9196>] ? check_pad_bytes+0x66/0x80
[    3.572605]  [<c0198574>] ? page_address+0x14/0xe0
[    3.572605]  [<c01a9764>] ? trace+0x14/0x90
[    3.572605]  [<c01a935a>] ? check_object+0xaa/0x1c0
[    3.572605]  [<c015ca8c>] ? validate_chain+0x3fc/0x540
[    3.572605]  [<c015e95c>] ? __lock_acquire+0x29c/0x8b0
[    3.572605]  [<c015a424>] ? lock_release_holdtime+0x74/0xc0
[    3.572605]  [<c01f355c>] ? proc_register+0x9c/0x140
[    3.572605]  [<c015fb47>] ? __lock_release+0x47/0x70
[    3.572605]  [<c03eace2>] ? _spin_unlock+0x22/0x30
[    3.572605]  [<c01f355c>] ? proc_register+0x9c/0x140
[    3.572605]  [<c01f38e9>] ? create_proc_entry+0x69/0xa0
[    3.572605]  [<c0173234>] ? register_irq_proc+0x14/0xd0
[    3.572605]  [<c056ea6a>] ? do_initcalls+0x2a/0x40
[    3.572605]  [<c056ead0>] ? kernel_init+0x0/0xa0
[    3.572605]  [<c056ea9c>] ? do_basic_setup+0x1c/0x20
[    3.572605]  [<c056eb25>] ? kernel_init+0x55/0xa0
[    3.572605]  [<c0103d33>] ? kernel_thread_helper+0x7/0x10
[    3.572605] Code: 05 00 00 80 00 39 c2 72 ea a1 c4 d4 52 c0 2d 00 30 60 00 25 00 00 c0 ff 2d 00 20 00 00 39 c2 73 d2 0f 0b 8d b6 00 00 00 00 eb fe <0f> 0b 8d b6 00 00 00 00 8d bf 00 00 00 00 eb fe 8d b4 26 00 00 
[    3.572605] EIP: [<c011e402>] __phys_addr+0x52/0x70 SS:ESP 0068:f700f930
[    3.824801] ---[ end trace d537ae8ff1cd7947 ]---

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: linux-next-20090225: ide-cd triggers BUG at arch/x86/mm/ioremap.c:80!
  2009-02-26  2:29 linux-next-20090225: ide-cd triggers BUG at arch/x86/mm/ioremap.c:80! Tetsuo Handa
@ 2009-02-26 14:29 ` Bartlomiej Zolnierkiewicz
  2009-02-26 15:51   ` Borislav Petkov
  0 siblings, 1 reply; 10+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2009-02-26 14:29 UTC (permalink / raw)
  To: Tetsuo Handa; +Cc: linux-kernel

On Thursday 26 February 2009, Tetsuo Handa wrote:
> 2.6.29-rc6 is OK.

Could you try to narrow down the issue by bisecting linux-next?

> Removing IDE CDROM drive solves this problem.
> 
> Full log is at http://I-love.SAKURA.ne.jp/tmp/dmesg-2.6.29-rc6-next-20090225.txt
> 
> [    0.000000] Linux version 2.6.29-rc6-next-20090225 (root@tomoyo) (gcc version 3.3.5 (Debian 1:3.3.5-13)) #1 SMP Thu Feb 26 09:48:39 JST 2009
> (...snipped...)
> [    2.448739] Uniform Multi-Platform E-IDE driver
> [    2.452036] piix 0000:00:07.1: IDE controller (0x8086:0x7111 rev 0x01)
> [    2.455202] piix 0000:00:07.1: IDE port disabled
> [    2.458046] piix 0000:00:07.1: not 100% native mode: will probe irqs later
> [    2.460836]     ide0: BM-DMA at 0x10e8-0x10ef
> [    3.200762] hda: VMware Virtual IDE CDROM Drive, ATAPI CD/DVD-ROM drive
> [    3.542671] hda: UDMA/33 mode selected
> [    3.544877] ide0 at 0x170-0x177,0x376 on irq 15
> [    3.550967] ide_generic: please use "probe_mask=0x3f" module parameter for probing all legacy ISA IDE ports
> [    3.554908] ide-gd driver 1.18
> [    3.557199] ide-cd driver 5.00
> [    3.564266] ide-cd: hda: ATAPI 1X CD-ROM drive, 32kB Cache
> [    3.567031] Uniform CD-ROM driver Revision: 3.20
> [    3.569938] ------------[ cut here ]------------
> [    3.571751] kernel BUG at arch/x86/mm/ioremap.c:80!
> [    3.572605] invalid opcode: 0000 [#1] SMP DEBUG_PAGEALLOC
> [    3.572605] last sysfs file: 
> [    3.572605] Modules linked in:
> [    3.572605] 
> [    3.572605] Pid: 1, comm: swapper Not tainted (2.6.29-rc6-next-20090225 #1) VMware Virtual Platform
> [    3.572605] EIP: 0060:[<c011e402>] EFLAGS: 00010213 CPU: 0
> [    3.572605] EIP is at __phys_addr+0x52/0x70
> [    3.572605] EAX: 00000000 EBX: 00000000 ECX: 00000018 EDX: 00000000
> [    3.572605] ESI: f69f4060 EDI: 00000000 EBP: f700f930 ESP: f700f930
> [    3.572605]  DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068
> [    3.572605] Process swapper (pid: 1, ti=f700f000 task=f7030000 task.ti=f700f000)
> [    3.572605] Stack:
> [    3.572605]  f700f944 c027dd73 f69f4060 f700f960 f700f9a0 f700f954 c02e7c82 f6570840
> [    3.572605]  f700f960 f700f9ac c02f5a71 f6b7e5b0 00000000 00000000 00000000 00000000
> [    3.572605]  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
> [    3.572605] Call Trace:
> [    3.572605]  [<c027dd73>] ? sg_init_one+0x23/0x90
> [    3.572605]  [<c02e7c82>] ? ide_map_sg+0x42/0x70
> [    3.572605]  [<c02f5a71>] ? ide_cd_do_request+0x101/0x150
> [    3.572605]  [<c02e7e48>] ? start_request+0xa8/0x160
> [    3.572605]  [<c015d85b>] ? trace_hardirqs_on+0xb/0x10
> [    3.572605]  [<c02e809b>] ? do_ide_request+0x16b/0x250
> [    3.572605]  [<c02646f5>] ? blk_remove_plug+0x75/0xf0
> [    3.572605]  [<c02658c0>] ? blk_start_queueing+0x20/0x30
> [    3.572605]  [<c026340e>] ? elv_insert+0x17e/0x1b0
> [    3.572605]  [<c02645a8>] ? blk_plug_device+0x88/0x120
> [    3.572605]  [<c02634c2>] ? __elv_add_request+0x82/0xc0
> [    3.572605]  [<c0269c20>] ? blk_execute_rq_nowait+0x60/0xb0
> [    3.572605]  [<c0269d06>] ? blk_execute_rq+0x96/0xd0
> [    3.572605]  [<c0269b90>] ? blk_end_sync_rq+0x0/0x30
> [    3.572605]  [<c02656ec>] ? get_request_wait+0x2c/0x160
> [    3.572605]  [<c0160359>] ? __lock_acquired+0x109/0x1c0
> [    3.572605]  [<c0265844>] ? blk_get_request+0x24/0x80
> [    3.572605]  [<c02f5276>] ? ide_cd_queue_pc+0xb6/0x140
> [    3.572605]  [<c01a9764>] ? trace+0x14/0x90
> [    3.572605]  [<c01a935a>] ? check_object+0xaa/0x1c0
> [    3.572605]  [<c01a8f84>] ? init_object+0x14/0x90
> [    3.572605]  [<c01a99a4>] ? alloc_debug_processing+0xf4/0x120
> [    3.572605]  [<c02f5b84>] ? cdrom_check_status+0x84/0x90
> [    3.572605]  [<c015d85b>] ? trace_hardirqs_on+0xb/0x10
> [    3.572605]  [<c02f5d31>] ? ide_cd_read_toc+0x41/0x420
> [    3.572605]  [<c02f1fc1>] ? ide_add_proc_entries+0x31/0x60
> [    3.572605]  [<c02f6921>] ? ide_cdrom_setup+0x101/0x130
> [    3.572605]  [<c027aa0c>] ? sprintf+0x1c/0x20
> [    3.572605]  [<c02f6d7e>] ? ide_cd_probe+0xee/0x140
> [    3.572605]  [<c01fb106>] ? sysfs_addrm_finish+0x16/0xa0
> [    3.572605]  [<c01fbb40>] ? sysfs_do_create_link+0xc0/0x150
> [    3.572605]  [<c015a424>] ? lock_release_holdtime+0x74/0xc0
> [    3.572605]  [<c01fbbe7>] ? sysfs_create_link+0x17/0x20
> [    3.572605]  [<c02e6cc4>] ? generic_ide_probe+0x24/0x30
> [    3.572605]  [<c02c483c>] ? really_probe+0x8c/0x110
> [    3.572605]  [<c02c493c>] ? driver_probe_device+0x1c/0x30
> [    3.572605]  [<c01515df>] ? down+0x2f/0x50
> [    3.572605]  [<c02c4a84>] ? __driver_attach+0x74/0x80
> [    3.572605]  [<c02c37b5>] ? bus_for_each_dev+0x55/0x70
> [    3.572605]  [<c02c4aae>] ? driver_attach+0x1e/0x30
> [    3.572605]  [<c02c4a10>] ? __driver_attach+0x0/0x80
> [    3.572605]  [<c02c3f36>] ? bus_add_driver+0xb6/0x1a0
> [    3.572605]  [<c02e6d00>] ? generic_ide_shutdown+0x0/0x30
> [    3.572605]  [<c02e6d00>] ? generic_ide_shutdown+0x0/0x30
> [    3.572605]  [<c02c4f50>] ? driver_register+0x70/0xd0
> [    3.572605]  [<c0137efd>] ? printk+0x1d/0x30
> [    3.572605]  [<c058fef0>] ? ide_cdrom_init+0x0/0x20
> [    3.572605]  [<c058ff0c>] ? ide_cdrom_init+0x1c/0x20
> [    3.572605]  [<c0101042>] ? do_one_initcall+0x32/0x1d0
> [    3.572605]  [<c011f54f>] ? __change_page_attr_set_clr+0x2f/0x70
> [    3.572605]  [<c015ca8c>] ? validate_chain+0x3fc/0x540
> [    3.572605]  [<c015ca8c>] ? validate_chain+0x3fc/0x540
> [    3.572605]  [<c015e95c>] ? __lock_acquire+0x29c/0x8b0
> [    3.572605]  [<c01a9008>] ? check_bytes+0x8/0x20
> [    3.572605]  [<c01a9099>] ? check_bytes_and_report+0x29/0xc0
> [    3.572605]  [<c0198574>] ? page_address+0x14/0xe0
> [    3.572605]  [<c01a9196>] ? check_pad_bytes+0x66/0x80
> [    3.572605]  [<c0198574>] ? page_address+0x14/0xe0
> [    3.572605]  [<c01a9764>] ? trace+0x14/0x90
> [    3.572605]  [<c01a935a>] ? check_object+0xaa/0x1c0
> [    3.572605]  [<c015ca8c>] ? validate_chain+0x3fc/0x540
> [    3.572605]  [<c015e95c>] ? __lock_acquire+0x29c/0x8b0
> [    3.572605]  [<c015a424>] ? lock_release_holdtime+0x74/0xc0
> [    3.572605]  [<c01f355c>] ? proc_register+0x9c/0x140
> [    3.572605]  [<c015fb47>] ? __lock_release+0x47/0x70
> [    3.572605]  [<c03eace2>] ? _spin_unlock+0x22/0x30
> [    3.572605]  [<c01f355c>] ? proc_register+0x9c/0x140
> [    3.572605]  [<c01f38e9>] ? create_proc_entry+0x69/0xa0
> [    3.572605]  [<c0173234>] ? register_irq_proc+0x14/0xd0
> [    3.572605]  [<c056ea6a>] ? do_initcalls+0x2a/0x40
> [    3.572605]  [<c056ead0>] ? kernel_init+0x0/0xa0
> [    3.572605]  [<c056ea9c>] ? do_basic_setup+0x1c/0x20
> [    3.572605]  [<c056eb25>] ? kernel_init+0x55/0xa0
> [    3.572605]  [<c0103d33>] ? kernel_thread_helper+0x7/0x10
> [    3.572605] Code: 05 00 00 80 00 39 c2 72 ea a1 c4 d4 52 c0 2d 00 30 60 00 25 00 00 c0 ff 2d 00 20 00 00 39 c2 73 d2 0f 0b 8d b6 00 00 00 00 eb fe <0f> 0b 8d b6 00 00 00 00 8d bf 00 00 00 00 eb fe 8d b4 26 00 00 
> [    3.572605] EIP: [<c011e402>] __phys_addr+0x52/0x70 SS:ESP 0068:f700f930
> [    3.824801] ---[ end trace d537ae8ff1cd7947 ]---

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: linux-next-20090225: ide-cd triggers BUG at arch/x86/mm/ioremap.c:80!
  2009-02-26 14:29 ` Bartlomiej Zolnierkiewicz
@ 2009-02-26 15:51   ` Borislav Petkov
  2009-03-02  2:15     ` Tetsuo Handa
  0 siblings, 1 reply; 10+ messages in thread
From: Borislav Petkov @ 2009-02-26 15:51 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: Tetsuo Handa, linux-kernel

Hi,

On Thu, Feb 26, 2009 at 3:29 PM, Bartlomiej Zolnierkiewicz
<bzolnier@gmail.com> wrote:
> On Thursday 26 February 2009, Tetsuo Handa wrote:
>> 2.6.29-rc6 is OK.
>
> Could you try to narrow down the issue by bisecting linux-next?

Can you also apply the following patch and send us the output?

Thanks.

--
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index 9e19aec..fca6e64 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -918,6 +918,12 @@ static ide_startstop_t
ide_cd_do_request(ide_drive_t *drive, struct request *rq,

 	ide_init_sg_cmd(&cmd,
 		blk_fs_request(rq) ? (rq->nr_sectors << 9) : rq->data_len);
+
+	blk_dump_rq_flags(rq, "mapping rq to sg");
+
+	if ((unsigned long)rq->data < PAGE_OFFSET)
+		dump_stack();
+
 	ide_map_sg(drive, &cmd);

 	return ide_issue_pc(drive, &cmd);

-- 
Regards/Gruss,
Boris

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: linux-next-20090225: ide-cd triggers BUG at arch/x86/mm/ioremap.c:80!
  2009-02-26 15:51   ` Borislav Petkov
@ 2009-03-02  2:15     ` Tetsuo Handa
  2009-03-02 13:15       ` Borislav Petkov
  0 siblings, 1 reply; 10+ messages in thread
From: Tetsuo Handa @ 2009-03-02  2:15 UTC (permalink / raw)
  To: bzolnier, petkovbb; +Cc: linux-kernel

Hello.

Bartlomiej Zolnierkiewicz wrote:
> Could you try to narrow down the issue by bisecting linux-next?
Below is what I tried.

# git bisect start next-20090227 v2.6.29-rc6 -- drivers/ide/
Bisecting: 82 revisions left to test after this
[014d273312ccf10311f8a95263330b20684936bc] au1xxx-ide: auide_dma_end() cleanup
# git bisect good
Bisecting: 41 revisions left to test after this
[3ddb800f6e42c0c3f9d172d50250b0c678f2baea] ide-cd: use ide_end_rq() also for failed non-fs requests
# git bisect good
Bisecting: 20 revisions left to test after this
[edf7ed742637b50e4977d7331d411fee79d2ddaf] ide: destroy DMA mappings after ending DMA (v2)
# git bisect bad
Bisecting: 10 revisions left to test after this
[cba1f97899c72442600464aaae5a24c7e0b65656] ide-cd: cleanup ide_cd_do_request()
# git bisect good
Bisecting: 5 revisions left to test after this
[7a4366a812ec85b9fb6e2d1dcc3d5b5265c1b529] ide-cd: use common completion path for DMA requests in cdrom_newpc_intr()
# git bisect bad
Bisecting: 2 revisions left to test after this
[9c23f4e08167015bcd889a1af64f751cfd67098f] ide-cd: fix non-SECTOR_SIZE-multiples PIO transfers for fs requests
# git bisect good
Bisecting: 1 revisions left to test after this
[09ba9b1c0591203d1e18821dfbc6748f6bc6c87d] ide-cd: use scatterlists for PIO transfers (non-fs requests)
# git bisect bad
Bisecting: 0 revisions left to test after this
[5057301c48092007e9f1892a8de94d1091a86517] ide-cd: merge ide_cd_prepare_rw_request() into cdrom_start_rw()
# git bisect good
09ba9b1c0591203d1e18821dfbc6748f6bc6c87d is first bad commit
commit 09ba9b1c0591203d1e18821dfbc6748f6bc6c87d
Author: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Date:   Fri Feb 27 09:15:51 2009 +1100

    ide-cd: use scatterlists for PIO transfers (non-fs requests)

    Convert ide-cd to use scatterlists for PIO transfers and get rid of
    partial completions (except on error) also for non-fs requests.

    Cc: Borislav Petkov <petkovbb@gmail.com>
    Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>

:040000 040000 ed031364d219241aabb64458023e7b212166df72 c384309fff17ce6004f3348d6c8be94375e9f372 M      drivers

Borislav Petkov wrote:
> Can you also apply the following patch and send us the output?
I applied the patch after "git bisect reset" since I couldn't apply from this
state.

[    3.419143] ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
[    3.424508] ide_generic: please use "probe_mask=0x3f" module parameter for probing all legacy ISA IDE ports
[    3.429658] ide-gd driver 1.18
[    3.433879] ide-cd driver 5.00
[    3.440135] mapping rq to sg: dev hda: type=a, flags=82640
[    3.441873]   sector 4294967295, nr/cnr 0/0
[    3.445288]   bio (null), biotail (null), buffer (null), data f700fbc4, len 24
[    3.452602] ide-cd: hda: ATAPI 1X CD-ROM drive, 32kB Cache
[    3.456659] Uniform CD-ROM driver Revision: 3.20
[    3.460913] mapping rq to sg: dev hda: type=a, flags=8a640
[    3.464697]   sector 4294967295, nr/cnr 0/0
[    3.465881]   bio (null), biotail (null), buffer (null), data (null), len 0
[    3.472354] Pid: 1, comm: swapper Not tainted 2.6.29-rc6-next-20090227-dirty #10
[    3.476790] Call Trace:
[    3.477860]  [<c02ef9bd>] ide_cd_do_request+0x12d/0x170
[    3.480496]  [<c02e1d28>] start_request+0xa8/0x160
[    3.481883]  [<c015d92b>] ? trace_hardirqs_on+0xb/0x10
[    3.485680]  [<c02e1f7b>] do_ide_request+0x16b/0x250
[    3.489231]  [<c025e5a5>] ? blk_remove_plug+0x75/0xf0
[    3.492817]  [<c025f770>] blk_start_queueing+0x20/0x30
[    3.495475]  [<c025d2be>] elv_insert+0x17e/0x1b0
[    3.497088]  [<c025e458>] ? blk_plug_device+0x88/0x120
[    3.499681]  [<c025d372>] __elv_add_request+0x82/0xc0
[    3.501428]  [<c0263ad0>] blk_execute_rq_nowait+0x60/0xb0
[    3.504214]  [<c0263bb6>] blk_execute_rq+0x96/0xd0
[    3.505802]  [<c0263a40>] ? blk_end_sync_rq+0x0/0x30
[    3.508392]  [<c025f59c>] ? get_request_wait+0x2c/0x160
[    3.509883]  [<c0160429>] ? __lock_acquired+0x109/0x1c0
[    3.512691]  [<c025f6f4>] ? blk_get_request+0x24/0x80
[    3.515239]  [<c02ef196>] ide_cd_queue_pc+0xb6/0x140
[    3.516904]  [<c01a9614>] ? trace+0x14/0x90
[    3.519311]  [<c01a920a>] ? check_object+0xaa/0x1c0
[    3.521082]  [<c01a8e34>] ? init_object+0x14/0x90
[    3.523696]  [<c01a9854>] ? alloc_debug_processing+0xf4/0x120
[    3.525670]  [<c02efac7>] cdrom_check_status+0x87/0x90
[    3.528380]  [<c015d92b>] ? trace_hardirqs_on+0xb/0x10
[    3.529883]  [<c02efc76>] ide_cd_read_toc+0x46/0x430
[    3.532577]  [<c02ebe61>] ? ide_add_proc_entries+0x31/0x60
[    3.535498]  [<c02f08a4>] ? ide_cdrom_setup+0x104/0x140
[    3.537249]  [<c02f0d7b>] ide_cd_probe+0x11b/0x170
[    3.539689]  [<c01fb9f0>] ? sysfs_do_create_link+0xc0/0x150
[    3.541533]  [<c015a4f4>] ? lock_release_holdtime+0x74/0xc0
[    3.544319]  [<c01fba97>] ? sysfs_create_link+0x17/0x20
[    3.545883]  [<c02e0ba4>] generic_ide_probe+0x24/0x30
[    3.548642]  [<c02be6ac>] really_probe+0x8c/0x110
[    3.551114]  [<c02be81c>] driver_probe_device+0x1c/0x30
[    3.552862]  [<c01516af>] ? down+0x2f/0x50
[    3.555169]  [<c02be964>] __driver_attach+0x74/0x80
[    3.556805]  [<c02bd625>] bus_for_each_dev+0x55/0x70
[    3.559303]  [<c02be98e>] driver_attach+0x1e/0x30
[    3.560885]  [<c02be8f0>] ? __driver_attach+0x0/0x80
[    3.563395]  [<c02bdda6>] bus_add_driver+0xb6/0x1a0
[    3.565049]  [<c02e0be0>] ? generic_ide_shutdown+0x0/0x30
[    3.567763]  [<c02e0be0>] ? generic_ide_shutdown+0x0/0x30
[    3.569625]  [<c02bee30>] driver_register+0x70/0xd0
[    3.572256]  [<c0137fcd>] ? printk+0x1d/0x30
[    3.573718]  [<c0574c80>] ? ide_cdrom_init+0x0/0x20
[    3.576207]  [<c0574c9c>] ide_cdrom_init+0x1c/0x20
[    3.577771]  [<c0101042>] do_one_initcall+0x32/0x1d0
[    3.580310]  [<c011f61f>] ? __change_page_attr_set_clr+0x2f/0x70
[    3.583259]  [<c015cb5c>] ? validate_chain+0x3fc/0x540
[    3.584968]  [<c015cb5c>] ? validate_chain+0x3fc/0x540
[    3.587568]  [<c015ea2c>] ? __lock_acquire+0x29c/0x8b0
[    3.589353]  [<c01a8eb8>] ? check_bytes+0x8/0x20
[    3.591841]  [<c01a8f49>] ? check_bytes_and_report+0x29/0xc0
[    3.593802]  [<c0198424>] ? page_address+0x14/0xe0
[    3.596285]  [<c01a9046>] ? check_pad_bytes+0x66/0x80
[    3.597887]  [<c0198424>] ? page_address+0x14/0xe0
[    3.600524]  [<c01a9614>] ? trace+0x14/0x90
[    3.601873]  [<c01a920a>] ? check_object+0xaa/0x1c0
[    3.604398]  [<c015cb5c>] ? validate_chain+0x3fc/0x540
[    3.607023]  [<c015ea2c>] ? __lock_acquire+0x29c/0x8b0
[    3.608794]  [<c015a4f4>] ? lock_release_holdtime+0x74/0xc0
[    3.611679]  [<c01f340c>] ? proc_register+0x9c/0x140
[    3.613707]  [<c015fc17>] ? __lock_release+0x47/0x70
[    3.616361]  [<c03e4c02>] ? _spin_unlock+0x22/0x30
[    3.617890]  [<c01f340c>] ? proc_register+0x9c/0x140
[    3.620617]  [<c01f3799>] ? create_proc_entry+0x69/0xa0
[    3.623493]  [<c01730f4>] ? register_irq_proc+0x14/0xd0
[    3.625260]  [<c0553a6a>] do_initcalls+0x2a/0x40
[    3.627647]  [<c0553ad0>] ? kernel_init+0x0/0xa0
[    3.629374]  [<c0553a9c>] do_basic_setup+0x1c/0x20
[    3.631837]  [<c0553b25>] kernel_init+0x55/0xa0
[    3.633475]  [<c0103d33>] kernel_thread_helper+0x7/0x10
[    3.636655] ------------[ cut here ]------------
[    3.639236] kernel BUG at arch/x86/mm/ioremap.c:80!
[    3.640100] invalid opcode: 0000 [#1] SMP DEBUG_PAGEALLOC
[    3.640100] last sysfs file: 
[    3.640100] Modules linked in:
[    3.640100] 
[    3.640100] Pid: 1, comm: swapper Not tainted (2.6.29-rc6-next-20090227-dirty #10) VMware Virtual Platform
[    3.640100] EIP: 0060:[<c011e4d2>] EFLAGS: 00010213 CPU: 0
[    3.640100] EIP is at __phys_addr+0x52/0x70
[    3.640100] EAX: 00000000 EBX: 00000000 ECX: 00000018 EDX: 00000000
[    3.640100] ESI: f69f4060 EDI: 00000000 EBP: f700f92c ESP: f700f92c
[    3.640100]  DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068
[    3.640100] Process swapper (pid: 1, ti=f700f000 task=f7030000 task.ti=f700f000)
[    3.640100] Stack:
[    3.640100]  f700f940 c0277c23 f69f4060 f700f95c f700f99c f700f950 c02e1b62 f629b840
[    3.640100]  f700f95c f700f9a8 c02ef9a9 f6b86180 00000000 00000000 00000000 00000000
[    3.640100]  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[    3.640100] Call Trace:
[    3.640100]  [<c0277c23>] ? sg_init_one+0x23/0x90
[    3.640100]  [<c02e1b62>] ? ide_map_sg+0x42/0x70
[    3.640100]  [<c02ef9a9>] ? ide_cd_do_request+0x119/0x170
[    3.640100]  [<c02e1d28>] ? start_request+0xa8/0x160
[    3.640100]  [<c015d92b>] ? trace_hardirqs_on+0xb/0x10
[    3.640100]  [<c02e1f7b>] ? do_ide_request+0x16b/0x250
[    3.640100]  [<c025e5a5>] ? blk_remove_plug+0x75/0xf0
[    3.640100]  [<c025f770>] ? blk_start_queueing+0x20/0x30
[    3.640100]  [<c025d2be>] ? elv_insert+0x17e/0x1b0
[    3.640100]  [<c025e458>] ? blk_plug_device+0x88/0x120
[    3.640100]  [<c025d372>] ? __elv_add_request+0x82/0xc0
[    3.640100]  [<c0263ad0>] ? blk_execute_rq_nowait+0x60/0xb0
[    3.640100]  [<c0263bb6>] ? blk_execute_rq+0x96/0xd0
[    3.640100]  [<c0263a40>] ? blk_end_sync_rq+0x0/0x30
[    3.640100]  [<c025f59c>] ? get_request_wait+0x2c/0x160
[    3.640100]  [<c0160429>] ? __lock_acquired+0x109/0x1c0
[    3.640100]  [<c025f6f4>] ? blk_get_request+0x24/0x80
[    3.640100]  [<c02ef196>] ? ide_cd_queue_pc+0xb6/0x140
[    3.640100]  [<c01a9614>] ? trace+0x14/0x90
[    3.640100]  [<c01a920a>] ? check_object+0xaa/0x1c0
[    3.640100]  [<c01a8e34>] ? init_object+0x14/0x90
[    3.640100]  [<c01a9854>] ? alloc_debug_processing+0xf4/0x120
[    3.640100]  [<c02efac7>] ? cdrom_check_status+0x87/0x90
[    3.640100]  [<c015d92b>] ? trace_hardirqs_on+0xb/0x10
[    3.640100]  [<c02efc76>] ? ide_cd_read_toc+0x46/0x430
[    3.640100]  [<c02ebe61>] ? ide_add_proc_entries+0x31/0x60
[    3.640100]  [<c02f08a4>] ? ide_cdrom_setup+0x104/0x140
[    3.640100]  [<c02f0d7b>] ? ide_cd_probe+0x11b/0x170
[    3.640100]  [<c01fb9f0>] ? sysfs_do_create_link+0xc0/0x150
[    3.640100]  [<c015a4f4>] ? lock_release_holdtime+0x74/0xc0
[    3.640100]  [<c01fba97>] ? sysfs_create_link+0x17/0x20
[    3.640100]  [<c02e0ba4>] ? generic_ide_probe+0x24/0x30
[    3.640100]  [<c02be6ac>] ? really_probe+0x8c/0x110
[    3.640100]  [<c02be81c>] ? driver_probe_device+0x1c/0x30
[    3.640100]  [<c01516af>] ? down+0x2f/0x50
[    3.640100]  [<c02be964>] ? __driver_attach+0x74/0x80
[    3.640100]  [<c02bd625>] ? bus_for_each_dev+0x55/0x70
[    3.640100]  [<c02be98e>] ? driver_attach+0x1e/0x30
[    3.640100]  [<c02be8f0>] ? __driver_attach+0x0/0x80
[    3.640100]  [<c02bdda6>] ? bus_add_driver+0xb6/0x1a0
[    3.640100]  [<c02e0be0>] ? generic_ide_shutdown+0x0/0x30
[    3.640100]  [<c02e0be0>] ? generic_ide_shutdown+0x0/0x30
[    3.640100]  [<c02bee30>] ? driver_register+0x70/0xd0
[    3.640100]  [<c0137fcd>] ? printk+0x1d/0x30
[    3.640100]  [<c0574c80>] ? ide_cdrom_init+0x0/0x20
[    3.640100]  [<c0574c9c>] ? ide_cdrom_init+0x1c/0x20
[    3.640100]  [<c0101042>] ? do_one_initcall+0x32/0x1d0
[    3.640100]  [<c011f61f>] ? __change_page_attr_set_clr+0x2f/0x70
[    3.640100]  [<c015cb5c>] ? validate_chain+0x3fc/0x540
[    3.640100]  [<c015cb5c>] ? validate_chain+0x3fc/0x540
[    3.640100]  [<c015ea2c>] ? __lock_acquire+0x29c/0x8b0
[    3.640100]  [<c01a8eb8>] ? check_bytes+0x8/0x20
[    3.640100]  [<c01a8f49>] ? check_bytes_and_report+0x29/0xc0
[    3.640100]  [<c0198424>] ? page_address+0x14/0xe0
[    3.640100]  [<c01a9046>] ? check_pad_bytes+0x66/0x80
[    3.640100]  [<c0198424>] ? page_address+0x14/0xe0
[    3.640100]  [<c01a9614>] ? trace+0x14/0x90
[    3.640100]  [<c01a920a>] ? check_object+0xaa/0x1c0
[    3.640100]  [<c015cb5c>] ? validate_chain+0x3fc/0x540
[    3.640100]  [<c015ea2c>] ? __lock_acquire+0x29c/0x8b0
[    3.640100]  [<c015a4f4>] ? lock_release_holdtime+0x74/0xc0
[    3.640100]  [<c01f340c>] ? proc_register+0x9c/0x140
[    3.640100]  [<c015fc17>] ? __lock_release+0x47/0x70
[    3.640100]  [<c03e4c02>] ? _spin_unlock+0x22/0x30
[    3.640100]  [<c01f340c>] ? proc_register+0x9c/0x140
[    3.640100]  [<c01f3799>] ? create_proc_entry+0x69/0xa0
[    3.640100]  [<c01730f4>] ? register_irq_proc+0x14/0xd0
[    3.640100]  [<c0553a6a>] ? do_initcalls+0x2a/0x40
[    3.640100]  [<c0553ad0>] ? kernel_init+0x0/0xa0
[    3.640100]  [<c0553a9c>] ? do_basic_setup+0x1c/0x20
[    3.640100]  [<c0553b25>] ? kernel_init+0x55/0xa0
[    3.640100]  [<c0103d33>] ? kernel_thread_helper+0x7/0x10
[    3.640100] Code: 05 00 00 80 00 39 c2 72 ea a1 c4 34 51 c0 2d 00 30 60 00 25 00 00 c0 ff 2d 00 20 00 00 39 c2 73 d2 0f 0b 8d b6 00 00 00 00 eb fe <0f> 0b 8d b6 00 00 00 00 8d bf 00 00 00 00 eb fe 8d b4 26 00 00 
[    3.640100] EIP: [<c011e4d2>] __phys_addr+0x52/0x70 SS:ESP 0068:f700f92c
[    3.901567] ---[ end trace 62bacdc937c3e403 ]---

Full log is at http://I-love.SAKURA.ne.jp/tmp/dmesg-2.6.29-rc6-next-20090227-dirty.txt

Config is at http://I-love.SAKURA.ne.jp/tmp/config-2.6.29-rc6-next-20090227-dirty

Regards.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: linux-next-20090225: ide-cd triggers BUG at arch/x86/mm/ioremap.c:80!
  2009-03-02  2:15     ` Tetsuo Handa
@ 2009-03-02 13:15       ` Borislav Petkov
  2009-03-02 15:27         ` Bartlomiej Zolnierkiewicz
  2009-03-03 12:31         ` Tetsuo Handa
  0 siblings, 2 replies; 10+ messages in thread
From: Borislav Petkov @ 2009-03-02 13:15 UTC (permalink / raw)
  To: Tetsuo Handa; +Cc: bzolnier, linux-kernel

Hi,

> Borislav Petkov wrote:
>> Can you also apply the following patch and send us the output?
> I applied the patch after "git bisect reset" since I couldn't apply from this
> state.
>
> [    3.419143] ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
> [    3.424508] ide_generic: please use "probe_mask=0x3f" module parameter for probing all legacy ISA IDE ports
> [    3.429658] ide-gd driver 1.18
> [    3.433879] ide-cd driver 5.00
> [    3.440135] mapping rq to sg: dev hda: type=a, flags=82640
> [    3.441873]   sector 4294967295, nr/cnr 0/0
> [    3.445288]   bio (null), biotail (null), buffer (null), data f700fbc4, len 24
> [    3.452602] ide-cd: hda: ATAPI 1X CD-ROM drive, 32kB Cache
> [    3.456659] Uniform CD-ROM driver Revision: 3.20
> [    3.460913] mapping rq to sg: dev hda: type=a, flags=8a640
> [    3.464697]   sector 4294967295, nr/cnr 0/0
> [    3.465881]   bio (null), biotail (null), buffer (null), data (null), len 0
> [    3.472354] Pid: 1, comm: swapper Not tainted 2.6.29-rc6-next-20090227-dirty #10
> [    3.476790] Call Trace:
> [    3.477860]  [<c02ef9bd>] ide_cd_do_request+0x12d/0x170
> [    3.480496]  [<c02e1d28>] start_request+0xa8/0x160
> [    3.481883]  [<c015d92b>] ? trace_hardirqs_on+0xb/0x10
> [    3.485680]  [<c02e1f7b>] do_ide_request+0x16b/0x250
> [    3.489231]  [<c025e5a5>] ? blk_remove_plug+0x75/0xf0
> [    3.492817]  [<c025f770>] blk_start_queueing+0x20/0x30
> [    3.495475]  [<c025d2be>] elv_insert+0x17e/0x1b0
> [    3.497088]  [<c025e458>] ? blk_plug_device+0x88/0x120
> [    3.499681]  [<c025d372>] __elv_add_request+0x82/0xc0
> [    3.501428]  [<c0263ad0>] blk_execute_rq_nowait+0x60/0xb0
> [    3.504214]  [<c0263bb6>] blk_execute_rq+0x96/0xd0
> [    3.505802]  [<c0263a40>] ? blk_end_sync_rq+0x0/0x30
> [    3.508392]  [<c025f59c>] ? get_request_wait+0x2c/0x160
> [    3.509883]  [<c0160429>] ? __lock_acquired+0x109/0x1c0
> [    3.512691]  [<c025f6f4>] ? blk_get_request+0x24/0x80
> [    3.515239]  [<c02ef196>] ide_cd_queue_pc+0xb6/0x140

ok, if I read the stack dump correctly, we map an rq with rq->data = NULL to an
sg. Code path starts at cdrom_check_status() and actually, we don't need a
buffer here since we send a TEST_UNIT_READY and we're only interested in the
sense returned. And this won't trigger if we haven't enabled
CONFIG_DEBUG_VIRTUAL. Yep, I know that this is a dirty hack but it fixes it
here. Tetsuo, does the following fix your problem?

diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index 481fb1b..e6ac4cc 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -238,6 +238,8 @@ void ide_map_sg(ide_drive_t *drive, struct ide_cmd *cmd)
 		sg_init_one(sg, rq->buffer, rq->nr_sectors * SECTOR_SIZE);
 		cmd->sg_nents = 1;
 	} else if (!rq->bio) {
+		if (!rq->data)
+			rq->data = &rq->data;
 		sg_init_one(sg, rq->data, rq->data_len);
 		cmd->sg_nents = 1;
 	} else

@Bart: I'm open for suggestions wrt to a more elegant solution :).

-- 
Regards/Gruss,
Boris

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: linux-next-20090225: ide-cd triggers BUG at arch/x86/mm/ioremap.c:80!
  2009-03-02 13:15       ` Borislav Petkov
@ 2009-03-02 15:27         ` Bartlomiej Zolnierkiewicz
  2009-03-03  8:35           ` Borislav Petkov
  2009-03-03 12:31         ` Tetsuo Handa
  1 sibling, 1 reply; 10+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2009-03-02 15:27 UTC (permalink / raw)
  To: petkovbb; +Cc: Tetsuo Handa, linux-kernel

On Monday 02 March 2009, Borislav Petkov wrote:
> Hi,
> 
> > Borislav Petkov wrote:
> >> Can you also apply the following patch and send us the output?
> > I applied the patch after "git bisect reset" since I couldn't apply from this
> > state.
> >
> > [    3.419143] ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
> > [    3.424508] ide_generic: please use "probe_mask=0x3f" module parameter for probing all legacy ISA IDE ports
> > [    3.429658] ide-gd driver 1.18
> > [    3.433879] ide-cd driver 5.00
> > [    3.440135] mapping rq to sg: dev hda: type=a, flags=82640
> > [    3.441873]   sector 4294967295, nr/cnr 0/0
> > [    3.445288]   bio (null), biotail (null), buffer (null), data f700fbc4, len 24
> > [    3.452602] ide-cd: hda: ATAPI 1X CD-ROM drive, 32kB Cache
> > [    3.456659] Uniform CD-ROM driver Revision: 3.20
> > [    3.460913] mapping rq to sg: dev hda: type=a, flags=8a640
> > [    3.464697]   sector 4294967295, nr/cnr 0/0
> > [    3.465881]   bio (null), biotail (null), buffer (null), data (null), len 0
> > [    3.472354] Pid: 1, comm: swapper Not tainted 2.6.29-rc6-next-20090227-dirty #10
> > [    3.476790] Call Trace:
> > [    3.477860]  [<c02ef9bd>] ide_cd_do_request+0x12d/0x170
> > [    3.480496]  [<c02e1d28>] start_request+0xa8/0x160
> > [    3.481883]  [<c015d92b>] ? trace_hardirqs_on+0xb/0x10
> > [    3.485680]  [<c02e1f7b>] do_ide_request+0x16b/0x250
> > [    3.489231]  [<c025e5a5>] ? blk_remove_plug+0x75/0xf0
> > [    3.492817]  [<c025f770>] blk_start_queueing+0x20/0x30
> > [    3.495475]  [<c025d2be>] elv_insert+0x17e/0x1b0
> > [    3.497088]  [<c025e458>] ? blk_plug_device+0x88/0x120
> > [    3.499681]  [<c025d372>] __elv_add_request+0x82/0xc0
> > [    3.501428]  [<c0263ad0>] blk_execute_rq_nowait+0x60/0xb0
> > [    3.504214]  [<c0263bb6>] blk_execute_rq+0x96/0xd0
> > [    3.505802]  [<c0263a40>] ? blk_end_sync_rq+0x0/0x30
> > [    3.508392]  [<c025f59c>] ? get_request_wait+0x2c/0x160
> > [    3.509883]  [<c0160429>] ? __lock_acquired+0x109/0x1c0
> > [    3.512691]  [<c025f6f4>] ? blk_get_request+0x24/0x80
> > [    3.515239]  [<c02ef196>] ide_cd_queue_pc+0xb6/0x140
> 
> ok, if I read the stack dump correctly, we map an rq with rq->data = NULL to an
> sg. Code path starts at cdrom_check_status() and actually, we don't need a
> buffer here since we send a TEST_UNIT_READY and we're only interested in the
> sense returned. And this won't trigger if we haven't enabled
> CONFIG_DEBUG_VIRTUAL. Yep, I know that this is a dirty hack but it fixes it
> here. Tetsuo, does the following fix your problem?
> 
> diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
> index 481fb1b..e6ac4cc 100644
> --- a/drivers/ide/ide-io.c
> +++ b/drivers/ide/ide-io.c
> @@ -238,6 +238,8 @@ void ide_map_sg(ide_drive_t *drive, struct ide_cmd *cmd)
>  		sg_init_one(sg, rq->buffer, rq->nr_sectors * SECTOR_SIZE);
>  		cmd->sg_nents = 1;
>  	} else if (!rq->bio) {
> +		if (!rq->data)
> +			rq->data = &rq->data;
>  		sg_init_one(sg, rq->data, rq->data_len);
>  		cmd->sg_nents = 1;
>  	} else
> 
> @Bart: I'm open for suggestions wrt to a more elegant solution :).

Seems like we should check for blk_fs_request(fs) || rq->data_len
instead of unconditionally sg mapping all requests in ->do_request.

[ Sigh, I thought it is harmless to always call sg_init_one()...
  probably because it was true back when I added this helper :) ]

Thanks,
Bart

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: linux-next-20090225: ide-cd triggers BUG at arch/x86/mm/ioremap.c:80!
  2009-03-02 15:27         ` Bartlomiej Zolnierkiewicz
@ 2009-03-03  8:35           ` Borislav Petkov
  2009-03-04  3:33             ` Tetsuo Handa
  0 siblings, 1 reply; 10+ messages in thread
From: Borislav Petkov @ 2009-03-03  8:35 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: Tetsuo Handa, linux-kernel

Hi,

> > @Bart: I'm open for suggestions wrt to a more elegant solution :).
> 
> Seems like we should check for blk_fs_request(fs) || rq->data_len
> instead of unconditionally sg mapping all requests in ->do_request.
> 
> [ Sigh, I thought it is harmless to always call sg_init_one()...
>   probably because it was true back when I added this helper :) ]

how about something like that:

We map to sg once in ide_issue_pc since all drivers call into that.
We have to exclude ide_tape for now since it doesn't do that and uses
its own io buffers-method. Then, we do for both ide-cd and ide-floppy
blk_rq_bytes(rq) in ide_init_sg_cmd() after I've fixed the partial
completions issue later.

Lightly tested with ide-cd for now.

@Tetsuo: please do test, this should fix your OOPS.

Thanks.

--

diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c
index ff6adea..3c7992a 100644
--- a/drivers/ide/ide-atapi.c
+++ b/drivers/ide/ide-atapi.c
@@ -625,7 +625,7 @@ static ide_startstop_t ide_transfer_pc(ide_drive_t *drive)
 
 ide_startstop_t ide_issue_pc(ide_drive_t *drive, struct ide_cmd *cmd)
 {
-	struct ide_atapi_pc *pc;
+	struct ide_atapi_pc *uninitialized_var(pc);
 	ide_hwif_t *hwif = drive->hwif;
 	ide_expiry_t *expiry = NULL;
 	struct request *rq = hwif->rq;
@@ -642,6 +642,7 @@ ide_startstop_t ide_issue_pc(ide_drive_t *drive, struct ide_cmd *cmd)
 
 		if (drive->dma)
 			drive->dma = !ide_dma_prepare(drive, cmd);
+
 	} else {
 		pc = drive->pc;
 
@@ -669,6 +670,17 @@ ide_startstop_t ide_issue_pc(ide_drive_t *drive, struct ide_cmd *cmd)
 						       : WAIT_TAPE_CMD;
 	}
 
+	if (drive->media != ide_tape &&
+	      !drive->dma && (blk_fs_request(rq) || rq->data_len)) {
+		ide_init_sg_cmd(cmd, blk_rq_bytes(rq));
+		ide_map_sg(drive, cmd);
+
+		if (drive->media == ide_floppy) {
+			pc->sg = hwif->sg_table;
+			pc->sg_cnt = cmd->sg_nents;
+		}
+	}
+
 	ide_init_packet_cmd(cmd, tf_flags, bcount, drive->dma);
 
 	(void)do_rw_taskfile(drive, cmd);
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index 9e19aec..e7c278c 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -916,10 +916,6 @@ static ide_startstop_t ide_cd_do_request(ide_drive_t *drive, struct request *rq,
 
 	cmd.rq = rq;
 
-	ide_init_sg_cmd(&cmd,
-		blk_fs_request(rq) ? (rq->nr_sectors << 9) : rq->data_len);
-	ide_map_sg(drive, &cmd);
-
 	return ide_issue_pc(drive, &cmd);
 out_end:
 	nsectors = rq->hard_nr_sectors;
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
index b7f0206..9a58db3 100644
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -244,7 +244,6 @@ static ide_startstop_t ide_floppy_do_request(ide_drive_t *drive,
 					     struct request *rq, sector_t block)
 {
 	struct ide_disk_obj *floppy = drive->driver_data;
-	ide_hwif_t *hwif = drive->hwif;
 	struct ide_cmd cmd;
 	struct ide_atapi_pc *pc;
 
@@ -292,13 +291,6 @@ static ide_startstop_t ide_floppy_do_request(ide_drive_t *drive,
 		cmd.tf_flags |= IDE_TFLAG_WRITE;
 
 	cmd.rq = rq;
-
-	ide_init_sg_cmd(&cmd, rq->nr_sectors << 9);
-	ide_map_sg(drive, &cmd);
-
-	pc->sg = hwif->sg_table;
-	pc->sg_cnt = cmd.sg_nents;
-
 	pc->rq = rq;
 
 	return ide_floppy_issue_pc(drive, &cmd, pc);


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: linux-next-20090225: ide-cd triggers BUG at arch/x86/mm/ioremap.c:80!
  2009-03-02 13:15       ` Borislav Petkov
  2009-03-02 15:27         ` Bartlomiej Zolnierkiewicz
@ 2009-03-03 12:31         ` Tetsuo Handa
  1 sibling, 0 replies; 10+ messages in thread
From: Tetsuo Handa @ 2009-03-03 12:31 UTC (permalink / raw)
  To: petkovbb; +Cc: bzolnier, linux-kernel

Hello.

Borislav Petkov wrote:
> ok, if I read the stack dump correctly, we map an rq with rq->data = NULL to an
> sg. Code path starts at cdrom_check_status() and actually, we don't need a
> buffer here since we send a TEST_UNIT_READY and we're only interested in the
> sense returned. And this won't trigger if we haven't enabled
> CONFIG_DEBUG_VIRTUAL. Yep, I know that this is a dirty hack but it fixes it
> here. Tetsuo, does the following fix your problem?
> 
> diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
> index 481fb1b..e6ac4cc 100644
> --- a/drivers/ide/ide-io.c
> +++ b/drivers/ide/ide-io.c
> @@ -238,6 +238,8 @@ void ide_map_sg(ide_drive_t *drive, struct ide_cmd *cmd)
>  		sg_init_one(sg, rq->buffer, rq->nr_sectors * SECTOR_SIZE);
>  		cmd->sg_nents = 1;
>  	} else if (!rq->bio) {
> +		if (!rq->data)
> +			rq->data = &rq->data;
>  		sg_init_one(sg, rq->data, rq->data_len);
>  		cmd->sg_nents = 1;
>  	} else
> 
Yes. This patch solved the problem.



You sent me another patch.
> @Tetsuo: please do test, this should fix your OOPS.
I'll try your new patch tomorrow.



Thanks.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: linux-next-20090225: ide-cd triggers BUG at arch/x86/mm/ioremap.c:80!
  2009-03-03  8:35           ` Borislav Petkov
@ 2009-03-04  3:33             ` Tetsuo Handa
  2009-03-04  7:23               ` Borislav Petkov
  0 siblings, 1 reply; 10+ messages in thread
From: Tetsuo Handa @ 2009-03-04  3:33 UTC (permalink / raw)
  To: petkovbb; +Cc: bzolnier, linux-kernel

Hello.

Borislav Petkov wrote:
> how about something like that:
> 
> We map to sg once in ide_issue_pc since all drivers call into that.
> We have to exclude ide_tape for now since it doesn't do that and uses
> its own io buffers-method. Then, we do for both ide-cd and ide-floppy
> blk_rq_bytes(rq) in ide_init_sg_cmd() after I've fixed the partial
> completions issue later.
> 
> Lightly tested with ide-cd for now.
> 
> @Tetsuo: please do test, this should fix your OOPS.
> 
OK. This patch solved the problem.

Thank you.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: linux-next-20090225: ide-cd triggers BUG at arch/x86/mm/ioremap.c:80!
  2009-03-04  3:33             ` Tetsuo Handa
@ 2009-03-04  7:23               ` Borislav Petkov
  0 siblings, 0 replies; 10+ messages in thread
From: Borislav Petkov @ 2009-03-04  7:23 UTC (permalink / raw)
  To: Tetsuo Handa; +Cc: bzolnier, linux-kernel

On Wed, Mar 04, 2009 at 12:33:14PM +0900, Tetsuo Handa wrote:
> Hello.
> 
> Borislav Petkov wrote:
> > how about something like that:
> > 
> > We map to sg once in ide_issue_pc since all drivers call into that.
> > We have to exclude ide_tape for now since it doesn't do that and uses
> > its own io buffers-method. Then, we do for both ide-cd and ide-floppy
> > blk_rq_bytes(rq) in ide_init_sg_cmd() after I've fixed the partial
> > completions issue later.
> > 
> > Lightly tested with ide-cd for now.
> > 
> > @Tetsuo: please do test, this should fix your OOPS.
> > 
> OK. This patch solved the problem.
> 
> Thank you.

Hi,

Thanks a lot for patiently testing for us.


-- 
Regards/Gruss,
    Boris.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2009-03-04  7:24 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-26  2:29 linux-next-20090225: ide-cd triggers BUG at arch/x86/mm/ioremap.c:80! Tetsuo Handa
2009-02-26 14:29 ` Bartlomiej Zolnierkiewicz
2009-02-26 15:51   ` Borislav Petkov
2009-03-02  2:15     ` Tetsuo Handa
2009-03-02 13:15       ` Borislav Petkov
2009-03-02 15:27         ` Bartlomiej Zolnierkiewicz
2009-03-03  8:35           ` Borislav Petkov
2009-03-04  3:33             ` Tetsuo Handa
2009-03-04  7:23               ` Borislav Petkov
2009-03-03 12:31         ` Tetsuo Handa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox