Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp1590126ybc; Wed, 13 Nov 2019 00:56:52 -0800 (PST) X-Google-Smtp-Source: APXvYqz/BGzNExgXnjoT/WVRyy3+P9o3OulZ9uDBnFfc1aFAcc88kbhXxFtVrof1bNRifmm4Es04 X-Received: by 2002:a17:906:ecad:: with SMTP id qh13mr1682664ejb.25.1573635411973; Wed, 13 Nov 2019 00:56:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573635411; cv=none; d=google.com; s=arc-20160816; b=UDeDd04M8ibCrWs0ibLE8HRdy1ZLVaX+wGH3DiZ7yHj1CzntlFRHBNtKQ8g07mXKCw 22Cx05e8ztZaHSsrzw7o3KmzmsX4xGGZ0XzbwOFPxJufG6rVc+j9tccFN06+/yeQAkw0 8h/A7UjYuWA73+JGpN/OPY7AHtDtS8Wg1Fw+LAYOxRUNlcymBdxnCMr6b0EsxExhfRfo 9X1xSkVaTpdNzECs8+NhL9LxDHkQir34udXLCcnlxpHkuxC7KMQvqdNjC8I4d7GMPbjE vG1+hAj0wDwd/D9wr3DPC3oJp4fzEnR3DHpcG0l51FQ4RA4D5UKNrZDBrCep870gGPoi xqbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=FoGUhCm680vi47F9sLMQ0q9Kc3J8GAzDERB8/9i6vVc=; b=edUKj8/Ylv4qUGeLQX1TJRhAAdVhOGcJHz5gAWCJN7nXEtEmlYPSsyKo5BvGlvHqVV 7/A31GZxOT+HTXd2WKGy93ewoblH3ceztplwIygzHcgLJpER1Z/NyWsXYYG4/3a8wuY+ 1cjKqSLuFD4Ka7Sqm2net9igWZykkmrW0LNajiWE2yp9rdb/9PpYEuexyiXs54zoMCrl LLBlSdhJYiW4EE5d/CtERQVR/eHlWRq9DlI8HG28KNAGcLAUt9RKZuOZ5+SKv0zuVwws dRa+dQb3NNuzns1fZkmULNsvLR5H8+SqoeQqNUmTe2Mmd2HOmd9L98sDUUCkgnSqghNw ftuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qtGPr4de; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s2si865216edi.413.2019.11.13.00.56.27; Wed, 13 Nov 2019 00:56:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qtGPr4de; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1727531AbfKMIxN (ORCPT + 99 others); Wed, 13 Nov 2019 03:53:13 -0500 Received: from mail-ed1-f65.google.com ([209.85.208.65]:43244 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725993AbfKMIxN (ORCPT ); Wed, 13 Nov 2019 03:53:13 -0500 Received: by mail-ed1-f65.google.com with SMTP id w6so1132807edx.10; Wed, 13 Nov 2019 00:53:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=FoGUhCm680vi47F9sLMQ0q9Kc3J8GAzDERB8/9i6vVc=; b=qtGPr4deSvpj4x5RdL3rFC9hggsBvUCn3D1O/3RCasj5aZAkjQfQc+cLAtGCIcqkzr 9dOSLucAlT1qPlWNmwYlMUROvs7fwBrQWajVzwyJWStgLgOop6xp0feotm8nSZBWuZYP zvquUzyTAKcU7MTb3/4NnR0UegmrXtFpsX4UAizHxuBksORhYx2VT2fr7jTbsMCrlsLX S2d/rXfcnpNqNExuRMV2ue9ts+/5EuX4L0H3dgQH+DwXSr/Vr5RkcGrnSI9V9hPe/mKU R7KMAUmXgH0QPqasr2STMBdem4ENOS3bMv5AoA+AS6mFfb7E5B0I6/brwesnnbVjwePJ K5VQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=FoGUhCm680vi47F9sLMQ0q9Kc3J8GAzDERB8/9i6vVc=; b=I0VW04v5eNokITRcCIKqg8Kli1I/HsiJr54TjHa9AGfDWK7YosMaugwZ2ZUmFGCdGX apd00p/AbeSrcO+QCzG7y3WSEgOcS2TvRMq4hMv+ZqSzn2QEAuuV1AcvNmrg1xbuKk9n 5HVzyx7AYMZS3dWHIzgDAjTu78cj4gMWsQVoDNFPT+k9o88HB3So5NUIJWGm0or/4kAA 1d2REBxUO4V0uHnTef0ionG1QOCd+GoG7zHHzFxU3m/kPhNZ2e7jWshws9LQjsNW+pQ2 7QPnkjvUufHFzWm2GTXXIimC+93uRSrFbVqgvKF6OviawnBG2UAyyLLUKo5qADMknHsF E7rQ== X-Gm-Message-State: APjAAAW2rIhgShgsyS32CS+k7s9Mmv4Gbo4U3RJXn7cCLq9SIta2yYZn D9p14tX1s9xS/wprJNXI3JfAyUJ3609yPRu1gDGSnJcIc+E= X-Received: by 2002:a17:906:a388:: with SMTP id k8mr1553484ejz.223.1573635191206; Wed, 13 Nov 2019 00:53:11 -0800 (PST) MIME-Version: 1.0 References: <20191113063656.8713-1-hslester96@gmail.com> <20191113082315.GP13374@dtor-ws> In-Reply-To: <20191113082315.GP13374@dtor-ws> From: Chuhong Yuan Date: Wed, 13 Nov 2019 16:52:59 +0800 Message-ID: Subject: Re: [PATCH] Input: synaptics-rmi4 - add missed operations in remove To: Dmitry Torokhov Cc: linux-input@vger.kernel.org, LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 13, 2019 at 4:23 PM Dmitry Torokhov wrote: > > On Wed, Nov 13, 2019 at 02:36:56PM +0800, Chuhong Yuan wrote: > > The driver forgets to deal with work and workqueue in remove like what > > is done when probe fails. > > Add the missed operations to fix it. > > Is it really possible for the work to still be pending when fully > registered device is properly unregistered? I thought we'd wait for > successful data acquisition in rmi_f54_buffer_queue() before unregister > can complete. > In fact, I am not familiar with the mechanism here... I have checked other drivers with video_unregister_device and found none of them deals with work in remove. Therefore, I think your opinion should be right and we only need to deal with the workqueue. Regards, Chuhong > > > > Signed-off-by: Chuhong Yuan > > --- > > drivers/input/rmi4/rmi_f54.c | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/drivers/input/rmi4/rmi_f54.c b/drivers/input/rmi4/rmi_f54.c > > index 710b02595486..2c0cde5c775c 100644 > > --- a/drivers/input/rmi4/rmi_f54.c > > +++ b/drivers/input/rmi4/rmi_f54.c > > @@ -730,6 +730,9 @@ static void rmi_f54_remove(struct rmi_function *fn) > > > > video_unregister_device(&f54->vdev); > > v4l2_device_unregister(&f54->v4l2); > > + cancel_delayed_work_sync(&f54->work); > > + flush_workqueue(f54->workqueue); > > + destroy_workqueue(f54->workqueue); > > } > > > > struct rmi_function_handler rmi_f54_handler = { > > -- > > 2.23.0 > > > > Thanks. > > -- > Dmitry