Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp4620794imb; Wed, 6 Mar 2019 18:48:02 -0800 (PST) X-Google-Smtp-Source: APXvYqwW0vLPBqwUD8SCzwUUEvC6BToTHfY19j/kC9vEThr0ioDtn8bDKlRv1fSzI7uerI4F5CSx X-Received: by 2002:a65:5181:: with SMTP id h1mr9345982pgq.422.1551926882909; Wed, 06 Mar 2019 18:48:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551926882; cv=none; d=google.com; s=arc-20160816; b=WQhetE5jHOettRESeLkniS6UchAu5uGv0vPWh+oTaVQFbQnY0k76vU41a882/FMaOA A/Ae2/RgfUxulGC2Mc2HXkPn5s6TVSuNpxheKvxr1Jar2UNKdS/vE+rb4sR5d/lRUY8y wa5I8pBnt+Z/rGuqgoMT93wFY3pFTOMYHyM6pMln3HP+OKkO31BxdQiNc9jmrhvlwZwI wRfbZgqlj00SgDXu9mCnXDPkg4FlpvqT4jMsQdfjIkk/IPWyX2j2nqz0Xgmf58tk8by4 +SYT9OYjN6VE89Vo1gLG0f57o1ztgFAGBgDb6OsjROZCyD4Xgm1p2VCHXZmcRyp0V1xj cpZQ== 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:subject:cc:to:from:message-id:date; bh=2ardtY8of/nHIlmKohgT+rPoVfCOxlCbYu9+tpbFZEM=; b=csRj9KAGWDzpBTxfLHNQ1dF6xiGja0HqYqawgrOppEjtLyFTDo85FjOieXb4ykuELB c8n7yWGIx+I52/NPmPY8OGjFUjIN1lMu0+dtlRW80xx4ALDNBATpmrrXol8TS4O0gTWh YulK7/qXatBbW4ulQO7kZmFsmZ55LyuUSVLXsArwXwTWK6uKm6PCFoxdDWwbqrKqYXPE /KQwPZMMBQEGkb5TctO6AZ9Hp77bFoRsPnGFZuLDBS3CsSdDWTyZnFTPYJavhP11Gh2H Ns0FV5yJD3dDmEQGK1SBfJcUcdUgssr9JLQuvlCVtzy2DxJGyOy9WXvF+dfsiRERgmWJ +hLA== 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 gn23si3053040plb.19.2019.03.06.18.47.47; Wed, 06 Mar 2019 18:48:02 -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 S1727523AbfCGCrY (ORCPT + 99 others); Wed, 6 Mar 2019 21:47:24 -0500 Received: from relmlor2.renesas.com ([210.160.252.172]:11881 "EHLO relmlie6.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726873AbfCGCrX (ORCPT ); Wed, 6 Mar 2019 21:47:23 -0500 Date: 07 Mar 2019 11:47:21 +0900 X-IronPort-AV: E=Sophos;i="5.58,450,1544454000"; d="scan'208";a="9453932" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 07 Mar 2019 11:47:21 +0900 Received: from morimoto-PC.renesas.com (unknown [10.166.18.140]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 06C254041534; Thu, 7 Mar 2019 11:47:21 +0900 (JST) Message-ID: <878sxrmmy1.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto To: Jiada Wang Cc: , , , , , Subject: Re: [PATCH linux-next v1 1/2] ASoC: rsnd: src: Avoid a potential deadlock In-Reply-To: <20190307023453.25017-2-jiada_wang@mentor.com> References: <20190307023453.25017-1-jiada_wang@mentor.com> <20190307023453.25017-2-jiada_wang@mentor.com> User-Agent: Wanderlust/2.15.9 Emacs/24.5 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jiada Thank you for your patch > lockdep warns us that priv->lock and k->k_lock can cause a > deadlock when after acquire of k->k_lock, process is interrupted > by src, while in another routine of src .init, k->k_lock is > acquired with priv->lock held. > > This patch avoids a potential deadlock by not calling soc_device_match() > in SRC .init callback, instead it adds new soc fields in priv->flags to > differentiate SoCs. > > Fixes: linux-next commit 7674bec4fc09 ("ASoC: rsnd: update BSDSR/BSDISR handling") > Signed-off-by: Jiada Wang > --- (snip) > @@ -1706,6 +1707,8 @@ static int rsnd_probe(struct platform_device *pdev) > > priv->pdev = pdev; > priv->flags = (unsigned long)of_device_get_match_data(dev); > + if (of_device_is_compatible(np, "renesas,rcar_sound-r8a77990")) > + priv->flags |= RSND_SOC_E; > spin_lock_init(&priv->lock); Updating rsnd_of_match is nice idea Maybe like this (not tested) ------------ diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index 9834474..e7ebc75 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c @@ -107,9 +107,12 @@ SNDRV_PCM_FMTBIT_S24_LE) static const struct of_device_id rsnd_of_match[] = { + /* General Handling */ { .compatible = "renesas,rcar_sound-gen1", .data = (void *)RSND_GEN1 }, { .compatible = "renesas,rcar_sound-gen2", .data = (void *)RSND_GEN2 }, { .compatible = "renesas,rcar_sound-gen3", .data = (void *)RSND_GEN3 }, + /* Special Handling */ + { .compatible = "renesas,rcar_sound-r8a77990", .data = (void *)(RSND_GEN3 | RSND_SOC_E) }, {}, }; ------------