Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp995507img; Mon, 18 Mar 2019 20:36:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqwvBRaXdCwvbuq8HCzsc50NKfiv4ksLrqR4N+vhpvECuVwuFhrHFHCFa+7HSiVvUl4tGXJN X-Received: by 2002:aa7:8205:: with SMTP id k5mr22181626pfi.86.1552966574147; Mon, 18 Mar 2019 20:36:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552966574; cv=none; d=google.com; s=arc-20160816; b=K2u0VOmp/k0EpTASC8QeioK+HOV9yfovpnpm6MlYgssRrkFUym4lNkqjhYDkznCNaW ywBImSMqivKw+lbxq8FXGLpJxsjrV/3I7fXi9WkAhJD0reM/X3UbruADJHbNs22sATBa PCSNRz3iiOfS1y8ouzd3FeXJvWgmf1O15nejaQ525D/5R9zH9VW4VNfoEGD9FWrwbM0L 4CozKHFlui0kc5hmnBYCSoVURk77SvMIBvYbeIFsQJHm+AIWQmQfS2Gne+2kvBoCNd3i FIvsaEAJ5Rl3+DTGTPCrPViYfhkWOQlMb2i2R0rS5ifQt1ZyTT+BQTfvLi8VEZfCNr37 e26g== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=RgBKkkXbE6pEfcGHgonVycwpAPeTT3+ziJjZEj1wHYo=; b=IgmCIwZ6dUSuJihRfW9GhTL77GyB9MGvqVal9LW90nvtSEzlUpWx3E7mlYcbkhhGiU 8TlD4mVjCvIm8j0wKUJ4vl8oW4RV18/sJPdroYgab6u7IlUiVq3a1hsQx7x5A8/4PibX VFKvdxo1nJ2741fwIDzEjSf7dWJiH0E9d2xQy9CgCOTOdriVmjrYNGPB5xOLRA2293pH Wrlk0pgpCW+fkTmH7ahRsx53ImT/uPVYSUSw7jrKMJ7+/KNDPc5VvVj0J5A13PlcdNmF +FJfKL2GBF9XRvZ3Jh+dzwov2aNj1tc9wV78SMsYEy+o7oID9b8UNEwh8AUwB/wyX5q1 B00g== 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 e6si10195743pgc.252.2019.03.18.20.35.58; Mon, 18 Mar 2019 20:36:14 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727000AbfCSDfU (ORCPT + 99 others); Mon, 18 Mar 2019 23:35:20 -0400 Received: from relay1.mentorg.com ([192.94.38.131]:48808 "EHLO relay1.mentorg.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726743AbfCSDfU (ORCPT ); Mon, 18 Mar 2019 23:35:20 -0400 Received: from svr-orw-mbx-03.mgc.mentorg.com ([147.34.90.203]) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1h65Wz-0006SK-He from Jiada_Wang@mentor.com ; Mon, 18 Mar 2019 20:35:13 -0700 Received: from [134.86.193.85] (147.34.91.1) by svr-orw-mbx-03.mgc.mentorg.com (147.34.90.203) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Mon, 18 Mar 2019 20:35:10 -0700 Subject: Re: [PATCH linux-next v2 1/2] ASoC: rsnd: src: Avoid a potential deadlock To: Fabrizio Castro , Geert Uytterhoeven CC: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Kuninori Morimoto , ALSA Development Mailing List , Linux Kernel Mailing List References: <20190307061554.26486-1-jiada_wang@mentor.com> <20190307061554.26486-2-jiada_wang@mentor.com> <8cd7f718-bfb2-15c8-823d-88458b385377@mentor.com> From: Jiada Wang Message-ID: <3f76f14b-b520-a0fa-b354-765a9e60551d@mentor.com> Date: Tue, 19 Mar 2019 12:34:56 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.3 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SVR-ORW-MBX-06.mgc.mentorg.com (147.34.90.206) To svr-orw-mbx-03.mgc.mentorg.com (147.34.90.203) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Fabrizio On 2019/03/14 3:19, Fabrizio Castro wrote: > Hello Jiada, > >> From: Jiada Wang >> Sent: 13 March 2019 11:56 >> Subject: Re: [PATCH linux-next v2 1/2] ASoC: rsnd: src: Avoid a potential deadlock >> >> Hi Geert >> >> On 2019/03/12 18:15, Geert Uytterhoeven wrote: >>> Hi Jiada, Fabrizio, >>> >>> On Thu, Mar 7, 2019 at 7:17 AM Jiada Wang wrote: >>>> 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 >>>> --- >>>> sound/soc/sh/rcar/core.c | 2 ++ >>>> sound/soc/sh/rcar/rsnd.h | 5 +++++ >>>> sound/soc/sh/rcar/src.c | 9 +-------- >>>> 3 files changed, 8 insertions(+), 8 deletions(-) >>>> >>>> diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c >>>> index 022996d2db13..4fe83e611c01 100644 >>>> --- a/sound/soc/sh/rcar/core.c >>>> +++ b/sound/soc/sh/rcar/core.c >>>> @@ -110,6 +110,8 @@ static const struct of_device_id rsnd_of_match[] = { >>>> { .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) }, >>> >>> I guess we need an entry for RZ/G2E, too? > > Geert has a point, I am looking at the User manual for the RZ/G2E and it looks like the > implementation for the RZ/G2E is the same as the one for the r8a77990 > >>> >> Sorry, I don't have user manual for RZ/G2E, >> if you can let me know where to find RZ/G2E's user manual, >> I can add entry for these SoCs > > If you prefer I could add that after running some tests? I do have a board with a RZ/G2E. > Yes, please since I have neither RZ/G2E board to test nor its user manual Thanks, Jiada > Thanks, > Fab > >> >> Thanks, >> Jiada >>> Gr{oetje,eeting}s, >>> >>> Geert >>>