From patchwork Fri Jul 31 13:02:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Reinecke X-Patchwork-Id: 6911111 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 01E04C05AC for ; Fri, 31 Jul 2015 13:02:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 19FDE20611 for ; Fri, 31 Jul 2015 13:02:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F037D2060B for ; Fri, 31 Jul 2015 13:02:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751200AbbGaNCZ (ORCPT ); Fri, 31 Jul 2015 09:02:25 -0400 Received: from mx2.suse.de ([195.135.220.15]:54281 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751207AbbGaNCX (ORCPT ); Fri, 31 Jul 2015 09:02:23 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id E4BF8ADB8; Fri, 31 Jul 2015 13:02:17 +0000 (UTC) From: Hannes Reinecke To: Tejun Heo Cc: linux-ide@vger.kernel.org, linux-scsi@vger.kernel.org, James Bottomley , Hannes Reinecke Subject: [PATCH 1/6] libata: Do not retry commands with valid autosense Date: Fri, 31 Jul 2015 15:02:03 +0200 Message-Id: <1438347728-106434-2-git-send-email-hare@suse.de> X-Mailer: git-send-email 1.8.5.2 In-Reply-To: <1438347728-106434-1-git-send-email-hare@suse.de> References: <1438347728-106434-1-git-send-email-hare@suse.de> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If a failed command has a valid autosense there is no need to retry it on the ATA level; at best we're incurring the same error again. So rather not retry it here, but leave it to the SCSI layer to decide if a retry is in order. Signed-off-by: Hannes Reinecke --- drivers/ata/libata-eh.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index 7465031..1b4e9d1 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c @@ -2218,6 +2218,8 @@ static inline int ata_eh_worth_retry(struct ata_queued_cmd *qc) return 1; /* otherwise retry anything from fs stack */ if (qc->err_mask & AC_ERR_INVALID) return 0; /* don't retry these */ + if (qc->flags & ATA_QCFLAG_SENSE_VALID) + return 0; /* Autosense, no need to retry here */ return qc->err_mask != AC_ERR_DEV; /* retry if not dev error */ }