Patchwork [7/8] libata: use the enlarged capacity after late HPA unlock

login
register
mail settings
Submitter Tejun Heo
Date May 15, 2010, 6:09 p.m.
Message ID <1273946974-29131-8-git-send-email-tj@kernel.org>
Download mbox | patch
Permalink /patch/52713/
State Not Applicable
Delegated to: David Miller
Headers show

Comments

Tejun Heo - May 15, 2010, 6:09 p.m.
After late HPA unlock, libata kept using the original capacity
ignoring the new larger native capacity.  Enlarging device on the fly
doesn't cause any harm.  Use the larger native capacity instead.  This
will enable on-demand HPA unlocking.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/ata/libata-core.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
Jeff Garzik - May 15, 2010, 7:22 p.m.
On 05/15/2010 02:09 PM, Tejun Heo wrote:
> After late HPA unlock, libata kept using the original capacity
> ignoring the new larger native capacity.  Enlarging device on the fly
> doesn't cause any harm.  Use the larger native capacity instead.  This
> will enable on-demand HPA unlocking.
>
> Signed-off-by: Tejun Heo<tj@kernel.org>
> Cc: Ben Hutchings<ben@decadent.org.uk>

Acked-by: Jeff Garzik <jgarzik@redhat.com>


--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller - May 16, 2010, 7:18 a.m.
From: Tejun Heo <tj@kernel.org>
Date: Sat, 15 May 2010 20:09:33 +0200

> After late HPA unlock, libata kept using the original capacity
> ignoring the new larger native capacity.  Enlarging device on the fly
> doesn't cause any harm.  Use the larger native capacity instead.  This
> will enable on-demand HPA unlocking.
> 
> Signed-off-by: Tejun Heo <tj@kernel.org>

Acked-by: David S. Miller <davem@davemloft.net>
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 86f405b..9d6e92d 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -4212,9 +4212,8 @@  int ata_dev_revalidate(struct ata_device *dev, unsigned int new_class,
 	    dev->n_sectors > n_sectors && dev->n_sectors == n_native_sectors) {
 		ata_dev_printk(dev, KERN_WARNING,
 			       "new n_sectors matches native, probably "
-			       "late HPA unlock, continuing\n");
-		/* keep using the old n_sectors */
-		dev->n_sectors = n_sectors;
+			       "late HPA unlock, n_sectors updated\n");
+		/* use the larger n_sectors */
 		return 0;
 	}