svn commit: r201719 - stable/7/sys/dev/ata
Alexander Motin
mav at FreeBSD.org
Thu Jan 7 09:02:31 UTC 2010
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;
More information about the svn-src-stable
mailing list