From patchwork Thu Jun 6 11:22:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 165975 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp8651184ili; Thu, 6 Jun 2019 04:22:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqwiGfsT3R1vQQDsK4ksbzXrtcpFmfirFtNR6Ac9BUZsy6dDNTNwa8cKBNkCUiddUy4t3lMs X-Received: by 2002:aa7:8e46:: with SMTP id d6mr52294481pfr.91.1559820153335; Thu, 06 Jun 2019 04:22:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559820153; cv=none; d=google.com; s=arc-20160816; b=S8h1rEgZC5RkngMchl1j4k7iYC4KJbVLu5yoqyr/yAdDNTmr1YdGqs79m0HUqs3Kr3 COqB9ZZEkG8tiANAzrwYhyZZY69vqVquMA9HHzOX/cwFJOdBszvEhmDThSNklS3GGZuQ UJSd8+83Ni+V8QcEdAm0mRBt+RY1o6bKry4LcfWP0E6eIR/O6rpF/k3X8cOrcvMMvlK9 MZTKG6brUUu7XBKua9oIEVX+SwBB8xVtiR3WXp52X18+EJDSF7aGx2SRw+lmQVVEGYAj vNj/bC4idbqi4cC4FsNQHeoPneWEoR3vrGxQrj9ZqU0ku/vhCdUvu1iQ/o7uN8S+ZiFW tDWw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=HEs0MSpYL/dt4ruohAAYosuccjeeKQUzYlFrfc+6zvI=; b=1CUqOZV2Fkhp7YKnfjHSYacgWsIxmRN6In3dJI3X17oMcdP8EBaMB0jwuGd15P1b5h v7PUVC1MCeU7vGR5ho0egxpXH5LLX4K+7bEtXmuzmCTIjXj535K0XB7lerMVSk7lNHmp pN7UTYIqpkI+0FekVWgCiMFdLNhyRqlVUe3AuBgHUNS9KQzBirrJPWW9q34SLf/C2N6J woiM3aX3TiVrElFiGoDmAJyg1GJptDAh65N7X05f/LcYyOIh36HmC/SBml7Ciph7Bafx bq5JKD9Wb0X4NplZXNkyviG6ZW4vcYp6kaLwjXplqmpWRb3gQG2u00zKIjv878gJuFP4 qlHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lH5XM5ly; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a4si1571868plm.209.2019.06.06.04.22.32; Thu, 06 Jun 2019 04:22:33 -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=@linaro.org header.s=google header.b=lH5XM5ly; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728203AbfFFLWc (ORCPT + 30 others); Thu, 6 Jun 2019 07:22:32 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:40575 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726066AbfFFLWb (ORCPT ); Thu, 6 Jun 2019 07:22:31 -0400 Received: by mail-wr1-f66.google.com with SMTP id p11so2003473wre.7 for ; Thu, 06 Jun 2019 04:22:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=HEs0MSpYL/dt4ruohAAYosuccjeeKQUzYlFrfc+6zvI=; b=lH5XM5lywTiuLbf3TJDU9hyYU1xSAF8s/CUIoBMZ2vJA/FwiFIjtrpP1YExH2Jim5h mJP+e1bdfvUvPo/VdxJToF5787YNEIbsyv4dOl6YX73oBr7BLFsg1o+fUzX5YQwEN1Ik Z6N/oJXYuE2klr2eHuzCSyZFnw1mkQUlcoUrWIhz0F1A/8osMu04SdmKwhhAxa4iVedC kXKCMZL6/cjDb+sIEsrGdMyDHNi161BVk4BUO9RzzY2nVatp2lMmfJRCnVn3jjjuRHrP YXYnWPz/rOb3joaEt05BrcJMmxErb5qvE8g4I59aC4Jwopo1qKjElK2z0QuzoUaHSkF3 NoWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=HEs0MSpYL/dt4ruohAAYosuccjeeKQUzYlFrfc+6zvI=; b=NlN8eM4U1BzT4E++rTGXrNCx/yu05PFBjEpcb8Rd3ubHpb7MPA22ua8Cv7v07ZrGXJ W5j4KfiWDmNXBMTMLADrE2pDFwOUuEyJ6w+DaPVfUY2sPn0CjIqUxGodjF+9EgNJeJzM 9+pWX6R40zcnrUICLtfCH8FkCGzGZjlasCsXq5H+6qrHUKjI+YXqGd54cuZI+t1goeN/ iP+Lgu5suOJ8dX7Hwo1k8YJiG9ufhlBrgE/WleE+swoAtaJSyvG5RNkIhK7r69507XtM 8G3ksx8HO65P64tQthZC/bpCqIjuMO0baG47e1S9uQTcBWI011DSqQo1rAOO8iEZIxhF l7MA== X-Gm-Message-State: APjAAAU2ZunVAbtbP3Z9wpuXflGXoDUS43NiYALAUtkO46AzTGjK0Jx5 TSpoIoaW93+dFe1eBSJcVmLH4IMzuI2FIg== X-Received: by 2002:adf:afd0:: with SMTP id y16mr29554545wrd.22.1559820149989; Thu, 06 Jun 2019 04:22:29 -0700 (PDT) Received: from srini-hackbox.lan (cpc89974-aztw32-2-0-cust43.18-1.cable.virginm.net. [86.30.250.44]) by smtp.gmail.com with ESMTPSA id d10sm1629867wrp.74.2019.06.06.04.22.29 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 06 Jun 2019 04:22:29 -0700 (PDT) From: Srinivas Kandagatla To: vkoul@kernel.org Cc: pierre-louis.bossart@linux.intel.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH v2] soundwire: stream: fix bad unlock balance Date: Thu, 6 Jun 2019 12:22:22 +0100 Message-Id: <20190606112222.16502-1-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org multi bank switching code takes lock on condition but releases without any check resulting in below warning. This patch fixes this. ===================================== WARNING: bad unlock balance detected! 5.1.0-16506-gc1c383a6f0a2-dirty #1523 Tainted: G W ------------------------------------- aplay/2954 is trying to release lock (&bus->msg_lock) at: do_bank_switch+0x21c/0x480 but there are no more locks to release! Signed-off-by: Srinivas Kandagatla --- drivers/soundwire/stream.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.21.0 Acked-by: Pierre-Louis Bossart Acked-by: Sanyog Kale diff --git a/drivers/soundwire/stream.c b/drivers/soundwire/stream.c index ce9cb7fa4724..73c52cd4fec8 100644 --- a/drivers/soundwire/stream.c +++ b/drivers/soundwire/stream.c @@ -814,7 +814,8 @@ static int do_bank_switch(struct sdw_stream_runtime *stream) goto error; } - mutex_unlock(&bus->msg_lock); + if (bus->multi_link) + mutex_unlock(&bus->msg_lock); } return ret;