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=SsTeTF80dL6cT6Ef7Y9Q3Fhj4Jp0S-_nk=UK1HsZ4hYw@mail.gmail.com>
Date:   Thu, 23 Jun 2022 01:01:12 +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:48 AM Mark Brown <broonie@...nel.org> wrote:
>
> On Thu, Jun 23, 2022 at 12:42:51AM +0800, Dong Aisheng wrote:
> > On Thu, Jun 23, 2022 at 12:27 AM Mark Brown <broonie@...nel.org> wrote:
>
> > > 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
>
> Ah, right.  That makes sense - we should relax the check to only apply
> if there is actually a cache.

If we don't remove the WARN_ON in regcache_cache_only(), how
would you suggest the fix?
Otherwise we can't call regcache_cache_only() for imx blkctl which does not
have a cache.

diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c
index 2eaffd3224c9..da1702fd57cc 100644
--- a/drivers/base/regmap/regcache.c
+++ b/drivers/base/regmap/regcache.c
@@ -495,7 +495,7 @@ EXPORT_SYMBOL_GPL(regcache_drop_region);
 void regcache_cache_only(struct regmap *map, bool enable)
 {
        map->lock(map->lock_arg);
-       WARN_ON(map->cache_bypass && enable);
+//     WARN_ON(map->cache_bypass && enable);
        map->cache_only = enable;
        trace_regmap_cache_only(map, enable);
        map->unlock(map->lock_arg);

Regards
Aisheng

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ