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]
Message-ID: <20221121184435.btehz6dzliz3lizk@scuba>
Date:   Mon, 21 Nov 2022 12:44:35 -0600
From:   Nishanth Menon <nm@...com>
To:     Georgi Vlaev <g-vlaev@...com>
CC:     Tero Kristo <kristo@...nel.org>,
        Santosh Shilimkar <ssantosh@...nel.org>,
        Rob Herring <robh+dt@...nel.org>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
        <linux-arm-kernel@...ts.infradead.org>,
        <linux-kernel@...r.kernel.org>, <devicetree@...r.kernel.org>,
        Vibhore Vardhan <vibhore@...com>,
        Vignesh Raghavendra <vigneshr@...com>,
        Roger Quadros <rogerq@...nel.org>
Subject: Re: [PATCH v4 3/5] firmware: ti_sci: Allocate memory for the LPM
 modes

On 20:13-20221116, Georgi Vlaev wrote:
[...]

> +static int ti_sci_init_suspend(struct platform_device *pdev,
> +			       struct ti_sci_info *info)
> +{
> +	struct device *dev = &pdev->dev;
> +	int ret;
> +
> +	dma_set_mask_and_coherent(dev, DMA_BIT_MASK(64));
> +	info->ctx_mem_buf = dma_alloc_coherent(info->dev, LPM_CTX_MEM_SIZE,
> +					       &info->ctx_mem_addr,
> +					       GFP_KERNEL);
> +	if (!info->ctx_mem_buf) {
> +		dev_err(info->dev, "Failed to allocate LPM context memory\n");
> +		return -ENOMEM;
> +	}
> +
> +	/*
> +	 * Attempt to call prepare_sleep, this will be NAK'd if suspend is not
> +	 * supported by firmware in use, in which case we will not attempt to
> +	 * init suspend.
> +	 */
> +	ret = ti_sci_cmd_prepare_sleep(&info->handle, 0,
> +				       (u32)(info->ctx_mem_addr & 0xffffffff),
> +				       (u32)((u64)info->ctx_mem_addr >> 32), 0);
> +
> +	if (ret)
> +		goto err;
> +
> +	return 0;
> +err:
> +	dma_free_coherent(info->dev, LPM_CTX_MEM_SIZE,
> +			  info->ctx_mem_buf,
> +			  info->ctx_mem_addr);
> +	return ret;
> +}
> +
>  /* Description for K2G */
>  static const struct ti_sci_desc ti_sci_pmmc_k2g_desc = {
>  	.default_host_id = 2,
> @@ -3639,6 +3682,14 @@ static int ti_sci_probe(struct platform_device *pdev)
>  		}
>  	}
>  
> +	ret = ti_sci_init_suspend(pdev, info);
> +	if (ret)
> +		dev_warn(dev,
> +			 "ti_sci_init_suspend failed, mem suspend will be non-functional.\n");
> +
> +	/* Suspend is an optional feature, reset return value and continue. */
> +	ret = 0;

We end up getting this warning on all platforms with TISCI - even if
LPM sequence is capable or not - what does the message mean? firmware is
not capable of supporting sleep or it is a firmware capable of
supporting, but failed to allocate LPM context memory?

If it is optional (since it is probing to see if it has functionality),
then do we need a dev_warn - maybe a softer of form?

[...]

-- 
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ