ide: abort TRIM operation for invalid range
authorAnton Nefedov <anton.nefedov@virtuozzo.com>
Fri, 8 Dec 2017 12:10:34 +0000 (15:10 +0300)
committerJohn Snow <jsnow@redhat.com>
Fri, 19 Jan 2018 21:04:56 +0000 (16:04 -0500)
commit947858b0ba97f4ec097de667e45eff99212867c3
treed01aade0eac30412b937ab3cf09aef07dc95f85e
parentd8b070fed2e94b3747a74a28709d0300404c0d05
ide: abort TRIM operation for invalid range

ATA8-ACS3, 7.9 DATA SET MANAGEMENT - 06h, DMA

    7.9.5 Error Outputs
    If the Trim bit is set to one and:
      a) the device detects an invalid LBA Range Entry; or
      b) count is greater than IDENTIFY DEVICE data word 105
         (see 7.16.7.55),
    then the device shall return command aborted.
    A device may trim one or more LBA Range Entries before it returns
    command aborted. See table 209.

This check is not in the common ide_dma_cb() as the range for TRIM
is harder to reach: it is not in LBA/count registers and the buffer has
to be parsed first.

Signed-off-by: Anton Nefedov <anton.nefedov@virtuozzo.com>
Message-id: 1512735034-35327-4-git-send-email-anton.nefedov@virtuozzo.com
Signed-off-by: John Snow <jsnow@redhat.com>
hw/ide/core.c