Message ID | 20231016020847.1270258-3-haowenchao2@huawei.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp3191670vqb; Sun, 15 Oct 2023 19:09:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHInpbDznirR0LGFWRfIq6W+MTV+qF1b2Hpn5AB2NFsgL3ZzSj4w2aVdPBnz88MEBQmOy1k X-Received: by 2002:a05:6808:2129:b0:3ae:5aab:a6fd with SMTP id r41-20020a056808212900b003ae5aaba6fdmr41030009oiw.5.1697422164801; Sun, 15 Oct 2023 19:09:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697422164; cv=none; d=google.com; s=arc-20160816; b=j9ZRpQgM/PJxdsm/JfDniN+iBhY6zLtQbP94q4yL3wb1Vpt5ezbHGPhVt0rCjJzVt0 Uh0rJW0eOCUXM2ls97eQC/Q1SL/4IVXu9XJgkalnwAifvUABgOiJ/6cAuKWENLleaZCy JKKMMY+L5569nMvSvZWITAFqKVUSihEVWfJL7QbnkHazaPRfABB9Dzf9cf0W/e3+LsF0 0ksDIIiH9CSUw7Qnd5YugbVuUcpfVyyvTDppGTBfMl1+avMN/6W0AfuumwZhrq9/Y4cH Zp2r34gJO7mT5Ehe9qYTjq11IA95I0Sqv2ohqFs00iqbuGfoVgthxcC7Ry6c8ouga4VO RZdQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=nY8KtV7wXdBWkQRfXLiFodakR4N32TXn3VHZcWWjMT0=; fh=ZDcIlyYggP5K3GvQBQF3K/GzUnCJV+bQb/1GDPxM7E4=; b=R0sfkAGQIAdKca9DK46IAXC0sWEEx+F5a8Dj3V4rGRhIoYTfCU0WbOmnYAffW253XG 8kgzE6cGbczpySv+IvcQqqvwt8HcJYgg+VReXJzSDcIEnseH1faX59VpPX8btpG8DVCD S4kv6k8WMtXp42G+URorPwQBO+Z6tO8qgwNVNhefkOt5dI7i+w5OQ0JKKIBb9sZ4SPgA NaQlKDr+K1sxIlaxz9XIBh+QBcTzc1ye000xZaloAF3+xEkcS2yaRLdoaoARqV0n5AO/ AGKlvfoRXeliPGFgA8zFUH0nHFYZbMwrDyWJQiYGWlPrpoPQGZXRw5AfGc+LzcGkjRHK J9mg== 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 c1-20020a056a00008100b0068fe9c452acsi2722559pfj.376.2023.10.15.19.09.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Oct 2023 19:09:24 -0700 (PDT) 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 1C93F80A2658; Sun, 15 Oct 2023 19:09:23 -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 S231415AbjJPCJL (ORCPT <rfc822;hjfbswb@gmail.com> + 19 others); Sun, 15 Oct 2023 22:09:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231253AbjJPCJH (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 15 Oct 2023 22:09:07 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99327AB; Sun, 15 Oct 2023 19:09:05 -0700 (PDT) Received: from kwepemm000012.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4S80m31nv5zvQ5n; Mon, 16 Oct 2023 10:04:19 +0800 (CST) Received: from build.huawei.com (10.175.101.6) 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, 16 Oct 2023 10:09:00 +0800 From: Wenchao Hao <haowenchao2@huawei.com> To: "James E . J . Bottomley" <jejb@linux.ibm.com>, "Martin K . Petersen" <martin.petersen@oracle.com>, <linux-scsi@vger.kernel.org> CC: <linux-kernel@vger.kernel.org>, <louhongxiang@huawei.com>, Wenchao Hao <haowenchao2@huawei.com> Subject: [PATCH v2 2/2] scsi: Add comment of target_destroy in scsi_host_template Date: Mon, 16 Oct 2023 10:08:47 +0800 Message-ID: <20231016020847.1270258-3-haowenchao2@huawei.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20231016020847.1270258-1-haowenchao2@huawei.com> References: <20231016020847.1270258-1-haowenchao2@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.101.6] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemm000012.china.huawei.com (7.193.23.142) X-CFilter-Loop: Reflected 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 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: <linux-kernel.vger.kernel.org> 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]); Sun, 15 Oct 2023 19:09:23 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779876143958814558 X-GMAIL-MSGID: 1779876143958814558 |
Series |
cleanup patch
|
|
Commit Message
Wenchao Hao
Oct. 16, 2023, 2:08 a.m. UTC
Add comment to tell callback function target_destroy of
scsi_host_template is called in atomic context.
Signed-off-by: Wenchao Hao <haowenchao2@huawei.com>
---
include/scsi/scsi_host.h | 3 +++
1 file changed, 3 insertions(+)
Comments
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 <haowenchao2@huawei.com> > --- > 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."? Thanks, Bart.
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 <haowenchao2@huawei.com> >> --- >> 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. >
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 *);