@@ -1537,6 +1537,8 @@ static int ata_hpa_resize(struct ata_device *dev)
}
/* let's unlock HPA */
+ dev->alt_n_sectors = sectors;
+
rc = ata_set_max_sectors(dev, native_sectors);
if (rc == -EACCES) {
/* if device aborted the command, skip HPA resizing */
@@ -1104,6 +1104,8 @@ static int ata_scsi_dev_config(struct scsi_device *sdev,
blk_queue_update_dma_alignment(sdev->request_queue,
ATA_SECT_SIZE - 1);
sdev->manage_start_stop = 1;
+
+ sdev->alt_capacity = dev->alt_n_sectors;
}
if (dev->flags & ATA_DFLAG_AN)
@@ -582,6 +582,7 @@ struct ata_device {
#endif
/* n_sector is used as CLEAR_OFFSET, read comment above CLEAR_OFFSET */
u64 n_sectors; /* size of device, if ATA */
+ u64 alt_n_sectors; /* size bios wants us to see */
unsigned int class; /* ATA_DEV_xxx */
unsigned long unpark_deadline;
Export HPA size as alt_size so that userland tools which need the BIOS size can determine it. Signed-off-by: Tejun Heo <tj@kernel.org> --- drivers/ata/libata-core.c | 2 ++ drivers/ata/libata-scsi.c | 2 ++ include/linux/libata.h | 1 + 3 files changed, 5 insertions(+), 0 deletions(-)