* Re: [KERNEL 2.6.26-rc4] bugreport : pata_pcmcia with Sandisk Extreme III 8GB
[not found] ` <20080607223716.7d142072.komurojun-mbn@nifty.com>
@ 2008-06-11 7:20 ` Dominik Brodowski
2008-06-14 3:00 ` Komuro
0 siblings, 1 reply; 17+ messages in thread
From: Dominik Brodowski @ 2008-06-11 7:20 UTC (permalink / raw)
To: Komuro, Tejun Heo, jgarzik, linux-ide
Cc: linux-kernel, linux-pcmcia, Kristoffer Ericson
On Sat, Jun 07, 2008 at 10:37:16PM +0900, Komuro wrote:
> On Fri, 30 May 2008 13:57:28 +0200
> Kristoffer Ericson <kristoffer.ericson@gmail.com> wrote:
>
>
> > > > pcmcia: registering new device pcmcia1.0
> > > ...
> > > > pcmcia: registering new device pcmcia1.1
> > > > 1.1: GetNextTuple: No more items
> > > > pata_pcmcia: probe of 1.1 failed with error -12
>
> This problem is introduced at kernel 2.6.26-rc4.
>
> The kernel 2.6.26-rc3 does not have this problem.
git-diff drivers/pcmcia is empty for 2.6.26-rc3 to 2.6.26-rc4. Therefore,
it looks like something in the ata codepaths introduced this error? Tejun,
Jeff, any ideas? (original bugreport below)
Thanks,
Dominik
> > > Hi,
> > >
> > > > Ive added the id123 strings for a Sandisk Extreme III 8GB.
> > > > I get this when using pcmcia->CF adapter.
> > >
> > > > pcmcia: registering new device pcmcia1.0
> > > ...
> > > > pcmcia: registering new device pcmcia1.1
> > > > 1.1: GetNextTuple: No more items
> > > > pata_pcmcia: probe of 1.1 failed with error -12
> > >
> > > Is that a multifunction device? It seems to me that something is broken in
> > > the device CIS, for both drives seem to be exported already by device
> > > pcmcia1.0.
> >
> > Its a simply pcmcia->CF adapter and the CF card is a simple storage one. I got it to work through USB-adapter after replacing my
> > broken one.
> > However it still doesnt work through the pcmcia->CF adapter.
> >
> > Im not ruling out that its broken though.
> >
> > >
> > > Best,
> > > Dominik
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [KERNEL 2.6.26-rc4] bugreport : pata_pcmcia with Sandisk Extreme III 8GB
2008-06-11 7:20 ` [KERNEL 2.6.26-rc4] bugreport : pata_pcmcia with Sandisk Extreme III 8GB Dominik Brodowski
@ 2008-06-14 3:00 ` Komuro
2008-06-14 7:20 ` Jeff Garzik
0 siblings, 1 reply; 17+ messages in thread
From: Komuro @ 2008-06-14 3:00 UTC (permalink / raw)
To: Tejun Heo
Cc: linux-pcmcia, linux-kernel, Dominik Brodowski, linux-ide,
Kristoffer Ericson, jgarzik
Dear Tejun
> > > > > pcmcia: registering new device pcmcia1.1
> > > > > 1.1: GetNextTuple: No more items
> > > > > pata_pcmcia: probe of 1.1 failed with error -12
The patch "libata: kill hotplug related race condition"
introduced the pata_pcmcia error.
Please fix this problem.
Best Regards
Komuro
> > f046519fc85a8fdf6a058b4ac9d897cdee6f3e52 is first bad commit
commit f046519fc85a8fdf6a058b4ac9d897cdee6f3e52
Author: Tejun Heo <htejun@gmail.com>
Date: Mon May 19 01:15:08 2008 +0900
libata: kill hotplug related race condition
Originally, whole reset processing was done while the port is frozen
and SError was cleared during @postreset(). This had two race
conditions. 1: hotplug could occur after reset but before SError is
cleared and libata won't know about it. 2: hotplug could occur after
all the reset is complete but before the port is thawed. As all
events are cleared on thaw, the hotplug event would be lost.
> > > > > pcmcia: registering new device pcmcia1.0
> > > > ...
> > > > > pcmcia: registering new device pcmcia1.1
> > > > > 1.1: GetNextTuple: No more items
> > > > > pata_pcmcia: probe of 1.1 failed with error -12
> >
> > This problem is introduced at kernel 2.6.26-rc4.
> >
> > The kernel 2.6.26-rc3 does not have this problem.
>
>
> git-diff drivers/pcmcia is empty for 2.6.26-rc3 to 2.6.26-rc4. Therefore,
> it looks like something in the ata codepaths introduced this error? Tejun,
> Jeff, any ideas? (original bugreport below)
>
> Thanks,
> Dominik
>
> > > > Hi,
> > > >
> > > > > Ive added the id123 strings for a Sandisk Extreme III 8GB.
> > > > > I get this when using pcmcia->CF adapter.
> > > >
> > > > > pcmcia: registering new device pcmcia1.0
> > > > ...
> > > > > pcmcia: registering new device pcmcia1.1
> > > > > 1.1: GetNextTuple: No more items
> > > > > pata_pcmcia: probe of 1.1 failed with error -12
> > > >
> > > > Is that a multifunction device? It seems to me that something is broken in
> > > > the device CIS, for both drives seem to be exported already by device
> > > > pcmcia1.0.
> > >
> > > Its a simply pcmcia->CF adapter and the CF card is a simple storage one. I got it to work through USB-adapter after replacing my
> > > broken one.
> > > However it still doesnt work through the pcmcia->CF adapter.
> > >
> > > Im not ruling out that its broken though.
> > >
> > > >
> > > > Best,
> > > > Dominik
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [KERNEL 2.6.26-rc4] bugreport : pata_pcmcia with Sandisk Extreme III 8GB
2008-06-14 3:00 ` Komuro
@ 2008-06-14 7:20 ` Jeff Garzik
2008-06-14 12:36 ` Komuro
0 siblings, 1 reply; 17+ messages in thread
From: Jeff Garzik @ 2008-06-14 7:20 UTC (permalink / raw)
To: Komuro
Cc: Tejun Heo, Dominik Brodowski, jgarzik, linux-ide, linux-kernel,
linux-pcmcia, Kristoffer Ericson
Komuro wrote:
> Dear Tejun
>
>>>>>> pcmcia: registering new device pcmcia1.1
>>>>>> 1.1: GetNextTuple: No more items
>>>>>> pata_pcmcia: probe of 1.1 failed with error -12
>
> The patch "libata: kill hotplug related race condition"
> introduced the pata_pcmcia error.
>
> Please fix this problem.
>
>
> Best Regards
> Komuro
>
>>> f046519fc85a8fdf6a058b4ac9d897cdee6f3e52 is first bad commit
> commit f046519fc85a8fdf6a058b4ac9d897cdee6f3e52
> Author: Tejun Heo <htejun@gmail.com>
> Date: Mon May 19 01:15:08 2008 +0900
>
> libata: kill hotplug related race condition
>
> Originally, whole reset processing was done while the port is frozen
> and SError was cleared during @postreset(). This had two race
> conditions. 1: hotplug could occur after reset but before SError is
> cleared and libata won't know about it. 2: hotplug could occur after
> all the reset is complete but before the port is thawed. As all
> events are cleared on thaw, the hotplug event would be lost.
Interesting! Thanks for the diagnosis...
Jeff
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [KERNEL 2.6.26-rc4] bugreport : pata_pcmcia with Sandisk Extreme III 8GB
2008-06-14 7:20 ` Jeff Garzik
@ 2008-06-14 12:36 ` Komuro
2008-06-16 3:07 ` Tejun Heo
0 siblings, 1 reply; 17+ messages in thread
From: Komuro @ 2008-06-14 12:36 UTC (permalink / raw)
To: Jeff Garzik
Cc: Tejun Heo, Dominik Brodowski, jgarzik, linux-ide, linux-kernel,
linux-pcmcia, Kristoffer Ericson
On Sat, 14 Jun 2008 03:20:41 -0400
Jeff Garzik <jeff@garzik.org> wrote:
After removing the 3-lines below in ata_eh_reset
the pata_pcmcia works properly.
- spin_lock_irqsave(link->ap->lock, flags);
- link->eh_info.serror = 0;
- spin_unlock_irqrestore(link->ap->lock, flags);
Please fix this problem.
Best Regards
Komuro
> >
> >>>>>> pcmcia: registering new device pcmcia1.1
> >>>>>> 1.1: GetNextTuple: No more items
> >>>>>> pata_pcmcia: probe of 1.1 failed with error -12
> >
> > The patch "libata: kill hotplug related race condition"
> > introduced the pata_pcmcia error.
> >
> > Please fix this problem.
> >
> >
> > Best Regards
> > Komuro
> >
> >>> f046519fc85a8fdf6a058b4ac9d897cdee6f3e52 is first bad commit
> > commit f046519fc85a8fdf6a058b4ac9d897cdee6f3e52
> > Author: Tejun Heo <htejun@gmail.com>
> > Date: Mon May 19 01:15:08 2008 +0900
> >
> > libata: kill hotplug related race condition
> >
> > Originally, whole reset processing was done while the port is frozen
> > and SError was cleared during @postreset(). This had two race
> > conditions. 1: hotplug could occur after reset but before SError is
> > cleared and libata won't know about it. 2: hotplug could occur after
> > all the reset is complete but before the port is thawed. As all
> > events are cleared on thaw, the hotplug event would be lost.
>
> Interesting! Thanks for the diagnosis...
>
> Jeff
>
>
>
--
Komuro <komurojun-mbn@nifty.com>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [KERNEL 2.6.26-rc4] bugreport : pata_pcmcia with Sandisk Extreme III 8GB
2008-06-14 12:36 ` Komuro
@ 2008-06-16 3:07 ` Tejun Heo
2008-06-16 13:11 ` Komuro
2008-06-22 1:07 ` Komuro
0 siblings, 2 replies; 17+ messages in thread
From: Tejun Heo @ 2008-06-16 3:07 UTC (permalink / raw)
To: Komuro
Cc: Jeff Garzik, Dominik Brodowski, jgarzik, linux-ide, linux-kernel,
linux-pcmcia, Kristoffer Ericson
[-- Attachment #1: Type: text/plain, Size: 994 bytes --]
Hello,
Komuro wrote:
> On Sat, 14 Jun 2008 03:20:41 -0400
> Jeff Garzik <jeff@garzik.org> wrote:
>
>
> After removing the 3-lines below in ata_eh_reset
> the pata_pcmcia works properly.
>
>
> - spin_lock_irqsave(link->ap->lock, flags);
> - link->eh_info.serror = 0;
> - spin_unlock_irqrestore(link->ap->lock, flags);
>
> Please fix this problem.
Thanks for diagnosing the problem but it doesn't make any sense at all.
Those three lines just clear cached SError value. pata_pcmcia being a
PATA driver, SError is not implemented and always zero.
Also the init_one error is -ENOMEM. For the above change to make any
difference, EH should have been entered which is invoked deep into
ata_host_register() and once control reaches that point it never returns
error code. I have difficult time imagining any way the above diff can
have anything to do with the reported failure.
Please apply the attached patch and report the log after probe failure.
Thanks.
--
tejun
[-- Attachment #2: pata_pcmcia-debug.patch --]
[-- Type: text/x-patch, Size: 1776 bytes --]
diff --git a/drivers/ata/pata_pcmcia.c b/drivers/ata/pata_pcmcia.c
index 3d39f9d..d5bcdc2 100644
--- a/drivers/ata/pata_pcmcia.c
+++ b/drivers/ata/pata_pcmcia.c
@@ -177,8 +177,10 @@ static int pcmcia_init_one(struct pcmcia_device *pdev)
struct ata_port_operations *ops = &pcmcia_port_ops;
info = kzalloc(sizeof(*info), GFP_KERNEL);
- if (info == NULL)
+ if (info == NULL) {
+ printk("XXX info alloc failed\n");
return -ENOMEM;
+ }
/* Glue stuff together. FIXME: We may be able to get rid of info with care */
info->pdev = pdev;
@@ -196,8 +198,10 @@ static int pcmcia_init_one(struct pcmcia_device *pdev)
/* Allocate resoure probing structures */
stk = kzalloc(sizeof(*stk), GFP_KERNEL);
- if (!stk)
+ if (!stk) {
+ printk("XXX stk alloc failed\n");
goto out1;
+ }
cfg = &stk->parse.cftable_entry;
@@ -290,8 +294,11 @@ next_entry:
ret = -ENOMEM;
io_addr = devm_ioport_map(&pdev->dev, io_base, 8);
ctl_addr = devm_ioport_map(&pdev->dev, ctl_base, 1);
- if (!io_addr || !ctl_addr)
+ if (!io_addr || !ctl_addr) {
+ printk("XXX ioport_map failed io_addr=%p ctl_addr=%p\n",
+ io_addr, ctl_addr);
goto failed;
+ }
/* Success. Disable the IRQ nIEN line, do quirks */
iowrite8(0x02, ctl_addr);
@@ -311,8 +318,10 @@ next_entry:
*/
ret = -ENOMEM;
host = ata_host_alloc(&pdev->dev, n_ports);
- if (!host)
+ if (!host) {
+ printk("XXX host alloc failed\n");
goto failed;
+ }
for (p = 0; p < n_ports; p++) {
ap = host->ports[p];
@@ -331,8 +340,10 @@ next_entry:
/* activate */
ret = ata_host_activate(host, pdev->irq.AssignedIRQ, ata_sff_interrupt,
IRQF_SHARED, &pcmcia_sht);
- if (ret)
+ if (ret) {
+ printk("XXX host activate failed ret=%d\n", ret);
goto failed;
+ }
info->ndev = 1;
kfree(stk);
^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [KERNEL 2.6.26-rc4] bugreport : pata_pcmcia with Sandisk Extreme III 8GB
2008-06-16 3:07 ` Tejun Heo
@ 2008-06-16 13:11 ` Komuro
2008-06-16 13:24 ` Tejun Heo
2008-06-22 1:07 ` Komuro
1 sibling, 1 reply; 17+ messages in thread
From: Komuro @ 2008-06-16 13:11 UTC (permalink / raw)
To: Tejun Heo
Cc: Jeff Garzik, linux-pcmcia, linux-kernel, Dominik Brodowski,
linux-ide, Kristoffer Ericson, jgarzik
Hi,
Here is the log (your patch is applied).
Unfortunately, no message that you added appears.
It seems this device is detected as pcmcia0.0 first
but later it is detected as pcmcia0.1.
>pcmcia: registering new device pcmcia0.0
>scsi2 : pata_pcmcia
>ata3: PATA max PIO0 cmd 0xd100 ctl 0xd10e irq 4
>ata3.00: CFA: , Ver.1.0, max PIO2
>ata3.00: 32000 sectors, multi 0: LBA
>ata3.00: configured for PIO0
>ata3.00: configured for PIO0
>ata3: EH complete
>isa bounce pool size: 16 pages
>scsi 2:0:0:0: Direct-Access ATA Ver. PQ: 0 ANSI: 5
>sd 2:0:0:0: [sdb] 32000 512-byte hardware sectors (16 MB)
>sd 2:0:0:0: [sdb] Write Protect is off
>sd 2:0:0:0: [sdb] Mode Sense: 00 3a 00 00
>sd 2:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
>sd 2:0:0:0: [sdb] 32000 512-byte hardware sectors (16 MB)
>sd 2:0:0:0: [sdb] Write Protect is off
>sd 2:0:0:0: [sdb] Mode Sense: 00 3a 00 00
>sd 2:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
> sdb: sdb1
>sd 2:0:0:0: [sdb] Attached SCSI removable disk
>sd 2:0:0:0: Attached scsi generic sg2 type 0
>pcmcia: registering new device pcmcia0.1
>pcmcia: registering new device pcmcia0.1
>0.1: GetNextTuple: No more items
>pata_pcmcia: probe of 0.1 failed with error -12
>modprobe used greatest stack depth: 1684 bytes left
>0.1: GetNextTuple: No more items
>pata_pcmcia: probe of 0.1 failed with error -12
>0.1: GetNextTuple: No more items
>pata_pcmcia: probe of 0.1 failed with error -12
Best Regards
Komuro
> Hello,
>
> Komuro wrote:
> > On Sat, 14 Jun 2008 03:20:41 -0400
> > Jeff Garzik <jeff@garzik.org> wrote:
> >
> >
> > After removing the 3-lines below in ata_eh_reset
> > the pata_pcmcia works properly.
> >
> >
> > - spin_lock_irqsave(link->ap->lock, flags);
> > - link->eh_info.serror = 0;
> > - spin_unlock_irqrestore(link->ap->lock, flags);
> >
> > Please fix this problem.
>
> Thanks for diagnosing the problem but it doesn't make any sense at all.
> Those three lines just clear cached SError value. pata_pcmcia being a
> PATA driver, SError is not implemented and always zero.
>
> Also the init_one error is -ENOMEM. For the above change to make any
> difference, EH should have been entered which is invoked deep into
> ata_host_register() and once control reaches that point it never returns
> error code. I have difficult time imagining any way the above diff can
> have anything to do with the reported failure.
>
> Please apply the attached patch and report the log after probe failure.
>
> Thanks.
>
> --
> tejun
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [KERNEL 2.6.26-rc4] bugreport : pata_pcmcia with Sandisk Extreme III 8GB
2008-06-16 13:11 ` Komuro
@ 2008-06-16 13:24 ` Tejun Heo
2008-06-17 12:23 ` Komuro
0 siblings, 1 reply; 17+ messages in thread
From: Tejun Heo @ 2008-06-16 13:24 UTC (permalink / raw)
To: Komuro
Cc: Jeff Garzik, Dominik Brodowski, jgarzik, linux-ide, linux-kernel,
linux-pcmcia, Kristoffer Ericson
[-- Attachment #1: Type: text/plain, Size: 286 bytes --]
Komuro wrote:
> Hi,
>
> Here is the log (your patch is applied).
> Unfortunately, no message that you added appears.
>
> It seems this device is detected as pcmcia0.0 first
> but later it is detected as pcmcia0.1.
Hmmm... strange. Can you please try the attached patch?
--
tejun
[-- Attachment #2: pata_pcmcia-debug-1.patch --]
[-- Type: text/x-patch, Size: 2105 bytes --]
diff --git a/drivers/ata/pata_pcmcia.c b/drivers/ata/pata_pcmcia.c
index 3d39f9d..0eb4f77 100644
--- a/drivers/ata/pata_pcmcia.c
+++ b/drivers/ata/pata_pcmcia.c
@@ -176,9 +176,14 @@ static int pcmcia_init_one(struct pcmcia_device *pdev)
struct ata_port_operations *ops = &pcmcia_port_ops;
+ dev_printk(KERN_INFO, &pdev->dev, "XXX ENTER\n");
+ dump_stack();
+
info = kzalloc(sizeof(*info), GFP_KERNEL);
- if (info == NULL)
+ if (info == NULL) {
+ printk("XXX info alloc failed\n");
return -ENOMEM;
+ }
/* Glue stuff together. FIXME: We may be able to get rid of info with care */
info->pdev = pdev;
@@ -196,8 +201,10 @@ static int pcmcia_init_one(struct pcmcia_device *pdev)
/* Allocate resoure probing structures */
stk = kzalloc(sizeof(*stk), GFP_KERNEL);
- if (!stk)
+ if (!stk) {
+ printk("XXX stk alloc failed\n");
goto out1;
+ }
cfg = &stk->parse.cftable_entry;
@@ -290,8 +297,11 @@ next_entry:
ret = -ENOMEM;
io_addr = devm_ioport_map(&pdev->dev, io_base, 8);
ctl_addr = devm_ioport_map(&pdev->dev, ctl_base, 1);
- if (!io_addr || !ctl_addr)
+ if (!io_addr || !ctl_addr) {
+ printk("XXX ioport_map failed io_addr=%p ctl_addr=%p\n",
+ io_addr, ctl_addr);
goto failed;
+ }
/* Success. Disable the IRQ nIEN line, do quirks */
iowrite8(0x02, ctl_addr);
@@ -311,8 +321,10 @@ next_entry:
*/
ret = -ENOMEM;
host = ata_host_alloc(&pdev->dev, n_ports);
- if (!host)
+ if (!host) {
+ printk("XXX host alloc failed\n");
goto failed;
+ }
for (p = 0; p < n_ports; p++) {
ap = host->ports[p];
@@ -331,11 +343,14 @@ next_entry:
/* activate */
ret = ata_host_activate(host, pdev->irq.AssignedIRQ, ata_sff_interrupt,
IRQF_SHARED, &pcmcia_sht);
- if (ret)
+ if (ret) {
+ printk("XXX host activate failed ret=%d\n", ret);
goto failed;
+ }
info->ndev = 1;
kfree(stk);
+ dev_printk(KERN_INFO, &pdev->dev, "XXX LEAVE 0\n");
return 0;
cs_failed:
@@ -345,6 +360,7 @@ failed:
info->ndev = 0;
pcmcia_disable_device(pdev);
out1:
+ dev_printk(KERN_INFO, &pdev->dev, "XXX LEAVE %d\n", ret);
kfree(info);
return ret;
}
^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [KERNEL 2.6.26-rc4] bugreport : pata_pcmcia with Sandisk Extreme III 8GB
2008-06-16 13:24 ` Tejun Heo
@ 2008-06-17 12:23 ` Komuro
2008-06-17 14:09 ` Tejun Heo
2008-07-06 1:37 ` Komuro
0 siblings, 2 replies; 17+ messages in thread
From: Komuro @ 2008-06-17 12:23 UTC (permalink / raw)
To: Tejun Heo
Cc: Jeff Garzik, Dominik Brodowski, jgarzik, linux-ide, linux-kernel,
linux-pcmcia, Kristoffer Ericson
Hi,
Here is the log again.
pcmcia: registering new device pcmcia0.0
pata_pcmcia 0.0: XXX ENTER
Pid: 1648, comm: modprobe Not tainted 2.6.26-rc5 #3
[<d885314f>] pcmcia_init_one+0x34/0x585 [pata_pcmcia]
[<c0559444>] pccard_get_tuple_data+0x53/0x5c
[<c0476a1a>] iput+0x2a/0x4a
[<c055b156>] pcmcia_device_probe+0xa6/0xf6
[<c0538d00>] driver_probe_device+0x103/0x12c
[<c0538d29>] __driver_attach+0x0/0x55
[<c0538cb2>] driver_probe_device+0xb5/0x12c
[<c0538d60>] __driver_attach+0x37/0x55
[<c05385fb>] bus_for_each_dev+0x37/0x59
[<c0538b4d>] driver_attach+0x11/0x13
[<c0538d29>] __driver_attach+0x0/0x55
[<c053894f>] bus_add_driver+0x8a/0x1a7
[<c04d2db0>] kset_find_obj+0x20/0x4b
[<c0538f41>] driver_register+0x6d/0xc1
[<c055b8d0>] pcmcia_register_driver+0xaf/0xdb
[<c043b932>] sys_init_module+0x1844/0x19b4
[<c055c3db>] pcmcia_request_irq+0x0/0x1d6
[<c0403815>] sysenter_past_esp+0x6a/0x91
=======================
scsi2 : pata_pcmcia
ata3: PATA max PIO0 cmd 0xd100 ctl 0xd10e irq 3
ata3.00: CFA: , Ver.1.0, max PIO2
ata3.00: 32000 sectors, multi 0: LBA
ata3.00: configured for PIO0
ata3.00: configured for PIO0
ata3: EH complete
isa bounce pool size: 16 pages
scsi 2:0:0:0: Direct-Access ATA Ver. PQ: 0 ANSI: 5
sd 2:0:0:0: [sdb] 32000 512-byte hardware sectors (16 MB)
sd 2:0:0:0: [sdb] Write Protect is off
sd 2:0:0:0: [sdb] Mode Sense: 00 3a 00 00
sd 2:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
sd 2:0:0:0: [sdb] 32000 512-byte hardware sectors (16 MB)
sd 2:0:0:0: [sdb] Write Protect is off
sd 2:0:0:0: [sdb] Mode Sense: 00 3a 00 00
sd 2:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
sdb: sdb1
sd 2:0:0:0: [sdb] Attached SCSI removable disk
sd 2:0:0:0: Attached scsi generic sg2 type 0
pata_pcmcia 0.0: XXX LEAVE 0
pcmcia: registering new device pcmcia0.1
pata_pcmcia 0.1: XXX ENTER
Pid: 6, comm: events/0 Not tainted 2.6.26-rc5 #3
[<d885314f>] pcmcia_init_one+0x34/0x585 [pata_pcmcia]
[<c0559444>] pccard_get_tuple_data+0x53/0x5c
[<c055b156>] pcmcia_device_probe+0xa6/0xf6
[<c0538cb2>] driver_probe_device+0xb5/0x12c
[<c0538d7e>] __device_attach+0x0/0x5
[<c05383e9>] bus_for_each_drv+0x36/0x5e
[<c0538dec>] device_attach+0x4e/0x5e
[<c0538d7e>] __device_attach+0x0/0x5
[<c053827c>] bus_attach_device+0x1e/0x46
[<c05376fa>] device_add+0x310/0x43d
[<c055b5ab>] pcmcia_device_add+0x188/0x1eb
[<c055b60e>] pcmcia_delayed_add_device+0x0/0x23
[<c055b628>] pcmcia_delayed_add_device+0x1a/0x23
[<c042b735>] run_workqueue+0x6b/0xe0
[<c042bddf>] worker_thread+0x0/0xbd
[<c042be92>] worker_thread+0xb3/0xbd
[<c042e000>] autoremove_wake_function+0x0/0x2d
[<c042df3e>] kthread+0x38/0x5e
[<c042df06>] kthread+0x0/0x5e
[<c0404407>] kernel_thread_helper+0x7/0x10
=======================
0.1: GetNextTuple: No more items
pata_pcmcia 0.1: XXX LEAVE -12
pata_pcmcia: probe of 0.1 failed with error -12
modprobe used greatest stack depth: 1676 bytes left
pata_pcmcia 0.1: XXX ENTER
Pid: 1661, comm: sh Not tainted 2.6.26-rc5 #3
[<d885314f>] pcmcia_init_one+0x34/0x585 [pata_pcmcia]
[<c0559444>] pccard_get_tuple_data+0x53/0x5c
[<c0476a1a>] iput+0x2a/0x4a
[<c055b156>] pcmcia_device_probe+0xa6/0xf6
[<c0538000>] bus_register_notifier+0x2/0xb
[<c0538063>] bus_rescan_devices_helper+0x0/0x44
[<c0538cb2>] driver_probe_device+0xb5/0x12c
[<c0538d7e>] __device_attach+0x0/0x5
[<c05383e9>] bus_for_each_drv+0x36/0x5e
[<c0538dec>] device_attach+0x4e/0x5e
[<c0538d7e>] __device_attach+0x0/0x5
[<c053808a>] bus_rescan_devices_helper+0x27/0x44
[<c05385fb>] bus_for_each_dev+0x37/0x59
[<c053862b>] bus_rescan_devices+0xe/0x10
[<c0538063>] bus_rescan_devices_helper+0x0/0x44
[<c055a8f2>] pcmcia_store_allow_func_id_match+0x46/0x5b
[<c055a8ac>] pcmcia_store_allow_func_id_match+0x0/0x5b
[<c05369d6>] dev_attr_store+0x19/0x1d
[<c04997a0>] sysfs_write_file+0xa4/0xd8
[<c04996fc>] sysfs_write_file+0x0/0xd8
[<c0467a3d>] vfs_write+0x83/0x114
[<c0467ff6>] sys_write+0x3c/0x63
[<c0403815>] sysenter_past_esp+0x6a/0x91
=======================
0.1: GetNextTuple: No more items
pata_pcmcia 0.1: XXX LEAVE -12
pata_pcmcia: probe of 0.1 failed with error -12
Best Regards
Komuro
> >
> > Here is the log (your patch is applied).
> > Unfortunately, no message that you added appears.
> >
> > It seems this device is detected as pcmcia0.0 first
> > but later it is detected as pcmcia0.1.
>
> Hmmm... strange. Can you please try the attached patch?
>
> --
> tejun
>
--
Komuro <komurojun-mbn@nifty.com>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [KERNEL 2.6.26-rc4] bugreport : pata_pcmcia with Sandisk Extreme III 8GB
2008-06-17 12:23 ` Komuro
@ 2008-06-17 14:09 ` Tejun Heo
2008-06-17 14:15 ` Dominik Brodowski
2008-06-18 12:23 ` Komuro
2008-07-06 1:37 ` Komuro
1 sibling, 2 replies; 17+ messages in thread
From: Tejun Heo @ 2008-06-17 14:09 UTC (permalink / raw)
To: Komuro
Cc: Jeff Garzik, Dominik Brodowski, jgarzik, linux-ide, linux-kernel,
linux-pcmcia, Kristoffer Ericson
[-- Attachment #1: Type: text/plain, Size: 363 bytes --]
Okay. The exit is from CS_CHECK macro on GetNextTuple, missed that
macro. It means it failed to request IO resource somewhere. Can you
please try the attached patch? It will show us where it failed.
This part of code hasn't changed at all in pata_pcmcia && I don't really
understand the tuple business. We need pcmcia people to pitch in.
Thanks.
--
tejun
[-- Attachment #2: pata_pcmcia-debug-2.patch --]
[-- Type: text/x-patch, Size: 5204 bytes --]
diff --git a/drivers/ata/pata_pcmcia.c b/drivers/ata/pata_pcmcia.c
index 3d39f9d..fafe525 100644
--- a/drivers/ata/pata_pcmcia.c
+++ b/drivers/ata/pata_pcmcia.c
@@ -176,9 +176,13 @@ static int pcmcia_init_one(struct pcmcia_device *pdev)
struct ata_port_operations *ops = &pcmcia_port_ops;
+ dev_printk(KERN_INFO, &pdev->dev, "XXX ENTER\n");
+
info = kzalloc(sizeof(*info), GFP_KERNEL);
- if (info == NULL)
+ if (info == NULL) {
+ printk("XXX info alloc failed\n");
return -ENOMEM;
+ }
/* Glue stuff together. FIXME: We may be able to get rid of info with care */
info->pdev = pdev;
@@ -196,8 +200,10 @@ static int pcmcia_init_one(struct pcmcia_device *pdev)
/* Allocate resoure probing structures */
stk = kzalloc(sizeof(*stk), GFP_KERNEL);
- if (!stk)
+ if (!stk) {
+ printk("XXX stk alloc failed\n");
goto out1;
+ }
cfg = &stk->parse.cftable_entry;
@@ -224,18 +230,27 @@ static int pcmcia_init_one(struct pcmcia_device *pdev)
/* Now munch the resources looking for a suitable set */
while (1) {
- if (pcmcia_get_tuple_data(pdev, &tuple) != 0)
+ dev_printk(KERN_INFO, &pdev->dev, "XXX resource loop, pass=%d\n", pass);
+ if (pcmcia_get_tuple_data(pdev, &tuple) != 0) {
+ dev_printk(KERN_INFO, &pdev->dev, "XXX get_tuple_data failed\n");
goto next_entry;
- if (pcmcia_parse_tuple(pdev, &tuple, &stk->parse) != 0)
+ }
+ if (pcmcia_parse_tuple(pdev, &tuple, &stk->parse) != 0) {
+ dev_printk(KERN_INFO, &pdev->dev, "XXX parse_tuple failed\n");
goto next_entry;
+ }
/* Check for matching Vcc, unless we're desperate */
if (!pass) {
if (cfg->vcc.present & (1 << CISTPL_POWER_VNOM)) {
- if (stk->conf.Vcc != cfg->vcc.param[CISTPL_POWER_VNOM] / 10000)
+ if (stk->conf.Vcc != cfg->vcc.param[CISTPL_POWER_VNOM] / 10000) {
+ dev_printk(KERN_INFO, &pdev->dev, "XXX vcc0 fail\n");
goto next_entry;
+ }
} else if (stk->dflt.vcc.present & (1 << CISTPL_POWER_VNOM)) {
- if (stk->conf.Vcc != stk->dflt.vcc.param[CISTPL_POWER_VNOM] / 10000)
+ if (stk->conf.Vcc != stk->dflt.vcc.param[CISTPL_POWER_VNOM] / 10000) {
+ dev_printk(KERN_INFO, &pdev->dev, "XXX vcc1 fail\n");
goto next_entry;
+ }
}
}
@@ -255,19 +270,27 @@ static int pcmcia_init_one(struct pcmcia_device *pdev)
pdev->io.NumPorts1 = 8;
pdev->io.BasePort2 = io->win[1].base;
pdev->io.NumPorts2 = (is_kme) ? 2 : 1;
- if (pcmcia_request_io(pdev, &pdev->io) != 0)
+ if (pcmcia_request_io(pdev, &pdev->io) != 0) {
+ dev_printk(KERN_INFO, &pdev->dev, "XXX IO request failed 1 %x:%d %x:%d\n",
+ pdev->io.BasePort1, pdev->io.NumPorts1, pdev->io.BasePort2, pdev->io.NumPorts2);
goto next_entry;
+ }
io_base = pdev->io.BasePort1;
ctl_base = pdev->io.BasePort2;
} else if ((io->nwin == 1) && (io->win[0].len >= 16)) {
pdev->io.NumPorts1 = io->win[0].len;
pdev->io.NumPorts2 = 0;
- if (pcmcia_request_io(pdev, &pdev->io) != 0)
+ if (pcmcia_request_io(pdev, &pdev->io) != 0) {
+ dev_printk(KERN_INFO, &pdev->dev, "XXX IO request failed 2 %x:%d %x:%d\n",
+ pdev->io.BasePort1, pdev->io.NumPorts1, pdev->io.BasePort2, pdev->io.NumPorts2);
goto next_entry;
+ }
io_base = pdev->io.BasePort1;
ctl_base = pdev->io.BasePort1 + 0x0e;
- } else
+ } else {
+ dev_printk(KERN_INFO, &pdev->dev, "XXX hmmmm\n");
goto next_entry;
+ }
/* If we've got this far, we're done */
break;
}
@@ -275,8 +298,10 @@ next_entry:
if (cfg->flags & CISTPL_CFTABLE_DEFAULT)
memcpy(&stk->dflt, cfg, sizeof(stk->dflt));
if (pass) {
+ dev_printk(KERN_INFO, &pdev->dev, "XXX pass=%d, doing GetNextTuple\n", pass);
CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(pdev, &tuple));
} else if (pcmcia_get_next_tuple(pdev, &tuple) != 0) {
+ dev_printk(KERN_INFO, &pdev->dev, "XXX pass=%d, doing GetFirstTuple\n", pass);
CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(pdev, &tuple));
memset(&stk->dflt, 0, sizeof(stk->dflt));
pass++;
@@ -290,8 +315,11 @@ next_entry:
ret = -ENOMEM;
io_addr = devm_ioport_map(&pdev->dev, io_base, 8);
ctl_addr = devm_ioport_map(&pdev->dev, ctl_base, 1);
- if (!io_addr || !ctl_addr)
+ if (!io_addr || !ctl_addr) {
+ printk("XXX ioport_map failed io_addr=%p ctl_addr=%p\n",
+ io_addr, ctl_addr);
goto failed;
+ }
/* Success. Disable the IRQ nIEN line, do quirks */
iowrite8(0x02, ctl_addr);
@@ -311,8 +339,10 @@ next_entry:
*/
ret = -ENOMEM;
host = ata_host_alloc(&pdev->dev, n_ports);
- if (!host)
+ if (!host) {
+ printk("XXX host alloc failed\n");
goto failed;
+ }
for (p = 0; p < n_ports; p++) {
ap = host->ports[p];
@@ -331,11 +361,14 @@ next_entry:
/* activate */
ret = ata_host_activate(host, pdev->irq.AssignedIRQ, ata_sff_interrupt,
IRQF_SHARED, &pcmcia_sht);
- if (ret)
+ if (ret) {
+ printk("XXX host activate failed ret=%d\n", ret);
goto failed;
+ }
info->ndev = 1;
kfree(stk);
+ dev_printk(KERN_INFO, &pdev->dev, "XXX LEAVE 0\n");
return 0;
cs_failed:
@@ -345,6 +378,7 @@ failed:
info->ndev = 0;
pcmcia_disable_device(pdev);
out1:
+ dev_printk(KERN_INFO, &pdev->dev, "XXX LEAVE %d\n", ret);
kfree(info);
return ret;
}
^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [KERNEL 2.6.26-rc4] bugreport : pata_pcmcia with Sandisk Extreme III 8GB
2008-06-17 14:09 ` Tejun Heo
@ 2008-06-17 14:15 ` Dominik Brodowski
2008-06-18 12:23 ` Komuro
1 sibling, 0 replies; 17+ messages in thread
From: Dominik Brodowski @ 2008-06-17 14:15 UTC (permalink / raw)
To: Tejun Heo
Cc: Komuro, Jeff Garzik, jgarzik, linux-ide, linux-kernel,
linux-pcmcia, Kristoffer Ericson
On Tue, Jun 17, 2008 at 11:09:20PM +0900, Tejun Heo wrote:
> Okay. The exit is from CS_CHECK macro on GetNextTuple, missed that
> macro. It means it failed to request IO resource somewhere. Can you
> please try the attached patch? It will show us where it failed.
>
> This part of code hasn't changed at all in pata_pcmcia && I don't really
> understand the tuple business. We need pcmcia people to pitch in.
The strange thing is that neither the PCMCIA side nor pata_pcmcia changed
between the working 2.6.26-rc4 and the non-working 2.6.26-rc3... that's why
I am at least as surprised as you are ;)
Thanks,
Dominik
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [KERNEL 2.6.26-rc4] bugreport : pata_pcmcia with Sandisk Extreme III 8GB
2008-06-17 14:09 ` Tejun Heo
2008-06-17 14:15 ` Dominik Brodowski
@ 2008-06-18 12:23 ` Komuro
1 sibling, 0 replies; 17+ messages in thread
From: Komuro @ 2008-06-18 12:23 UTC (permalink / raw)
To: Tejun Heo
Cc: Jeff Garzik, Dominik Brodowski, jgarzik, linux-ide, linux-kernel,
linux-pcmcia, Kristoffer Ericson
Hi,
Here is the log.
My card is single function device.
it is correct that GetNextTuple fails for pcmcia0.1.
since pcmcia0.1 does not exist.
I think the reason of this problem is
memory-leak or something.
pcmcia: registering new device pcmcia0.0
pata_pcmcia 0.0: XXX ENTER
pata_pcmcia 0.0: XXX resource loop, pass=0
pata_pcmcia 0.0: XXX resource loop, pass=0
scsi2 : pata_pcmcia
ata3: PATA max PIO0 cmd 0xd100 ctl 0xd10e irq 4
ata3.00: CFA: , Ver.1.0, max PIO2
ata3.00: 32000 sectors, multi 0: LBA
ata3.00: configured for PIO0
ata3.00: configured for PIO0
ata3: EH complete
isa bounce pool size: 16 pages
scsi 2:0:0:0: Direct-Access ATA Ver. PQ: 0 ANSI: 5
sd 2:0:0:0: [sdb] 32000 512-byte hardware sectors (16 MB)
sd 2:0:0:0: [sdb] Write Protect is off
sd 2:0:0:0: [sdb] Mode Sense: 00 3a 00 00
sd 2:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
sd 2:0:0:0: [sdb] 32000 512-byte hardware sectors (16 MB)
sd 2:0:0:0: [sdb] Write Protect is off
sd 2:0:0:0: [sdb] Mode Sense: 00 3a 00 00
sd 2:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
sdb: sdb1
sd 2:0:0:0: [sdb] Attached SCSI removable disk
sd 2:0:0:0: Attached scsi generic sg2 type 0
pata_pcmcia 0.0: XXX LEAVE 0
pcmcia: registering new device pcmcia0.1
pata_pcmcia 0.1: XXX ENTER
pata_pcmcia 0.1: XXX resource loop, pass=0
pata_pcmcia 0.1: XXX resource loop, pass=0
pata_pcmcia 0.1: XXX IO request failed 2 0:16 0:0
pata_pcmcia 0.1: XXX resource loop, pass=0
pata_pcmcia 0.1: XXX IO request failed 1 1f0:8 3f6:1
pata_pcmcia 0.1: XXX resource loop, pass=0
pata_pcmcia 0.1: XXX IO request failed 1 170:8 376:1
pata_pcmcia 0.1: XXX pass=0, doing GetFirstTuple
pata_pcmcia 0.1: XXX resource loop, pass=1
pata_pcmcia 0.1: XXX pass=1, doing GetNextTuple
pata_pcmcia 0.1: XXX resource loop, pass=1
pata_pcmcia 0.1: XXX IO request failed 2 0:16 376:0
pata_pcmcia 0.1: XXX pass=1, doing GetNextTuple
pata_pcmcia 0.1: XXX resource loop, pass=1
pata_pcmcia 0.1: XXX IO request failed 1 1f0:8 3f6:1
pata_pcmcia 0.1: XXX pass=1, doing GetNextTuple
pata_pcmcia 0.1: XXX resource loop, pass=1
pata_pcmcia 0.1: XXX IO request failed 1 170:8 376:1
pata_pcmcia 0.1: XXX pass=1, doing GetNextTuple
0.1: GetNextTuple: No more items
pata_pcmcia 0.1: XXX LEAVE -12
pata_pcmcia: probe of 0.1 failed with error -12
modprobe used greatest stack depth: 1676 bytes left
pata_pcmcia 0.1: XXX ENTER
pata_pcmcia 0.1: XXX resource loop, pass=0
pata_pcmcia 0.1: XXX resource loop, pass=0
pata_pcmcia 0.1: XXX IO request failed 2 0:16 376:0
pata_pcmcia 0.1: XXX resource loop, pass=0
pata_pcmcia 0.1: XXX IO request failed 1 1f0:8 3f6:1
pata_pcmcia 0.1: XXX resource loop, pass=0
pata_pcmcia 0.1: XXX IO request failed 1 170:8 376:1
pata_pcmcia 0.1: XXX pass=0, doing GetFirstTuple
pata_pcmcia 0.1: XXX resource loop, pass=1
pata_pcmcia 0.1: XXX pass=1, doing GetNextTuple
pata_pcmcia 0.1: XXX resource loop, pass=1
pata_pcmcia 0.1: XXX IO request failed 2 0:16 376:0
pata_pcmcia 0.1: XXX pass=1, doing GetNextTuple
pata_pcmcia 0.1: XXX resource loop, pass=1
pata_pcmcia 0.1: XXX IO request failed 1 1f0:8 3f6:1
pata_pcmcia 0.1: XXX pass=1, doing GetNextTuple
pata_pcmcia 0.1: XXX resource loop, pass=1
pata_pcmcia 0.1: XXX IO request failed 1 170:8 376:1
pata_pcmcia 0.1: XXX pass=1, doing GetNextTuple
0.1: GetNextTuple: No more items
pata_pcmcia 0.1: XXX LEAVE -12
pata_pcmcia: probe of 0.1 failed with error -12
pata_pcmcia 0.1: XXX ENTER
pata_pcmcia 0.1: XXX resource loop, pass=0
pata_pcmcia 0.1: XXX resource loop, pass=0
pata_pcmcia 0.1: XXX IO request failed 2 0:16 376:0
pata_pcmcia 0.1: XXX resource loop, pass=0
pata_pcmcia 0.1: XXX IO request failed 1 1f0:8 3f6:1
pata_pcmcia 0.1: XXX resource loop, pass=0
pata_pcmcia 0.1: XXX IO request failed 1 170:8 376:1
pata_pcmcia 0.1: XXX pass=0, doing GetFirstTuple
pata_pcmcia 0.1: XXX resource loop, pass=1
pata_pcmcia 0.1: XXX pass=1, doing GetNextTuple
pata_pcmcia 0.1: XXX resource loop, pass=1
pata_pcmcia 0.1: XXX IO request failed 2 0:16 376:0
pata_pcmcia 0.1: XXX pass=1, doing GetNextTuple
pata_pcmcia 0.1: XXX resource loop, pass=1
pata_pcmcia 0.1: XXX IO request failed 1 1f0:8 3f6:1
pata_pcmcia 0.1: XXX pass=1, doing GetNextTuple
pata_pcmcia 0.1: XXX resource loop, pass=1
pata_pcmcia 0.1: XXX IO request failed 1 170:8 376:1
pata_pcmcia 0.1: XXX pass=1, doing GetNextTuple
0.1: GetNextTuple: No more items
pata_pcmcia 0.1: XXX LEAVE -12
pata_pcmcia: probe of 0.1 failed with error -12
Best Regards
Komuro
> Okay. The exit is from CS_CHECK macro on GetNextTuple, missed that
> macro. It means it failed to request IO resource somewhere. Can you
> please try the attached patch? It will show us where it failed.
>
> This part of code hasn't changed at all in pata_pcmcia && I don't really
> understand the tuple business. We need pcmcia people to pitch in.
>
> Thanks.
>
> --
> tejun
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [KERNEL 2.6.26-rc4] bugreport : pata_pcmcia with Sandisk Extreme III 8GB
2008-06-16 3:07 ` Tejun Heo
2008-06-16 13:11 ` Komuro
@ 2008-06-22 1:07 ` Komuro
1 sibling, 0 replies; 17+ messages in thread
From: Komuro @ 2008-06-22 1:07 UTC (permalink / raw)
To: Tejun Heo
Cc: Jeff Garzik, linux-pcmcia, linux-kernel, Dominik Brodowski,
linux-ide, Kristoffer Ericson, jgarzik
Hi,
Strangely, after removing the spin_lock_irqsave
and spin_unlock_irqrestore from the ata_eh_reset,
the pata_pcmcia works properly.
It seedms link->ap->lock is not intialized
by spin_lock_init().
- spin_lock_irqsave(link->ap->lock, flags);
link->eh_info.serror = 0;
- spin_unlock_irqrestore(link->ap->lock, flags);
Best Regards
Komuro
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [KERNEL 2.6.26-rc4] bugreport : pata_pcmcia with Sandisk Extreme III 8GB
2008-06-17 12:23 ` Komuro
2008-06-17 14:09 ` Tejun Heo
@ 2008-07-06 1:37 ` Komuro
2008-07-06 14:19 ` Tejun Heo
1 sibling, 1 reply; 17+ messages in thread
From: Komuro @ 2008-07-06 1:37 UTC (permalink / raw)
To: Tejun Heo
Cc: Jeff Garzik, linux-pcmcia, linux-kernel, Brodowski, rjw,
linux-ide, Dominik, Kristoffer Ericson, jgarzik
Hi, Tejun
The patch below fixes the pata_pcmcia problem.
I think the ap->lock points to bogus address.
Any comment?
--- linux-2.6.26-rc8/drivers/ata/libata-core.c.orig 2008-07-06 10:05:46.000000000 +0900
+++ linux-2.6.26-rc8/drivers/ata/libata-core.c 2008-07-06 10:09:16.000000000 +0900
@@ -5304,6 +5304,8 @@ struct ata_host *ata_host_alloc(struct d
goto err_out;
ap->port_no = i;
+ ap->lock = &ap->__lock;
+ spin_lock_init(ap->lock);
host->ports[i] = ap;
}
--- linux-2.6.26-rc8/include/linux/libata.h.orig 2008-07-06 10:03:54.000000000 +0900
+++ linux-2.6.26-rc8/include/linux/libata.h 2008-07-06 10:04:35.000000000 +0900
@@ -639,6 +639,7 @@ struct ata_port {
struct Scsi_Host *scsi_host; /* our co-allocated scsi host */
struct ata_port_operations *ops;
spinlock_t *lock;
+ spinlock_t __lock;
unsigned long flags; /* ATA_FLAG_xxx */
unsigned int pflags; /* ATA_PFLAG_xxx */
unsigned int print_id; /* user visible unique port ID */
Best Regards
Komuro
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [KERNEL 2.6.26-rc4] bugreport : pata_pcmcia with Sandisk Extreme III 8GB
2008-07-06 1:37 ` Komuro
@ 2008-07-06 14:19 ` Tejun Heo
2008-07-07 12:42 ` Komuro
0 siblings, 1 reply; 17+ messages in thread
From: Tejun Heo @ 2008-07-06 14:19 UTC (permalink / raw)
To: Komuro
Cc: Jeff Garzik, linux-pcmcia, linux-kernel, Dominik Brodowski,
linux-ide, Kristoffer Ericson, jgarzik, rjw
Hello, Komuro.
Komuro wrote:
> Hi, Tejun
>
> The patch below fixes the pata_pcmcia problem.
>
> I think the ap->lock points to bogus address.
>
> Any comment?
>
> --- linux-2.6.26-rc8/drivers/ata/libata-core.c.orig 2008-07-06 10:05:46.000000000 +0900
> +++ linux-2.6.26-rc8/drivers/ata/libata-core.c 2008-07-06 10:09:16.000000000 +0900
> @@ -5304,6 +5304,8 @@ struct ata_host *ata_host_alloc(struct d
> goto err_out;
>
> ap->port_no = i;
> + ap->lock = &ap->__lock;
> + spin_lock_init(ap->lock);
> host->ports[i] = ap;
> }
>
> --- linux-2.6.26-rc8/include/linux/libata.h.orig 2008-07-06 10:03:54.000000000 +0900
> +++ linux-2.6.26-rc8/include/linux/libata.h 2008-07-06 10:04:35.000000000 +0900
> @@ -639,6 +639,7 @@ struct ata_port {
> struct Scsi_Host *scsi_host; /* our co-allocated scsi host */
> struct ata_port_operations *ops;
> spinlock_t *lock;
> + spinlock_t __lock;
> unsigned long flags; /* ATA_FLAG_xxx */
> unsigned int pflags; /* ATA_PFLAG_xxx */
> unsigned int print_id; /* user visible unique port ID */
Hmmm... Strange. From ata_port_alloc(),
struct ata_port *ata_port_alloc(struct ata_host *host)
{
struct ata_port *ap;
DPRINTK("ENTER\n");
ap = kzalloc(sizeof(*ap), GFP_KERNEL);
if (!ap)
return NULL;
ap->pflags |= ATA_PFLAG_INITIALIZING;
ap->lock = &host->lock;
^^^^^^^^^^^^^^^^^^^^^^^
How come ap->lock can get set to bogus address? Can you please printk
&host->lock and ap->lock after ata_host_alloc() without the patch?
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [KERNEL 2.6.26-rc4] bugreport : pata_pcmcia with Sandisk Extreme III 8GB
2008-07-06 14:19 ` Tejun Heo
@ 2008-07-07 12:42 ` Komuro
2008-07-09 4:10 ` Tejun Heo
0 siblings, 1 reply; 17+ messages in thread
From: Komuro @ 2008-07-07 12:42 UTC (permalink / raw)
To: Tejun Heo
Cc: Jeff Garzik, linux-pcmcia, linux-kernel, Brodowski, rjw,
linux-ide, Dominik, Kristoffer Ericson, jgarzik
Hi,
> How come ap->lock can get set to bogus address? Can you please printk
> &host->lock and ap->lock after ata_host_alloc() without the patch?
Here is the output of printk.
Strangely, without the patch, the pata_pcmcia problem happens again.
ata_piix 0000:00:1f.1: version 2.12
ACPI: PCI Interrupt Link [LNKC] enabled at IRQ 11
ACPI: PCI Interrupt 0000:00:1f.1[A] -> Link [LNKC] -> GSI 11 (level, low) -> IRQ 11
&host->lock = d6c288b4
ap->lock = d6c288b4
ap->lock = d6c288b4
PCI: Setting latency timer of device 0000:00:1f.1 to 64
scsi0 : ata_piix
scsi1 : ata_piix
....
pcmcia: registering new device pcmcia1.0
&host->lock = d70ee534
ap->lock = d70ee534
scsi2 : pata_pcmcia
host = devres_alloc(ata_host_release, sz, GFP_KERNEL);
if (!host)
goto err_out;
devres_add(dev, host);
dev_set_drvdata(dev, host);
spin_lock_init(&host->lock);
printk("&host->lock = %x\n", &host->lock);
host->dev = dev;
host->n_ports = max_ports;
/* allocate ports bound to this host */
for (i = 0; i < max_ports; i++) {
struct ata_port *ap;
ap = ata_port_alloc(host);
if (!ap)
goto err_out;
ap->port_no = i;
/*
ap->lock = &ap->__lock;
spin_lock_init(ap->lock);
*/
printk("ap->lock = %x\n", ap->lock);
host->ports[i] = ap;
}
Best Regards
Komuro
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [KERNEL 2.6.26-rc4] bugreport : pata_pcmcia with Sandisk Extreme III 8GB
2008-07-07 12:42 ` Komuro
@ 2008-07-09 4:10 ` Tejun Heo
2008-07-12 2:39 ` Komuro
0 siblings, 1 reply; 17+ messages in thread
From: Tejun Heo @ 2008-07-09 4:10 UTC (permalink / raw)
To: Komuro
Cc: Jeff Garzik, linux-pcmcia, linux-kernel, Dominik Brodowski,
linux-ide, Kristoffer Ericson, jgarzik, rjw
Hello,
Komuro wrote:
>> How come ap->lock can get set to bogus address? Can you please printk
>> &host->lock and ap->lock after ata_host_alloc() without the patch?
>
> Here is the output of printk.
> Strangely, without the patch, the pata_pcmcia problem happens again.
Ah... super strange. Can you please try to swap memory sticks around
and see whether anything changes to rule out bad memory? Another
possibility is DMA corrupting the memory and printk makes the timing
different and dodges the bullet. Does putting msleep(100) in the
pata_pcmcia init_one make any difference?
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [KERNEL 2.6.26-rc4] bugreport : pata_pcmcia with Sandisk Extreme III 8GB
2008-07-09 4:10 ` Tejun Heo
@ 2008-07-12 2:39 ` Komuro
0 siblings, 0 replies; 17+ messages in thread
From: Komuro @ 2008-07-12 2:39 UTC (permalink / raw)
To: Tejun Heo
Cc: Jeff Garzik, linux-pcmcia, linux-kernel, Brodowski, rjw,
linux-ide, Dominik, Kristoffer Ericson, jgarzik
Hello,
> Ah... super strange. Can you please try to swap memory sticks around
> and see whether anything changes to rule out bad memory?
I tried the pata_pcmcia on 3(three) PC.but the result is same.
So I think the memory is good.
> Another
> possibility is DMA corrupting the memory and printk makes the timing
> different and dodges the bullet. Does putting msleep(100) in the
> pata_pcmcia init_one make any difference?
I tried the msleep , but it still does not work.
By the way,
If I delete the pata_pcmcia.ko from /lib/modules/...
and insert the ata pcmcia card,
only /sys/bus/pcmcia/devices/0.0 exist.
But if I install the pata_pcmcia.ko,
/sys/bus/pcmcia/devices/0.0 and
/sys/bus/pcmcia/devices/0.1 exist.
Maybe the sysfs or something like that
is the problem.
Best Regards
Komuro
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2008-07-12 2:39 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20080528225049.9a134e0d.Kristoffer.Ericson@Gmail.com>
[not found] ` <20080528222740.GB20893@isilmar.linta.de>
[not found] ` <20080530135728.be02d3dc.Kristoffer.Ericson@Gmail.com>
[not found] ` <20080607223716.7d142072.komurojun-mbn@nifty.com>
2008-06-11 7:20 ` [KERNEL 2.6.26-rc4] bugreport : pata_pcmcia with Sandisk Extreme III 8GB Dominik Brodowski
2008-06-14 3:00 ` Komuro
2008-06-14 7:20 ` Jeff Garzik
2008-06-14 12:36 ` Komuro
2008-06-16 3:07 ` Tejun Heo
2008-06-16 13:11 ` Komuro
2008-06-16 13:24 ` Tejun Heo
2008-06-17 12:23 ` Komuro
2008-06-17 14:09 ` Tejun Heo
2008-06-17 14:15 ` Dominik Brodowski
2008-06-18 12:23 ` Komuro
2008-07-06 1:37 ` Komuro
2008-07-06 14:19 ` Tejun Heo
2008-07-07 12:42 ` Komuro
2008-07-09 4:10 ` Tejun Heo
2008-07-12 2:39 ` Komuro
2008-06-22 1:07 ` Komuro
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).