From owner-freebsd-scsi@FreeBSD.ORG Thu Nov 25 09:20:29 2004 Return-Path: Delivered-To: freebsd-scsi@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 78DC216A4CE for ; Thu, 25 Nov 2004 09:20:29 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6370843D2D for ; Thu, 25 Nov 2004 09:20:29 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.1/8.13.1) with ESMTP id iAP9KT1T058308 for ; Thu, 25 Nov 2004 09:20:29 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.1/8.13.1/Submit) id iAP9KSKX058307; Thu, 25 Nov 2004 09:20:28 GMT (envelope-from gnats) Date: Thu, 25 Nov 2004 09:20:28 GMT Message-Id: <200411250920.iAP9KSKX058307@freefall.freebsd.org> To: freebsd-scsi@FreeBSD.org From: lindroos@nls.fi Subject: Re: kern/21220: mlx0: I/O error - attempt to write beyond end of drive X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: lindroos@nls.fi List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Nov 2004 09:20:29 -0000 The following reply was made to PR kern/21220; it has been noted by GNATS. From: lindroos@nls.fi To: FreeBSD-gnats-submit@FreeBSD.org Cc: Subject: Re: kern/21220: mlx0: I/O error - attempt to write beyond end of drive Date: Thu, 25 Nov 2004 11:16:06 +0200 (EET) The same problem appears on my Alpha. Seems like the controller doesn't like I/O size larger than 64k, and by hacking PAGE_SIZE (8k on alpha) to 4k will make the driver decide the max. 65536 bytes I/O block. This hack works for me, but i don't know how to fix it on i386 and/or other Mylex controllers. I suggest you try something like: # dd if=/dev/rmlxd0c bs=XXX of=/dev/zero with different block sizes and see when the I/O errors will appear. --- mlx_disk.c.orig Mon Jun 25 07:37:51 2001 +++ mlx_disk.c Fri Nov 5 12:42:54 2004 @@ -267,8 +267,10 @@ * maximum. */ s1 = sc->mlxd_controller->mlx_enq2->me_maxblk * MLX_BLKSIZE; - s2 = (sc->mlxd_controller->mlx_enq2->me_max_sg - 1) * PAGE_SIZE; + s2 = (sc->mlxd_controller->mlx_enq2->me_max_sg - 1) * 4096; dsk->si_iosize_max = imin(s1, s2); + device_printf(dev, "I/O size decided to %d after comparing %d and %d\n", + dsk->si_iosize_max, s1, s2); return (0); } Here is the driver's output on my system: mlx0: port 0x10100-0x1017f mem 0x81128100-0x8112817f irq 3 at device 12.0 on pci0 mlx0: interrupting at CIA irq 3 mlx0: DAC960P/PD, 3 channels, firmware 2.70-0-00, 4MB RAM mlxd0: on mlx0 mlxd0: 8182MB (16756736 sectors) RAID 5 (online) mlxd0: I/O size decided to 65536 after comparing 131072 and 65536 -- Dennis Lindroos