From afc928387fabd0ef32931887fa92f2d2c7eec8f6 Mon Sep 17 00:00:00 2001 From: jhb Date: Mon, 17 Nov 2008 23:30:19 +0000 Subject: 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 --- sys/dev/mfi/mfi_disk.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- cgit v1.1