From patchwork Wed Oct 9 08:07:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hongxing Zhu X-Patchwork-Id: 175600 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp428725ill; Wed, 9 Oct 2019 01:09:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqy5KLMax/J0jd9fxNrhu0EAu5o5jyi+TE+ahyNcbty+952VWP8HIpNQD6bBTzUMVsHjTuxt X-Received: by 2002:a17:906:d29a:: with SMTP id ay26mr1588679ejb.21.1570608590610; Wed, 09 Oct 2019 01:09:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570608590; cv=none; d=google.com; s=arc-20160816; b=i9n6WRzDIlXNWHY0DHwI/e1aRdu2hIz+KXlo5iYBHhHPj1HSm7l2T0PzRtC5tcVsTo oYIXcmzOKOv/LLPY+UlGT4IZVp5LxaQcYRyD29H7Cg+bKludFM5px2Z+KjGIVE/yaaIF ANe77DwfGKdaHAt8Ue8kjk+SQfSd7pHXvSuo8GOxVVgtReqdOluUKnbnSjYqMv8FTl9t Skm4d0o2nQMnhbHzlD7m1GHpJnsB19BQFQBC6P89mfGSXUV1uOg7F8vt7DeVC4Cw5rDf f4LhFjAXjo3DmS9fvokat+EaLur3XDyRD4rOBOk6tnXOJT8WdbxFAfGIxM09g9aSQPtq 6glg== 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; bh=UrDrVapL7N3ELwnBx94eNfFIdw8+eiJ6DJadYpONjn4=; b=f7WF3G1BOz4kkuCLf/nvcHnr/xSc0WNFTuCWykeghvUsfNhKOtOxIuljB2hY+HNJ5A LZ/3/RHSap9gqLv2QlLckeHTdDkoJTqqQ3268tSSZcSOAEeMkKtG3vvFsZGrgYr7v7JH bpZjsZqJyitnyfPYojYVA+G8VkiWnGle2eRP0iN9mv5OL3Em++jMVG8YscSkpomwLGoj yky4qpfG3IWw8FOxQT9Pl1xe4T6CSIXuJ5AVR7/6nFzn9zDKIqoDbOnj9T8jQbWUUPoO q4FPR4lU0G8fIjttToWH8vctf24NFfTHJhvP3jZ5gNcCep+G+/8exNPB8/67xH+b4eGU QhkQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b31si1030627ede.12.2019.10.09.01.09.50; Wed, 09 Oct 2019 01:09:50 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730324AbfJIIJt (ORCPT + 26 others); Wed, 9 Oct 2019 04:09:49 -0400 Received: from inva020.nxp.com ([92.121.34.13]:53878 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730212AbfJIIJr (ORCPT ); Wed, 9 Oct 2019 04:09:47 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id AFACE1A039D; Wed, 9 Oct 2019 10:09:45 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id A951F1A0382; Wed, 9 Oct 2019 10:09:41 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id B4232402FF; Wed, 9 Oct 2019 16:09:33 +0800 (SGT) From: Richard Zhu To: jassisinghbrar@gmail.com, o.rempel@pengutronix.de, daniel.baluta@nxp.com, aisheng.dong@nxp.com Cc: linux-imx@nxp.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Richard Zhu Subject: [PATCH v6 2/4] mailbox: imx: Clear the right interrupts at shutdown Date: Wed, 9 Oct 2019 16:07:19 +0800 Message-Id: <1570608441-29651-3-git-send-email-hongxing.zhu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1570608441-29651-1-git-send-email-hongxing.zhu@nxp.com> References: <1570608441-29651-1-git-send-email-hongxing.zhu@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Daniel Baluta Make sure to only clear enabled interrupts keeping count of the connection type. Suggested-by: Oleksij Rempel Signed-off-by: Daniel Baluta Signed-off-by: Richard Zhu Reviewed-by: Dong Aisheng --- drivers/mailbox/imx-mailbox.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) -- 2.7.4 diff --git a/drivers/mailbox/imx-mailbox.c b/drivers/mailbox/imx-mailbox.c index 957c10c..afe625e 100644 --- a/drivers/mailbox/imx-mailbox.c +++ b/drivers/mailbox/imx-mailbox.c @@ -219,8 +219,19 @@ static void imx_mu_shutdown(struct mbox_chan *chan) return; } - imx_mu_xcr_rmw(priv, 0, IMX_MU_xCR_TIEn(cp->idx) | - IMX_MU_xCR_RIEn(cp->idx) | IMX_MU_xCR_GIEn(cp->idx)); + switch (cp->type) { + case IMX_MU_TYPE_TX: + imx_mu_xcr_rmw(priv, 0, IMX_MU_xCR_TIEn(cp->idx)); + break; + case IMX_MU_TYPE_RX: + imx_mu_xcr_rmw(priv, 0, IMX_MU_xCR_RIEn(cp->idx)); + break; + case IMX_MU_TYPE_RXDB: + imx_mu_xcr_rmw(priv, 0, IMX_MU_xCR_GIEn(cp->idx)); + break; + default: + break; + } free_irq(priv->irq, chan); }