From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.7 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 12602C31E45 for ; Thu, 13 Jun 2019 16:26:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DA5922173C for ; Thu, 13 Jun 2019 16:26:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560443194; bh=ilvYRAJYmWHo2bclhcV1IruziHE7tfIfJ0nMbVRPb0E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=A+giPZi5HxPipV1+RSv7PXTJ2ItR5RbN7VvKMLeToika7fuPhWU86FU9aml4TQnk9 vlVEmbRbaBFe2mIUkVHJ297emcehhk9UfYI3lRTgYY5kWh4MIQ5ZNU38Ab0M/Dijy2 nA3QRUtS57atM0dp48fvFrHEb5xTkc3ymI3qogC4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392346AbfFMQ0d (ORCPT ); Thu, 13 Jun 2019 12:26:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:53700 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730956AbfFMIgI (ORCPT ); Thu, 13 Jun 2019 04:36:08 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1EDC721473; Thu, 13 Jun 2019 08:36:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560414967; bh=ilvYRAJYmWHo2bclhcV1IruziHE7tfIfJ0nMbVRPb0E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WEb/GiPrPJ6J72n8+oiL6k34WabbkqbwpUEv1ovjtNrX4TUbb1KLCIJ6z+YNnMcLq KLNjOFEaOibr94OLmHooKCf00xDnBZKUUGR8JfHFlCsK1OYwdGOEgz+WW/tv7zvKWQ kOtpuyBM4w8k5EQAMpqoeetlBcgxx1oiVPobot+o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jiada Wang , Simon Horman , Daniel Lezcano , Eduardo Valentin , Sasha Levin Subject: [PATCH 4.14 14/81] thermal: rcar_gen3_thermal: disable interrupt in .remove Date: Thu, 13 Jun 2019 10:32:57 +0200 Message-Id: <20190613075650.123146008@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190613075649.074682929@linuxfoundation.org> References: <20190613075649.074682929@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 63f55fcea50c25ae5ad45af92d08dae3b84534c2 ] Currently IRQ remains enabled after .remove, later if device is probed, IRQ is requested before .thermal_init, this may cause IRQ function be called before device is initialized. this patch disables interrupt in .remove, to ensure irq function only be called after device is fully initialized. Signed-off-by: Jiada Wang Reviewed-by: Simon Horman Reviewed-by: Daniel Lezcano Signed-off-by: Eduardo Valentin Signed-off-by: Sasha Levin --- drivers/thermal/rcar_gen3_thermal.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/thermal/rcar_gen3_thermal.c b/drivers/thermal/rcar_gen3_thermal.c index 203aca44a2bb..0afdda2db3a0 100644 --- a/drivers/thermal/rcar_gen3_thermal.c +++ b/drivers/thermal/rcar_gen3_thermal.c @@ -342,6 +342,9 @@ MODULE_DEVICE_TABLE(of, rcar_gen3_thermal_dt_ids); static int rcar_gen3_thermal_remove(struct platform_device *pdev) { struct device *dev = &pdev->dev; + struct rcar_gen3_thermal_priv *priv = dev_get_drvdata(dev); + + rcar_thermal_irq_set(priv, false); pm_runtime_put(dev); pm_runtime_disable(dev); -- 2.20.1