Received: by 10.223.185.116 with SMTP id b49csp2509318wrg; Thu, 15 Feb 2018 12:44:20 -0800 (PST) X-Google-Smtp-Source: AH8x227Zbc0GI8Gtm4yu+ZlqsNfkjd0+STwQv0WI4uKPwkcXOb2NxNfA9CpEfqb/+HTfreKfLb/z X-Received: by 10.99.99.132 with SMTP id x126mr3150366pgb.86.1518727460605; Thu, 15 Feb 2018 12:44:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518727460; cv=none; d=google.com; s=arc-20160816; b=GrEhD1w/GgtStm/8OPe9g0WR3kW8jQb5QCao2iNSfiE8aJw5VmahvJhuascIZBFvX8 fqgIjfypvRcfbi2AxGoLIR4bKgo4QCGbJcjZMGhza9rz6nkkIzZhLwCvrGTf9u4XE714 bSK24AW4cZRTltMgGM1yah059LzzGuFfMbjhei/ZFapbhI7Zp9vpQyjCy3Cn60/YYuQc +33b9q5yFnGuOytbbZiWa16gVMdfSFMy5NLJGPg7SgzCazEC+51Um6o4J1MA+1p4ghAj Brx+EJ+keT0RHFN8tduy2Z/e8fZxHtMJZePfnc/1+fO2XgEMze6To5Y++Ngy+V5vYExq wHdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=peg3wykYFGXU9t6TLhCl4AdfXRGzqcw+jXxTE02hvEk=; b=jWx7G7qcJq+zJkkkzQqkFBRZw6enWSph6hHApC8i8S/VkIsUfCJU4hVG8exqT4CRvh IO4oi5j0tXq4hcqLhNNyyCFCDL7dZ86T0rAbReolCXi5Y+JxqsasYMNKbWKFI/AQ71G6 TahFAQDVgD38SeWvth1BGH74QyitxISaRlHzxOZM4nHJ2l6Fg/gk+pbdin/+C/TYXKcm lkfgGrkoRkweTPhI2gpn7mXGAg0DcrhM5H7l2kYoBpKHhVDkzyMeFOVP+FSs8Ogh7GMb cIWbe4d47OHkvrJ6tKlvrtcEyMxj2yYmYt7W3IFAMi4C9BBwvQPIlE3RWOTavf8Cj0Yv cUzg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l1si3291335pga.408.2018.02.15.12.44.06; Thu, 15 Feb 2018 12:44:20 -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; 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 S1162054AbeBOPVY (ORCPT + 99 others); Thu, 15 Feb 2018 10:21:24 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:48730 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1162036AbeBOPVV (ORCPT ); Thu, 15 Feb 2018 10:21:21 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 1C9CF88D; Thu, 15 Feb 2018 15:21:19 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kuninori Morimoto , Hiroyuki Yokoyama , Mark Brown , thongsyho , Nhan Nguyen Subject: [PATCH 4.4 022/108] ASoC: rsnd: dont call free_irq() on Parent SSI Date: Thu, 15 Feb 2018 16:16:19 +0100 Message-Id: <20180215151225.677191137@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180215151222.267507937@linuxfoundation.org> References: <20180215151222.267507937@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Kuninori Morimoto commit 1f8754d4daea5f257370a52a30fcb22798c54516 upstream. If SSI uses shared pin, some SSI will be used as parent SSI. Then, normal SSI's remove and Parent SSI's remove (these are same SSI) will be called when unbind or remove timing. In this case, free_irq() will be called twice. This patch solve this issue. Signed-off-by: Kuninori Morimoto Tested-by: Hiroyuki Yokoyama Reported-by: Hiroyuki Yokoyama Signed-off-by: Mark Brown Signed-off-by: thongsyho Signed-off-by: Nhan Nguyen Signed-off-by: Greg Kroah-Hartman --- sound/soc/sh/rcar/rsnd.h | 2 ++ sound/soc/sh/rcar/ssi.c | 5 +++++ 2 files changed, 7 insertions(+) --- a/sound/soc/sh/rcar/rsnd.h +++ b/sound/soc/sh/rcar/rsnd.h @@ -235,6 +235,7 @@ enum rsnd_mod_type { RSND_MOD_MIX, RSND_MOD_CTU, RSND_MOD_SRC, + RSND_MOD_SSIP, /* SSI parent */ RSND_MOD_SSI, RSND_MOD_MAX, }; @@ -365,6 +366,7 @@ struct rsnd_dai_stream { }; #define rsnd_io_to_mod(io, i) ((i) < RSND_MOD_MAX ? (io)->mod[(i)] : NULL) #define rsnd_io_to_mod_ssi(io) rsnd_io_to_mod((io), RSND_MOD_SSI) +#define rsnd_io_to_mod_ssip(io) rsnd_io_to_mod((io), RSND_MOD_SSIP) #define rsnd_io_to_mod_src(io) rsnd_io_to_mod((io), RSND_MOD_SRC) #define rsnd_io_to_mod_ctu(io) rsnd_io_to_mod((io), RSND_MOD_CTU) #define rsnd_io_to_mod_mix(io) rsnd_io_to_mod((io), RSND_MOD_MIX) --- a/sound/soc/sh/rcar/ssi.c +++ b/sound/soc/sh/rcar/ssi.c @@ -550,11 +550,16 @@ static int rsnd_ssi_dma_remove(struct rs struct rsnd_priv *priv) { struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod); + struct rsnd_mod *ssi_parent_mod = rsnd_io_to_mod_ssip(io); struct device *dev = rsnd_priv_to_dev(priv); int irq = ssi->info->irq; rsnd_dma_quit(io, rsnd_mod_to_dma(mod)); + /* Do nothing for SSI parent mod */ + if (ssi_parent_mod == mod) + return 0; + /* PIO will request IRQ again */ devm_free_irq(dev, irq, mod);