[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5fa1e99f1b9097336a3e610dc383170f09036b14.camel@mediatek.com>
Date: Mon, 13 Sep 2021 13:55:38 +0800
From: Trevor Wu <trevor.wu@...iatek.com>
To: Mark Brown <broonie@...nel.org>
CC: <tiwai@...e.com>, <matthias.bgg@...il.com>,
<alsa-devel@...a-project.org>,
<linux-mediatek@...ts.infradead.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>, <dan.carpenter@...cle.com>
Subject: Re: [PATCH v2] ASoC: mediatek: common: handle NULL case in
suspend/resume function
On Fri, 2021-09-10 at 11:23 +0100, Mark Brown wrote:
> On Fri, Sep 10, 2021 at 05:26:13PM +0800, Trevor Wu wrote:
>
> > When memory allocation for afe->reg_back_up fails, reg_back_up
> > can't
> > be used.
> > Keep the suspend/resume flow but skip register backup when
> > afe->reg_back_up is NULL, in case illegal memory access happens.
>
> It seems like it'd be better to just allocate the buffer at probe
> time
> and fail in case we can't get it, I'd be surprised if there's many
> platforms using this hardware that don't also end up suspending and
> resuming.
Hi Mark,
Thanks for your suggestion.
I agree it's better to allocate the memory at probe time.
I think we can still keep the implementation in the suspend/resume
function as a fallback solution if user doesn't allocate the memory in
probe function.
In the new mediatek SOCs, regcache has been used to handle register
backup.
Do I need to add the buffer allocation on probe function to the
platform in which mtk_afe_suspend and mtk_afe_resume are used?
Thanks,
Trevor
Powered by blists - more mailing lists