Index: sys/dev/aacraid/aacraid.c =================================================================== --- sys/dev/aacraid/aacraid.c +++ sys/dev/aacraid/aacraid.c @@ -579,7 +579,7 @@ BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - sc->aac_max_sectors << 9, /* maxsize */ + AAC_MAXIO_SIZE(sc), /* maxsize */ sc->aac_sg_tablesize, /* nsegments */ BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ BUS_DMA_ALLOCNOW, /* flags */ @@ -1807,7 +1807,7 @@ } ip->MaxIoCommands = sc->aac_max_fibs; - ip->MaxIoSize = sc->aac_max_sectors << 9; + ip->MaxIoSize = AAC_MAXIO_SIZE(sc); ip->MaxFibSize = sc->aac_max_fib_size; aac_adapter_init_tole(ip); Index: sys/dev/aacraid/aacraid_cam.c =================================================================== --- sys/dev/aacraid/aacraid_cam.c +++ sys/dev/aacraid/aacraid_cam.c @@ -1011,7 +1011,7 @@ cpi->max_lun = 7; /* Per the controller spec */ cpi->initiator_id = camsc->inf->InitiatorBusId; cpi->bus_id = camsc->inf->BusNumber; - cpi->maxio = sc->aac_max_sectors << 9; + cpi->maxio = AAC_MAXIO_SIZE(sc); /* * Resetting via the passthrough or parallel bus scan Index: sys/dev/aacraid/aacraid_var.h =================================================================== --- sys/dev/aacraid/aacraid_var.h +++ sys/dev/aacraid/aacraid_var.h @@ -470,6 +470,14 @@ u_int32_t FwDebugBufferSize; /* FW Debug Buffer size */ }; +/* + * Max. I/O size in bytes. + * Reserve one page for the DMA subsystem, that may need it when the + * I/O buffer is not page aligned. + */ +#define AAC_MAXIO_SIZE(sc) MIN(((sc)->aac_max_sectors << 9) - PAGE_SIZE, \ + maxphys) + /* * Event callback mechanism for the driver */