From patchwork Thu Dec 14 12:29:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ye Bin X-Patchwork-Id: 178711 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp8512593dys; Thu, 14 Dec 2023 04:42:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IFw5/9flSC9gXjwP9sEEkh5PKS4a3itzb6Rlzfq83QUITFaPk5IQXMX6LwiNvw7KO6d2lmY X-Received: by 2002:a05:6a00:2286:b0:6ce:2731:e870 with SMTP id f6-20020a056a00228600b006ce2731e870mr11629305pfe.55.1702557744392; Thu, 14 Dec 2023 04:42:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702557744; cv=none; d=google.com; s=arc-20160816; b=H1y8hgsXtLr623REVdph8jbQZNdjriTuMgumzwneV/OMc3MXaNA+sLi/IIiTLHiayr Q6W6ujt5rJ9TNVWHtSqFiM/kLBtm8dot3CdNSoRDi/lrw2XAoVcCSie+Xspb6oXRYDQ1 IzfwIo4geHwjwHu7usBJ3BlE89upJqDIoOoFbbetpVSgkTS12XX489yKEKt2gpFY2j7G pZtGeuDARLQCBu63pP335W38+uNnA13yfC2Xiz7PkrVc812Q7ByLDEu7NaFYxcWkVcYO Vjqc/372Qmd4AoKrphEiVbvEQazeUE/P1YRJj+A1/ZGE940cRM+4GuVshtK9fu2/an0r bmgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=ZOhaKaDvjpdr5GDOds7HS4Viwx6pgmBR0NCwbOLwLuk=; fh=3X80RpGoUIpRnCwEMQ9rcyGK2rKaVYfV9SdEBvlXwTU=; b=x+6ABEo1XorkxP0ZSnE2kQ5Pk40zr9owmIdXGdl8In7XF9/oGHVKnYB1s4ueUyLd7P Wlq6Syj9lW0rgw3RoyJ/KQja5lmGaWY/4YEHVTQVdYqzUtj3Guxyr3I0sXDtvfDvgHv0 0laKbUX5ETL5sOdDgtiWr9vRXxjHECi+12K6Eu/RYd6cm3zyFRareOZnvwvtC4e2pKSx CQ0K2eRKh0CStUGQDHVx5C5AKgTaPgVyIDgNykpR4E8rkjlsWzJ/s7gaFLVjNPuQKM72 NUk4YwnC4fYPiH5mgAxRWBA8NZDQIs4oE2mOY/YsbosCTg5vIS07qaHXyKqlfhb2w6KO 1Yzw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id y23-20020a056a00181700b006ce35e17cabsi11318729pfa.21.2023.12.14.04.42.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 04:42:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 662FB8025D03; Thu, 14 Dec 2023 04:42:23 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1573118AbjLNMmP (ORCPT + 99 others); Thu, 14 Dec 2023 07:42:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1573121AbjLNMmN (ORCPT ); Thu, 14 Dec 2023 07:42:13 -0500 X-Greylist: delayed 987 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 14 Dec 2023 04:42:19 PST Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04AF6129; Thu, 14 Dec 2023 04:42:19 -0800 (PST) Received: from mail.maildlp.com (unknown [172.19.88.214]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4SrWkd4XgVz1kvF0; Thu, 14 Dec 2023 20:24:41 +0800 (CST) Received: from canpemm500010.china.huawei.com (unknown [7.192.105.118]) by mail.maildlp.com (Postfix) with ESMTPS id DCEEE1A0190; Thu, 14 Dec 2023 20:25:49 +0800 (CST) Received: from huawei.com (10.175.127.227) by canpemm500010.china.huawei.com (7.192.105.118) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 14 Dec 2023 20:25:49 +0800 From: Ye Bin To: , , , CC: Ye Bin Subject: [PATCH] scsi: core: add CMD_LAST flag for error handle scsi command Date: Thu, 14 Dec 2023 20:29:19 +0800 Message-ID: <20231214122919.985087-1-yebin10@huawei.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-Originating-IP: [10.175.127.227] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500010.china.huawei.com (7.192.105.118) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 14 Dec 2023 04:42:23 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785261189140272457 X-GMAIL-MSGID: 1785261189140272457 SCSI error handle will send scsi command bypass block layer. After commit 8930a6c20791 scsi support request batching. Some LLD only writing the hardware doorbell when necessary, after the last request was prepared. For scsi error handle, each command waits synchronously. So each scsi command is both the beginning and the end. So add CMD_LAST flag for error handle scsi command. Fixes: 8930a6c20791 ("scsi: core: add support for request batching") Signed-off-by: Ye Bin Reviewed-by: Christoph Hellwig --- drivers/scsi/scsi_error.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index 1bac12ef238e..9e79047a1250 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -1147,6 +1147,7 @@ static enum scsi_disposition scsi_send_eh_cmnd(struct scsi_cmnd *scmd, const unsigned long stall_for = msecs_to_jiffies(100); int rtn; + scmd->flags |= SCMD_LAST; retry: scsi_eh_prep_cmnd(scmd, &ses, cmnd, cmnd_size, sense_bytes); shost->eh_action = &done;