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/atapi-cd.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/atapi-cd.c')
-rw-r--r-- | sys/dev/ata/atapi-cd.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/dev/ata/atapi-cd.c b/sys/dev/ata/atapi-cd.c index 7bf3b9f..abd1db4 100644 --- a/sys/dev/ata/atapi-cd.c +++ b/sys/dev/ata/atapi-cd.c @@ -906,8 +906,11 @@ acd_set_ioparm(device_t dev) { struct ata_channel *ch = device_get_softc(device_get_parent(dev)); struct acd_softc *cdp = device_get_ivars(dev); + uint32_t max_iosize; - cdp->iomax = min(ch->dma.max_iosize, 65534); + max_iosize = ch->dma.max_iosize ? ch->dma.max_iosize : DFLTPHYS; + + cdp->iomax = min(max_iosize, 65534); } static void |