From patchwork Tue Jun 23 19:54:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 223541 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=-10.0 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,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 F1013C433E0 for ; Tue, 23 Jun 2020 20:13:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B99C9206C3 for ; Tue, 23 Jun 2020 20:13:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592943208; bh=K/4JzaY+ILlY4OM95wmDtD1aA5+zt7bNidlRQvr0BaM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=CEEq1PNGBiKIJA2ZmCiYXccu0TjaUrEHEAjPaQA4ph/vSBQWv0mVEToayYJR3sOlg 7LovfyOb4mqCBzF2dMtZyZD4Vlip/LzCWsGOGMjRuOupLeP/NH1S/Hq1GMp8NlNzUm 8CVkRIKpH2mL/VQyKlbSbMdUv5vcsLsWTu7/3RRQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389086AbgFWUN1 (ORCPT ); Tue, 23 Jun 2020 16:13:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:55528 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389083AbgFWUN1 (ORCPT ); Tue, 23 Jun 2020 16:13:27 -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 6A7A920707; Tue, 23 Jun 2020 20:13:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592943206; bh=K/4JzaY+ILlY4OM95wmDtD1aA5+zt7bNidlRQvr0BaM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SYT5w9cNlIzZ+qOSr0g+A/NTWXYRR3VeXDgYcNCCOavr/E/RZBooAmmw/Z6MwAsa2 5py28qICi7gK7alEaa9LiO8pV/mH4CxUY7j1e+FednpR2vJHYrnSXOE3NdwkSEv+Wc uPAKk2SWnGHH1WH3r9+jVu52Edqc8a7yXa3r7lPU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Amelie Delaunay , Lee Jones , Sasha Levin Subject: [PATCH 5.7 271/477] mfd: stmfx: Disable IRQ in suspend to avoid spurious interrupt Date: Tue, 23 Jun 2020 21:54:28 +0200 Message-Id: <20200623195420.372000784@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200623195407.572062007@linuxfoundation.org> References: <20200623195407.572062007@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Amelie Delaunay [ Upstream commit 97eda5dcc2cde5dcc778bef7a9344db3b6bf8ef5 ] When STMFX supply is stopped, spurious interrupt can occur. To avoid that, disable the interrupt in suspend before disabling the regulator and re-enable it at the end of resume. Fixes: 06252ade9156 ("mfd: Add ST Multi-Function eXpander (STMFX) core driver") Signed-off-by: Amelie Delaunay Signed-off-by: Lee Jones Signed-off-by: Sasha Levin --- drivers/mfd/stmfx.c | 6 ++++++ include/linux/mfd/stmfx.h | 1 + 2 files changed, 7 insertions(+) diff --git a/drivers/mfd/stmfx.c b/drivers/mfd/stmfx.c index 1977fe95f876c..711979afd90a0 100644 --- a/drivers/mfd/stmfx.c +++ b/drivers/mfd/stmfx.c @@ -296,6 +296,8 @@ static int stmfx_irq_init(struct i2c_client *client) if (ret) goto irq_exit; + stmfx->irq = client->irq; + return 0; irq_exit: @@ -486,6 +488,8 @@ static int stmfx_suspend(struct device *dev) if (ret) return ret; + disable_irq(stmfx->irq); + if (stmfx->vdd) return regulator_disable(stmfx->vdd); @@ -529,6 +533,8 @@ static int stmfx_resume(struct device *dev) if (ret) return ret; + enable_irq(stmfx->irq); + return 0; } #endif diff --git a/include/linux/mfd/stmfx.h b/include/linux/mfd/stmfx.h index 3c67983678ec7..744dce63946e0 100644 --- a/include/linux/mfd/stmfx.h +++ b/include/linux/mfd/stmfx.h @@ -109,6 +109,7 @@ struct stmfx { struct device *dev; struct regmap *map; struct regulator *vdd; + int irq; struct irq_domain *irq_domain; struct mutex lock; /* IRQ bus lock */ u8 irq_src;