Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp1729896rdb; Mon, 9 Oct 2023 00:19:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEpltth8Ku6fH5FsU+Cli/Nx69GuYM6iOXyGEKtRHu7lBPopnvRBpCJfRWF6LdRNsNsF+MF X-Received: by 2002:a05:6358:7e49:b0:142:d0dc:a3ce with SMTP id p9-20020a0563587e4900b00142d0dca3cemr15232830rwm.2.1696835975779; Mon, 09 Oct 2023 00:19:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696835975; cv=none; d=google.com; s=arc-20160816; b=ZYbgGtVrvPnzkvGHDq1SWCIMlmJJBzxRZAYXKqAMD6CsrtPrEY/5YjKtEY/DYSdlxA RI21RMT2S/tis/FQzTU9wHGqdu7rLo285heh0wnGWA1WMVdKfpl3DROkgEVRwVxYa7v6 2OfAm0le/frkSLGNc/TX+CnQNdQPpAcyM4Anh4O87JtCnn/XxGOsuImUS7IGnDkB3ix0 R/iDL/PLVXSpLjccZHkAxf4FRpj0GP+UGrK+bcudwi1CHsHmai5ocUjttwyubxAjyaqi X5PKgHC21MUChL9GCUVTE3Te2R6d56f6jIb9XONkan6LpHOGAWafYEok1ugHSukvNfWC 1KMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=C7WfAgZeDIXluOz3FfOlW2kYhQHIOx8d+Xqhzi8E378=; fh=1P8NgU50PxHZdbwZcm0RhGfpfaEszaZZUlNuX7tjKbk=; b=mCbxuvKGoTwKGg3IHOQFRdKic+5fJzvkLmbDS+1Kq51wQqLfg0G7rd904tILMeBe/C 3mi0Rv7HTc0EcQCgjleAghuxXkk4ZOA0XvCDmGVi2t9prfgcNYPXtmjVOdbL7ZRYIiLh 29UaO6qvhEuNpT7xlSkqrZj8I98Qh5f2K2cwbmMFKJ/JkmsQN69OvSENRJDSsYoLK6KG HJkO5oOubutc+zNvlfcaPoRkJ1x6YMZyTCtdXU/T+8kHEqrLDMktwjc0BkPuq6iYV6DQ SlCb39DGYbUlhFMAOKXZw5NpKKYaHnDQIXw8vqZRVzTkWflZcKq/k7L4LTiYI5xO8JFA Msfw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id i191-20020a6387c8000000b005859e224624si8652942pge.823.2023.10.09.00.19.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 00:19:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 D5EDB802DD0F; Mon, 9 Oct 2023 00:19:34 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232625AbjJIHTb (ORCPT + 99 others); Mon, 9 Oct 2023 03:19:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234360AbjJIHTa (ORCPT ); Mon, 9 Oct 2023 03:19:30 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D82CA4; Mon, 9 Oct 2023 00:19:28 -0700 (PDT) Received: from kwepemm000012.china.huawei.com (unknown [172.30.72.55]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4S3r1z3WFVz1M9Gb; Mon, 9 Oct 2023 15:16:55 +0800 (CST) Received: from [10.174.178.220] (10.174.178.220) by kwepemm000012.china.huawei.com (7.193.23.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Mon, 9 Oct 2023 15:19:25 +0800 Message-ID: <89365bd3-b4b0-de2d-f863-afbaad118649@huawei.com> Date: Mon, 9 Oct 2023 15:19:24 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH v5 10/10] scsi: scsi_debug: Add param to control sdev's allow_restart Content-Language: en-US To: , "James E . J . Bottomley" , "Martin K . Petersen" , , CC: , References: <20230922092906.2645265-1-haowenchao2@huawei.com> <20230922092906.2645265-11-haowenchao2@huawei.com> From: Wenchao Hao In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.178.220] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemm000012.china.huawei.com (7.193.23.142) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS 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]); Mon, 09 Oct 2023 00:19:35 -0700 (PDT) On 2023/10/9 7:17, Douglas Gilbert wrote: > On 2023-09-22 05:29, Wenchao Hao wrote: >> Add new module param "allow_restart" to control if setup >> scsi_device's allow_restart flag. This is used to test scsi >> command finished with sense_key 0x6, asc 0x4 and ascq 0x2 >> >> Signed-off-by: Wenchao Hao > > Hi, > Looked at this and verified that the allow_restart flag of scsi_debug > devices (disks ?) is usually 0 and when the scsi_debug module is > started with allow_restart=1 then the allow_restart flag does indeed > change to 1. For example: >    # cat /sys/class/scsi_disk/1\:0\:0\:0/allow_restart >    1 > > That ASC/ASCQ code means: "Logical unit not ready, initializing command > required" according to my library. Played around with sg_start but didn't > see any change in how it reacts. According to scsi_device.h that flag's > description is: "issue START_UNIT in error handler" which implies it > changes how the EH handler reacts. > > Perhaps the 3 line patch description could say a little more about how > to use this new parameter... Sorry I did not write in detail. As you mentioned above, this is to determine if to trigger error. I would update the commit message to following lines: Add new module param "allow_restart" to control if setup scsi_device's allow_restart flag, this flag determines if trigger EH after command finished with sense_key 0x6, asc 0x4 and ascq 0x2, EH would be triggered if allow_restart=1 in this condition. The new param can be used with error inject added in patch6 to test how commands finished with sense_key 0x6, asc 0x4 and ascq 0x2 are handled. > > Tested-by: Douglas Gilbert > > > > > > >