Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Dec 2009 09:26:56 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r200353 - head/sys/dev/ata
Message-ID:  <200912100926.nBA9Quia057027@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Thu Dec 10 09:26:56 2009
New Revision: 200353
URL: http://svn.freebsd.org/changeset/base/200353

Log:
  Limit maximum I/O size, depending on command set supported by device.
  It is required to suppot non-LBA48 devices with MAXPHYS above 128K.
  Same is done in ada(4).

Modified:
  head/sys/dev/ata/ata-disk.c

Modified: head/sys/dev/ata/ata-disk.c
==============================================================================
--- head/sys/dev/ata/ata-disk.c	Thu Dec 10 07:48:47 2009	(r200352)
+++ head/sys/dev/ata/ata-disk.c	Thu Dec 10 09:26:56 2009	(r200353)
@@ -126,6 +126,10 @@ ad_attach(device_t dev)
     adp->disk->d_name = "ad";
     adp->disk->d_drv1 = dev;
     adp->disk->d_maxsize = ch->dma.max_iosize ? ch->dma.max_iosize : 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?200912100926.nBA9Quia057027>