<feed xmlns='http://www.w3.org/2005/Atom'>
<title>talos-obmc-linux/drivers/nvmem/core.c, branch dev-4.13</title>
<subtitle>Talos™ II Linux sources for OpenBMC</subtitle>
<id>https://git.raptorcs.com/git/talos-obmc-linux/atom?h=dev-4.13</id>
<link rel='self' href='https://git.raptorcs.com/git/talos-obmc-linux/atom?h=dev-4.13'/>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/'/>
<updated>2017-06-09T10:08:27+00:00</updated>
<entry>
<title>nvmem: core: add locking to nvmem_find_cell</title>
<updated>2017-06-09T10:08:27+00:00</updated>
<author>
<name>Heiner Kallweit</name>
<email>hkallweit1@gmail.com</email>
</author>
<published>2017-06-09T09:59:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/commit/?id=666d6a36234f3123e909165ac32ea692213f0155'/>
<id>urn:sha1:666d6a36234f3123e909165ac32ea692213f0155</id>
<content type='text'>
Adding entries to nvmem_cells and deleting entries from it is
protected by nvmem_cells_mutex. Therefore this mutex should
also protect iterating over the list.

Signed-off-by: Heiner Kallweit &lt;hkallweit1@gmail.com&gt;
Signed-off-by: Srinivas Kandagatla &lt;srinivas.kandagatla@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>nvmem: core: Call put_device() in nvmem_unregister()</title>
<updated>2017-06-09T10:08:27+00:00</updated>
<author>
<name>Andrey Smirnov</name>
<email>andrew.smirnov@gmail.com</email>
</author>
<published>2017-06-09T09:59:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/commit/?id=79fbf0468b2a05a743d31794423925d229c0e9c2'/>
<id>urn:sha1:79fbf0468b2a05a743d31794423925d229c0e9c2</id>
<content type='text'>
Call put_device() in nvmem_unregister() to make sure nvmem_release
gets called freeing up allocated resources.

Cc: cphealy@gmail.com
Cc: Srinivas Kandagatla &lt;srinivas.kandagatla@linaro.org&gt;
Cc: Maxime Ripard &lt;maxime.ripard@free-electrons.com&gt;
Signed-off-by: Andrey Smirnov &lt;andrew.smirnov@gmail.com&gt;
Signed-off-by: Srinivas Kandagatla &lt;srinivas.kandagatla@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>nvmem: core: fix leaks on registration errors</title>
<updated>2017-06-09T10:08:27+00:00</updated>
<author>
<name>Johan Hovold</name>
<email>johan@kernel.org</email>
</author>
<published>2017-06-09T09:59:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/commit/?id=3360acdf839170b612f5b212539694c20e3f16d0'/>
<id>urn:sha1:3360acdf839170b612f5b212539694c20e3f16d0</id>
<content type='text'>
Make sure to deregister and release the nvmem device and underlying
memory on registration errors.

Note that the private data must be freed using put_device() once the
struct device has been initialised.

Also note that there's a related reference leak in the deregistration
function as reported by Mika Westerberg which is being fixed separately.

Fixes: b6c217ab9be6 ("nvmem: Add backwards compatibility support for older EEPROM drivers.")
Fixes: eace75cfdcf7 ("nvmem: Add a simple NVMEM framework for nvmem providers")
Cc: stable &lt;stable@vger.kernel.org&gt;     # 4.3
Cc: Andrew Lunn &lt;andrew@lunn.ch&gt;
Cc: Srinivas Kandagatla &lt;srinivas.kandagatla@linaro.org&gt;
Cc: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
Acked-by: Andrey Smirnov &lt;andrew.smirnov@gmail.com&gt;
Signed-off-by: Srinivas Kandagatla &lt;srinivas.kandagatla@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>nvmem: core: Allow allocating several anonymous nvmem devices</title>
<updated>2017-04-08T15:51:48+00:00</updated>
<author>
<name>Aban Bedel</name>
<email>albeu@free.fr</email>
</author>
<published>2017-03-31T12:44:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/commit/?id=5253193d5479006b14dbe475740d031ce3e01570'/>
<id>urn:sha1:5253193d5479006b14dbe475740d031ce3e01570</id>
<content type='text'>
Currently the nvmem core expect the config to provide a name and ID
that are then used to create the device name. When no device name is
given 'nvmem' is used. However if there is several such anonymous
devices they all get named 'nvmem0', which doesn't work.

To fix this problem use the ID from the config only when the config
also provides a name. When no name is provided take the uinque ID of
the nvmem device instead.

Signed-off-by: Aban Bedel &lt;albeu@free.fr&gt;
Reviewed-by: Moritz Fischer &lt;mdf@kernel.org&gt;
Signed-off-by: Srinivas Kandagatla &lt;srinivas.kandagatla@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>nvmem: core: Allow getting nvmem cell with a NULL cell id</title>
<updated>2017-01-25T10:49:39+00:00</updated>
<author>
<name>Vivek Gautam</name>
<email>vivek.gautam@codeaurora.org</email>
</author>
<published>2017-01-22T23:02:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/commit/?id=fd0c478c0dd800449e2d70025ef742679a16a8de'/>
<id>urn:sha1:fd0c478c0dd800449e2d70025ef742679a16a8de</id>
<content type='text'>
The nvmem cell with a NULL cell name/id should be the one
with no accompanying 'nvmem-cell-names' property, and thus
will be the cell at index 0 in the device tree.
So, we default to index 0 and update the cell index only when
nvmem cell name id exists.

Suggested-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
Signed-off-by: Vivek Gautam &lt;vivek.gautam@codeaurora.org&gt;
Reviewed-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
Signed-off-by: Srinivas Kandagatla &lt;srinivas.kandagatla@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>nvmem: core: Correct a bunch of function documentations</title>
<updated>2017-01-25T10:49:39+00:00</updated>
<author>
<name>Vivek Gautam</name>
<email>vivek.gautam@codeaurora.org</email>
</author>
<published>2017-01-22T23:02:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/commit/?id=29143268ec7d292ae4531bdf8deb6e55239a0051'/>
<id>urn:sha1:29143268ec7d292ae4531bdf8deb6e55239a0051</id>
<content type='text'>
Correct the documentation for arguments to a number
of functions.

Signed-off-by: Vivek Gautam &lt;vivek.gautam@codeaurora.org&gt;
Signed-off-by: Srinivas Kandagatla &lt;srinivas.kandagatla@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>nvmem: core: Allow ignoring length when reading a cell</title>
<updated>2017-01-25T10:49:39+00:00</updated>
<author>
<name>Vivek Gautam</name>
<email>vivek.gautam@codeaurora.org</email>
</author>
<published>2017-01-22T23:02:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/commit/?id=3b4a687726f0019115bd903d9724db6cdcbb00fe'/>
<id>urn:sha1:3b4a687726f0019115bd903d9724db6cdcbb00fe</id>
<content type='text'>
nvmem_cell_read() API fills in the argument 'len' with
the number of bytes read from the cell. Many users don't
care about this length value. So allow users to pass a
NULL pointer to this len field.

Signed-off-by: Vivek Gautam &lt;vivek.gautam@codeaurora.org&gt;
Reviewed-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
Signed-off-by: Srinivas Kandagatla &lt;srinivas.kandagatla@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>nvmem: fix nvmem_cell_read() return type doc</title>
<updated>2017-01-04T17:22:47+00:00</updated>
<author>
<name>Brian Norris</name>
<email>briannorris@chromium.org</email>
</author>
<published>2017-01-04T16:18:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/commit/?id=b577fafc4366eb82334518c552912652328c74fa'/>
<id>urn:sha1:b577fafc4366eb82334518c552912652328c74fa</id>
<content type='text'>
nvmem_cell_read() returns void *, not char *. This is a cleanup that got
left out of commit a6c50912508d ("nvmem: Declare nvmem_cell_read()
consistently").

Signed-off-by: Brian Norris &lt;briannorris@chromium.org&gt;
Fixes: a6c50912508d ("nvmem: Declare nvmem_cell_read() consistently")
Signed-off-by: Srinivas Kandagatla &lt;srinivas.kandagatla@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>remove lots of IS_ERR_VALUE abuses</title>
<updated>2016-05-27T22:26:11+00:00</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2016-05-27T21:23:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/commit/?id=287980e49ffc0f6d911601e7e352a812ed27768e'/>
<id>urn:sha1:287980e49ffc0f6d911601e7e352a812ed27768e</id>
<content type='text'>
Most users of IS_ERR_VALUE() in the kernel are wrong, as they
pass an 'int' into a function that takes an 'unsigned long'
argument. This happens to work because the type is sign-extended
on 64-bit architectures before it gets converted into an
unsigned type.

However, anything that passes an 'unsigned short' or 'unsigned int'
argument into IS_ERR_VALUE() is guaranteed to be broken, as are
8-bit integers and types that are wider than 'unsigned long'.

Andrzej Hajda has already fixed a lot of the worst abusers that
were causing actual bugs, but it would be nice to prevent any
users that are not passing 'unsigned long' arguments.

This patch changes all users of IS_ERR_VALUE() that I could find
on 32-bit ARM randconfig builds and x86 allmodconfig. For the
moment, this doesn't change the definition of IS_ERR_VALUE()
because there are probably still architecture specific users
elsewhere.

Almost all the warnings I got are for files that are better off
using 'if (err)' or 'if (err &lt; 0)'.
The only legitimate user I could find that we get a warning for
is the (32-bit only) freescale fman driver, so I did not remove
the IS_ERR_VALUE() there but changed the type to 'unsigned long'.
For 9pfs, I just worked around one user whose calling conventions
are so obscure that I did not dare change the behavior.

I was using this definition for testing:

 #define IS_ERR_VALUE(x) ((unsigned long*)NULL == (typeof (x)*)NULL &amp;&amp; \
       unlikely((unsigned long long)(x) &gt;= (unsigned long long)(typeof(x))-MAX_ERRNO))

which ends up making all 16-bit or wider types work correctly with
the most plausible interpretation of what IS_ERR_VALUE() was supposed
to return according to its users, but also causes a compile-time
warning for any users that do not pass an 'unsigned long' argument.

I suggested this approach earlier this year, but back then we ended
up deciding to just fix the users that are obviously broken. After
the initial warning that caused me to get involved in the discussion
(fs/gfs2/dir.c) showed up again in the mainline kernel, Linus
asked me to send the whole thing again.

[ Updated the 9p parts as per Al Viro  - Linus ]

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: Andrzej Hajda &lt;a.hajda@samsung.com&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Link: https://lkml.org/lkml/2016/1/7/363
Link: https://lkml.org/lkml/2016/5/27/486
Acked-by: Srinivas Kandagatla &lt;srinivas.kandagatla@linaro.org&gt; # For nvmem part
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>nvmem: core: remove regmap dependency</title>
<updated>2016-05-01T21:01:00+00:00</updated>
<author>
<name>Srinivas Kandagatla</name>
<email>srinivas.kandagatla@linaro.org</email>
</author>
<published>2016-04-24T19:28:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/commit/?id=795ddd18d38f9762fbfefceab9aa16caef0cf431'/>
<id>urn:sha1:795ddd18d38f9762fbfefceab9aa16caef0cf431</id>
<content type='text'>
nvmem uses regmap_raw_read/write apis to read/write data from providers,
regmap raw apis stopped working with recent kernels which removed raw
accessors on mmio bus. This resulted in broken nvmem for providers
which are based on regmap mmio bus. This issue can be fixed temporarly
by moving to other regmap apis, but we might hit same issue in future.
Moving to interfaces based on read/write callbacks from providers would
be more robust.

This patch removes regmap dependency from nvmem and introduces
read/write callbacks from the providers.

Without this patch nvmem providers like qfprom based on regmap mmio
bus would not work.

Reported-by: Rajendra Nayak &lt;rjendra@qti.qualcomm.com&gt;
Signed-off-by: Srinivas Kandagatla &lt;srinivas.kandagatla@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
