diff options
author | jhb <jhb@FreeBSD.org> | 2008-11-17 23:30:19 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2008-11-17 23:30:19 +0000 |
commit | afc928387fabd0ef32931887fa92f2d2c7eec8f6 (patch) | |
tree | 36645512d8a4cceee3cfd2bf5e0de4cc0c859ee4 /sys/dev | |
parent | 6e1bfa6c69ad6be9670c6ce7d3f206843e23979b (diff) | |
download | FreeBSD-src-afc928387fabd0ef32931887fa92f2d2c7eec8f6.zip FreeBSD-src-afc928387fabd0ef32931887fa92f2d2c7eec8f6.tar.gz |
Fix the maximum transfer size for mfi(4) disk devices to not exceed the
maximum number of scatter/gather elements supported in the bus dma tag.
Reviewed by: scottl
MFC after: 1 week
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/mfi/mfi_disk.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/dev/mfi/mfi_disk.c b/sys/dev/mfi/mfi_disk.c index 0a553fa..4594ca2 100644 --- a/sys/dev/mfi/mfi_disk.c +++ b/sys/dev/mfi/mfi_disk.c @@ -136,7 +136,8 @@ mfi_disk_attach(device_t dev) sc->ld_disk = disk_alloc(); sc->ld_disk->d_drv1 = sc; - sc->ld_disk->d_maxsize = sc->ld_controller->mfi_max_io * secsize; + sc->ld_disk->d_maxsize = min(sc->ld_controller->mfi_max_io * secsize, + (sc->ld_controller->mfi_max_sge - 1) * PAGE_SIZE); sc->ld_disk->d_name = "mfid"; sc->ld_disk->d_open = mfi_disk_open; sc->ld_disk->d_close = mfi_disk_close; |