linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Doug Anderson <dianders@chromium.org>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Mark Brown <broonie@kernel.org>,
	Vinod Koul <vinod.koul@intel.com>,
	Matthias Kaehlcke <mka@chromium.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	colin.king@canonical.com, o-takashi@sakamocchi.jp,
	sebastien.guiriec@intel.com,
	ALSA Development Mailing List <alsa-devel@alsa-project.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH] ASoC: Intel: sst: Delete sst_save_shim64(); saved regs are never used
Date: Tue, 30 May 2017 09:55:13 -0700	[thread overview]
Message-ID: <CAD=FV=UOpPiEHoi9hcU7cDNwHrj74z4PSgeB8cAZ7VLg5en3xA@mail.gmail.com> (raw)
In-Reply-To: <CAHp75VezZESJQk4kacSk3OstewTa6OFvyGDY0ogyP3dsqUSVqA@mail.gmail.com>

Hi,

On Sat, May 27, 2017 at 9:35 AM, Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
> On Fri, May 26, 2017 at 7:34 PM, Douglas Anderson <dianders@chromium.org> wrote:
>> In commit 9a075265c6dc ("ASoC: Intel: sst: Remove unused function
>> sst_restore_shim64()"), we deleted the sst_restore_shim64() since it
>> was never used.  ...but a quick look at the code shows that we should
>> also be able to remove the sst_save_shim64() function and the
>> structure members we were storing data in.
>>
>> Note that the saving code (and the comments talking about how
>> important it is to do the save) has been around since
>> commit 336cfbb05edf ("ASoC: Intel: mrfld- add ACPI module").
>
> While I like "-" statistics, the below I think should be preserved if
> it's repeating real registers layout.
>
>>  struct sst_shim_regs64 {
>> -       u64 csr;
>>         u64 pisr;
>>         u64 pimr;
>>         u64 isrx;
>>         u64 isrd;
>> -       u64 imrx;
>>         u64 imrd;
>>         u64 ipcx;
>>         u64 ipcd;

Yup, it does seem to follow real hardware.  From the header file:

#define SST_CSR 0x00
#define SST_PISR 0x08
#define SST_PIMR 0x10
#define SST_ISRX 0x18
#define SST_ISRD 0x20
#define SST_IMRX 0x28
#define SST_IMRD 0x30
#define SST_IPCX 0x38 /* IPC IA -> SST */
#define SST_IPCD 0x40 /* IPC SST -> IA */
...

Thus, I'm happy to rework the patch to not delete the elements from
the structure.  Just for curiosity's sake, Let's see how much memory
that will waste (check how much these are used).

...umm, wait a second.  We don't even use the dang structure anymore!
So I guess an even cleaner solution is to totally delete
shim_regs64...  I'll send out a v2 with an even better diffstat and
with totally avoiding a devm allocation of a 136 byte structure.  :)

Posted a v2 here: https://patchwork.kernel.org/patch/9754923/

-Doug

      reply	other threads:[~2017-05-30 16:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-26 16:34 [RFC PATCH] ASoC: Intel: sst: Delete sst_save_shim64(); saved regs are never used Douglas Anderson
2017-05-27 16:35 ` Andy Shevchenko
2017-05-30 16:55   ` Doug Anderson [this message]

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='CAD=FV=UOpPiEHoi9hcU7cDNwHrj74z4PSgeB8cAZ7VLg5en3xA@mail.gmail.com' \
    --to=dianders@chromium.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=broonie@kernel.org \
    --cc=colin.king@canonical.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mka@chromium.org \
    --cc=o-takashi@sakamocchi.jp \
    --cc=perex@perex.cz \
    --cc=sebastien.guiriec@intel.com \
    --cc=tiwai@suse.com \
    --cc=vinod.koul@intel.com \
    /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;
as well as URLs for NNTP newsgroup(s).