diff mbox

[2/6] libata: Use scsi_zbc_noretry_cmd() for ZAC devices

Message ID 20180301194024.25532-3-damien.lemoal@wdc.com (mailing list archive)
State Changes Requested
Headers show

Commit Message

Damien Le Moal March 1, 2018, 7:40 p.m. UTC
Improve decisions regarding command retry worthiness by calling
the funtion scsi_zbc_noretry_cmd() in ata_eh_worth_retry() if the
command target is a ZAC device.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
---
 drivers/ata/libata-eh.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Hannes Reinecke March 2, 2018, 7:32 a.m. UTC | #1
On 03/01/2018 08:40 PM, Damien Le Moal wrote:
> Improve decisions regarding command retry worthiness by calling
> the funtion scsi_zbc_noretry_cmd() in ata_eh_worth_retry() if the
> command target is a ZAC device.
> 
> Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
> ---
>  drivers/ata/libata-eh.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
> index 11c3137d7b0a..504272b18e75 100644
> --- a/drivers/ata/libata-eh.c
> +++ b/drivers/ata/libata-eh.c
> @@ -2139,6 +2139,10 @@ static unsigned int ata_eh_speed_down(struct ata_device *dev,
>   */
>  static inline int ata_eh_worth_retry(struct ata_queued_cmd *qc)
>  {
> +	if (qc->dev->flags & ATA_DFLAG_ZAC &&
> +	    qc->flags & ATA_QCFLAG_SENSE_VALID &&
> +	    scsi_zbc_noretry_cmd(qc->scsicmd))
> +		return 0;	/* retrying will fail again */
>  	if (qc->err_mask & AC_ERR_MEDIA)
>  		return 0;	/* don't retry media errors */
>  	if (qc->flags & ATA_QCFLAG_IO)
> 
Reviewed-by: Hannes Reinecke <hare@suse.com>

Cheers,

Hannes
diff mbox

Patch

diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 11c3137d7b0a..504272b18e75 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -2139,6 +2139,10 @@  static unsigned int ata_eh_speed_down(struct ata_device *dev,
  */
 static inline int ata_eh_worth_retry(struct ata_queued_cmd *qc)
 {
+	if (qc->dev->flags & ATA_DFLAG_ZAC &&
+	    qc->flags & ATA_QCFLAG_SENSE_VALID &&
+	    scsi_zbc_noretry_cmd(qc->scsicmd))
+		return 0;	/* retrying will fail again */
 	if (qc->err_mask & AC_ERR_MEDIA)
 		return 0;	/* don't retry media errors */
 	if (qc->flags & ATA_QCFLAG_IO)