Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3732404imm; Mon, 8 Oct 2018 08:39:50 -0700 (PDT) X-Google-Smtp-Source: ACcGV62rCucN4uifysjRSdSP4WFpjg5zG25jZsxfFe7SqjF7pMaxKpsdWcxAwSkx1pD7EXJTBurP X-Received: by 2002:a62:adc:: with SMTP id 89-v6mr25770200pfk.56.1539013190038; Mon, 08 Oct 2018 08:39:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539013190; cv=none; d=google.com; s=arc-20160816; b=fA+ArOsmVI+cToFDBupR3PtSXEUFuCZQ5NiFUibyfrajorPxyGfooI24hoAwum0wm0 NAaGPGtRfjcjE3faCbnA44MXOXn0fmB6xUnOqPTCb+hJ87eLFndqK2vLx8uXo9kkS2T9 FevRal/gk6vfcVcZlaXBHsj0QdbnAR34CsN+L9fzImurbnT6p1ktXowsZWz+WtxrfMqO hOkoT7thXvIvIUuUrGtijV2mBwiOe5auFqfRwdSkItRZ9kJbuma9MyZPmcZCbcN1ofX+ 4jv9mrjSgZCQdZThRAFTeKctLq8ABPg5GWKR+jjtZqtfsrGFIhdBA3FjaGzTsSW4MJhx fJsg== 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:dkim-signature; bh=wWLq/RparksldEIs63VcMfn4OB+zXmibFh/Z0vNUJo8=; b=olb/K+Wa1d4Ai+dpBxBjVOfeMGOLGRaYRFD+2tL8t1GB7esW0XTiWcx9MeAoSbU98p sLyye7+4z2ERqCyY8/fdVpbhXau6PgT41gknjF+qyENb+iLwbGLHQr+9m0VpM/N387D5 wr3vDZIXWbQnY0HAw0XmUAFlaZbrqo1RGQTsSkM9HBbs9IGDHgHs7WVYAQFk4jLv0OGp EIp5hAQPv8Ro5QX/aKGOO1u+pe0y+0RQnufI0V5UL785xdI1XDidCjtPgJmZXoCI5ifU MA2YZlvSliI/3s30f3zLL0oWJgyjHJi160S6UlHQViPxDLZf0txYeHIm1uTyBO5tylcT CuoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0FdNFA1J; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b1-v6si18477365pfc.156.2018.10.08.08.39.35; Mon, 08 Oct 2018 08:39:49 -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=0FdNFA1J; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726666AbeJHWhq (ORCPT + 99 others); Mon, 8 Oct 2018 18:37:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:55720 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726492AbeJHWhp (ORCPT ); Mon, 8 Oct 2018 18:37:45 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6602220878; Mon, 8 Oct 2018 15:25:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539012331; bh=09O93cjrg/pcC3dl8LtUgQGenyotl9ppGe3FmWlD6gA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0FdNFA1JZ1JZEyHpiYQsUN43ZHwOFEmYR0LlST0e0CR3sIf3qjxLygtvjCjyhl1cW xnB/btDSN2Kr/nJus7oNmMEDxM4sxsD9m0JTD4DbAAI+1crrq3L8fmCpU2uhAgl9Mv z/pt/QXj1S5JEsuAWCfU3WXA5pvzqbagNbInJrQI= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Sanyog Kale , Shreyas NC , Vinod Koul , Sasha Levin Subject: [PATCH AUTOSEL 4.18 03/58] soundwire: Fix acquiring bus lock twice during master release Date: Mon, 8 Oct 2018 11:24:28 -0400 Message-Id: <20181008152523.70705-3-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181008152523.70705-1-sashal@kernel.org> References: <20181008152523.70705-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sanyog Kale [ Upstream commit 8d6ccf5cebbc7ed1dee9986e36853a78dfb64084 ] As part of sdw_stream_remove_master(), sdw_stream_remove_slave() is called which results in bus lock being acquired twice. So, fix it by performing specific Slave remove operations in sdw_release_master_stream() instead of calling sdw_stream_remove_slave(). Signed-off-by: Sanyog Kale Signed-off-by: Shreyas NC Acked-by: Pierre-Louis Bossart Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/soundwire/stream.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/soundwire/stream.c b/drivers/soundwire/stream.c index b2682272503e..e5c7e1ef6318 100644 --- a/drivers/soundwire/stream.c +++ b/drivers/soundwire/stream.c @@ -899,9 +899,10 @@ static void sdw_release_master_stream(struct sdw_stream_runtime *stream) struct sdw_master_runtime *m_rt = stream->m_rt; struct sdw_slave_runtime *s_rt, *_s_rt; - list_for_each_entry_safe(s_rt, _s_rt, - &m_rt->slave_rt_list, m_rt_node) - sdw_stream_remove_slave(s_rt->slave, stream); + list_for_each_entry_safe(s_rt, _s_rt, &m_rt->slave_rt_list, m_rt_node) { + sdw_slave_port_release(s_rt->slave->bus, s_rt->slave, stream); + sdw_release_slave_stream(s_rt->slave, stream); + } list_del(&m_rt->bus_node); } -- 2.17.1