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:   Wed, 12 Jul 2023 14:40:11 +0200
From:   Alexandre Mergnat <amergnat@...libre.com>
To:     Trevor Wu <trevor.wu@...iatek.com>, broonie@...nel.org,
        lgirdwood@...il.com, tiwai@...e.com, perex@...ex.cz,
        robh+dt@...nel.org, krzysztof.kozlowski+dt@...aro.org,
        conor+dt@...nel.org, matthias.bgg@...il.com,
        angelogioacchino.delregno@...labora.com
Cc:     alsa-devel@...a-project.org, linux-mediatek@...ts.infradead.org,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        devicetree@...r.kernel.org
Subject: Re: [RESEND 1/2] ASoC: mediatek: mt8188: add memory-region support



On 12/07/2023 09:08, Trevor Wu wrote:
> In certain projects, it is necessary to utilize the reserved memory
> region for audio dma. The patch takes into account the dts property
> 'memory-region', allowing for the specification of memory for afe memif
> through device tree.
> 
> Signed-off-by: Trevor Wu <trevor.wu@...iatek.com>
> ---
>   sound/soc/mediatek/mt8188/mt8188-afe-pcm.c | 8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/sound/soc/mediatek/mt8188/mt8188-afe-pcm.c b/sound/soc/mediatek/mt8188/mt8188-afe-pcm.c
> index 6a24b339444b..5e14655c5617 100644
> --- a/sound/soc/mediatek/mt8188/mt8188-afe-pcm.c
> +++ b/sound/soc/mediatek/mt8188/mt8188-afe-pcm.c
> @@ -16,6 +16,7 @@
>   #include <linux/of.h>
>   #include <linux/of_address.h>
>   #include <linux/of_platform.h>
> +#include <linux/of_reserved_mem.h>
>   #include <linux/pm_runtime.h>
>   #include <linux/soc/mediatek/infracfg.h>
>   #include <linux/reset.h>
> @@ -3193,11 +3194,15 @@ static int mt8188_afe_pcm_dev_probe(struct platform_device *pdev)
>   {
>   	struct mtk_base_afe *afe;
>   	struct mt8188_afe_private *afe_priv;
> -	struct device *dev;
> +	struct device *dev = &pdev->dev;

I think that make sense to replace all "&pdev->dev" by "dev" in the next 
called functions:
- dma_set_mask_and_coherent
- devm_kzalloc
- devm_kzalloc

>   	struct reset_control *rstc;
>   	struct regmap *infra_ao;
>   	int i, irq_id, ret;
>   
> +	ret = of_reserved_mem_device_init(dev);
> +	if (ret)
> +		dev_dbg(dev, "failed to assign memory region: %d\n", ret);
> +
>   	ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(33));
>   	if (ret)
>   		return ret;
> @@ -3213,7 +3218,6 @@ static int mt8188_afe_pcm_dev_probe(struct platform_device *pdev)
>   
>   	afe_priv = afe->platform_priv;
>   	afe->dev = &pdev->dev;
> -	dev = afe->dev;
>   
>   	afe->base_addr = devm_platform_ioremap_resource(pdev, 0);
>   	if (IS_ERR(afe->base_addr))

-- 
Regards,
Alexandre

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ