Subject: Re: haning after pciicd0
To: None <port-i386@netbsd.org>
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
List: port-i386
Date: 03/12/2001 21:28:40
On Sun, Mar 11, 2001 at 10:48:54PM +0100, Hanspeter Roth wrote:
> 
> Hello Manuel,
> 
> Friday, March 09, 2001, 7:55:41 PM, you wrote:
> 
> [...]
> 
> > It hangs before the pciide0 line ?
> > If so it may not be a problem inside the IDE code  ...
> 
> No it hangs _after_ the pciide0 line.
> I realized that printf works fine. So I used printfs to isolate
> the location where it hangs.
> 
> On the Mitac pciide0:0:0 is a harddisk and pciide0:1:0 is the CD-ROM.
> Wdcattach calls ata_get_params on pciide0:0:0 which runs trough
> without long delays.
> Then it attempts ata_get_params on pciide0:0:1 which is empty.
> It calls wd_exec_command twice since the first time failes.
> On the second attempt wd_exec_command calls wdc_exec_xfer which
> calls wdcstart which seems to hang somewhere.
> 
> When I tried to isolate it further it ended up issuing endless
> trace messages within wd_exec_xfer.
> I also ran out of dmesg-buffer-space. Can I increase it somewhere?

Yes, 'man 4 options' and look for MSGBUFSIZE. Default is 8192 for i386.

> 
> When I had lot of trace stuff it seemed to me that the problem was
> less reproducable.
> In dev/ic/wdc.c I changed the condition for the second invocation
> of ata_get_params from "error != CMD_OK" to "error == CMD_AGAIN".
> This seemed to solve the problem when checking pciide0:0:1 but
> it occasionally hung while checking pciide0:1:1.
> It seems to me timing is also playing a role.

Did you try to add some delay between the 2 attemps ?

> I'm considering playing with PCIC_ISA_INTR_ALLOC_MASK and
> PCIBIOS_IRQS_HINT. But I have no idea what I should set them to...

PCIC_ISA_INTR_ALLOC_MASK is only for PCMCIA controllers, it won't help here.
As for PCIBIOS_IRQS_HINT, I guess your pciide controller is in legaty
mode, so this won't have any effect either.

--
Manuel Bouyer <bouyer@antioche.eu.org>
--