Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp4740692rwb; Mon, 21 Nov 2022 11:14:21 -0800 (PST) X-Google-Smtp-Source: AA0mqf4DxCQNzHo7lHI3u7TjbiaTLBAcRbg9sOtQUBxMCZ9AHYnxfpQjBAuBXGpbbHH2d4lvnHI9 X-Received: by 2002:a17:90b:30d0:b0:213:f1d8:eb6a with SMTP id hi16-20020a17090b30d000b00213f1d8eb6amr21481781pjb.219.1669058061376; Mon, 21 Nov 2022 11:14:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669058061; cv=none; d=google.com; s=arc-20160816; b=BuB6JEdhNGDoVSBJ5KHIlcOLOi4XUugnKNWynJTrjPb9YlPcapbZfpSLw8WM/8fDHj mWELb/vxL3pA8hp5dMyU1FZsULvoUuntNHY93Oip1jvUpuycubWaxJwSqKK2FhuJoZXc oje0VbDp2CbBAePRpIGkKje0IXIQosyCHWtoe+IgN2TfjPAQTN0lDi9nWctoXSQcyvDf abwBtopXjI7MyTnv0YeTlb+AiS4hGaND7stIOYD7yyQ5ULT8jX2NL5k7GP0Ci6AR0AS4 pwDiIIHw2tsYe3dgOdAq5+cQrr1s/GMO5RKtYLkgGUH4say8Es4Oy+9jSTQ1YgoSbnz9 pRHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=5+bNkHsySG+rb1AP+yg51q/RLBAyiDbcqwjFZQT0DQQ=; b=Zg9GM1/bN698iejm3FXgpia7tF7W54rw+aM2AmRsQHlys4XAN7oGDMXgZiFHeHGMPC r40vK2hQYWc2uEQWgpteEu7m+slKLkWdzzbMICPZABKhMA6A1FoCXIl6bl7nHBJQzppZ MSDvcDJUj/JxE5OgFZaFKjJjxGgNSOhKHTfL8Ureth3kyFygmscPiRe69mY5rIv+MXj0 KR37KJzs7s8XeqSmRf5isbpb1jR025kPE0xmH0P24EnXvRORyk4vpm6Mb17OoU51j+gB 1HRcvjUbYooRuOtS6ANE0OFbmsr7bIUkBgB+MpsCvSyx1UU9Su3onAkRm0nbAWMuV/5U RrIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=iGowHcm6; 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 140-20020a630792000000b004769549ac7bsi12203658pgh.469.2022.11.21.11.14.08; Mon, 21 Nov 2022 11:14:21 -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=iGowHcm6; 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 S229739AbiKUSou (ORCPT + 91 others); Mon, 21 Nov 2022 13:44:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229482AbiKUSor (ORCPT ); Mon, 21 Nov 2022 13:44:47 -0500 Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94FC4C7222; Mon, 21 Nov 2022 10:44:46 -0800 (PST) Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 2ALIiaPB076276; Mon, 21 Nov 2022 12:44:36 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1669056276; bh=5+bNkHsySG+rb1AP+yg51q/RLBAyiDbcqwjFZQT0DQQ=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=iGowHcm6I28WpVfVdVbeXNFGSWoCOhoY5IypmUPGAmaQF3exQvGTTSiN0Vt8RpVIw udTCZB5/kUA5ye7FFvbsZCDTBg0MxzTYp5PY8u/1aqne/q6E4dOo21MfcNj5lOTk6p SB0P2vyMpV1Il5ilXxOxd0To5nX7ZRggTuBwzRBc= Received: from DFLE103.ent.ti.com (dfle103.ent.ti.com [10.64.6.24]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 2ALIiaNU075329 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 21 Nov 2022 12:44:36 -0600 Received: from DFLE111.ent.ti.com (10.64.6.32) by DFLE103.ent.ti.com (10.64.6.24) 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 12:44:35 -0600 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE111.ent.ti.com (10.64.6.32) 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 12:44:35 -0600 Received: from localhost (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 2ALIiZRq019261; Mon, 21 Nov 2022 12:44:35 -0600 Date: Mon, 21 Nov 2022 12:44:35 -0600 From: Nishanth Menon To: Georgi Vlaev CC: Tero Kristo , Santosh Shilimkar , Rob Herring , Krzysztof Kozlowski , , , , Vibhore Vardhan , Vignesh Raghavendra , Roger Quadros Subject: Re: [PATCH v4 3/5] firmware: ti_sci: Allocate memory for the LPM modes Message-ID: <20221121184435.btehz6dzliz3lizk@scuba> References: <20221116181307.198209-1-g-vlaev@ti.com> <20221116181307.198209-4-g-vlaev@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20221116181307.198209-4-g-vlaev@ti.com> User-Agent: NeoMutt/20171215 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,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 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