diff options
author | sos <sos@FreeBSD.org> | 2002-12-03 20:20:44 +0000 |
---|---|---|
committer | sos <sos@FreeBSD.org> | 2002-12-03 20:20:44 +0000 |
commit | 71edc5e4eb36ba021cec4018ead8d4e7bd6d759d (patch) | |
tree | 905ab8bf0e6cc6504398fed7db55f39319883169 /sys/dev/ata/ata-disk.c | |
parent | 9a5da33a40507cd3fd2cebf1aa8999a6cdd27862 (diff) | |
download | FreeBSD-src-71edc5e4eb36ba021cec4018ead8d4e7bd6d759d.zip FreeBSD-src-71edc5e4eb36ba021cec4018ead8d4e7bd6d759d.tar.gz |
Add support for the PC98 platform to the ATA driver.
This mostly consists of functionality to serialize accesses to
the two ATA channels (which can also be used to "fix" certain
PCI based controllers).
Add support for Acard controllers.
Enable the ATA driver in PC98 GENERIC, and add device hints.
Update man page with latest support.
The PC98 core team has kindly provided me with a PC98
machine that made this all possible, thanks to all that
contributed to that effort, without that this would
probably newer have been possible..
Approved by: re@
Diffstat (limited to 'sys/dev/ata/ata-disk.c')
-rw-r--r-- | sys/dev/ata/ata-disk.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/dev/ata/ata-disk.c b/sys/dev/ata/ata-disk.c index f8bae5e..05e4ad9 100644 --- a/sys/dev/ata/ata-disk.c +++ b/sys/dev/ata/ata-disk.c @@ -268,6 +268,10 @@ adopen(dev_t dev, int flags, int fmt, struct thread *td) if (adp->flags & AD_F_RAID_SUBDISK) return EBUSY; + + /* hold off access to we are fully attached */ + while (ata_delayed_attach) + tsleep(&ata_delayed_attach, PRIBIO, "adopn", 1); return 0; } @@ -276,10 +280,12 @@ adclose(dev_t dev, int flags, int fmt, struct thread *td) { struct ad_softc *adp = dev->si_drv1; + adp->device->channel->lock_func(adp->device->channel, ATA_LF_LOCK); ATA_SLEEPLOCK_CH(adp->device->channel, ATA_CONTROL); if (ata_command(adp->device, ATA_C_FLUSHCACHE, 0, 0, 0, ATA_WAIT_READY)) ata_prtdev(adp->device, "flushing cache on close failed\n"); ATA_UNLOCK_CH(adp->device->channel); + adp->device->channel->lock_func(adp->device->channel, ATA_LF_UNLOCK); return 0; } @@ -312,7 +318,9 @@ addump(dev_t dev, void *virtual, vm_offset_t physical, off_t offset, size_t leng if (!once) { /* force PIO mode for dumps */ adp->device->mode = ATA_PIO; + adp->device->channel->lock_func(adp->device->channel, ATA_LF_LOCK); ata_reinit(adp->device->channel); + adp->device->channel->lock_func(adp->device->channel, ATA_LF_UNLOCK); once = 1; } |