<feed xmlns='http://www.w3.org/2005/Atom'>
<title>litmus-rt.git/drivers/i2c, branch wip-kernthreads</title>
<subtitle>The LITMUS^RT kernel.</subtitle>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/litmus-rt.git/'/>
<entry>
<title>i2c-imx: do not allow interruptions when waiting for I2C to complete</title>
<updated>2010-10-18T00:29:04+00:00</updated>
<author>
<name>Marc Kleine-Budde</name>
<email>mkl@pengutronix.de</email>
</author>
<published>2010-06-21T07:27:05+00:00</published>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/litmus-rt.git/commit/?id=e39428d53d080ad2615b772d7f99d2a70c2aaab2'/>
<id>e39428d53d080ad2615b772d7f99d2a70c2aaab2</id>
<content type='text'>
The i2c_imx_trx_complete() function is using
wait_event_interruptible_timeout() to wait for the I2C controller to
signal that it has completed an I2C bus operation. If the process that
causes the I2C operation receives a signal, the wait will be
interrupted, returning an error. It is better to let the I2C operation
finished before handling the signal (i.e. returning into userspace).

It is safe to use wait_event_timeout() instead, because the timeout
will allow the process to exit if the I2C bus hangs. It's also better
to allow the I2C operation to finish, because unacknowledged I2C
operations can cause the I2C bus to hang.

Signed-off-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
Reviewed-by: Wolfram Sang &lt;w.sang@pengutronix.de&gt;
Signed-off-by: Ben Dooks &lt;ben-linux@fluff.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The i2c_imx_trx_complete() function is using
wait_event_interruptible_timeout() to wait for the I2C controller to
signal that it has completed an I2C bus operation. If the process that
causes the I2C operation receives a signal, the wait will be
interrupted, returning an error. It is better to let the I2C operation
finished before handling the signal (i.e. returning into userspace).

It is safe to use wait_event_timeout() instead, because the timeout
will allow the process to exit if the I2C bus hangs. It's also better
to allow the I2C operation to finish, because unacknowledged I2C
operations can cause the I2C bus to hang.

Signed-off-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
Reviewed-by: Wolfram Sang &lt;w.sang@pengutronix.de&gt;
Signed-off-by: Ben Dooks &lt;ben-linux@fluff.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>i2c-davinci: Fix TX setup for more SoCs</title>
<updated>2010-10-18T00:25:33+00:00</updated>
<author>
<name>Jon Povey</name>
<email>jon.povey@racelogic.co.uk</email>
</author>
<published>2010-10-12T04:47:05+00:00</published>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/litmus-rt.git/commit/?id=c5b4afec8e669bbe265daea24037fccfc42c4fe3'/>
<id>c5b4afec8e669bbe265daea24037fccfc42c4fe3</id>
<content type='text'>
This patch is an improvement to 4bba0fd8d1c6d405df666e2573e1a1f917098be0
which got to mainline a little early.

Sudhakar Rajashekhara explains that at least OMAP-L138 requires MDR mode
settings before DXR for correct behaviour, so load MDR first with
STT cleared and later load again with STT set.

Tested on DM355 connected to Techwell TW2836 and Wolfson WM8985

Signed-off-by: Jon Povey &lt;jon.povey@racelogic.co.uk&gt;
Acked-by: Troy Kisky &lt;troy.kisky@boundarydevices.com&gt;
Tested-by: Sudhakar Rajashekhara &lt;sudhakar.raj@ti.com&gt;
Acked-by: Kevin Hilman &lt;khilman@deeprootsystems.com&gt;
Signed-off-by: Ben Dooks &lt;ben-linux@fluff.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch is an improvement to 4bba0fd8d1c6d405df666e2573e1a1f917098be0
which got to mainline a little early.

Sudhakar Rajashekhara explains that at least OMAP-L138 requires MDR mode
settings before DXR for correct behaviour, so load MDR first with
STT cleared and later load again with STT set.

Tested on DM355 connected to Techwell TW2836 and Wolfson WM8985

Signed-off-by: Jon Povey &lt;jon.povey@racelogic.co.uk&gt;
Acked-by: Troy Kisky &lt;troy.kisky@boundarydevices.com&gt;
Tested-by: Sudhakar Rajashekhara &lt;sudhakar.raj@ti.com&gt;
Acked-by: Kevin Hilman &lt;khilman@deeprootsystems.com&gt;
Signed-off-by: Ben Dooks &lt;ben-linux@fluff.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging</title>
<updated>2010-10-07T20:44:30+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2010-10-07T20:44:30+00:00</published>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/litmus-rt.git/commit/?id=5672bc8181b189c05ccc29c692491500682a1b49'/>
<id>5672bc8181b189c05ccc29c692491500682a1b49</id>
<content type='text'>
* 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
  of/i2c: Fix module load order issue caused by of_i2c.c
  i2c: Fix checks which cause legacy suspend to never get called
  i2c-pca: Fix waitforcompletion() return value
  i2c: Fix for suspend/resume issue
  i2c: Remove obsolete cleanup for clientdata
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
  of/i2c: Fix module load order issue caused by of_i2c.c
  i2c: Fix checks which cause legacy suspend to never get called
  i2c-pca: Fix waitforcompletion() return value
  i2c: Fix for suspend/resume issue
  i2c: Remove obsolete cleanup for clientdata
</pre>
</div>
</content>
</entry>
<entry>
<title>i2c-s3c2410: fix calculation of SDA line delay</title>
<updated>2010-09-30T23:00:35+00:00</updated>
<author>
<name>MyungJoo Ham</name>
<email>myungjoo.ham@samsung.com</email>
</author>
<published>2010-09-30T13:54:46+00:00</published>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/litmus-rt.git/commit/?id=7031307aefb6048377385dbb0af2dd43bb0190bb'/>
<id>7031307aefb6048377385dbb0af2dd43bb0190bb</id>
<content type='text'>
S3C2440 style I2C controller uses PCLK to calculate the SDA line delay.
The driver wrongly assumed that this delay is calculated from the
frequency that the controller is operating on. This patch fixes this
issue.

Signed-off-by: MyungJoo Ham &lt;myungjoo.ham@samsung.com&gt;
Signed-off-by: Kyungmin Park &lt;kyungmin.park@samsung.com&gt;
Signed-off-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Signed-off-by: Ben Dooks &lt;ben-linux@fluff.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
S3C2440 style I2C controller uses PCLK to calculate the SDA line delay.
The driver wrongly assumed that this delay is calculated from the
frequency that the controller is operating on. This patch fixes this
issue.

Signed-off-by: MyungJoo Ham &lt;myungjoo.ham@samsung.com&gt;
Signed-off-by: Kyungmin Park &lt;kyungmin.park@samsung.com&gt;
Signed-off-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Signed-off-by: Ben Dooks &lt;ben-linux@fluff.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>of/i2c: Fix module load order issue caused by of_i2c.c</title>
<updated>2010-09-30T12:14:23+00:00</updated>
<author>
<name>Grant Likely</name>
<email>grant.likely@secretlab.ca</email>
</author>
<published>2010-09-30T12:14:23+00:00</published>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/litmus-rt.git/commit/?id=925bb9c649cf8d7200549b395f2ae291833dd494'/>
<id>925bb9c649cf8d7200549b395f2ae291833dd494</id>
<content type='text'>
Commit 959e85f7, "i2c: add OF-style registration and binding" caused a
module dependency loop where of_i2c.c calls functions in i2c-core, and
i2c-core calls of_i2c_register_devices() in of_i2c.  This means that
when i2c support is built as a module when CONFIG_OF is set, then
neither i2c_core nor of_i2c are able to be loaded.

This patch fixes the problem by moving the of_i2c_register_devices()
calls back into the device drivers.  Device drivers already
specifically request the core code to parse the device tree for
devices anyway by setting the of_node pointer, so it isn't a big
deal to also call the registration function.  The drivers just become
slightly more verbose.

Signed-off-by: Grant Likely &lt;grant.likely@secretlab.ca&gt;
Signed-off-by: Jean Delvare &lt;khali@linux-fr.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commit 959e85f7, "i2c: add OF-style registration and binding" caused a
module dependency loop where of_i2c.c calls functions in i2c-core, and
i2c-core calls of_i2c_register_devices() in of_i2c.  This means that
when i2c support is built as a module when CONFIG_OF is set, then
neither i2c_core nor of_i2c are able to be loaded.

This patch fixes the problem by moving the of_i2c_register_devices()
calls back into the device drivers.  Device drivers already
specifically request the core code to parse the device tree for
devices anyway by setting the of_node pointer, so it isn't a big
deal to also call the registration function.  The drivers just become
slightly more verbose.

Signed-off-by: Grant Likely &lt;grant.likely@secretlab.ca&gt;
Signed-off-by: Jean Delvare &lt;khali@linux-fr.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>i2c: Fix checks which cause legacy suspend to never get called</title>
<updated>2010-09-30T12:14:22+00:00</updated>
<author>
<name>Rajendra Nayak</name>
<email>rnayak@ti.com</email>
</author>
<published>2010-09-30T12:14:22+00:00</published>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/litmus-rt.git/commit/?id=64b4782fc9e4bdc59ae90897e2258e4ec938690e'/>
<id>64b4782fc9e4bdc59ae90897e2258e4ec938690e</id>
<content type='text'>
For devices which are not adapted to runtime PM a call to
pm_runtime_suspended always returns true.

Hence the pm_runtime_suspended checks below prevent legacy
suspend from getting called.

So do a pm_runtime_suspended check only for devices with a
dev_pm_ops populated (which hence do not rely on the legacy
suspend.)

Signed-off-by: Rajendra Nayak &lt;rnayak@ti.com&gt;
Acked-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
Cc: Ben Dooks &lt;ben-linux@fluff.org&gt;
Cc: Mark Brown &lt;broonie@opensource.wolfsonmicro.com&gt;
Cc: Kevin Hilman &lt;khilman@deeprootsystems.com&gt;
Signed-off-by: Jean Delvare &lt;khali@linux-fr.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For devices which are not adapted to runtime PM a call to
pm_runtime_suspended always returns true.

Hence the pm_runtime_suspended checks below prevent legacy
suspend from getting called.

So do a pm_runtime_suspended check only for devices with a
dev_pm_ops populated (which hence do not rely on the legacy
suspend.)

Signed-off-by: Rajendra Nayak &lt;rnayak@ti.com&gt;
Acked-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
Cc: Ben Dooks &lt;ben-linux@fluff.org&gt;
Cc: Mark Brown &lt;broonie@opensource.wolfsonmicro.com&gt;
Cc: Kevin Hilman &lt;khilman@deeprootsystems.com&gt;
Signed-off-by: Jean Delvare &lt;khali@linux-fr.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>i2c-pca: Fix waitforcompletion() return value</title>
<updated>2010-09-30T12:14:22+00:00</updated>
<author>
<name>Yegor Yefremov</name>
<email>yegor_sub1@visionsystems.de</email>
</author>
<published>2010-09-30T12:14:22+00:00</published>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/litmus-rt.git/commit/?id=6abb930af064fb1cf4177d32e2c7bfb89eee0fe5'/>
<id>6abb930af064fb1cf4177d32e2c7bfb89eee0fe5</id>
<content type='text'>
ret is still -1, if during the polling read_byte() returns at once
with I2C_PCA_CON_SI set. So ret &gt; 0 would lead *_waitforcompletion()
to return 0, in spite of the proper behavior.

The routine was rewritten, so that ret has always a proper value,
before returning.

Signed-off-by: Yegor Yefremov &lt;yegorslists@googlemail.com&gt;
Reviewed-by: Wolfram Sang &lt;w.sang@pengutronix.de&gt;
Cc: stable@kernel.org
Signed-off-by: Jean Delvare &lt;khali@linux-fr.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ret is still -1, if during the polling read_byte() returns at once
with I2C_PCA_CON_SI set. So ret &gt; 0 would lead *_waitforcompletion()
to return 0, in spite of the proper behavior.

The routine was rewritten, so that ret has always a proper value,
before returning.

Signed-off-by: Yegor Yefremov &lt;yegorslists@googlemail.com&gt;
Reviewed-by: Wolfram Sang &lt;w.sang@pengutronix.de&gt;
Cc: stable@kernel.org
Signed-off-by: Jean Delvare &lt;khali@linux-fr.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>i2c: Fix for suspend/resume issue</title>
<updated>2010-09-30T12:14:22+00:00</updated>
<author>
<name>Vishwanath BS</name>
<email>vishwanath.bs@ti.com</email>
</author>
<published>2010-09-30T12:14:22+00:00</published>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/litmus-rt.git/commit/?id=753419f59e10d7181e43f0b9cc5beff43ef3f7a4'/>
<id>753419f59e10d7181e43f0b9cc5beff43ef3f7a4</id>
<content type='text'>
In current i2c core driver, call to pm_runtime_set_active from
i2c_device_pm_resume will unconditionally enable i2c module and
increment child count of the parent. Because of this, in CPU Idle
path, i2c does not idle, preventing Core to enter retention. Also i2c
module will not be suspended upon system suspend as
pm_runtime_set_suspended is not called from i2c_device_pm_suspend.

This issue is fixed by removing pm_runtime_set_active call from resume
path which is not necessary.
This fix has been tested on OMAP4430.

Signed-off-by: Partha Basak &lt;p-basak2@ti.com&gt;
Signed-off-by: Vishwanath BS &lt;vishwanath.bs@ti.com&gt;
Acked-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
Cc: Kevin Hilman &lt;khilman@deeprootsystems.com&gt;
Cc: Ben Dooks &lt;ben-linux@fluff.org&gt;
Signed-off-by: Jean Delvare &lt;khali@linux-fr.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In current i2c core driver, call to pm_runtime_set_active from
i2c_device_pm_resume will unconditionally enable i2c module and
increment child count of the parent. Because of this, in CPU Idle
path, i2c does not idle, preventing Core to enter retention. Also i2c
module will not be suspended upon system suspend as
pm_runtime_set_suspended is not called from i2c_device_pm_suspend.

This issue is fixed by removing pm_runtime_set_active call from resume
path which is not necessary.
This fix has been tested on OMAP4430.

Signed-off-by: Partha Basak &lt;p-basak2@ti.com&gt;
Signed-off-by: Vishwanath BS &lt;vishwanath.bs@ti.com&gt;
Acked-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
Cc: Kevin Hilman &lt;khilman@deeprootsystems.com&gt;
Cc: Ben Dooks &lt;ben-linux@fluff.org&gt;
Signed-off-by: Jean Delvare &lt;khali@linux-fr.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>i2c-davinci: Fix race when setting up for TX</title>
<updated>2010-09-27T23:05:08+00:00</updated>
<author>
<name>Jon Povey</name>
<email>jon.povey@racelogic.co.uk</email>
</author>
<published>2010-09-17T03:02:11+00:00</published>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/litmus-rt.git/commit/?id=4bba0fd8d1c6d405df666e2573e1a1f917098be0'/>
<id>4bba0fd8d1c6d405df666e2573e1a1f917098be0</id>
<content type='text'>
When setting up to transmit, a race exists between the ISR and
i2c_davinci_xfer_msg() trying to load the first byte and adjust counters.
This is mostly visible for transmits &gt; 1 byte long.

The hardware starts sending immediately that MDR is loaded. IMR trickery
doesn't work because if we start sending, finish the first byte and an
XRDY event occurs before we load IMR to unmask it, we never get an
interrupt, and we timeout.

Move the MDR load after DXR,IMR loads to avoid this race without locking.

Tested on DM355 connected to Techwell TW2836 and Wolfson WM8985

Signed-off-by: Jon Povey &lt;jon.povey@racelogic.co.uk&gt;
Signed-off-by: Ben Dooks &lt;ben-linux@fluff.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When setting up to transmit, a race exists between the ISR and
i2c_davinci_xfer_msg() trying to load the first byte and adjust counters.
This is mostly visible for transmits &gt; 1 byte long.

The hardware starts sending immediately that MDR is loaded. IMR trickery
doesn't work because if we start sending, finish the first byte and an
XRDY event occurs before we load IMR to unmask it, we never get an
interrupt, and we timeout.

Move the MDR load after DXR,IMR loads to avoid this race without locking.

Tested on DM355 connected to Techwell TW2836 and Wolfson WM8985

Signed-off-by: Jon Povey &lt;jon.povey@racelogic.co.uk&gt;
Signed-off-by: Ben Dooks &lt;ben-linux@fluff.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>i2c-octeon: Return -ETIMEDOUT in octeon_i2c_wait() on timeout</title>
<updated>2010-09-27T22:21:16+00:00</updated>
<author>
<name>Bernhard Walle</name>
<email>walle@corscience.de</email>
</author>
<published>2010-09-27T10:55:16+00:00</published>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/litmus-rt.git/commit/?id=cc33e54290ed845904dac4b047934207738f0205'/>
<id>cc33e54290ed845904dac4b047934207738f0205</id>
<content type='text'>
It doesn't make sense to set result to -ETIMEDOUT but return 0 (success)
afterwards. Since there's code in octeon_i2c_start() to handle the
error, it should be called.

Signed-off-by: Bernhard Walle &lt;walle@corscience.de&gt;
Acked-by: David Daney &lt;ddaney@caviumnetworks.com&gt;
Signed-off-by: Ben Dooks &lt;ben-linux@fluff.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It doesn't make sense to set result to -ETIMEDOUT but return 0 (success)
afterwards. Since there's code in octeon_i2c_start() to handle the
error, it should be called.

Signed-off-by: Bernhard Walle &lt;walle@corscience.de&gt;
Acked-by: David Daney &lt;ddaney@caviumnetworks.com&gt;
Signed-off-by: Ben Dooks &lt;ben-linux@fluff.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
