From patchwork Mon Sep 28 04:50:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muneendra Kumar X-Patchwork-Id: 257510 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.9 required=3.0 tests=BAYES_00, DATE_IN_PAST_06_12, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MIME_HEADER_CTYPE_ONLY,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, T_TVD_MIME_NO_HEADERS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B82ADC2D0A8 for ; Mon, 28 Sep 2020 11:44:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7123321D95 for ; Mon, 28 Sep 2020 11:44:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="LGZWHD5d" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726617AbgI1Loj (ORCPT ); Mon, 28 Sep 2020 07:44:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726477AbgI1Loi (ORCPT ); Mon, 28 Sep 2020 07:44:38 -0400 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6607C061755 for ; Mon, 28 Sep 2020 04:44:38 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id o25so651835pgm.0 for ; Mon, 28 Sep 2020 04:44:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ipZs9C50+egt+iGuh0khMSlAHX1K89Ohv1B509sSeHM=; b=LGZWHD5dZbOtiWGHbHXeaBER0zrCoLS6RgHYrFd/38od3MQPM9tE3zEl67JdYajrwZ hzlTttdGG8Eakict0jubtoZXwalgeYnBz+17gqcm1QK8m8UmZLb2bD/jj6NquABSXyho S1HhghAdIk5VyVm7DxSY1A66bEHushi4uW1kA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ipZs9C50+egt+iGuh0khMSlAHX1K89Ohv1B509sSeHM=; b=YsAiYs7oigklri88mVYDp794w/RiAPUQichI7vMM1g2lS5kbXgdiCx8l9LDq4+67DY sRxnqAGOUb22CPSZcY8VSbRlQfGdrv2QGVvTBoifrtnVWzcoPOTCexFym1EHhvKNAJV/ JawyR6sT+bvz4mVfsjic8XJKQaLPdbTSHzxDCDe5eE6TW2UEboZpOPz9RVwzgPw3uvVz SVDQYZumXUi6uPgDTz1KqYC8G5WMaWLNS4MDXFVmPUmWhFZKB/I1rxm2HFbPdfqKrqFw bPTOa6dOj5/CRlpfLvVEfqc1eoNZxGlFLQcbcBKBFe0ZEmyGcEdaWbigEvRsLpIUFVh/ h1YA== X-Gm-Message-State: AOAM532nJ+eErfui2/VxqfbvDE6KbS6bF5paJxI+Wpb/yVI7aUsu/30q oadWKxFR72JLozfOlwEpI+oGtC2vfhjZlU72Nb39PD2SXITrLU8ygFhbNLJYG/7bxz8y+v8M5VD DF8/yADZaP4D2zubSIms2rPSAABbmSyeuWTHncAmAO/zmfOmW4zJ6Ts5l3STv7N73Gtu+BGtFxi oBS+fbFp+P X-Google-Smtp-Source: ABdhPJy5ThP8TISQd7Y2ZyFFI/FZ5X/AOmwi3tLArSFcPoASj28oRmWcrhTAcNcuonP53kQvyufFLw== X-Received: by 2002:a17:902:6902:b029:d0:cb2d:f26d with SMTP id j2-20020a1709026902b02900d0cb2df26dmr1304796plk.6.1601293477955; Mon, 28 Sep 2020 04:44:37 -0700 (PDT) Received: from localhost.localdomain ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id w19sm1468866pfq.60.2020.09.28.04.44.35 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Sep 2020 04:44:37 -0700 (PDT) From: Muneendra To: linux-scsi@vger.kernel.org, hare@suse.de Cc: jsmart2021@gmail.com, emilne@redhat.com, mkumar@redhat.com, Muneendra Subject: [PATCH v2 3/8] scsi: Clear state bit SCMD_NORETRIES_ABORT of scsi_cmd before start request Date: Mon, 28 Sep 2020 10:20:52 +0530 Message-Id: <1601268657-940-4-git-send-email-muneendra.kumar@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1601268657-940-1-git-send-email-muneendra.kumar@broadcom.com> References: <1601268657-940-1-git-send-email-muneendra.kumar@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Clearing the SCMD_NORETRIES_ABORT bit in state flag before blk_mq_start_request. Added a code in scsi_result_to_blk_status to translate a new error DID_TRANSPORT_MARGINAL to the corresponding blk_status_t i.e BLK_STS_TRANSPORT Signed-off-by: Muneendra --- v2: Made changes in scsi_result_to_blk_status to support DID_TRANSPORT_MARGINAL --- drivers/scsi/scsi_lib.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index f0ee11dc07e4..da95ae8b572f 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -643,6 +643,7 @@ static blk_status_t scsi_result_to_blk_status(struct scsi_cmnd *cmd, int result) return BLK_STS_OK; return BLK_STS_IOERR; case DID_TRANSPORT_FAILFAST: + case DID_TRANSPORT_MARGINAL: return BLK_STS_TRANSPORT; case DID_TARGET_FAILURE: set_host_byte(cmd, DID_OK); @@ -1689,6 +1690,7 @@ static blk_status_t scsi_queue_rq(struct blk_mq_hw_ctx *hctx, req->rq_flags |= RQF_DONTPREP; } else { clear_bit(SCMD_STATE_COMPLETE, &cmd->state); + clear_bit(SCMD_NORETRIES_ABORT, &cmd->state); blk_mq_start_request(req); }