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] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAA+hA=SHgp1jZn1Qwrcu3fMnn22aaVimS4+Y2hPcWehS4zdRoA@mail.gmail.com>
Date:   Thu, 23 Jun 2022 00:42:51 +0800
From:   Dong Aisheng <dongas86@...il.com>
To:     Mark Brown <broonie@...nel.org>
Cc:     Aisheng Dong <aisheng.dong@....com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "l.stach@...gutronix.de" <l.stach@...gutronix.de>,
        Peng Fan <peng.fan@....com>,
        "shawnguo@...nel.org" <shawnguo@...nel.org>
Subject: Re: [PATCH RFC 1/2] regmap: add option to disable debugfs

On Thu, Jun 23, 2022 at 12:27 AM Mark Brown <broonie@...nel.org> wrote:

> > > > -       WARN_ON(map->cache_bypass && enable);
> > > > +//     WARN_ON(map->cache_bypass && enable);
>
> > > What is the purpose of this change?  Why would the combination of cache
> > > only and bypass modes work be a good idea, and how should things behave
> > > in that case?
>
> > Because without this change, there will be a kernel dump caused by
> > WARN_ON when drivers call regcache_cache_only(map, true) after power
> > is off. There's no cache used in the imx blkctl driver. So map->cache_bypass
> > is default to true.
>
> cache_bypass is only going to be true if something enabled bypass, why
> would a device that doesn't use a cache enable bypass?  It does get
> turned on transiently by things like patching but those only make sense
> if the device can be accessed so caceh_only shouldn't be on then.

It was enabled by default according to the code:
__regmap_init -> regcache_init

int regcache_init(struct regmap *map, const struct regmap_config *config)
{
        int ret;
        int i;
        void *tmp_buf;

        if (map->cache_type == REGCACHE_NONE) {
                if (config->reg_defaults || config->num_reg_defaults_raw)
                        dev_warn(map->dev,
                                 "No cache used with register defaults set!\n");

                map->cache_bypass = true;
                return 0;
        }
}

Regards
Aisheng

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ