From owner-p4-projects@FreeBSD.ORG Sat Jul 4 19:21:58 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C8FFE1065670; Sat, 4 Jul 2009 19:21:57 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88FF8106564A for ; Sat, 4 Jul 2009 19:21:57 +0000 (UTC) (envelope-from mav@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 77B6C8FC15 for ; Sat, 4 Jul 2009 19:21:57 +0000 (UTC) (envelope-from mav@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n64JLv5D018922 for ; Sat, 4 Jul 2009 19:21:57 GMT (envelope-from mav@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n64JLvrN018920 for perforce@freebsd.org; Sat, 4 Jul 2009 19:21:57 GMT (envelope-from mav@freebsd.org) Date: Sat, 4 Jul 2009 19:21:57 GMT Message-Id: <200907041921.n64JLvrN018920@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to mav@freebsd.org using -f From: Alexander Motin To: Perforce Change Reviews Cc: Subject: PERFORCE change 165607 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Jul 2009 19:21:58 -0000 http://perforce.freebsd.org/chv.cgi?CH=165607 Change 165607 by mav@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 */