<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/i2c/i2c-dev.c, branch v4.7</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.7</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.7'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2016-05-28T15:37:42Z</updated>
<entry>
<title>i2c: dev: use after free in detach</title>
<updated>2016-05-28T15:37:42Z</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2016-05-28T05:01:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e6be18f6d62c1d3b331ae020b76a29c2ccf6b0bf'/>
<id>urn:sha1:e6be18f6d62c1d3b331ae020b76a29c2ccf6b0bf</id>
<content type='text'>
The call to put_i2c_dev() frees "i2c_dev" so there is a use after
free when we call cdev_del(&amp;i2c_dev-&gt;cdev).

Fixes: d6760b14d4a1 ('i2c: dev: switch from register_chrdev to cdev API')
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
</content>
</entry>
<entry>
<title>i2c: dev: don't start function name with 'return'</title>
<updated>2016-05-27T11:13:01Z</updated>
<author>
<name>Wolfram Sang</name>
<email>wsa@the-dreams.de</email>
</author>
<published>2016-05-27T11:13:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=72a71f869c95dc11b73f09fe18c593d4a0618c3f'/>
<id>urn:sha1:72a71f869c95dc11b73f09fe18c593d4a0618c3f</id>
<content type='text'>
I stumbled multiple times over 'return_i2c_dev', especially before the
actual 'return res'. It makes the code hard to read, so reanme the
function to 'put_i2c_dev' which also better matches 'get_free_i2c_dev'.

Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
</content>
</entry>
<entry>
<title>i2c: dev: switch from register_chrdev to cdev API</title>
<updated>2016-05-26T19:18:57Z</updated>
<author>
<name>Erico Nunes</name>
<email>erico.nunes@datacom.ind.br</email>
</author>
<published>2016-05-03T18:45:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d6760b14d4a1243f918d983bba1e35c5a5cd5a6d'/>
<id>urn:sha1:d6760b14d4a1243f918d983bba1e35c5a5cd5a6d</id>
<content type='text'>
i2c-dev had never moved away from the older register_chrdev interface to
implement its char device registration. The register_chrdev API has the
limitation of enabling only up to 256 i2c-dev busses to exist.

Large platforms with lots of i2c devices (i.e. pluggable transceivers)
with dedicated busses may have to exceed that limit.
In particular, there are also platforms making use of the i2c bus
multiplexing API, which instantiates a virtual bus for each possible
multiplexed selection.

This patch removes the register_chrdev usage and replaces it with the
less old cdev API, which takes away the 256 i2c-dev bus limitation.
It should not have any other impact for i2c bus drivers or user space.

This patch has been tested on qemu x86 and qemu powerpc platforms with
the aid of a module which adds and removes 5000 virtual i2c busses, as
well as validated on an existing powerpc hardware platform which makes
use of the i2c bus multiplexing API.
i2c-dev busses with device minor numbers larger than 256 have also been
validated to work with the existing i2c-tools.

Signed-off-by: Erico Nunes &lt;erico.nunes@datacom.ind.br&gt;
[wsa: kept includes sorted]
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
</content>
</entry>
<entry>
<title>i2c: i2c-dev: sort includes</title>
<updated>2016-02-20T22:33:38Z</updated>
<author>
<name>Wolfram Sang</name>
<email>wsa@the-dreams.de</email>
</author>
<published>2016-02-20T22:33:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a87660737f66123acf2f0dd2e5994e91b95a2351'/>
<id>urn:sha1:a87660737f66123acf2f0dd2e5994e91b95a2351</id>
<content type='text'>
I request this for drivers, so the core should adhere to sorted includes as
well.

Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
</content>
</entry>
<entry>
<title>i2c-dev: Fix I2C_SLAVE ioctl comment</title>
<updated>2015-10-23T21:26:44Z</updated>
<author>
<name>Jean Delvare</name>
<email>jdelvare@suse.de</email>
</author>
<published>2015-09-11T09:27:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9e685c84c266582ad002311497684f183db6b937'/>
<id>urn:sha1:9e685c84c266582ad002311497684f183db6b937</id>
<content type='text'>
The first part of the comment is wrong since November 2007, delete it.

The second part of the comment is related to I2C_PEC, not I2C_SLAVE, so
move it where it belongs.

Signed-off-by: Jean Delvare &lt;jdelvare@suse.de&gt;
Cc: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
</content>
</entry>
<entry>
<title>i2c-dev: Fix typo in ioctl name reference</title>
<updated>2015-10-23T21:26:43Z</updated>
<author>
<name>Jean Delvare</name>
<email>jdelvare@suse.de</email>
</author>
<published>2015-09-08T09:05:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c57d3e7a9391c03ae7ee5572be850284393f5bef'/>
<id>urn:sha1:c57d3e7a9391c03ae7ee5572be850284393f5bef</id>
<content type='text'>
The ioctl is named I2C_RDWR for "I2C read/write". But references to it
were misspelled "rdrw". Fix them.

Signed-off-by: Jean Delvare &lt;jdelvare@suse.de&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
</content>
</entry>
<entry>
<title>i2c: remove FSF address</title>
<updated>2014-11-07T17:35:33Z</updated>
<author>
<name>Wolfram Sang</name>
<email>wsa+renesas@sang-engineering.com</email>
</author>
<published>2014-11-04T22:46:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ca1f8da9ac5ce6e63d8f6933f83fabc1f3f961f4'/>
<id>urn:sha1:ca1f8da9ac5ce6e63d8f6933f83fabc1f3f961f4</id>
<content type='text'>
We have a central copy of the GPL for that. Some addresses were already
outdated.

Signed-off-by: Wolfram Sang &lt;wsa+renesas@sang-engineering.com&gt;
</content>
</entry>
<entry>
<title>i2c: i2c-dev: Create 'name' attribute automatically</title>
<updated>2013-09-30T04:02:31Z</updated>
<author>
<name>Guenter Roeck</name>
<email>linux@roeck-us.net</email>
</author>
<published>2013-09-27T02:36:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=45f176aea60e9fe8c5fdf8e5c90e5c50c264d86f'/>
<id>urn:sha1:45f176aea60e9fe8c5fdf8e5c90e5c50c264d86f</id>
<content type='text'>
The 'name' attribute is needed for all i2c-dev class devices, meaning
it can be created automatically by pointing to it in the class data
structure. This simplifies the code and reduces the probability for race
conditions (the name attribute should exist by the time the device is
announced to user space).

Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
</content>
</entry>
<entry>
<title>new helper: file_inode(file)</title>
<updated>2013-02-23T04:31:31Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2013-01-23T22:07:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=496ad9aa8ef448058e36ca7a787c61f2e63f0f54'/>
<id>urn:sha1:496ad9aa8ef448058e36ca7a787c61f2e63f0f54</id>
<content type='text'>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>i2c-dev: Add support for I2C_M_RECV_LEN</title>
<updated>2012-05-30T08:55:34Z</updated>
<author>
<name>Jean Delvare</name>
<email>khali@linux-fr.org</email>
</author>
<published>2012-05-30T08:55:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=838bfa6049fb84dc66c9c9bbeb3a968ec987fd3d'/>
<id>urn:sha1:838bfa6049fb84dc66c9c9bbeb3a968ec987fd3d</id>
<content type='text'>
As the bus driver side implementation of I2C_M_RECV_LEN is heavily
tied to SMBus, we can't support received length over 32 bytes, but
let's at least support that.

In practice, the caller will have to setup a buffer large enough to
cover the case where received length byte has value 32, so minimum
32 + 1 = 33 bytes, possibly more if there is a fixed number of bytes
added for the specific slave (for example a checksum.)

Signed-off-by: Jean Delvare &lt;khali@linux-fr.org&gt;
Tested-by: Douglas Gilbert &lt;dgilbert@interlog.com&gt;
</content>
</entry>
</feed>
