Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp4937963rwb; Mon, 21 Nov 2022 14:09:23 -0800 (PST) X-Google-Smtp-Source: AA0mqf4yuwBiEw2SnPOC9FWR8CeHV8HkjN4fg+tpEJWtcPkhXLq2EmQ1xakuWh11jSKY3uhnuqgt X-Received: by 2002:a05:6402:370d:b0:462:1a67:75ef with SMTP id ek13-20020a056402370d00b004621a6775efmr1571363edb.16.1669068563533; Mon, 21 Nov 2022 14:09:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669068563; cv=none; d=google.com; s=arc-20160816; b=BeJZOsKfC/hSQz9nvG6P1lA8fxA4MK/NqJ4XYMRZsfYpqpaSyp2A7XcMZIgg0qLFRc TspfuL110n4v/EUFlqiQhc8Y1hqYw3m3o/fxKic6W25kSnTkRlZsqTjnZFfmM/UaSnOc flrsnW+BdSE883FeSQxGu3QezYZu0uAYXAAMJrXyg906kKU13u0KE8MXem588hbu+v0h C9iS+eABdKIT5K6rTuKfh77LdwYeFzuVBn8DdafZuRNbOX9jil+R384Qd5oxhx4Y9n6G r39Kb1P0X/O+ih3yjNHEybhAvnWJGrydCS1DQPhFA8T2tarPujc+XV+4VCc8CMxPI1II lHaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=9nmkt/fM+sdQIIViulu9vtC5+7HYjTlTa5MRtxWn4fM=; b=glW8YjNDPeEtJNA4FJhQ6uNiyTheUq0ea8sI3zwEHs94LGmC1uJsLg9BiuVMQVQ/k0 qBeQ02d8689fuhj5ddJpOhfqIksQIM7fqMFGG7rt1WXsD8xp4h/dqGgFb0AnwPpZOohe gILImCCO5Za9uP0iH2TNjIOcNCJui+5gxOmeBF2ui4x0LF7ydDqVlXgGPpujIL2nK+1p j+wdbnW8jPdx9GpNGLrSUUe4ojRywUpERtbsgpKLEdnbqCHOiSCtda5SQJ1E17l6A8Fa V5T/umoPx0RB+UND22nttzX+cO/9951arpxPL9YBtC0QTIf6TMxYaPV/P5s9Le8/JZY6 YEFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=AFFIzrXQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hd10-20020a170907968a00b00782b24c1ed8si10547938ejc.368.2022.11.21.14.09.00; Mon, 21 Nov 2022 14:09:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=AFFIzrXQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231319AbiKUVqE (ORCPT + 92 others); Mon, 21 Nov 2022 16:46:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229953AbiKUVp6 (ORCPT ); Mon, 21 Nov 2022 16:45:58 -0500 Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3AC92E8; Mon, 21 Nov 2022 13:45:57 -0800 (PST) Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 2ALLjlUi089236; Mon, 21 Nov 2022 15:45:47 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1669067147; bh=9nmkt/fM+sdQIIViulu9vtC5+7HYjTlTa5MRtxWn4fM=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=AFFIzrXQpKWA+1SJ2QgnDZmJkQXNfbg6UBSM33x9qLaiiHnkpoVwRX2SzfzVNcyL1 oODPrznms/e76ti3FTrvJ6Hh12jth7NxNBfkcb1LqFs6yAcaR5nS5rKJlvrm9ySkCg 9e+j2PvlnE8KTzxpcyuYLZx8C6J49LMOuR0b5vZY= Received: from DLEE115.ent.ti.com (dlee115.ent.ti.com [157.170.170.26]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 2ALLjli0017320 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 21 Nov 2022 15:45:47 -0600 Received: from DLEE107.ent.ti.com (157.170.170.37) by DLEE115.ent.ti.com (157.170.170.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16; Mon, 21 Nov 2022 15:45:47 -0600 Received: from fllv0040.itg.ti.com (10.64.41.20) by DLEE107.ent.ti.com (157.170.170.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16 via Frontend Transport; Mon, 21 Nov 2022 15:45:47 -0600 Received: from [10.250.135.52] (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 2ALLjbIn102805; Mon, 21 Nov 2022 15:45:39 -0600 Message-ID: <2558a8fd-68c0-1a3e-61d1-57d032024f5f@ti.com> Date: Mon, 21 Nov 2022 23:45:35 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 Subject: Re: [PATCH v4 3/5] firmware: ti_sci: Allocate memory for the LPM modes Content-Language: en-US To: Nishanth Menon CC: Tero Kristo , Santosh Shilimkar , Rob Herring , Krzysztof Kozlowski , , , , Vibhore Vardhan , Vignesh Raghavendra , Roger Quadros References: <20221116181307.198209-1-g-vlaev@ti.com> <20221116181307.198209-4-g-vlaev@ti.com> <20221121184435.btehz6dzliz3lizk@scuba> From: Georgi Vlaev In-Reply-To: <20221121184435.btehz6dzliz3lizk@scuba> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Nishanth, On 11/21/22 20:44, Nishanth Menon wrote: > 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? > Yeah, I agree, the message looks confusing. In both cases we can't enter suspend-to-ram, but we consider that an optional feature, so a softer message will be more appropriate. > [...] > -- Regards, Georgi