public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Dhruva Gole <d-gole@ti.com>
To: Andrew Davis <afd@ti.com>
Cc: Nishanth Menon <nm@ti.com>, Tero Kristo <kristo@kernel.org>,
	"Santosh Shilimkar" <ssantosh@kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>, <linux-pm@vger.kernel.org>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	Praneeth Bajjuri <praneeth@ti.com>,
	Tony Lindgren <tony@atomide.com>, Dave Gerlach <d-gerlach@ti.com>,
	Vibhore Vardhan <vibhore@ti.com>, Georgi Vlaev <g-vlaev@ti.com>,
	Roger Quadros <rogerq@kernel.org>
Subject: Re: [PATCH V6 3/4] firmware: ti_sci: Allocate memory for Low Power Modes
Date: Thu, 3 Aug 2023 21:27:10 +0530	[thread overview]
Message-ID: <20230803155710.fivxx7hufuravcdr@dhruva> (raw)
In-Reply-To: <7c12b109-d6b9-f0d4-cada-28140a33da21@ti.com>

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 <d-gerlach@ti.com>
> > 
> > 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 <d-gerlach@ti.com>
> > Signed-off-by: Vibhore Vardhan <vibhore@ti.com>
> > Signed-off-by: Georgi Vlaev <g-vlaev@ti.com>
> > Tested-by: Roger Quadros <rogerq@kernel.org>
> > [d-gole@ti.com: Use dma_alloc_attrs instead of dma_alloc_coherent]
> > Signed-off-by: Dhruva Gole <d-gole@ti.com>
> > ---
> >   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 <d-gole@ti.com>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2023-08-03 15:57 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-03  6:42 [PATCH V6 0/4] firmware: ti_sci: Introduce system suspend support Dhruva Gole
2023-08-03  6:42 ` [PATCH V6 1/4] firmware: ti_sci: Introduce Power Management Ops Dhruva Gole
2023-08-03 15:14   ` Andrew Davis
2023-08-03 15:42     ` Dhruva Gole
2023-08-03 15:57       ` Andrew Davis
2023-08-03  6:42 ` [PATCH V6 2/4] firmware: ti_sci: Add support for querying the firmware caps Dhruva Gole
2023-08-03 15:21   ` Andrew Davis
2023-08-03  6:42 ` [PATCH V6 3/4] firmware: ti_sci: Allocate memory for Low Power Modes Dhruva Gole
2023-08-03 15:23   ` Andrew Davis
2023-08-03 15:57     ` Dhruva Gole [this message]
2023-08-03  6:42 ` [PATCH V6 4/4] firmware: ti_sci: Introduce system suspend resume support Dhruva Gole
2023-08-03 15:26   ` Andrew Davis
2023-08-03 15:55     ` Dhruva Gole
2023-08-03 16:00       ` Andrew Davis
2023-08-03 16:08         ` Dhruva Gole
2023-08-07 21:57           ` Kevin Hilman
2023-08-08 11:54             ` Dhruva Gole
2023-08-09  0:20               ` Kevin Hilman
2023-08-09  7:23                 ` Tony Lindgren
2023-08-09 17:37                   ` Kevin Hilman
2023-08-03 15:18 ` [PATCH V6 0/4] firmware: ti_sci: Introduce system suspend support Andrew Davis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230803155710.fivxx7hufuravcdr@dhruva \
    --to=d-gole@ti.com \
    --cc=afd@ti.com \
    --cc=d-gerlach@ti.com \
    --cc=g-vlaev@ti.com \
    --cc=kristo@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=praneeth@ti.com \
    --cc=rogerq@kernel.org \
    --cc=ssantosh@kernel.org \
    --cc=tony@atomide.com \
    --cc=vibhore@ti.com \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox