Received: by 10.223.176.46 with SMTP id f43csp267259wra; Thu, 18 Jan 2018 17:07:09 -0800 (PST) X-Google-Smtp-Source: ACJfBovOLapaI/GfY20t0DExg8mMwdXJckVnVTCx0uLkZRGSGJESnHO65fm6R+ddDs0vZyk0ZuBB X-Received: by 10.99.96.23 with SMTP id u23mr38206308pgb.355.1516324029657; Thu, 18 Jan 2018 17:07:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516324029; cv=none; d=google.com; s=arc-20160816; b=zxch3dgrbiP7PbxYdNswjksPveZ7Aeh4SWzjNhGbK4duUFsQEzSh0xjGpBwLkqgx9Q NYax7m1kP8rO+Yaeaj3ce8JrVDBSQ6BtkHD7+/pgTArVxUo32SZYf1mmxsDRZsbTb86v kqEDbgmMoPexJiEtmO5dPng1kE9OqZWBqOgPZ90hOcqb51qqEtOz9mErrZ2T+o0C3drz ka1J/XC2tpTeORzpQbTGPovCoUFN0AoAiil6aSMqrYQTxgh51dUtL+m1KFQTMolTEA8u QBCxOcTN28oDlOUh8sWfIHjpGFZJTNIBD8Q+iAtYGEOti0SssKwwlKeHGFnrQyzP+d2L 27hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature:arc-authentication-results; bh=92O7hPCcBzNPrCQjluPgcnVYiEtUwDh8H2x7QzVZUMo=; b=W5/XTzB91tWLKFHLd0I0ovOGlwjh5uimuRI3WtxDHR0AMhVNudVdxwbPIim5YIzEZU uvgxmLX1rAaCqbJk+M7FRiCJi5xUeaFnnrFOCSDAtNlTk+UalXwKrkHITbU7dnIrLHLa XfVgEFZU8j8OZCMFEfy9TrH6JniHwH9QvL9bORO7rMsxy8NvP+J04WBxZMPHkQwWswFU ZHG2Y2AcjdpUBkcaFET9vOsFQxlufQXjrmrRcNYYcxcnywNhw8Q01Kku/BqNhijlpp/D JQlBCzi/xt/MsOmdjePBTyo2Jd83VdUpXirPgLoypqoicnmj4/XcVp9LfrPSuXrd5OeT W10w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Ta3mmgcc; 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=NONE 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 d6si8115979pfc.32.2018.01.18.17.06.55; Thu, 18 Jan 2018 17:07:09 -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=Ta3mmgcc; 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=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755290AbeASBG3 (ORCPT + 99 others); Thu, 18 Jan 2018 20:06:29 -0500 Received: from mail-ua0-f193.google.com ([209.85.217.193]:40551 "EHLO mail-ua0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753476AbeASBGW (ORCPT ); Thu, 18 Jan 2018 20:06:22 -0500 Received: by mail-ua0-f193.google.com with SMTP id t6so64901ual.7; Thu, 18 Jan 2018 17:06:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:cc:date:in-reply-to:references :mime-version:content-transfer-encoding; bh=92O7hPCcBzNPrCQjluPgcnVYiEtUwDh8H2x7QzVZUMo=; b=Ta3mmgccehJfwOmasfUdnV/JjyoOPBxuqbhTPK8BEGBrNbf+iAyPsEbbLgeNjLIXLu E6/kavRuwveyl9GiODIz2yjlmHcVcqt0LFWOboRy+ap3VjsRW0SFySBLF5Rw5YG1Fjq1 mC+uLipFXAkSGVLdnLk/S+GiZhCAPxyq34lh/MOX1ytkDOv3YOmoQhNsLGyomD2PZG3D 5fnt0mJ8ZtQF/xhrkV6XfvV7tbrd9VCaqLtiloVE8l0BygKlajNnWCM1aTi0SYzipd3Z NDtvEz/hEkk+Khmk2gFQtXCpYRkqych0KbqYBLfe8/sArosvMvSn7uS9pVis8eEu5wol HvUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=92O7hPCcBzNPrCQjluPgcnVYiEtUwDh8H2x7QzVZUMo=; b=h5vECF+h3HCbuDSCb61JvyszzyYlSB9V30hBSAAOVBG8WIbF/gtAhTKEOFaBg7rR+s 0CFYl+JvoQRYJBJufGw+t0KSMav8AQtpo56R0MYQGa5W1aZBea4K0IpD0m6UxATCLcvU iKg9y9VCOUeUqW1FFkQokbZ/ffy7ypv86zPph1dU0Zu8wGFNZmPqx25dOrvdFHxayu7q FqeyOGuK/18ppTRhU0DUfxwN9oKP7kbzqMaKMQE/d/bOT+3weI4yi4nJH9ZTi92NzfKc qmQNhCkliasHA08OkwY+ctHxynQ8e5FGmJSm1WUTdlQ8QegUh6IQY1VcoZQ9U6EUBZOX KO7Q== X-Gm-Message-State: AKwxytfbUgQBig0DSahMYp8Z8D+TuZxHNXn+ShNHIETm2SqWV1h2srHG 1pQKQDFKjZGbQVUv4D1nnpg= X-Received: by 10.176.96.4 with SMTP id j4mr6235710ual.180.1516323981701; Thu, 18 Jan 2018 17:06:21 -0800 (PST) Received: from malachite ([172.58.217.89]) by smtp.gmail.com with ESMTPSA id h81sm1815432vkd.31.2018.01.18.17.06.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 18 Jan 2018 17:06:21 -0800 (PST) Message-ID: <1516323951.2814.2.camel@gmail.com> Subject: Re: [PATCH 1/3] Input: synaptics_rmi4 - do not delete interrupt memory too early From: thatslyude@gmail.com To: Dmitry Torokhov , Benjamin Tissoires , Damjan Georgievski Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Andrew Duggan , stable@vger.kernel.org Date: Thu, 18 Jan 2018 20:05:51 -0500 In-Reply-To: <20180119004955.247190-2-dmitry.torokhov@gmail.com> References: <20180119004955.247190-1-dmitry.torokhov@gmail.com> <20180119004955.247190-2-dmitry.torokhov@gmail.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.4 (3.26.4-1.fc27) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Reviewed-by: Lyude Paul (hope you don't mind that I'm using my gmail address for this ;) On Thu, 2018-01-18 at 16:49 -0800, Dmitry Torokhov wrote: > We want to free memory reserved for interrupt mask handling only after we > free functions, as function drivers might want to mask interrupts. This is > needed for the followup patch to the F03 that would implement unmasking and > masking interrupts from the serio pass-through port open() and close() > methods. > > Cc: stable@vger.kernel.org > Signed-off-by: Dmitry Torokhov > --- > drivers/input/rmi4/rmi_driver.c | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) > > diff --git a/drivers/input/rmi4/rmi_driver.c > b/drivers/input/rmi4/rmi_driver.c > index 27791d6546c66..ce3ede289ed04 100644 > --- a/drivers/input/rmi4/rmi_driver.c > +++ b/drivers/input/rmi4/rmi_driver.c > @@ -41,6 +41,13 @@ void rmi_free_function_list(struct rmi_device *rmi_dev) > > rmi_dbg(RMI_DEBUG_CORE, &rmi_dev->dev, "Freeing function list\n"); > > + /* Doing it in the reverse order so F01 will be removed last */ > + list_for_each_entry_safe_reverse(fn, tmp, > + &data->function_list, node) { > + list_del(&fn->node); > + rmi_unregister_function(fn); > + } > + > devm_kfree(&rmi_dev->dev, data->irq_memory); > data->irq_memory = NULL; > data->irq_status = NULL; > @@ -50,13 +57,6 @@ void rmi_free_function_list(struct rmi_device *rmi_dev) > > data->f01_container = NULL; > data->f34_container = NULL; > - > - /* Doing it in the reverse order so F01 will be removed last */ > - list_for_each_entry_safe_reverse(fn, tmp, > - &data->function_list, node) { > - list_del(&fn->node); > - rmi_unregister_function(fn); > - } > } > > static int reset_one_function(struct rmi_function *fn)