lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 30 May 2017 09:55:13 -0700
From:   Doug Anderson <dianders@...omium.org>
To:     Andy Shevchenko <andy.shevchenko@...il.com>
Cc:     Mark Brown <broonie@...nel.org>, Vinod Koul <vinod.koul@...el.com>,
        Matthias Kaehlcke <mka@...omium.org>,
        Liam Girdwood <lgirdwood@...il.com>,
        Jaroslav Kysela <perex@...ex.cz>,
        Takashi Iwai <tiwai@...e.com>, colin.king@...onical.com,
        o-takashi@...amocchi.jp, sebastien.guiriec@...el.com,
        ALSA Development Mailing List <alsa-devel@...a-project.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH] ASoC: Intel: sst: Delete sst_save_shim64(); saved
 regs are never used

Hi,

On Sat, May 27, 2017 at 9:35 AM, Andy Shevchenko
<andy.shevchenko@...il.com> wrote:
> On Fri, May 26, 2017 at 7:34 PM, Douglas Anderson <dianders@...omium.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ