diff options
author | grehan <grehan@FreeBSD.org> | 2008-05-08 17:55:44 +0000 |
---|---|---|
committer | grehan <grehan@FreeBSD.org> | 2008-05-08 17:55:44 +0000 |
commit | 1bdc8efe1532fb47d452acdf221653403243b1f7 (patch) | |
tree | ed27c635766096baa0d73e6b8ea680292df61554 /sys/dev/ata/ata-disk.c | |
parent | 494160ee656e9d1bbcc0fb4d77980e3fd1d85da7 (diff) | |
download | FreeBSD-src-1bdc8efe1532fb47d452acdf221653403243b1f7.zip FreeBSD-src-1bdc8efe1532fb47d452acdf221653403243b1f7.tar.gz |
Fix panic and breakage for non-DMA ATA devices e.g. powermac macio cells.
Handle cases where dma function pointers may be NULL, and where
the max_iosize can't be derived from a DMA data structure. For
the latter, revert to the prior behaviour of using DFLTPHYS for
the max i/o size when there is no other data.
Reviewed by: marcel
No objection by: sos
Diffstat (limited to 'sys/dev/ata/ata-disk.c')
-rw-r--r-- | sys/dev/ata/ata-disk.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/ata/ata-disk.c b/sys/dev/ata/ata-disk.c index 6bf9fd9..203eb64 100644 --- a/sys/dev/ata/ata-disk.c +++ b/sys/dev/ata/ata-disk.c @@ -125,7 +125,7 @@ ad_attach(device_t dev) adp->disk->d_dump = ad_dump; adp->disk->d_name = "ad"; adp->disk->d_drv1 = dev; - adp->disk->d_maxsize = ch->dma.max_iosize; + adp->disk->d_maxsize = ch->dma.max_iosize ? ch->dma.max_iosize : DFLTPHYS; adp->disk->d_sectorsize = DEV_BSIZE; adp->disk->d_mediasize = DEV_BSIZE * (off_t)adp->total_secs; adp->disk->d_fwsectors = adp->sectors; |