Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp973729ioo; Sat, 21 May 2022 22:47:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxn6GPEcS+QD/ZS32t5ZQvVT/i5AEKoF6kZz5TQUkpmdGzKiVLvmmDoKr+JiD4tQGZks72c X-Received: by 2002:a17:902:bb0f:b0:161:f859:bec7 with SMTP id im15-20020a170902bb0f00b00161f859bec7mr9724871plb.0.1653198448562; Sat, 21 May 2022 22:47:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653198448; cv=none; d=google.com; s=arc-20160816; b=EVzhXX1OQiKmdr0d8sqrmVza8CwEhpHYDSV7CXJdLbCyIFEQWZ5JPc7l4YLlVnp4XO M/cto3g0lP+wUOJ8aWWQENBOhhsHbRjlrEHJ+WrUp+C5yMFKDj6ylkdqfePiYuB72bOv 4ThFrYArPHCkllnCPEM5I0Y7CJ9+WYSpAzOrCJX6JOQvYoXcw7VlsXmxD9F7xefnXY+i 5MAIXcuNbuAhdIMZvezE/VbHlOYax7nJbaEef6tbfrvUcqGM2t2/bORwpQHtQafdgqtm 92fUEpw1WhLWjILZcf4u2wRCmtdUXXVruwUAuZhtDZU2Q5rXDB83F5TcHaTYGGor+/jq VOGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=X3MaARWJ+5KG00Wc5nTbIiJMgENCDmkYALjE5uIyz6c=; b=UMVCXhqK84WKzcaiVEgpMeQX30dmqRzmit/HdyLI7NLLmyASCYOQcoiL+Nw+c+sWSY vmKMyENIN0FDyFUeElFtKFHaHduGH4WroMogH7n/D0WP3KwQgOA/ONNQ7UQQ/eQnrcR7 MtvqKe1s+BryzAmwpqJ84GueqSz086kShdkKLzu6bOHuUvxF+NX0zvDk+7i3poCq4urw 8nO71H5VfZeJXpxbj340ktKXMYUIlnriZNWmTEbikUCU7JbFnQwSdkY9auGHKxMPhd+2 1207J/wjZsX9NjOlxciIrkIkiqaP0EHBU5qqLSM/b/0isJNnqkxBVovRC2XHaGVzDXAR q5Wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=eZT3F2+M; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s39-20020a056a0017a700b00518820f0cbfsi4965059pfg.335.2022.05.21.22.47.16; Sat, 21 May 2022 22:47:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=eZT3F2+M; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239989AbiESOw1 (ORCPT + 99 others); Thu, 19 May 2022 10:52:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231665AbiESOwZ (ORCPT ); Thu, 19 May 2022 10:52:25 -0400 Received: from mail-yb1-xb36.google.com (mail-yb1-xb36.google.com [IPv6:2607:f8b0:4864:20::b36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D9485A5A1 for ; Thu, 19 May 2022 07:52:24 -0700 (PDT) Received: by mail-yb1-xb36.google.com with SMTP id d137so9405131ybc.13 for ; Thu, 19 May 2022 07:52:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=X3MaARWJ+5KG00Wc5nTbIiJMgENCDmkYALjE5uIyz6c=; b=eZT3F2+MWMucw2Gp0mVJ2l/DTHLIC06PRZzaRe1OHJnbYryPlNCia7J9bsGwiyGmjn 3g/e9iJQKkg6kFwzBx41R/X3Y+dtjKjGeVUL8kYhuCUKJ962BB/TyzWZV1C5rHslW3rk VZXl3RRQrtXU8a5gGzthh9h3BxjwgRBGBIetAW65TSyNxsgL1o2RI8KMe5lZluVW4etb iw787C+ujVB2UEeP/Ioc3tkGMwz9ZSiNpZnAZ2XYjcFXr6dwytffJGipzgr/FkDLSXIg 5wPOhnHFuTODIFBCzMbTBNKEYkhOm3iMo5C6wo/jdKXC3dKDcuqSvfz4W793aNqABquW mlbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=X3MaARWJ+5KG00Wc5nTbIiJMgENCDmkYALjE5uIyz6c=; b=XK1WB2VbdEG5pmIfGq9nT9Fb/KLKDC9Cnpe6JQ6qo6+Kdqu3SoC+/jebqAkmqjOmcT IIbaIxuEBhhkHNVL0Jdc6OwcT3k4UyaaZOxQN/wRMwTKIRXO8f7TgR3mLQa4oYHnrhOg xmDuiowLDEiieHX/dFelFMtoOiTLpK9dXBSOTrUk4RQpJcmagogcoAavdtmGddYfdvb2 GMGjbIK2Nvaf2ofd+M8nP03W5+YGFLOfiEx2wzDaJEKfsKHjdpjx4DJPTAAdflkDhXmt dM+pT2KCnmo0A4YSrcaZVAJNyNC4Wf2be+zIYVFRLp+2iBiPKJfK3BGfwR7rDJEJQDHv gTbQ== X-Gm-Message-State: AOAM532mETWLBwon6dNWWsnVBKu8O4Un738q64hLCd8kyH0PcDdjajTY z1RWh+KuN90SRU3V8YLa8LKBS0GOrNOV+W7zVSby2bHxC7A= X-Received: by 2002:a25:c7d0:0:b0:64d:a15e:7599 with SMTP id w199-20020a25c7d0000000b0064da15e7599mr4650204ybe.251.1652971943711; Thu, 19 May 2022 07:52:23 -0700 (PDT) MIME-Version: 1.0 References: <20220519135642.83209-1-andrey.grodzovsky@amd.com> In-Reply-To: <20220519135642.83209-1-andrey.grodzovsky@amd.com> From: Lai Jiangshan Date: Thu, 19 May 2022 22:52:12 +0800 Message-ID: Subject: Re: [PATCH] Revert "workqueue: remove unused cancel_work()" To: Andrey Grodzovsky Cc: Tejun Heo , LKML , amd-gfx@lists.freedesktop.org, Christian.Koenig@amd.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 On Thu, May 19, 2022 at 9:57 PM Andrey Grodzovsky wrote: > > This reverts commit 6417250d3f894e66a68ba1cd93676143f2376a6f > and exports the function. > > We need this funtion in amdgpu driver to fix a bug. Hello, Could you specify the reason why it is needed in amdgpu driver rather than "fix a bug", please. And there is a typo: "funtion". And please avoid using "we" in the changelog. For example, the sentence can be changed to: The amdgpu driver needs this function to cancel a work item in blabla context/situation or for blabla reason. (I'm not good at Engish, this is just an example of not using "we". No need to use the sentence.) Thanks Lai > > Signed-off-by: Andrey Grodzovsky > --- > include/linux/workqueue.h | 1 + > kernel/workqueue.c | 9 +++++++++ > 2 files changed, 10 insertions(+) > > diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h > index 7fee9b6cfede..9e41e1226193 100644 > --- a/include/linux/workqueue.h > +++ b/include/linux/workqueue.h > @@ -453,6 +453,7 @@ extern int schedule_on_each_cpu(work_func_t func); > int execute_in_process_context(work_func_t fn, struct execute_work *); > > extern bool flush_work(struct work_struct *work); > +extern bool cancel_work(struct work_struct *work); > extern bool cancel_work_sync(struct work_struct *work); > > extern bool flush_delayed_work(struct delayed_work *dwork); > diff --git a/kernel/workqueue.c b/kernel/workqueue.c > index 613917bbc4e7..f94b596ebffd 100644 > --- a/kernel/workqueue.c > +++ b/kernel/workqueue.c > @@ -3267,6 +3267,15 @@ static bool __cancel_work(struct work_struct *work, bool is_dwork) > return ret; > } > > +/* > + * See cancel_delayed_work() > + */ > +bool cancel_work(struct work_struct *work) > +{ > + return __cancel_work(work, false); > +} > +EXPORT_SYMBOL(cancel_work); > + > /** > * cancel_delayed_work - cancel a delayed work > * @dwork: delayed_work to cancel > -- > 2.25.1 >