Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Jan 2010 09:02:31 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r201719 - stable/7/sys/dev/ata
Message-ID:  <201001070902.o0792VFw001042@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001070902.o0792VFw001042>