From patchwork Wed May 17 23:09:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 683225 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 E2599C77B7A for ; Wed, 17 May 2023 23:09:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229930AbjEQXJ5 (ORCPT ); Wed, 17 May 2023 19:09:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230036AbjEQXJu (ORCPT ); Wed, 17 May 2023 19:09:50 -0400 Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A8842D76 for ; Wed, 17 May 2023 16:09:35 -0700 (PDT) Received: by mail-pf1-f176.google.com with SMTP id d2e1a72fcca58-644d9bf05b7so1079101b3a.3 for ; Wed, 17 May 2023 16:09:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684364974; x=1686956974; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=E4BivBkDVwb9wkvJmHlC3sRkvVJuZrmosM6xqXvfVxc=; b=GZk/GQDVLGs+nYZ2dJ9x/kyptDLIEsbc3nWwKDj2zxO7HlxunDR7dW4+oZaYL0ohQz 6Nc+rTxochZCm7kNoKVuPeWfaH7W3IpfFT//PFw5H9Ae/d4EoD0m95744C3WdpUTgRBp gggiQFLCXwufLsMeEjPhZTNMr1qoY0ihE5yne56qCoO5+sJHB9LUsiwHfRSiYWZPE5Ng ksdEGz8C1AYrp3VgPac7e59yHRCcpqgmTMbIW4R6JbOn5BT54Pt7EBPppFqWA8T9Q9/P 2qh2l/w984Qog9Q/WM9SaJ5HG2T+4v6N8Mni6okUeIGIvfV6NeWjWOk+bvNcHW2DqpW7 FCFg== X-Gm-Message-State: AC+VfDzB70OePrsNYaeQiH9LoPjmGJRA/NXG9Mzqt1YOvjPv6XNo1uRp k3zl1EghuZD49qZ5d6RlfW8= X-Google-Smtp-Source: ACHHUZ5IvUqr1s95aU0u8T0C6YWsD4MaHnj40g2TZC9Eax3Xm4GCkTiDNDbkw61+9swwUmNbz/7XVA== X-Received: by 2002:a05:6a20:3d87:b0:101:e680:d423 with SMTP id s7-20020a056a203d8700b00101e680d423mr35758258pzi.28.1684364974389; Wed, 17 May 2023 16:09:34 -0700 (PDT) Received: from bvanassche-glaptop2.roam.corp.google.com ([98.51.102.78]) by smtp.gmail.com with ESMTPSA id e9-20020a656789000000b005286ea6190esm15080694pgr.20.2023.05.17.16.09.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 May 2023 16:09:33 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: Christoph Hellwig , linux-scsi@vger.kernel.org, Bart Van Assche , Benjamin Block , Douglas Gilbert Subject: [PATCH v3 1/4] scsi: core: Use min() instead of open-coding it Date: Wed, 17 May 2023 16:09:24 -0700 Message-ID: <20230517230927.1091124-2-bvanassche@acm.org> X-Mailer: git-send-email 2.40.1.698.g37aff9b760-goog In-Reply-To: <20230517230927.1091124-1-bvanassche@acm.org> References: <20230517230927.1091124-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Use min() instead of open-coding it in scsi_normalize_sense(). Reviewed-by: Christoph Hellwig Reviewed-by: Benjamin Block Cc: Douglas Gilbert Signed-off-by: Bart Van Assche --- drivers/scsi/scsi_common.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/scsi/scsi_common.c b/drivers/scsi/scsi_common.c index 6e50e81a8216..24dec80a6253 100644 --- a/drivers/scsi/scsi_common.c +++ b/drivers/scsi/scsi_common.c @@ -176,8 +176,7 @@ bool scsi_normalize_sense(const u8 *sense_buffer, int sb_len, if (sb_len > 2) sshdr->sense_key = (sense_buffer[2] & 0xf); if (sb_len > 7) { - sb_len = (sb_len < (sense_buffer[7] + 8)) ? - sb_len : (sense_buffer[7] + 8); + sb_len = min(sb_len, sense_buffer[7] + 8); if (sb_len > 12) sshdr->asc = sense_buffer[12]; if (sb_len > 13) From patchwork Wed May 17 23:09:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 683842 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 C6C94C77B7A for ; Wed, 17 May 2023 23:10:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229612AbjEQXKq (ORCPT ); Wed, 17 May 2023 19:10:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230037AbjEQXJu (ORCPT ); Wed, 17 May 2023 19:09:50 -0400 Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 211A944A8 for ; Wed, 17 May 2023 16:09:36 -0700 (PDT) Received: by mail-pf1-f169.google.com with SMTP id d2e1a72fcca58-6439d505274so996152b3a.0 for ; Wed, 17 May 2023 16:09:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684364975; x=1686956975; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YH0YhUusr/UFgVmOgEoNP7zvykLbCuFM8H/nENdgsEQ=; b=jdiVuvJI/1EFZOnQHYG6y8rBgoi0HFMPyYn3Xb7Nj8fkQ80f3PMFJYnsEz3Ug4BFGc uAXIwrLtWm3yW1P+kZOZz+wHCvNTAAOT7IcFxgHQm1QavYqC/tqDnFaovlhQK5hKm8SL DJk6ZMQPXQ2RZmrrHXq2qvrAy8w5nimK3kdCUJMRApUUiqviwLNtQHm2aCq6wz5XPlka 5yvyQcBOGd8ws/vN+hCzg8ghqhllVEfEXaUEwgbLWMN+EBnNoyTR8+EaLQJm9eAi3X5O q4QxGktg01HxM46mLp8Ya/PdN230GDOTCpzYDzfaGaec4gif0yIfGewZmHmksSBYss0l MbYw== X-Gm-Message-State: AC+VfDy0cB0Ldn+WtP/pqAJWqwz8FQ4zmfCGBswbTtQHvwyG6jgPIxdG i4k0sDuziu/gg5nCIRVRCLI= X-Google-Smtp-Source: ACHHUZ6Aqsv26aWT2AEzdgkv58smoWaLIea8/rgsnSjwxdoEsnhK0Zizv3Mh+WcG5CXN/NzBQia9/w== X-Received: by 2002:a05:6a21:78a9:b0:102:a593:a158 with SMTP id bf41-20020a056a2178a900b00102a593a158mr35846303pzc.47.1684364975446; Wed, 17 May 2023 16:09:35 -0700 (PDT) Received: from bvanassche-glaptop2.roam.corp.google.com ([98.51.102.78]) by smtp.gmail.com with ESMTPSA id e9-20020a656789000000b005286ea6190esm15080694pgr.20.2023.05.17.16.09.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 May 2023 16:09:35 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: Christoph Hellwig , linux-scsi@vger.kernel.org, Bart Van Assche , Niklas Cassel , Ming Lei , Hannes Reinecke , John Garry , Mike Christie Subject: [PATCH v3 2/4] scsi: core: Trace SCSI sense data Date: Wed, 17 May 2023 16:09:25 -0700 Message-ID: <20230517230927.1091124-3-bvanassche@acm.org> X-Mailer: git-send-email 2.40.1.698.g37aff9b760-goog In-Reply-To: <20230517230927.1091124-1-bvanassche@acm.org> References: <20230517230927.1091124-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org If a command fails, SCSI sense data is essential to determine why it failed. Hence make the sense key, ASC and ASCQ codes available in the ftrace output. Reviewed-by: Niklas Cassel Reviewed-by: Christoph Hellwig Cc: Ming Lei Cc: Hannes Reinecke Cc: John Garry Cc: Mike Christie Signed-off-by: Bart Van Assche --- include/trace/events/scsi.h | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/include/trace/events/scsi.h b/include/trace/events/scsi.h index a2c7befd451a..512792317577 100644 --- a/include/trace/events/scsi.h +++ b/include/trace/events/scsi.h @@ -269,9 +269,14 @@ DECLARE_EVENT_CLASS(scsi_cmd_done_timeout_template, __field( unsigned int, prot_sglen ) __field( unsigned char, prot_op ) __dynamic_array(unsigned char, cmnd, cmd->cmd_len) + __field( u8, sense_key ) + __field( u8, asc ) + __field( u8, ascq ) ), TP_fast_assign( + struct scsi_sense_hdr sshdr; + __entry->host_no = cmd->device->host->host_no; __entry->channel = cmd->device->channel; __entry->id = cmd->device->id; @@ -285,11 +290,22 @@ DECLARE_EVENT_CLASS(scsi_cmd_done_timeout_template, __entry->prot_sglen = scsi_prot_sg_count(cmd); __entry->prot_op = scsi_get_prot_op(cmd); memcpy(__get_dynamic_array(cmnd), cmd->cmnd, cmd->cmd_len); + if (cmd->sense_buffer && SCSI_SENSE_VALID(cmd) && + scsi_command_normalize_sense(cmd, &sshdr)) { + __entry->sense_key = sshdr.sense_key; + __entry->asc = sshdr.asc; + __entry->ascq = sshdr.ascq; + } else { + __entry->sense_key = 0; + __entry->asc = 0; + __entry->ascq = 0; + } ), TP_printk("host_no=%u channel=%u id=%u lun=%u data_sgl=%u prot_sgl=%u " \ "prot_op=%s driver_tag=%d scheduler_tag=%d cmnd=(%s %s raw=%s) " \ - "result=(driver=%s host=%s message=%s status=%s)", + "result=(driver=%s host=%s message=%s status=%s " + "sense_key=%#x asc=%#x ascq=%#x)", __entry->host_no, __entry->channel, __entry->id, __entry->lun, __entry->data_sglen, __entry->prot_sglen, show_prot_op_name(__entry->prot_op), __entry->driver_tag, @@ -299,7 +315,8 @@ DECLARE_EVENT_CLASS(scsi_cmd_done_timeout_template, "DRIVER_OK", show_hostbyte_name(((__entry->result) >> 16) & 0xff), "COMMAND_COMPLETE", - show_statusbyte_name(__entry->result & 0xff)) + show_statusbyte_name(__entry->result & 0xff), + __entry->sense_key, __entry->asc, __entry->ascq) ); DEFINE_EVENT(scsi_cmd_done_timeout_template, scsi_dispatch_cmd_done, From patchwork Wed May 17 23:09:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 683224 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 17B14C7EE23 for ; Wed, 17 May 2023 23:10:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229980AbjEQXJ6 (ORCPT ); Wed, 17 May 2023 19:09:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230044AbjEQXJu (ORCPT ); Wed, 17 May 2023 19:09:50 -0400 Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47A465276 for ; Wed, 17 May 2023 16:09:37 -0700 (PDT) Received: by mail-pf1-f175.google.com with SMTP id d2e1a72fcca58-64d11974b45so145494b3a.2 for ; Wed, 17 May 2023 16:09:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684364977; x=1686956977; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8SXLTFsp+gjzSgG9JqJUM2xgRcPzYQQmb2LNC2tO1KA=; b=dH+PSz5y7jaQ6rwaocE3mBcw3daaJnd6qxpval0X8oIlAogpLjEo8blchwol/H9XYS ZHb7lkrQXJii8wtD+h61TWKRC6R9mZ0TMmYJAoItX9pvXhX+XLU02IN1piY6flWTmP9m sRa/yZonnNDIaSeueVSzK/qGTeSLGpMT9HQSM9jvUgF7jwPifwo+qYBvn89NIEPx/IwV ehEFJFJq1H0xmD9bwkEPTT82QLnK7H+Rh2OrKtaEcHuKzScsLhqRMcC9IPSBY5Y5fx9S N9W+xNMsJrM0/JIpOmeQZ3O/VP35+eakLY0TOdEEqFrrp77bpxhqLbJ+bvonfdbC3gb1 sK1g== X-Gm-Message-State: AC+VfDyZ8XeE2uA8J/ivUor3RBODk0dIOT8HMMGI6ke5/vTvrDDn3nLE vUYzruOkesfDjnp4Ex56g84= X-Google-Smtp-Source: ACHHUZ5xUmhGjf5OSM6z+FdH1grxavG1CmgJxdLZ9YGX7Lcbf7eXv6K6tM+16KUHo1iWCLOpySBflw== X-Received: by 2002:a05:6a21:9991:b0:104:7a4c:6ca6 with SMTP id ve17-20020a056a21999100b001047a4c6ca6mr27035099pzb.13.1684364976546; Wed, 17 May 2023 16:09:36 -0700 (PDT) Received: from bvanassche-glaptop2.roam.corp.google.com ([98.51.102.78]) by smtp.gmail.com with ESMTPSA id e9-20020a656789000000b005286ea6190esm15080694pgr.20.2023.05.17.16.09.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 May 2023 16:09:36 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: Christoph Hellwig , linux-scsi@vger.kernel.org, Bart Van Assche , Ming Lei , Hannes Reinecke , John Garry , Mike Christie Subject: [PATCH v3 3/4] scsi: core: Only kick the requeue list if necessary Date: Wed, 17 May 2023 16:09:26 -0700 Message-ID: <20230517230927.1091124-4-bvanassche@acm.org> X-Mailer: git-send-email 2.40.1.698.g37aff9b760-goog In-Reply-To: <20230517230927.1091124-1-bvanassche@acm.org> References: <20230517230927.1091124-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Instead of running the request queue of each device associated with a host every 3 ms (BLK_MQ_RESOURCE_DELAY) while host error handling is in progress, run the request queue after error handling has finished. Cc: Christoph Hellwig Cc: Ming Lei Cc: Hannes Reinecke Cc: John Garry Cc: Mike Christie Signed-off-by: Bart Van Assche --- drivers/scsi/scsi_lib.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index e59eb0cbfc83..e4f34217b879 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -122,11 +122,9 @@ static void scsi_mq_requeue_cmd(struct scsi_cmnd *cmd, unsigned long msecs) WARN_ON_ONCE(true); } - if (msecs) { - blk_mq_requeue_request(rq, false); + blk_mq_requeue_request(rq, false); + if (!scsi_host_in_recovery(cmd->device->host)) blk_mq_delay_kick_requeue_list(rq->q, msecs); - } else - blk_mq_requeue_request(rq, true); } /** @@ -165,7 +163,8 @@ static void __scsi_queue_insert(struct scsi_cmnd *cmd, int reason, bool unbusy) */ cmd->result = 0; - blk_mq_requeue_request(scsi_cmd_to_rq(cmd), true); + blk_mq_requeue_request(scsi_cmd_to_rq(cmd), + !scsi_host_in_recovery(cmd->device->host)); } /** @@ -449,6 +448,7 @@ static void scsi_run_queue(struct request_queue *q) if (!list_empty(&sdev->host->starved_list)) scsi_starved_list_run(sdev->host); + blk_mq_kick_requeue_list(q); blk_mq_run_hw_queues(q, false); } @@ -499,6 +499,9 @@ static void scsi_mq_uninit_cmd(struct scsi_cmnd *cmd) static void scsi_run_queue_async(struct scsi_device *sdev) { + if (scsi_host_in_recovery(sdev->host)) + return; + if (scsi_target(sdev)->single_lun || !list_empty(&sdev->host->starved_list)) { kblockd_schedule_work(&sdev->requeue_work); From patchwork Wed May 17 23:09:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 683844 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 A140DC77B75 for ; Wed, 17 May 2023 23:09:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229558AbjEQXJ4 (ORCPT ); Wed, 17 May 2023 19:09:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230046AbjEQXJu (ORCPT ); Wed, 17 May 2023 19:09:50 -0400 Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2DECF5270 for ; Wed, 17 May 2023 16:09:38 -0700 (PDT) Received: by mail-pf1-f176.google.com with SMTP id d2e1a72fcca58-643990c5319so999948b3a.2 for ; Wed, 17 May 2023 16:09:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684364977; x=1686956977; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ayP7PD7vRVU1mwC0IUNGGeoZSbvK9/rrOfR1Ufk+uSw=; b=I6waPoZYcg6h8O84vkVE7YHIWI+JwBYsXqEXqVuybAMyvKvzobBUWgXw7NtFQMEb5U OvG8DUnE9tWzo/Uw/1OA7tu3P3SsELlySsTTvPVdUEej8lLbNs5T/n4UIRPjtCmU9RHi jf3f+8qexxX3YOEFyylApYL/bVPwZlehVijnYtLwAQouDKzbwK5ltTiJv00ScaL2ZUyj 22yau6dTv4p/HA0kzmBscdZhS4cs0C6CsUdMdvqU4bhUmcgzIBQrW/CQIr9yFMHNQzn3 819cT9Fim8jTAMOy5JCe3gnyPdHUL4NWdHde8unTTlCrjSnv8fiwofKvaLMzdrT8ioTB tcaA== X-Gm-Message-State: AC+VfDz4Roi3/lHzRTP6s8gGPwQjn/kLgYqWF1HQuPp74upfq6AVbd3t LNaYzMZ7XTWGwY5Pz5FUkIQ= X-Google-Smtp-Source: ACHHUZ45vIUmaZgBORY4vgSKE+1M7dVxZwOMeznua/L70337e7/EBmm/mMmfXmiecSg4hdxyIX/dBw== X-Received: by 2002:a05:6a00:190e:b0:643:558d:9ce2 with SMTP id y14-20020a056a00190e00b00643558d9ce2mr1655301pfi.21.1684364977599; Wed, 17 May 2023 16:09:37 -0700 (PDT) Received: from bvanassche-glaptop2.roam.corp.google.com ([98.51.102.78]) by smtp.gmail.com with ESMTPSA id e9-20020a656789000000b005286ea6190esm15080694pgr.20.2023.05.17.16.09.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 May 2023 16:09:37 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: Christoph Hellwig , linux-scsi@vger.kernel.org, Bart Van Assche , Ming Lei , Hannes Reinecke , John Garry , Mike Christie Subject: [PATCH v3 4/4] scsi: core: Delay running the queue if the host is blocked Date: Wed, 17 May 2023 16:09:27 -0700 Message-ID: <20230517230927.1091124-5-bvanassche@acm.org> X-Mailer: git-send-email 2.40.1.698.g37aff9b760-goog In-Reply-To: <20230517230927.1091124-1-bvanassche@acm.org> References: <20230517230927.1091124-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Tell the block layer to rerun the queue after a delay instead of immediately if the SCSI LLD decided to block the host. Note: neither scsi_run_host_queues() nor scsi_run_queue() are called from the fast path. Reviewed-by: Christoph Hellwig Cc: Ming Lei Cc: Hannes Reinecke Cc: John Garry Cc: Mike Christie Signed-off-by: Bart Van Assche --- drivers/scsi/scsi_lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index e4f34217b879..b37718ebbbfc 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -1767,7 +1767,7 @@ static blk_status_t scsi_queue_rq(struct blk_mq_hw_ctx *hctx, break; case BLK_STS_RESOURCE: case BLK_STS_ZONE_RESOURCE: - if (scsi_device_blocked(sdev)) + if (scsi_device_blocked(sdev) || shost->host_self_blocked) ret = BLK_STS_DEV_RESOURCE; break; case BLK_STS_AGAIN: