Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp1567522ybc; Wed, 13 Nov 2019 00:27:00 -0800 (PST) X-Google-Smtp-Source: APXvYqxZZHKkQrO7ttZyp+2eNgiYmJUpV/s0oRsah1VC4D+KRLV1UFh9cG7ba9EaGi+Q5tlzrLke X-Received: by 2002:a05:6402:8cb:: with SMTP id d11mr2170233edz.303.1573633620341; Wed, 13 Nov 2019 00:27:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573633620; cv=none; d=google.com; s=arc-20160816; b=DMyNbWukA3HkfNISbFGpZthocIXaWLvIx3BEF0Inx9Ltza7evDOPWGD1weLWItbvGT v+DNTZam0cxmh6GClmIUHdSHPaH6LtMsRvXGdPkgbQNeV4yQIVjnhp4jR2qtmSYtsL/y +h9D5DXmq76UIZG0bjNj7jfAEDKBei9Vz17r09oXGlQ7tX5mJ35pwAPeI5HqBTCP7IZ6 J/2f83uXCMQJue/q7I7zTYyL+i3QQ/PqmmVNNXWIXLXw6Ps39Rm7+FgrG2IjG43wpcpe FL44HwgLp/k6IfIB4o9CbYOLGDrPG+5suW34UPRloIA3W+nsFXIQvr/piF46vho9H7xZ IFeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=2Dr4DtssgxrhEWsTdOORMh6MSvL94CfbPjLQDiXX5z8=; b=TJP6OynT3cbwRECr5girBGyv4vE14BjaX6JPBPqR9jekXgv8kiyIqGexZnMrG6eSUU DTZ0HP6NubUVuI8o6ZabMW77s2C7OmQCCq04wXlPemO2gboW5H821iUI3FzL7lW8bEkA zWa1FSm+seOOf+dY5FmcGeejfocRFWvQZPsxMEuavJMjKWivZi3nqZ9fsLhKGRCjUfRr a8G4SD4y/zYHrzre1K7QcyzXGfxYVG6MjUHhEoQQC8OC63br89Egu/gTfDNkk9V5O0RY uwMlanIkT47V+el2igSn0AnP5EnLQsjlGAOpLTNrqO6QvxIP+X200of3qT6fr45t4TX4 lhRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=EMfPDGRW; 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 w17si942148edc.152.2019.11.13.00.26.35; Wed, 13 Nov 2019 00:27:00 -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=EMfPDGRW; 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 S1727372AbfKMIXV (ORCPT + 99 others); Wed, 13 Nov 2019 03:23:21 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:35301 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727412AbfKMIXT (ORCPT ); Wed, 13 Nov 2019 03:23:19 -0500 Received: by mail-pf1-f195.google.com with SMTP id q13so1147941pff.2; Wed, 13 Nov 2019 00:23:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=2Dr4DtssgxrhEWsTdOORMh6MSvL94CfbPjLQDiXX5z8=; b=EMfPDGRWhFSD7qSuLI608VmxMoUqaFuxMujKCLx8kmpxOWcr4cSSxmJ6EqaaHAyZml wTFZ3ix7annFmdDY+6uX2dcXHQpRCF494ol73mlx00a6gMtKHNeO4Xe6C5wkjn4EAwvw LM4y9sy+BGdr0p5/20q/7HYjMA72hoAizGWu0B/wRFSuEAn2IAddHpDcu0ATDU+hN8Ge aLuVsw08gkdWCWSeBtughBpmN3+BLxIeR4esrk7uwRwEse+CHUl9SNTm9zKFp0WG+M/l yWO5WMtxKHEU4h/H6HhKm8GZPDXvDniTT7Tq6ZpUXz/ehVwJNRxbw5RlBOFSIzZfDjad 9L7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=2Dr4DtssgxrhEWsTdOORMh6MSvL94CfbPjLQDiXX5z8=; b=T1iyIozWw3IDxdkC6mGIcbMNOZkvNdKBqafq7w+g+Rl40/Qx+IF0U0P8z5BTYMX3+t Xmt3+5US0bgyojHyNVsfOnZYC0xjxHtYeA8sZeS961FJ4Dc4zwkvS+aDJ07uR0eoRxHf 3QXgOU8hrzkv8K/zoN5Op5uvQ1cM3k6oGjy+ww0DR7uca6lkpZnF8k+s6iUiJnqAIcDY hMyB46okR/2E5VIKQuDdjH2NtOcmlZ9QnOzfIZuUtGQsvo2er6X+QVQJrTT3SfeH7FBe 26YCQgBcqCuJc8OGPjhX++OsWf3Vjajd8A1LNHfIJxw+gvFMiMYeRJ8vY8rzxVtFbWV6 fBzw== X-Gm-Message-State: APjAAAWml0tolKYFxPTQOc0iElUNZZ6vDQgduFP/jD4Tq+r6ZO3b3uIq eUgAahMUYM9zu1oDCJ9f6+RkLR1u X-Received: by 2002:aa7:96e2:: with SMTP id i2mr569783pfq.256.1573633398428; Wed, 13 Nov 2019 00:23:18 -0800 (PST) Received: from dtor-ws ([2620:15c:202:201:3adc:b08c:7acc:b325]) by smtp.gmail.com with ESMTPSA id t12sm1615211pgv.45.2019.11.13.00.23.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Nov 2019 00:23:17 -0800 (PST) Date: Wed, 13 Nov 2019 00:23:15 -0800 From: Dmitry Torokhov To: Chuhong Yuan Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Input: synaptics-rmi4 - add missed operations in remove Message-ID: <20191113082315.GP13374@dtor-ws> References: <20191113063656.8713-1-hslester96@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191113063656.8713-1-hslester96@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) 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 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. > > 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