Received: by 10.223.176.46 with SMTP id f43csp251522wra; Thu, 18 Jan 2018 16:52:17 -0800 (PST) X-Google-Smtp-Source: ACJfBosiy5F0TQyAnSCJV66NAbbL2/7ZeYGDdk4f4Y6jouf+tEDddmwFqLPvSHIon2ojgtt+6xUH X-Received: by 10.99.95.193 with SMTP id t184mr34251084pgb.189.1516323137654; Thu, 18 Jan 2018 16:52:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516323137; cv=none; d=google.com; s=arc-20160816; b=rTY9dl1ecTUW9OljROCSrkeBbxqBOUo2zAarA07QGhV4qHe4n/ewLYHikCtW84qCwx 4+TNFbDMrEEmy6JJlsJ90qxIUu9rrAlyJdSIKGjRN3tAfyzNFDSzezYAw8sLQ4IYaw0q 95UDk+DIK/Yw/lsr+CwL1fRPB9YPk8pcJMzCHb8Ix8qj72sZTwVErwDtepLoTSxyt4YS O+EHazIx9t5s62ziOS1DLAhik+iKk/7tczQrSvTBQ0gl1QAelmygU5mVlm2+dtMuLOg7 WMc+d8PfqaguyEKm0PFmYQIjMiKiyb7asxA2agrj4LYGMh4LHSHBRLxbQkMqivsoaiF+ lBwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=cmaNJNG7JoF9Mxet2I/vzuVUVU+sywxe141kTxYBdTw=; b=zq2K5rnb/VKUvRep0gl3emHriJMKHA90Fnbvyp2ltvo6po16fqX5kaVCv2lS7MfN90 3sFmD0FlQPY2L6Mgh448rSp2i0MPdWHw/g1HyVM1v7QVe+BP1nA6H2Vj/sAb8A1b4Q5J Mvp/3ZzOXY9rRtTf1Y4y48FEuGtMPF2nWWTFz0nUh/11XxBddUbFs+ttkQllfR5zVosG zbz6WKRTAR7E6Ue7takE9gj17TTG0TK7GZL2fXZDEMGt7YvF1g7EMGsKcYm8tDtP4Ywx 829CHOz2Yi/UGuNFFavGd6F5hQHmPbVnnbj+CbMvTPZU3P3i5ks/6aPxdUO2+UtY7KUw RLvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WBYGVgtJ; 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 f6-v6si358444pln.303.2018.01.18.16.52.03; Thu, 18 Jan 2018 16:52:17 -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=WBYGVgtJ; 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 S1755403AbeASAur (ORCPT + 99 others); Thu, 18 Jan 2018 19:50:47 -0500 Received: from mail-pf0-f196.google.com ([209.85.192.196]:36347 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754796AbeASAuA (ORCPT ); Thu, 18 Jan 2018 19:50:00 -0500 Received: by mail-pf0-f196.google.com with SMTP id 23so81195pfp.3; Thu, 18 Jan 2018 16:49:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=cmaNJNG7JoF9Mxet2I/vzuVUVU+sywxe141kTxYBdTw=; b=WBYGVgtJVq4DA51C50wQ1vBinZlBhVsVbomCRzrvYCt3R6zb4wlFXO9EJ5ZT8yCmbA ktNgPj9yaaj7qwRMBsh5zNdg6j0h/y6E53cKPUXINnmKlMIG+Xv/+xi2fxnysrMAjKWV kp/gJ/EeGfJe9ljdpLAfrQdxn6bGFDpQnaSa9ic07zf1F7/6sK9MX1uBHC2bFT1Lcz3L R/rUT6k/5fholBQAL/6/rT84xseKNjg6Lt+isXxeNgVUeSDSHcF+6gAYcZHXlBw/htDt 04VifWL8OZPL+OzP7newgIE065DGQFUGAyMX2BrhfLjdxr+2ubf+kYxNfy5EDQb/Rp0W kQfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=cmaNJNG7JoF9Mxet2I/vzuVUVU+sywxe141kTxYBdTw=; b=sNc9IAIjYOGUMhGX69rZWpDi+lgjmCTqEO533MSoGYa7uPEkf+v2931HNDi16qb1E+ Kj0/nmPg1ea52cKdMp5javxxFiL58fiEKUbDG6nzRv5w47HcxHJ+HgF1kp1qkxksmkN0 AKiQWzOikc4p32Cr4mfDg/m2xhbMIUCLXk5+RLMWgDAmBwZvMeu1Bn7jswyGzH7wce0q FH4+aCf7DS71HPv94CZMrZZ88nDCeqQeBruKi2b4ytS/St/0pBEXcizEsJuW2d+uBZer g9XJ3FoF3jUKWs5l8KwqtrEi++ko1/kfFlANtldw1GqUNJF0tAa5WEwFGYik+pIR8ALw RpzQ== X-Gm-Message-State: AKwxytfHovSJJosQrjAC7vXxziQivBouNskiD2vLNxAnr9iKe0ci4v52 La+D7PLVV+J2jfdBxu2UgLk= X-Received: by 10.98.196.205 with SMTP id h74mr29188179pfk.129.1516322999390; Thu, 18 Jan 2018 16:49:59 -0800 (PST) Received: from dtor-ws.mtv.corp.google.com ([2620:0:1000:1611:da80:8749:c06f:9515]) by smtp.gmail.com with ESMTPSA id t80sm12540937pgb.88.2018.01.18.16.49.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jan 2018 16:49:58 -0800 (PST) From: Dmitry Torokhov To: Benjamin Tissoires , Lyude Paul , Damjan Georgievski Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Andrew Duggan , stable@vger.kernel.org Subject: [PATCH 1/3] Input: synaptics_rmi4 - do not delete interrupt memory too early Date: Thu, 18 Jan 2018 16:49:53 -0800 Message-Id: <20180119004955.247190-2-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.16.0.rc1.238.g530d649a79-goog In-Reply-To: <20180119004955.247190-1-dmitry.torokhov@gmail.com> References: <20180119004955.247190-1-dmitry.torokhov@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) -- 2.16.0.rc1.238.g530d649a79-goog