PERFORCE change 165607 for review
Alexander Motin
mav at FreeBSD.org
Sat Jul 4 19:21:58 UTC 2009
http://perforce.freebsd.org/chv.cgi?CH=165607
Change 165607 by mav at mav_mavbook on 2009/07/04 19:21:36
Rise XPT_DEV_MATCH memory limit up to MAXPHYS. It is not going to
be passed to ancient hardware, so to reasons to be overly strict.
Affected files ...
.. //depot/projects/scottl-camlock/src/sys/cam/cam_periph.c#31 edit
Differences ...
==== //depot/projects/scottl-camlock/src/sys/cam/cam_periph.c#31 (text+ko) ====
@@ -571,6 +571,8 @@
u_int8_t **data_ptrs[CAM_PERIPH_MAXMAPS];
u_int32_t lengths[CAM_PERIPH_MAXMAPS];
u_int32_t dirs[CAM_PERIPH_MAXMAPS];
+ /* Some controllers may not be able to handle more data. */
+ size_t maxmap = DFLTPHYS;
switch(ccb->ccb_h.func_code) {
case XPT_DEV_MATCH:
@@ -593,6 +595,11 @@
dirs[0] = CAM_DIR_IN;
numbufs = 1;
}
+ /*
+ * This request will not go to the hardware, no reason
+ * to be so strict. vmapbuf() is able to map up to MAXPHYS.
+ */
+ maxmap = MAXPHYS;
break;
case XPT_SCSI_IO:
case XPT_CONT_TARGET_IO:
@@ -635,12 +642,12 @@
* boundary.
*/
if ((lengths[i] +
- (((vm_offset_t)(*data_ptrs[i])) & PAGE_MASK)) > DFLTPHYS){
+ (((vm_offset_t)(*data_ptrs[i])) & PAGE_MASK)) > maxmap){
printf("cam_periph_mapmem: attempt to map %lu bytes, "
- "which is greater than DFLTPHYS(%d)\n",
+ "which is greater than %lu\n",
(long)(lengths[i] +
(((vm_offset_t)(*data_ptrs[i])) & PAGE_MASK)),
- DFLTPHYS);
+ (u_long)maxmap);
return(E2BIG);
}
@@ -672,7 +679,7 @@
/* put our pointer in the data slot */
mapinfo->bp[i]->b_data = *data_ptrs[i];
- /* set the transfer length, we know it's < DFLTPHYS */
+ /* set the transfer length, we know it's < MAXPHYS */
mapinfo->bp[i]->b_bufsize = lengths[i];
/* set the direction */
More information about the p4-projects
mailing list