2007-02-11 02:40:34

by Komuro

[permalink] [raw]
Subject: Re: [BUG] PATA_PCMCIA does not work


>> [pata_pcmcia dmesg]
>> ata1.00: CFA, max PIO0, 20480 sectors: LBA
>> ata1.00: ata1: dev 0 multi count 0
>> ata1.01: CFA, max PIO0, 20480 sectors: LBA
>> ata1.01: ata1: dev 1 multi count 0

>Do you have two cards here ?

No. one card.
I am not sure why two devices are detected.


Actually, this card works properly with ide-cs driver.
but it displays some warning message.


hde: SunDisk SDP5-10, CFA DISK drive
hdf: SunDisk SDP5-10, CFA DISK drive
ide-probe: ignoring undecoded slave
ide2 at 0xd100-0xd107,0xd10e on irq 3
hde: max request size: 128KiB
hde: 20480 sectors (10 MB) w/1KiB Cache, CHS=320/2/32
hde:hde: set_geometry_intr: status=0x51 { DriveReady SeekComplete Error }
hde: set_geometry_intr: error=0x04 { DriveStatusError }
ide: failed opcode was: unknown
hde1
ide-cs: hde: Vpp = 0.0


Best Regards
Komuro


2007-02-18 02:09:34

by Komuro

[permalink] [raw]
Subject: Re: [BUG] PATA_PCMCIA does not work


Hi,

I tried the kernel 2.6.20-git14,
the pata_pcmcia drive works properly.Thanks!

But I do the "pccardctl eject"
NULL-pointer-dereference error happens.


[dmesg]
pcmcia: registering new device pcmcia1.0
SCSI subsystem initialized
libata version 2.10 loaded.
ata1: PATA max PIO0 cmd 0x0001d100 ctl 0x0001d10e bmdma 0x00000000 irq 3
scsi0 : pata_pcmcia
ata1.00: CFA: Hitachi XXM2.3.0, Rev 3.00, max PIO1
ata1.00: 62592 sectors, multi 0: LBA
ata1.00: configured for PIO0
scsi 0:0:0:0: Direct-Access ATA Hitachi XXM2.3.0 Rev PQ: 0 ANSI: 5
scsi 0:0:0:0: Attached scsi generic sg0 type 0
SCSI device sda: 62592 512-byte hdwr sectors (32 MB)
sda: Write Protect is off
sda: Mode Sense: 00 3a 00 00
SCSI device sda: write cache: disabled, read cache: enabled, doesn't support DPO or FUA
SCSI device sda: 62592 512-byte hdwr sectors (32 MB)
sda: Write Protect is off
sda: Mode Sense: 00 3a 00 00
SCSI device sda: write cache: disabled, read cache: enabled, doesn't support DPO or FUA
sda: sda1
sd 0:0:0:0: Attached scsi removable disk sda
pccard: card ejected from slot 1
ata1.00: disabled
BUG: unable to handle kernel NULL pointer dereference at virtual address 00000020
printing eip:
d89f7f3e
*pde = 00000000
Oops: 0000 [#1]
Modules linked in: nls_ascii vfat fat sd_mod sg pata_pcmcia libata scsi_mod dm_mirror dm_multipath dm_mod pcmcia yenta_socket rsrc_nonstatic pcmcia_core
CPU: 0
EIP: 0060:[<d89f7f3e>] Not tainted VLI
EFLAGS: 00010246 (2.6.20-git14 #1)
EIP is at ata_host_release+0x2e/0x48 [libata]
eax: d7981884 ebx: d545b8c0 ecx: d7f6f180 edx: d545b8cc
esi: 00000000 edi: 00000000 ebp: 00000000 esp: d5bfde58
ds: 007b es: 007b fs: 00d8 gs: 0033 ss: 0068
Process pccardctl (pid: 1711, ti=d5bfc000 task=c13d1540 task.ti=d5bfc000)
Stack: d545b8c0 d5ac4700 d7981a24 c0220120 d7981a24 d7981884 00000006 d5ac4720
d5ac4660 d7981884 d887c278 d71c8dbc d7c53c48 c02201e9 00000286 d7981884
c021d363 d7981884 d7981884 c021d7ae d798192c c021cd84 d7981884 d7981884
Call Trace:
[<c0220120>] release_nodes+0x10f/0x12f
[<c02201e9>] devres_release_all+0x27/0x2a
[<c021d363>] __device_release_driver+0x78/0x8e
[<c021d7ae>] device_release_driver+0x31/0x46
[<c021cd84>] bus_remove_device+0x6d/0x7d
[<c021b58a>] device_del+0x162/0x1bf
[<c021b5ef>] device_unregister+0x8/0x10
[<d88304b9>] pcmcia_card_remove+0x66/0x81 [pcmcia]
[<d883143d>] ds_event+0x4a/0x6d [pcmcia]
[<c01b6db5>] kobject_get+0xf/0x13
[<d88172da>] send_event+0x31/0x49 [pcmcia_core]
[<d88174b9>] socket_shutdown+0xc/0xb3 [pcmcia_core]
[<d881757c>] socket_remove+0x1c/0x26 [pcmcia_core]
[<d88175c5>] pcmcia_eject_card+0x3f/0x4c [pcmcia_core]
[<d8819e48>] pccard_store_eject+0x1b/0x22 [pcmcia_core]
[<d8819e2d>] pccard_store_eject+0x0/0x22 [pcmcia_core]
[<c021af3b>] dev_attr_store+0x27/0x2c
[<c017d1cb>] sysfs_write_file+0xbc/0xe5
[<c017d10f>] sysfs_write_file+0x0/0xe5
[<c014df18>] vfs_write+0x8a/0x10c
[<c014e3ae>] sys_write+0x41/0x67
[<c0103c76>] sysenter_past_esp+0x5f/0x85
[<c02b0000>] wait_for_completion+0x33/0xaf
=======================
Code: 56 53 8b b0 50 01 00 00 eb 21 8b 5c be 34 85 db 74 18 8b 43 04 8b 90 88 00 00 00 85 d2 74 04 89 d8 ff d2 8b 03 e8 fa 0d e6 ff 47 <3b> 7e 20 72 da 8b 46 28 8b 90 8c 00 00 00 85 d2 74 04 89 f0 ff
EIP: [<d89f7f3e>] ata_host_release+0x2e/0x48 [libata] SS:ESP 0068:d5bfde58

Best Regards
Komuro

2007-02-21 14:33:47

by Alan

[permalink] [raw]
Subject: Re: [BUG] PATA_PCMCIA does not work

Does this fix the oops ?

Alan


diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.20-mm2/drivers/ata/pata_pcmcia.c linux-2.6.20-mm2/drivers/ata/pata_pcmcia.c
--- linux.vanilla-2.6.20-mm2/drivers/ata/pata_pcmcia.c 2007-02-20 13:37:58.000000000 +0000
+++ linux-2.6.20-mm2/drivers/ata/pata_pcmcia.c 2007-02-21 14:06:58.792707976 +0000
@@ -308,7 +342,6 @@
if (info->ndev) {
struct ata_host *host = dev_get_drvdata(dev);
ata_host_detach(host);
- dev_set_drvdata(dev, NULL);
}
info->ndev = 0;
pdev->priv = NULL;



2007-02-21 15:24:52

by Manuel Lauss

[permalink] [raw]
Subject: Re: [BUG] PATA_PCMCIA does not work

On Wed, Feb 21, 2007 at 03:37:29PM +0000, Alan wrote:
> Does this fix the oops ?
>
> Alan
>
>
> diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.20-mm2/drivers/ata/pata_pcmcia.c linux-2.6.20-mm2/drivers/ata/pata_pcmcia.c
> --- linux.vanilla-2.6.20-mm2/drivers/ata/pata_pcmcia.c 2007-02-20 13:37:58.000000000 +0000
> +++ linux-2.6.20-mm2/drivers/ata/pata_pcmcia.c 2007-02-21 14:06:58.792707976 +0000
> @@ -308,7 +342,6 @@
> if (info->ndev) {
> struct ata_host *host = dev_get_drvdata(dev);
> ata_host_detach(host);
> - dev_set_drvdata(dev, NULL);
> }
> info->ndev = 0;
> pdev->priv = NULL;

This bug is also present in 2.6.21-rc1, and this patch
indeed fixes it.

Thanks,

--
ml.

2007-02-24 02:06:46

by Komuro

[permalink] [raw]
Subject: Re: [BUG] PATA_PCMCIA does not work


Alan <[email protected]> wrote:

The oops is fixed. Thanks!

But when I repeat insertion/rejection of the device,
ataX.00 is incremented.
Is this correct?

>pccard: PCMCIA card inserted into slot 1
>pccard: card ejected from slot 1
>ata1.00: disabled
>
>pccard: PCMCIA card inserted into slot 1
>pccard: card ejected from slot 1
>ata2.00: disabled
>
>pccard: PCMCIA card inserted into slot 1
>pccard: card ejected from slot 1
>ata3.00: disabled

Best Regards
Komuro

> Does this fix the oops ?
>
> Alan
>
>
> diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.20-mm2/drivers/ata/pata_pcmcia.c linux-2.6.20-mm2/drivers/ata/pata_pcmcia.c
> --- linux.vanilla-2.6.20-mm2/drivers/ata/pata_pcmcia.c 2007-02-20 13:37:58.000000000 +0000
> +++ linux-2.6.20-mm2/drivers/ata/pata_pcmcia.c 2007-02-21 14:06:58.792707976 +0000
> @@ -308,7 +342,6 @@
> if (info->ndev) {
> struct ata_host *host = dev_get_drvdata(dev);
> ata_host_detach(host);
> - dev_set_drvdata(dev, NULL);
> }
> info->ndev = 0;
> pdev->priv = NULL;
>
>
>

2007-02-24 23:14:26

by Komuro

[permalink] [raw]
Subject: Re: [BUG] PATA_PCMCIA does not work

Hi,

The pata_pcmcia problem is fixed. Thanks!
(I tested it on kernel 2.6.20-git14)

But kernel 2.6.20-mm2 introduced new oops
when I insert the pata_pcmcia device.


pcmcia: registering new device pcmcia1.0
SCSI subsystem initialized
libata version 2.10 loaded.
ata1: PATA max PIO0 cmd 0x0001d100 ctl 0x0001d10e bmdma 0x00000000 irq 3
scsi0 : pata_pcmcia
BUG: unable to handle kernel NULL pointer dereference at virtual address 0000004d
printing eip:
d8a1b10e
*pde = 00000000
Oops: 0000 [#1]
last sysfs file: /block/hda/size
Modules linked in: pata_pcmcia libata scsi_mod dm_mirror dm_multipath dm_mod pcmcia yenta_socket rsrc_nonstatic pcmcia_core
CPU: 0
EIP: 0060:[<d8a1b10e>] Not tainted VLI
EFLAGS: 00010296 (2.6.20-mm2 #1)
EIP is at ata_acpi_exec_tfs+0x157/0x8ad [libata]
eax: 00000001 ebx: 00000000 ecx: d6d43c84 edx: d6d43c84
esi: d51f4514 edi: 00000000 ebp: d51f438c esp: d6f2bcdc
ds: 007b es: 007b fs: 00d8 gs: 0000 ss: 0068
Process scsi_eh_0 (pid: 1647, ti=d6f2a000 task=c13c9a70 task.ti=d6f2a000)
Stack: d51f6190 00000246 00000246 00000000 d8a130b7 00000000 00000000 00000000
00000000 d6f2bd48 d6f2bdf0 d51f4514 ec000000 d51f6190 00000000 00000000
00000000 00000246 d6d43c84 00000000 00000000 00000000 00000000 ffffffff
Call Trace:
[<d8a130b7>] ata_exec_internal_sg+0x3ae/0x3b8 [libata]
[<d8a125f8>] ata_dev_configure+0xc1/0x7d2 [libata]
[<d8a10e87>] ata_dev_select+0xce/0x11a [libata]
[<d8a1324e>] ata_dev_read_id+0xe0/0x2d1 [libata]
[<d8a19c7f>] ata_do_eh+0x1235/0x16de [libata]
[<d8a1234d>] ata_std_softreset+0x0/0xbe [libata]
[<d8a14270>] ata_std_prereset+0x0/0x127 [libata]
[<c011ebe9>] cancel_work_sync+0x1c/0x87
[<d8a17c2a>] ata_bmdma_drive_eh+0xd2/0x167 [libata]
[<d8a1234d>] ata_std_softreset+0x0/0xbe [libata]
[<d8a17cf2>] ata_bmdma_error_handler+0x33/0x37 [libata]
[<d8a1210e>] ata_std_postreset+0x0/0x7e [libata]
[<d8a1a707>] ata_scsi_error+0x223/0x4b4 [libata]
[<d885b956>] scsi_error_handler+0x0/0x490 [scsi_mod]
[<d885ba16>] scsi_error_handler+0xc0/0x490 [scsi_mod]
[<c02bb445>] _spin_unlock_irq+0x5/0x7
[<c02b9d9c>] __sched_text_start+0x4e4/0x569
[<c010eaca>] __wake_up_common+0x32/0x55
[<d885b956>] scsi_error_handler+0x0/0x490 [scsi_mod]
[<c0120b4f>] kthread+0xa0/0xc9
[<c0120aaf>] kthread+0x0/0xc9
[<c0103f3f>] kernel_thread_helper+0x7/0x10
=======================
Code: 0f 84 e1 00 00 00 8b 54 24 48 c7 44 24 5c ff ff ff ff 8b 4c 24 48 c7 44 24 60 00 00 00 00 83 ea 48 8b 42 10 8b 5a 20 8b 54 24 48 <8b> 78 4c 8b 92 8c 01 00 00 89 54 24 44 8b 81 a4 00 00 00 8d 54
EIP: [<d8a1b10e>] ata_acpi_exec_tfs+0x157/0x8ad [libata] SS:ESP 0068:d6f2bcdc

Best Regards
Komuro

2007-02-25 01:45:27

by Jeff Garzik

[permalink] [raw]
Subject: Re: [BUG] PATA_PCMCIA does not work

Komuro wrote:
> Hi,
>
> The pata_pcmcia problem is fixed. Thanks!
> (I tested it on kernel 2.6.20-git14)
>
> But kernel 2.6.20-mm2 introduced new oops
> when I insert the pata_pcmcia device.
>
>
> pcmcia: registering new device pcmcia1.0
> SCSI subsystem initialized
> libata version 2.10 loaded.
> ata1: PATA max PIO0 cmd 0x0001d100 ctl 0x0001d10e bmdma 0x00000000 irq 3
> scsi0 : pata_pcmcia
> BUG: unable to handle kernel NULL pointer dereference at virtual address 0000004d
> printing eip:
> d8a1b10e
> *pde = 00000000
> Oops: 0000 [#1]
> last sysfs file: /block/hda/size
> Modules linked in: pata_pcmcia libata scsi_mod dm_mirror dm_multipath dm_mod pcmcia yenta_socket rsrc_nonstatic pcmcia_core
> CPU: 0
> EIP: 0060:[<d8a1b10e>] Not tainted VLI
> EFLAGS: 00010296 (2.6.20-mm2 #1)
> EIP is at ata_acpi_exec_tfs+0x157/0x8ad [libata]
> eax: 00000001 ebx: 00000000 ecx: d6d43c84 edx: d6d43c84
> esi: d51f4514 edi: 00000000 ebp: d51f438c esp: d6f2bcdc
> ds: 007b es: 007b fs: 00d8 gs: 0000 ss: 0068
> Process scsi_eh_0 (pid: 1647, ti=d6f2a000 task=c13c9a70 task.ti=d6f2a000)
> Stack: d51f6190 00000246 00000246 00000000 d8a130b7 00000000 00000000 00000000
> 00000000 d6f2bd48 d6f2bdf0 d51f4514 ec000000 d51f6190 00000000 00000000
> 00000000 00000246 d6d43c84 00000000 00000000 00000000 00000000 ffffffff
> Call Trace:
> [<d8a130b7>] ata_exec_internal_sg+0x3ae/0x3b8 [libata]
> [<d8a125f8>] ata_dev_configure+0xc1/0x7d2 [libata]
> [<d8a10e87>] ata_dev_select+0xce/0x11a [libata]

Any chance you could insert some printk() calls into ata_apci_exec_tfs?
ata_exec_internal_sg() never calls that function, so I'm curious if
something corrupted memory a bit, or what happened.

In any case, I'm surprised that ACPI would be executing taskfiles on
PCMCIA anyway.

Jeff



2007-02-25 02:44:24

by Komuro

[permalink] [raw]
Subject: Re: [BUG] PATA_PCMCIA does not work

On Sat, 24 Feb 2007 20:45:18 -0500
Jeff Garzik <[email protected]> wrote:

> Any chance you could insert some printk() calls into ata_apci_exec_tfs?
> ata_exec_internal_sg() never calls that function, so I'm curious if
> something corrupted memory a bit, or what happened.

I insert some printk().
I think the problem is happening on do_drive_get_GTF.


>pcmcia: registering new device pcmcia0.0
>SCSI subsystem initialized
>libata version 2.10 loaded.
>ata1: PATA max PIO0 cmd 0x00010100 ctl 0x0001010e bmdma 0x00000000 irq 4
>scsi0 : pata_pcmcia
>ata_acpi_exec_tfs 0
>ata_acpi_exec_tfs 1
>BUG: unable to handle kernel NULL pointer dereference at virtual address 0000004d
> printing eip:
>
>
>int ata_acpi_exec_tfs(struct ata_port *ap)
>{
> int ix;
> int ret =0;
> unsigned int gtf_length;
> unsigned long gtf_address;
> unsigned long obj_loc;
>
> if (noacpi)
> return 0;
>
> for (ix = 0; ix < ATA_MAX_DEVICES; ix++) {
> printk("ata_acpi_exec_tfs 0 \n");
> if (!ata_dev_enabled(&ap->device[ix]))
> continue;
>
> printk("ata_acpi_exec_tfs 1 \n");
> ret = do_drive_get_GTF(ap, ix,
> &gtf_length, &gtf_address, &obj_loc);
> printk("ata_acpi_exec_tfs 2 \n");
> if (ret < 0) {

Best Regards
Komuro