Subject: Re: kern/17208: Insufficient delay in wdc_attach()
To: None <>
From: Manuel Bouyer <>
List: netbsd-bugs
Date: 06/12/2002 11:55:11
On Mon, Jun 10, 2002 at 03:39:10PM -0700, wrote:
> [...]
> In src/sys/dev/ic/wdc.c, function wdc_attach(), there is a delay(100)
> between the device reset and the attempt to get device parameters.  This
> delay is insufficient for some devices.  In particular, a Seagate TR-5
> tape drive which probes as
> st0 at atapibus0 drive 0: <Seagate STT20000A, , 8A51> type 1 sequential removabl
> e
> locks up if you do not have at 2000 microseconds (2ms) of delay.
> For some reason, there is a similar delay in src/sys/dev/ata/atapi_wdc.c
> in routine wdc_atapi_get_params(), but here the delay amount is 5ms.
> It seems to make sense to me that both of these delay()s should be the same,
> as the comments immediately preceeding them indicate that the reason for
> the delay() is the same, mainly that some devices don't behave well if they
> are accessed too soon after being reset.

wdc_atapi_get_params() is for ATAPI devices only, and ATAPI devices are not
supposed to react to a WDC_RESET, only the SOFT_RESET command. This is why
I didn't bump the delay here.
However there's no harm in making it 5ms, so I commited your patch.

Manuel Bouyer, LIP6, Universite Paris VI.