lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   07 Mar 2019 11:47:21 +0900
From:   Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>
To:     Jiada Wang <jiada_wang@...tor.com>
Cc:     <lgirdwood@...il.com>, <broonie@...nel.org>, <perex@...ex.cz>,
        <tiwai@...e.com>, <alsa-devel@...a-project.org>,
        <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH linux-next v1 1/2] ASoC: rsnd: src: Avoid a potential deadlock


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 <jiada_wang@...tor.com>
> ---
(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) },
 	{},
 };
------------

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ