Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3528639rdg; Tue, 17 Oct 2023 19:24:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGQu7BoK5JWzS4mtJKfck3Tzjpqg1Kzbv7A1mT8N6LTVdO/GFegf4hjPSiopyMdeWccAYfe X-Received: by 2002:a05:6359:2d4a:b0:143:61d:ffd3 with SMTP id rm10-20020a0563592d4a00b00143061dffd3mr3504798rwb.4.1697595888892; Tue, 17 Oct 2023 19:24:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697595888; cv=none; d=google.com; s=arc-20160816; b=cupFm4S1MGUrNpmimP001HlMEN/0WV94RszG7JIc0Gv7JGCRy8bIanvwkjPgX3Rr16 Bw+zhkdB6rf4W0ALTIOcD70oGKXVK50bp91M+vsCD8Wo8M6y/vnJrEVg4Vemm93k2FPr sVPB2D4lS87QUr+U4OaNFbJqdZhRUiKnYr4pFTMWmPgFutyFk3VSIfauGt7e/n60+UZN kxzv8ppBe83b7N1gGSf5k2B5Bt8dZrn5/84LefZzbwseZ5vcGx6lvsTiKbn5fk3c5d2f r6IrJNXdFEecktnEL6+d9Jh73PpYi2PWSLQfjWU+1lvq35M0BTIZkL5DGRm2U3upgIOq G/sA== 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=dRGcvk406DT9mE4zCqisN0z5KNlr+EaEpUj6/oMLf4M=; fh=onr0/RZ/cLL0we95FTjDzSgxAIzfJ8Q8wC5ZGrmwFy4=; b=bxTxnEOND5QZtd+LPbGmk20lFeaexNXnqeWW7ByrdTi5GgoWm9cRdpRgu7nHZQQGva d95xSGSgixnHPvEvbshYnh1XgSRvkhFTQcNo5Vorc6JtebAH6ttbWWvhWlYpeGGns/cv QQVozFWgq1SpWwSqDIaOZC75jaVfgrf3Q/8ev7qzuhwx91oXQh7gdxW+VjxIP6buWqQA UdPt1Ve2L7tuuWww0IvxpYgnJsKa9TKjriwkDkxjUfUqTbQEpol97Le4g6ziCZ03nmsz OQyNSJpoqOPtxt4C8NPjJ5dUUAAt17wvBZl9DLxYE3XyviUZPwMYUg4mB8ralO/h2zFQ +cDg== 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:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id i23-20020a633c57000000b005ab7b51ab5bsi1137123pgn.110.2023.10.17.19.24.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 19:24:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id 653FC8026AFF; Tue, 17 Oct 2023 19:24:46 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229480AbjJRCYf (ORCPT + 99 others); Tue, 17 Oct 2023 22:24:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229454AbjJRCYe (ORCPT ); Tue, 17 Oct 2023 22:24:34 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A869C6; Tue, 17 Oct 2023 19:24:32 -0700 (PDT) Received: from kwepemm000012.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4S9F1l3jb5zCrTt; Wed, 18 Oct 2023 10:20:27 +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; Wed, 18 Oct 2023 10:24:26 +0800 Message-ID: <24a3427e-d0dd-4f77-0342-71f0296135be@huawei.com> Date: Wed, 18 Oct 2023 10:24:25 +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 v2 2/2] scsi: Add comment of target_destroy in scsi_host_template Content-Language: en-US To: Bart Van Assche , "James E . J . Bottomley" , "Martin K . Petersen" , CC: , References: <20231016020847.1270258-1-haowenchao2@huawei.com> <20231016020847.1270258-3-haowenchao2@huawei.com> <128adc0e-3a91-4395-b373-ef77a0882f29@acm.org> From: Wenchao Hao In-Reply-To: <128adc0e-3a91-4395-b373-ef77a0882f29@acm.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.178.220] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemm000012.china.huawei.com (7.193.23.142) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.1 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email 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 (agentk.vger.email [0.0.0.0]); Tue, 17 Oct 2023 19:24:46 -0700 (PDT) On 2023/10/18 5:04, Bart Van Assche wrote: > On 10/15/23 19:08, Wenchao Hao wrote: >> Add comment to tell callback function target_destroy of >> scsi_host_template is called in atomic context. >> >> Signed-off-by: Wenchao Hao >> --- >>   include/scsi/scsi_host.h | 3 +++ >>   1 file changed, 3 insertions(+) >> >> diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h >> index 49f768d0ff37..2e8d77441064 100644 >> --- a/include/scsi/scsi_host.h >> +++ b/include/scsi/scsi_host.h >> @@ -245,6 +245,9 @@ struct scsi_host_template { >>        * midlayer calls this point so that the driver may deallocate >>        * and terminate any references to the target. >>        * >> +     * Note: this callback in called with spin_lock shost->host_lock held, >> +     * so donot call functions might cause schedule >> +     * >>        * Status: OPTIONAL >>        */ >>       void (* target_destroy)(struct scsi_target *); > > The above comment can be made shorter and spelling and grammar can be improved. How about the following: "This callback is called with the host lock held and hence must not sleep."? > Looks better, I would update. Thanks. > Thanks, > > Bart. >