From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3F8BAEB64DD for ; Thu, 3 Aug 2023 15:57:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:CC:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Ffb3ie+SfSBKl/8hwwgs5NOiuG1zjmfHGgiMwDGlyE0=; b=sr8w2iiAYwpUWQ A4j8D0guSoWrCbdC4tf8EGmLfLB57szV+aMOOsFqjPe/P0lDDwknaPDEuJe85qGnXIkkumse5ABY2 O5/xR1VlYvGuXQynoNClce4+YHj/lRT9dIDd9yJXlzVZgQ3TNEyGjJLvCCKA4t7eEG7nILrYELwsW qI6kPXC+ESKUvFKxd2oGYPQgDEsoe4geQ5lL+UgPHItA9pmd0d+TcRtNpgcb7XOTDhRsd/cPPT+A5 EjGbv+7OtfhDZehBiSoRZEvAreGNokrQR8q/9h3LM4gwlwNcxIIVlQcCO+NSfi10jc5YZxk4rNaNL RE4pfKha9bx05Xo5Cxug==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qRahT-00AGKk-2w; Thu, 03 Aug 2023 15:57:19 +0000 Received: from fllv0016.ext.ti.com ([198.47.19.142]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qRahQ-00AGKL-2q for linux-arm-kernel@lists.infradead.org; Thu, 03 Aug 2023 15:57:18 +0000 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 373FvBxe079735; Thu, 3 Aug 2023 10:57:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1691078231; bh=zbceunG6HLkq7CegqrVypMKkS+qXgl2Bk5f+wlEXjo0=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=ZeGlA5Mgo8Byyq1cbaJXcdV3u5p1qbjlvnt33CF2OttRsnjvRkHk3NFNYAzlmRA6g psZx3tUMbjDhprs8jWoigM5eFXVRwUVLKP1jGb9n9iphv4xlN/+7WyryCjldFMDF1q gi5Y6xNxqWzyCtjSMeETGD1T9S8ru9oRKjna/4J0= Received: from DLEE104.ent.ti.com (dlee104.ent.ti.com [157.170.170.34]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 373FvBi5111377 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 3 Aug 2023 10:57:11 -0500 Received: from DLEE107.ent.ti.com (157.170.170.37) by DLEE104.ent.ti.com (157.170.170.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Thu, 3 Aug 2023 10:57:11 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) 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.23 via Frontend Transport; Thu, 3 Aug 2023 10:57:11 -0500 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 373FvATh008664; Thu, 3 Aug 2023 10:57:11 -0500 Date: Thu, 3 Aug 2023 21:27:10 +0530 From: Dhruva Gole To: Andrew Davis CC: Nishanth Menon , Tero Kristo , "Santosh Shilimkar" , , , , Viresh Kumar , Praneeth Bajjuri , Tony Lindgren , Dave Gerlach , Vibhore Vardhan , Georgi Vlaev , Roger Quadros Subject: Re: [PATCH V6 3/4] firmware: ti_sci: Allocate memory for Low Power Modes Message-ID: <20230803155710.fivxx7hufuravcdr@dhruva> References: <20230803064247.503036-1-d-gole@ti.com> <20230803064247.503036-4-d-gole@ti.com> <7c12b109-d6b9-f0d4-cada-28140a33da21@ti.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <7c12b109-d6b9-f0d4-cada-28140a33da21@ti.com> X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230803_085717_022998_DD8D3B58 X-CRM114-Status: GOOD ( 24.53 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Aug 03, 2023 at 10:23:47 -0500, Andrew Davis wrote: > On 8/3/23 1:42 AM, Dhruva Gole wrote: > > From: Dave Gerlach > > > > A region of memory in DDR must be used during Deep Sleep for saving > > of some system context when using the ti_sci firmware. From DM's point > > of view, this can be any contiguous region in the DDR, so can allocate > > 512KB of DMA reserved memory in probe(), instead of another carveout. > > > > Also send a TISCI_MSG_QUERY_FW_CAPS message to the firmware during > > probe to determine if any low power modes are supported and if > > ti_sci_init_suspend should be called based on the response received. > > > > Signed-off-by: Dave Gerlach > > Signed-off-by: Vibhore Vardhan > > Signed-off-by: Georgi Vlaev > > Tested-by: Roger Quadros > > [d-gole@ti.com: Use dma_alloc_attrs instead of dma_alloc_coherent] > > Signed-off-by: Dhruva Gole > > --- > > drivers/firmware/ti_sci.c | 42 +++++++++++++++++++++++++++++++++++++++ > > 1 file changed, 42 insertions(+) > > [..snip..] > > static const struct ti_sci_desc ti_sci_pmmc_k2g_desc = { > > .default_host_id = 2, > > @@ -3661,6 +3690,15 @@ static int ti_sci_probe(struct platform_device *pdev) > > } > > } > > + /* > > + * Check if the firmware supports any optional low power modes > > + * and initialize them if present. Old revisions of TIFS (< 08.04) > > + * will NACK the request. > > + */ > > + ret = ti_sci_msg_cmd_query_fw_caps(&info->handle, &info->fw_caps); > > + if (!ret && (info->fw_caps & MSG_MASK_CAPS_LPM)) > > + ti_sci_init_suspend(pdev, info); > > + > > dev_info(dev, "ABI: %d.%d (firmware rev 0x%04x '%s')\n", > > info->handle.version.abi_major, info->handle.version.abi_minor, > > info->handle.version.firmware_revision, > > @@ -3708,6 +3746,10 @@ static int ti_sci_remove(struct platform_device *pdev) > > mbox_free_channel(info->chan_rx); > > } > > + if (info->ctx_mem_buf) > > + dma_free_coherent(info->dev, LPM_CTX_MEM_SIZE, > > You allocated with dma_alloc_attrs() you should free with dma_free_attrs(). Good catch, will fix this in next revision > > Andrew > > > + info->ctx_mem_buf, > > + info->ctx_mem_addr); > > return ret; > > } -- Best regards, Dhruva Gole _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel