From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 7 09:02:31 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5583F1065679; Thu, 7 Jan 2010 09:02:31 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 439428FC27; Thu, 7 Jan 2010 09:02:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0792VQf001043; Thu, 7 Jan 2010 09:02:31 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0792VFw001042; Thu, 7 Jan 2010 09:02:31 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201001070902.o0792VFw001042@svn.freebsd.org> From: Alexander Motin Date: Thu, 7 Jan 2010 09:02:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201719 - stable/7/sys/dev/ata X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 09:02:31 -0000 Author: mav Date: Thu Jan 7 09:02:30 2010 New Revision: 201719 URL: http://svn.freebsd.org/changeset/base/201719 Log: MFC r200353: Limit maximum I/O size, depending on command set supported by device. It is required to suppot non-LBA48 devices with MAXPHYS above 128K. Modified: stable/7/sys/dev/ata/ata-disk.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/ata/ata-disk.c ============================================================================== --- stable/7/sys/dev/ata/ata-disk.c Thu Jan 7 06:59:16 2010 (r201718) +++ stable/7/sys/dev/ata/ata-disk.c Thu Jan 7 09:02:30 2010 (r201719) @@ -155,6 +155,10 @@ ad_attach(device_t dev) adp->disk->d_maxsize = ch->dma->max_iosize; else adp->disk->d_maxsize = DFLTPHYS; + if (atadev->param.support.command2 & ATA_SUPPORT_ADDRESS48) + adp->disk->d_maxsize = min(adp->disk->d_maxsize, 65536 * DEV_BSIZE); + else /* 28bit ATA command limit */ + adp->disk->d_maxsize = min(adp->disk->d_maxsize, 256 * DEV_BSIZE); adp->disk->d_sectorsize = DEV_BSIZE; adp->disk->d_mediasize = DEV_BSIZE * (off_t)adp->total_secs; adp->disk->d_fwsectors = adp->sectors;