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: <87twtnkkfu.wl%kuninori.morimoto.gx@renesas.com>
Date:	Thu, 2 Jul 2015 08:58:15 +0000
From:	Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>
To:	Lars-Peter Clausen <lars@...afoo.de>
CC:	Mark Brown <broonie@...nel.org>,
	Linux-Kernel <linux-kernel@...r.kernel.org>,
	Greg KH <gregkh@...uxfoundation.org>,
	shiiba <naoya.shiiba.nx@...esas.com>
Subject: Re: [PATCH 0/4][RFC] regmap: add force write option


Hi Lars

> > Current _regmap_update_bits() writes data to register if current value and
> > write value was different. This means it doesn't write data if the value was
> > same as current value.
> > But, some device needs to write data even though it was same value.
> 
> Can you go into more detail about the exact usecase with a specific example?

Some of our device registers need to be written data even though it was same as current value.
Otherwise, it doesn't work correctly.
Now, its device driver is using regmap. If my understanding was correct, regmap write
function will try to read current data. then it writes data if current data and
write data were not same. this behavior can reduce process, but we had trouble.

pseudo code of current regmap is

xxx regmap_xx_write(reg, new)
{
        old = xx_read(reg);

        if (old != new)
               xxx_write(reg, new);
}

We would like to have "force" write feature

xxx regmap_xx_write(reg, new, force)
{
        old = xx_read(reg);

        /*
         * we would like to write data
         * even though old == new here
         */

        if (force || (old != new))
               xxx_write(reg, new);
}


Best regards
---
Kuninori Morimoto
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ