From: Martin K. Petersen Date: Wed, 18 May 2011 02:13:23 +0000 (-0400) Subject: libata: Use Maximum Write Same Length to report discard size limit X-Git-Tag: v2.6.39.1~131 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=0d6a1cd7121da74a36846dfa1701c37ccee8faac;p=karo-tx-linux.git libata: Use Maximum Write Same Length to report discard size limit commit 5f4e206666f834340b69ddb43f86de3851c8675a upstream. Previously we used Maximum Unmap LBA Count in the Block Limits VPD to signal the maximum number of sectors we could handle in a single Write Same command. Starting with SBC3r26 the Block Limits VPD has an explicit limit on the number of blocks in a Write Same. This means we can stop abusing a field related to the Unmap command and let our SAT use the proper value in the VPD (Maximum Write Same Length). Signed-off-by: Martin K. Petersen Signed-off-by: Jeff Garzik Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index dad2c952e0d2..d51f9795c064 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c @@ -2139,7 +2139,7 @@ static unsigned int ata_scsiop_inq_b0(struct ata_scsi_args *args, u8 *rbuf) * with the unmap bit set. */ if (ata_id_has_trim(args->id)) { - put_unaligned_be32(65535 * 512 / 8, &rbuf[20]); + put_unaligned_be64(65535 * 512 / 8, &rbuf[36]); put_unaligned_be32(1, &rbuf[28]); }