From patchwork Thu May 5 18:48:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sreekanth Reddy X-Patchwork-Id: 12840023 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E67B5C433FE for ; Thu, 5 May 2022 18:44:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1381408AbiEESrs (ORCPT ); Thu, 5 May 2022 14:47:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1384639AbiEESrV (ORCPT ); Thu, 5 May 2022 14:47:21 -0400 Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4513606C3 for ; Thu, 5 May 2022 11:37:47 -0700 (PDT) Received: by mail-pg1-x535.google.com with SMTP id 7so4258039pga.12 for ; Thu, 05 May 2022 11:37:47 -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:mime-version; bh=blJZNsj6z5am0z6BCLTC5pxY3WeKTWtqX4pzShGIzeg=; b=LCyseZPJRjBBu318seTFMKL73yZxJ48KEwIc8ZFFEOjNW4b1m5YbrUFIGS7TIAWfJ9 ejp/6iuc/1a+uM+tjZeNOdP2QY8DpVm7Kqq0qtHgy+bYTgQyxOKRryflIdChbXBMl/3A yWL4HBWnqO6D8WSditHjzlb8B7YOpHLFloguI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version; bh=blJZNsj6z5am0z6BCLTC5pxY3WeKTWtqX4pzShGIzeg=; b=icN/BNYFhthh2E/qeMnIU2gXco12jbKVC6E3R/zyVrBqyB/KTYi/XCocOyJt8RHoEo rgn+UIBq7W9h9Kjg15yDf2xnkSGLk7m4mHqD2Pipq3sh9YAfFLnGQ3JA5Fg8Mq7UEZwZ 7iQRYMIoYjuAQCcgn6NIWDFhQ4Oib9tdSW7AJoxZckDM9nOEEw4wpKD1mUL4l9RVw4nQ Eq0HAkRNj2444crWzv6Xm/VRdfLsHrN8mSyGSZ/yAD6AtnXdmZrFyGIyyyRQtd3svIj+ Ek/loTIJqQe1+1v3MQY8jYmwQjkIx/X9hVqAm7r2FlYbUUsX51j9Y1K7DAs4Pc+QMfrJ Q7fQ== X-Gm-Message-State: AOAM531AcYGjOH/XcK2DL8HUv6nrUVJQCjK+Zo0YpQdSJOd2YIUr/bkg ZrA8vsUSXWTRzVCfZ9SuB2IyH75cRVo4JhcZfnz6wDWMFWIS2wU3RhGc7waQytraSB6ZLRERrJa fhmkSLlPlcY/b95R18k6Jh1yLLBQXZcvSKyv5urHZROr2tDTQ/lSja07Okb5pCw5EX9F4gL8j8c Jl4hk55jCfdtE= X-Google-Smtp-Source: ABdhPJw8ALhiABDwiChKBAwuIrCJlmYInfAa2ilAq8ZYvSZZObCGobUVj28faHegfqQQhCti3P3T7w== X-Received: by 2002:a05:6a00:84e:b0:510:5fbc:7738 with SMTP id q14-20020a056a00084e00b005105fbc7738mr4352920pfk.86.1651775866574; Thu, 05 May 2022 11:37:46 -0700 (PDT) Received: from dhcp-10-123-20-36.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id 4-20020a170902c24400b0015edb22aba1sm1696166plg.270.2022.05.05.11.37.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 May 2022 11:37:45 -0700 (PDT) From: Sreekanth Reddy To: linux-scsi@vger.kernel.org Cc: martin.petersen@oracle.com, Sreekanth Reddy Subject: [PATCH] mpi3mr: Return IOs to an unrecoverable HBA with DID_ERROR Date: Fri, 6 May 2022 00:18:06 +0530 Message-Id: <20220505184808.24049-1-sreekanth.reddy@broadcom.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Complete all new I/O requests issued to an unrecoverable controller with DID_ERROR status instead of returning the I/O requests with SCSI_MLQUEUE_HOST_BUSY. This will prevent the infinite retries of the new I/Os when a controller is in the unrecoverable state. Signed-off-by: Sreekanth Reddy --- drivers/scsi/mpi3mr/mpi3mr_os.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/scsi/mpi3mr/mpi3mr_os.c b/drivers/scsi/mpi3mr/mpi3mr_os.c index 89a4918..5c57519 100644 --- a/drivers/scsi/mpi3mr/mpi3mr_os.c +++ b/drivers/scsi/mpi3mr/mpi3mr_os.c @@ -3996,6 +3996,12 @@ static int mpi3mr_qcmd(struct Scsi_Host *shost, int iprio_class; u8 is_pcie_dev = 0; + if (mrioc->unrecoverable) { + scmd->result = DID_ERROR << 16; + scsi_done(scmd); + goto out; + } + sdev_priv_data = scmd->device->hostdata; if (!sdev_priv_data || !sdev_priv_data->tgt_priv_data) { scmd->result = DID_NO_CONNECT << 16;