From patchwork Thu Mar 1 19:40:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 10252321 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B0F1660365 for ; Thu, 1 Mar 2018 19:40:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A083E28521 for ; Thu, 1 Mar 2018 19:40:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9520628534; Thu, 1 Mar 2018 19:40:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4283528521 for ; Thu, 1 Mar 2018 19:40:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161342AbeCATka (ORCPT ); Thu, 1 Mar 2018 14:40:30 -0500 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:46961 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161365AbeCATk3 (ORCPT ); Thu, 1 Mar 2018 14:40:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1519933230; x=1551469230; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=HrJkmPRv/EsegqEz8ZAsquxsWba7yxrLrDQCHVtfH64=; b=Mfybun3nBlQFLHUcm1Eu1cCMDa/oek4uRIu8uOfjLbwKJqxLuE/oR7Ml 27uR/toDoZn6VSvPAPxV3su5wnURomOetnxHnB/o1nH1EAZuElKN8tUws 6bBI/dtjlo3Ss8hyjWyJdABaFHvtE5tfHvSI5vU/rQfsZECawcxO5WXN1 oup0EEUT/BoDOThp0FoImrkBOjjrEzAdhobChZZsf3rTrLyor/n4rBNIV 28Di7Ig5/HarpTb79Xa39knOHPTIYChB5MclMrVP3vOQru2+CdLaV4NyP BQtTnTEuKSedy07TfmX2ym4rzW6pPBOLYl7+V1hQD7FPa/0twkmI2VjJ9 Q==; X-IronPort-AV: E=Sophos;i="5.47,409,1515427200"; d="scan'208";a="72555663" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 02 Mar 2018 03:40:29 +0800 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP; 01 Mar 2018 11:33:51 -0800 Received: from washi.fujisawa.hgst.com ([10.149.53.254]) by uls-op-cesaip01.wdc.com with ESMTP; 01 Mar 2018 11:40:28 -0800 From: Damien Le Moal To: linux-scsi@vger.kernel.org, "Martin K . Petersen" , linux-ata@vger.kernel.org, Tejun Heo Cc: Bart Van Assche , Hannes Reinecke Subject: [PATCH 2/6] libata: Use scsi_zbc_noretry_cmd() for ZAC devices Date: Fri, 2 Mar 2018 04:40:20 +0900 Message-Id: <20180301194024.25532-3-damien.lemoal@wdc.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180301194024.25532-1-damien.lemoal@wdc.com> References: <20180301194024.25532-1-damien.lemoal@wdc.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Hannes Reinecke --- 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)