tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: drvctl rescan for atabus
On Tue, Oct 06, 2009 at 11:48:06AM -0500, David Young wrote:
> [...]
> I think the reason is that you use atabusconfig() to re-probe the bus
> and attach the devices:
>
> > @@ -384,6 +385,10 @@
> > if (chp->ch_flags & ATACH_SHUTDOWN) {
> > break;
> > }
> > + if (chp->ch_flags & ATACH_TH_RESCAN) {
> > + atabusconfig(sc);
> > + chp->ch_flags &= ~ATACH_TH_RESCAN;
> > + }
> > if (chp->ch_flags & ATACH_TH_RESET) {
> > /*
> > * ata_reset_channel() will freeze 2 times, so
>
> atabusconfig() assumes that neither drives nor an atapibus are attached.
> I think that if you check in atabusconfig() whether there is a non-NULL
> device_t at chp->atapibus or at chp->ata_drives[i] before trying to
> attach a driver, then you can do without the EBUSY's above.
there's another reason to do request all devices to be detached before
rescan: in ATA the master and slave devices are probed at the same
time, they can't really be probed independantly ...
This probably could be fixed by doing the probe without attach, but this
adds complexity to the driver (you have to stall I/Os while doing
this) and I'm not sure it's worth it.
--
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
NetBSD: 26 ans d'experience feront toujours la difference
--
Home |
Main Index |
Thread Index |
Old Index