<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/drivers/base/regmap/regmap-spi.c, branch 0x221E-v0.0.1-v6.19</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=0x221E-v0.0.1-v6.19</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=0x221E-v0.0.1-v6.19'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2024-06-05T21:23:52Z</updated>
<entry>
<title>regmap: spi: Fix potential off-by-one when calculating reserved size</title>
<updated>2024-06-05T21:23:52Z</updated>
<author>
<name>Andy Shevchenko</name>
<email>andy.shevchenko@gmail.com</email>
</author>
<published>2024-06-05T20:53:15Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=d4ea1d504d2701ba04412f98dc00d45a104c52ab'/>
<id>urn:sha1:d4ea1d504d2701ba04412f98dc00d45a104c52ab</id>
<content type='text'>
If we ever meet a hardware that uses weird register bits and padding,
we may end up in off-by-one error since x/8 + y/8 might not be equal
to (x + y)/8 in some cases.

bits    pad   x/8+y/8 (x+y)/8
4..7    0..3    0       0 // x + y from 4 up to 7
4..7    4..7    0       1 // x + y from 8 up to 11
4..7    8..11   1       1 // x + y from 12 up to 15
8..15   0..7    1       1 // x + y from 8 up to 15
8..15   8..15   2       2 // x + y from 16 up to 23

Fix this by using (x+y)/8.

Signed-off-by: Andy Shevchenko &lt;andy.shevchenko@gmail.com&gt;
Link: https://msgid.link/r/20240605205315.19132-1-andy.shevchenko@gmail.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>regmap: spi: Add missing MODULE_DESCRIPTION()</title>
<updated>2024-04-10T21:45:53Z</updated>
<author>
<name>Andy Shevchenko</name>
<email>andriy.shevchenko@linux.intel.com</email>
</author>
<published>2024-04-10T20:27:53Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=135cec6ba82ebffc0275c5228b4c4bf279fbf6f5'/>
<id>urn:sha1:135cec6ba82ebffc0275c5228b4c4bf279fbf6f5</id>
<content type='text'>
The modpost script is not happy

  WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/base/regmap/regmap-spi.o

because there is a missing module description.

Add it to the module.

Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Link: https://msgid.link/r/20240410202912.1659275-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>regmap: spi: Reserve space for register address/padding</title>
<updated>2022-08-18T14:02:05Z</updated>
<author>
<name>Cristian Ciocaltea</name>
<email>cristian.ciocaltea@collabora.com</email>
</author>
<published>2022-08-18T10:48:51Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=f5723cfc01932c7a8d5c78dbf7e067e537c91439'/>
<id>urn:sha1:f5723cfc01932c7a8d5c78dbf7e067e537c91439</id>
<content type='text'>
Currently the max_raw_read and max_raw_write limits in regmap_spi struct
do not take into account the additional size of the transmitted register
address and padding.  This may result in exceeding the maximum permitted
SPI message size, which could cause undefined behaviour, e.g. data
corruption.

Fix regmap_get_spi_bus() to properly adjust the above mentioned limits
by reserving space for the register address/padding as set in the regmap
configuration.

Fixes: f231ff38b7b2 ("regmap: spi: Set regmap max raw r/w from max_transfer_size")

Signed-off-by: Cristian Ciocaltea &lt;cristian.ciocaltea@collabora.com&gt;
Reviewed-by: Lucas Tanure &lt;tanureal@opensource.cirrus.com&gt;
Link: https://lore.kernel.org/r/20220818104851.429479-1-cristian.ciocaltea@collabora.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>regmap: spi: Set regmap max raw r/w from max_transfer_size</title>
<updated>2021-10-23T18:55:03Z</updated>
<author>
<name>Lucas Tanure</name>
<email>tanureal@opensource.cirrus.com</email>
</author>
<published>2021-10-21T13:27:21Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=f231ff38b7b23197013b437128d196710fe282da'/>
<id>urn:sha1:f231ff38b7b23197013b437128d196710fe282da</id>
<content type='text'>
Set regmap raw read/write from spi max_transfer_size
so regmap_raw_read/write can split the access into chunks

Signed-off-by: Lucas Tanure &lt;tanureal@opensource.cirrus.com&gt;
Reviewed-by: Charles Keepax &lt;ckeepax@opensource.cirrus.com&gt;
[André: fix build warning]
Signed-off-by: André Almeida &lt;andrealmeid@collabora.com&gt;
Link: https://lore.kernel.org/r/20211021132721.13669-1-andrealmeid@collabora.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>regmap: add proper SPDX identifiers on files that did not have them.</title>
<updated>2019-04-25T19:22:15Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2019-04-25T18:06:18Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=37613fa5b762a73073de3c2e23baa4a1da337e71'/>
<id>urn:sha1:37613fa5b762a73073de3c2e23baa4a1da337e71</id>
<content type='text'>
There were a few files in the regmap code that did not have SPDX
identifiers on them, so fix that up.  At the same time, remove the "free
form" text that specified the license of the file, as that is impossible
for any tool to properly parse.

Also, as Mark loves // comment markers, convert all of the headers to be
the same to make things look consistent :)

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>regmap: constify regmap_bus structures</title>
<updated>2017-08-14T16:36:29Z</updated>
<author>
<name>Julia Lawall</name>
<email>Julia.Lawall@lip6.fr</email>
</author>
<published>2017-08-11T06:57:36Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=9c2e5cb38da2202c6591efec631562116761521f'/>
<id>urn:sha1:9c2e5cb38da2202c6591efec631562116761521f</id>
<content type='text'>
These regmap_bus structures are only passed as the second argument to
__devm_regmap_init or __regmap_init, both of which are const, so the
regmap_bus structures can be const too.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall &lt;Julia.Lawall@lip6.fr&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>regmap: Move documentation to regmap.h</title>
<updated>2015-08-11T16:21:44Z</updated>
<author>
<name>Nicolas Boichat</name>
<email>drinkcat@chromium.org</email>
</author>
<published>2015-08-11T10:04:21Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=1ed8111443ae8caa455e7107031da36d1a6d351a'/>
<id>urn:sha1:1ed8111443ae8caa455e7107031da36d1a6d351a</id>
<content type='text'>
Init functions defined in regmap*.c files are now prefixed with
__, take lockdep key and class parameters, and should not be
called directly: move the documentation to regmap.h, where the
macros are defined.

Signed-off-by: Nicolas Boichat &lt;drinkcat@chromium.org&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>regmap: Use different lockdep class for each regmap init call</title>
<updated>2015-08-07T13:50:59Z</updated>
<author>
<name>Nicolas Boichat</name>
<email>drinkcat@chromium.org</email>
</author>
<published>2015-07-08T06:30:18Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=3cfe7a74d42b7e3644f8b2b26aa20146d4f90f0f'/>
<id>urn:sha1:3cfe7a74d42b7e3644f8b2b26aa20146d4f90f0f</id>
<content type='text'>
Lockdep validator complains about recursive locking and deadlock
when two different regmap instances are called in a nested order.
That happens anytime a regmap read/write call needs to access
another regmap.

This is because, for performance reason, lockdep groups all locks
initialized by the same mutex_init() in the same lock class.
Therefore all regmap mutexes are in the same lock class, leading
to lockdep "nested locking" warnings if a regmap accesses another
regmap.

In general, it is impossible to establish in advance the hierarchy
of regmaps, so we make sure that each regmap init call initializes
its own static lock_class_key. This is done by wrapping all
regmap_init calls into macros.

This also allows us to give meaningful names to the lock_class_key.
For example, in rt5677 case, we have in /proc/lockdep_chains:
irq_context: 0
[ffffffc0018d2198] &amp;dev-&gt;mutex
[ffffffc0018d2198] &amp;dev-&gt;mutex
[ffffffc001bd7f60] rt5677:5104:(&amp;rt5677_regmap)-&gt;_lock
[ffffffc001bd7f58] rt5677:5096:(&amp;rt5677_regmap_physical)-&gt;_lock
[ffffffc001b95448] &amp;(&amp;base-&gt;lock)-&gt;rlock

The above would have resulted in a lockdep recursive warning
previously. This is not the case anymore as the lockdep validator
now clearly identifies the 2 regmaps as separate.

Signed-off-by: Nicolas Boichat &lt;drinkcat@chromium.org&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>regmap: add DT endianness binding support.</title>
<updated>2014-08-16T21:56:23Z</updated>
<author>
<name>Xiubo Li</name>
<email>Li.Xiubo@freescale.com</email>
</author>
<published>2014-07-15T04:23:02Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=d647c199510c2c126ac03ecbea51086e10126a40'/>
<id>urn:sha1:d647c199510c2c126ac03ecbea51086e10126a40</id>
<content type='text'>
For many drivers which will support rich endianness of Devices
need define DT properties by itself with the binding support.

The endianness using regmap:
Index      Device     Properties if needs bytes-swap,
                      or just ignore it
-------------------------------------------------------------
1          BE         'big-endian'
2          LE         'little-endian'

The properties include all the register values and the buffers.
And these properties are very usful for the MMIO devices:

Such as: a memory-mapped device, on one SoC is in BE mode, while
in another SoC will be in LE mode, and the CPU will always in LE
mode.

For the first case, we must use cpu_to_be32/be32_to_cpu for
32-bit registers accessing, so the 'big-endian' property is needed.

For the second case, we can just ignore the bytes-swap
functions like cpu_to_le32/le32_to_cpu, so the 'little-endian'
property could be abscent.

And vice versa...

Signed-off-by: Xiubo Li &lt;Li.Xiubo@freescale.com&gt;
Signed-off-by: Mark Brown &lt;broonie@linaro.org&gt;
</content>
</entry>
<entry>
<title>drivers/base: delete non-required instances of include &lt;linux/init.h&gt;</title>
<updated>2014-02-14T22:31:37Z</updated>
<author>
<name>Paul Gortmaker</name>
<email>paul.gortmaker@windriver.com</email>
</author>
<published>2014-01-21T21:23:10Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=4272b9611c30f99f51590085998129480f2fe45e'/>
<id>urn:sha1:4272b9611c30f99f51590085998129480f2fe45e</id>
<content type='text'>
None of these files are actually using any __init type directives
and hence don't need to include &lt;linux/init.h&gt;.  Most are just a
left over from __devinit and __cpuinit removal, or simply due to
code getting copied from one driver to the next.

Cc: Len Brown &lt;len.brown@intel.com&gt;
Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
Acked-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Acked-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Acked-by: Mark Brown &lt;broonie@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
