Received: by 2002:a25:b323:0:0:0:0:0 with SMTP id l35csp905957ybj; Fri, 20 Sep 2019 01:49:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqyLJr1E7JoVeCPSVzrcdet+c7uKKrbLO1JY6xh5SD7HPdyxTk/QcNulWjsOPC7qd8afUzRS X-Received: by 2002:aa7:d750:: with SMTP id a16mr20677503eds.27.1568969393095; Fri, 20 Sep 2019 01:49:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568969393; cv=none; d=google.com; s=arc-20160816; b=dPn6P2VtKvbQB2bg0IvAEEs+Chn/kzRA6a1+sKrf6Bw4LAHLPHacVhjr8o1ckdaHQW s4N3EXNL4gRT61GFH/a+N8SGQR7dGsioZ9YmuqGHK8GwPFXPwcF9aYGkph4H2fr6pqm2 UNdWjXbGDNmM82l3x0DPT1cAC/mkZZaqX9XoB8Ln6oc77QFXzvWO1mtr9Hp3elcqArK9 RzZAaW1Fr/KXNepiknLyP3FaxTwzhh4gS1Fp4xxREtrHTofNrhyUz+zAhTlKGjYVqa/f iNOd6T3qAO3N8BLnlQK+oON6g1+bS2SJ0OXEJoWxv86IgoVzddE3f8vESgyCLTpBMIS/ Lyuw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=zz2R+YXHkXEJOrbk7UFVK2wA2LAajFEh8G3Q/QnadeA=; b=f8EQxe4N3Qqa5YhwGA+D0ra7HbqyBpL4k7QOqsGwWMSAXOH64M1I2901fI0JWwzCSs wotDiYHIca4pjudW8O6aI3wlSC4YOkhKCGAcbT8sIxH/43UBzqn5sa0FMLiEoQfH7Q6T iYr7jxr+xCzQvXyGBu0W3Zz1e+1NJx9JNtoys9ss5a1Yf2m7j5nwXFYJOG9hHhGkrqEZ MSsL7WHE+kTfbN2QQBRIximQh85Pk1QpIhnSbr3WBxCZL7zoQAwVhyRBlevQMjmJKgJ1 CedKTp3Lj6b9swu8Vn1RGgh4V/OjHN8i34RXCPbQuM0cBfROp1FihI/h+Yo7yypa45jv 3irw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=icXvJMP7; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m10si675827ejc.337.2019.09.20.01.49.29; Fri, 20 Sep 2019 01:49:53 -0700 (PDT) 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=@kernel.org header.s=default header.b=icXvJMP7; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405495AbfISWJv (ORCPT + 99 others); Thu, 19 Sep 2019 18:09:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:48064 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405508AbfISWJq (ORCPT ); Thu, 19 Sep 2019 18:09:46 -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 5585921927; Thu, 19 Sep 2019 22:09:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1568930985; bh=RBiB+nszUOZlllJwJQPDLHwFxoOujyJoImu0eDIhmHY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=icXvJMP733MT1BHVIOzx87TzHvT6p8gwMJ6cC2R2ds/gwFk37jSlZWj322We6n1r7 ZonUEsAb0alT5/+F0pT+agv9+2aBEHRTqlC+ch3E//2J558KWuE/Upxp53l8E3PD5K W3xDE14ERk5qb7zHmcA5lPzwOgdPHXZQMpe4Lh/k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Krzysztof Adamski , Wolfram Sang , Jarkko Nikula , Sasha Levin Subject: [PATCH 5.2 087/124] i2c: designware: Synchronize IRQs when unregistering slave client Date: Fri, 20 Sep 2019 00:02:55 +0200 Message-Id: <20190919214822.197921026@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190919214819.198419517@linuxfoundation.org> References: <20190919214819.198419517@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 From: Jarkko Nikula [ Upstream commit c486dcd2f1bbdd524a1e0149734b79e4ae329650 ] Make sure interrupt handler i2c_dw_irq_handler_slave() has finished before clearing the the dev->slave pointer in i2c_dw_unreg_slave(). There is possibility for a race if i2c_dw_irq_handler_slave() is running on another CPU while clearing the dev->slave pointer. Reported-by: Krzysztof Adamski Reported-by: Wolfram Sang Signed-off-by: Jarkko Nikula Signed-off-by: Wolfram Sang Signed-off-by: Sasha Levin --- drivers/i2c/busses/i2c-designware-slave.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/i2c/busses/i2c-designware-slave.c b/drivers/i2c/busses/i2c-designware-slave.c index e7f9305b2dd9f..f5f001738df5e 100644 --- a/drivers/i2c/busses/i2c-designware-slave.c +++ b/drivers/i2c/busses/i2c-designware-slave.c @@ -94,6 +94,7 @@ static int i2c_dw_unreg_slave(struct i2c_client *slave) dev->disable_int(dev); dev->disable(dev); + synchronize_irq(dev->irq); dev->slave = NULL; pm_runtime_put(dev->dev); -- 2.20.1