Use usleep_range() with return value to implement time-bounded
wait-for hardware loop where delay is applicable; use ktime
instead of jiffies for a busy-wait loop.
Signed-off-by: Dmitry Antipov <dmitry.antipov(a)linaro.org>
---
drivers/i2c/busses/i2c-omap.c | 23 +++++++++++------------
1 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index fa23faa..401a622 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -49,8 +49,8 @@
#define OMAP_I2C_REV_ON_3430 0x3C
#define OMAP_I2C_REV_ON_3530_4430 0x40
-/* timeout waiting for the controller to respond */
-#define OMAP_I2C_TIMEOUT (msecs_to_jiffies(1000))
+/* timeout waiting for the controller to respond, in usecs */
+#define OMAP_I2C_TIMEOUT USEC_PER_SEC
/* For OMAP3 I2C_IV has changed to I2C_WE (wakeup enable) */
enum {
@@ -333,16 +333,16 @@ static int omap_i2c_init(struct omap_i2c_dev *dev)
omap_i2c_write_reg(dev, OMAP_I2C_SYSC_REG, SYSC_SOFTRESET_MASK);
/* For some reason we need to set the EN bit before the
* reset done bit gets set. */
- timeout = jiffies + OMAP_I2C_TIMEOUT;
+ timeout = 0;
omap_i2c_write_reg(dev, OMAP_I2C_CON_REG, OMAP_I2C_CON_EN);
while (!(omap_i2c_read_reg(dev, OMAP_I2C_SYSS_REG) &
SYSS_RESETDONE_MASK)) {
- if (time_after(jiffies, timeout)) {
+ if (timeout > OMAP_I2C_TIMEOUT) {
dev_warn(dev->dev, "timeout waiting "
"for controller reset\n");
return -ETIMEDOUT;
}
- msleep(1);
+ timeout += usleep_range(1000, 2000);
}
/* SYSC register is cleared by the reset; rewrite it */
@@ -498,15 +498,14 @@ static int omap_i2c_init(struct omap_i2c_dev *dev)
*/
static int omap_i2c_wait_for_bb(struct omap_i2c_dev *dev)
{
- unsigned long timeout;
+ unsigned long timeout = 0;
- timeout = jiffies + OMAP_I2C_TIMEOUT;
while (omap_i2c_read_reg(dev, OMAP_I2C_STAT_REG) & OMAP_I2C_STAT_BB) {
- if (time_after(jiffies, timeout)) {
+ if (timeout > OMAP_I2C_TIMEOUT) {
dev_warn(dev->dev, "timeout waiting for bus ready\n");
return -ETIMEDOUT;
}
- msleep(1);
+ timeout += usleep_range(1000, 2000);
}
return 0;
@@ -564,13 +563,13 @@ static int omap_i2c_xfer_msg(struct i2c_adapter *adap,
* Don't write stt and stp together on some hardware.
*/
if (dev->b_hw && stop) {
- unsigned long delay = jiffies + OMAP_I2C_TIMEOUT;
+ ktime_t start = ktime_get();
u16 con = omap_i2c_read_reg(dev, OMAP_I2C_CON_REG);
while (con & OMAP_I2C_CON_STT) {
con = omap_i2c_read_reg(dev, OMAP_I2C_CON_REG);
/* Let the user know if i2c is in a bad state */
- if (time_after(jiffies, delay)) {
+ if (ktime_us_delta(ktime_get(), start) > OMAP_I2C_TIMEOUT) {
dev_err(dev->dev, "controller timed out "
"waiting for start condition to finish\n");
return -ETIMEDOUT;
@@ -588,7 +587,7 @@ static int omap_i2c_xfer_msg(struct i2c_adapter *adap,
* into arbitration and we're currently unable to recover from it.
*/
r = wait_for_completion_timeout(&dev->cmd_complete,
- OMAP_I2C_TIMEOUT);
+ usecs_to_jiffies(OMAP_I2C_TIMEOUT));
dev->buf_len = 0;
if (r < 0)
return r;
--
1.7.7.5
Hello
please find below the summary of the status from OCTO for the wk02.2012.
The full report is in
https://wiki.linaro.org/OfficeofCTO/WeeklyReport
The last meeting minutes can be found in
https://wiki.linaro.org/OfficeofCTO/2012-01-10
Highlights
- ARMHF: more than 90% of the debian archive now built. In particular
from last week, webkit was ported (it will enable building kde/gnome).
Also ruby 1.9.1 has been uploaded yesterday (there are still some
testcases failing but the package has been uploaded). Gnat compiler
(ADA) is in progress.
Latest info is that Gnome 3 almost entirely built, except for
gnome-shell which is blocked because of gjs. KDE4 building now.
- Arm server: Working on technical requirements
(https://docs.google.com/a/linaro.org/document/d/1s8OdPu1Kw1YfvDmpFg_rHGYp6S…)
- PLEASE NOTE this is work in progress still.
Upcoming deliverables
ARMHF
-
https://blueprints.launchpad.net/linaro-ubuntu/+spec/armhf-images-enablement
is expected to be done in 12.01 by Platform team
- Once this is done, then running benchmarks on Lava will be facilitated
https://blueprints.launchpad.net/linaro-octo-armhf/+spec/linaro-octo-armhf-….
This is still blocked due to
https://bugs.launchpad.net/offspring/+bug/892240 which should be fixed
for the images to be created (see previous bullet point)
The risk is that rerunning benchmarks on LAVA (as opposed to by hand)
may not be possible for 12.01 due to the time shortage and dependencies.
Best regards
--
Ilias Biris ilias.biris(a)linaro.org
Project Manager, Linaro
M: +358504839608, IRC: ibiris Skype: ilias_biris
Linaro.org│ Open source software for ARM SoCs
Hello everybody,
I'm struggling to find a way of booting an armv7 fs compiled with poky /
yocto. I found some resources on the internet but none proved to be
successful for me. Would you be so kind and provide me some infos upon
this topic?
I would be so grateful if anybody could explain me the boot process, and
if anybody managed to boot an armv7, what kernel did he use, how did he
compiled it and so on. Is there a simply way to boot this? Something like:
qemu-system-arm -kernel
/home/xxx/work/yyy/yocto/2012-01-08-14-57/tmp/deploy/images/zImage-qemuarmv7.bin
-net nic,vlan=0 -net tap,vlan=0,ifname=tap0,script=no,downscript=no -M
vexpress-a9 -hda
/home/xxx/work/yyy/yocto/2012-01-08-14-57/tmp/deploy/images/image-qemuarmv7.ext3
-no-reboot -show-cursor -usb -cpu cortex-a8 -no-reboot -m 128 --append
"root=/dev/sda rw console=ttyAMA0,115200 console=tty
ip=192.168.7.2::192.168.7.1:255.255.255.0 mem=128M highres=off "
What defconfig to use for the kernel? Do i need a modified kernel? Do i
need somthing special in the file-system? Any help would be great.
ag
Greetings,
This is a mail sent to remind you the coming release dates:
* Platform/LTs/WGs components release is January 19th, 2012.
* Linaro 12.01 RC images is January 23rd, 2012.
* Linaro 12.01 release is January 26th, 2012.
Please, confirm the list of components planned to be delivered this month:
http://wiki.linaro.org/Cycles/1201/Release/Status
The release dates and deliveries information is available from the
releasedashboard: http://wiki.linaro.org/Cycles/1201/Release/Dashboard
--
David Zinman
Linaro Release Manager | Project Manager
Linaro.org | Open source software for ARM SoCs
Hello
please find below the summary of the status report from Graphics WG for
wk02.2012. The full report can be found in
https://wiki.linaro.org/WorkingGroups/Middleware/Graphics/WeeklyReport
The last meeting minutes are in
https://wiki.linaro.org/WorkingGroups/Middleware/Graphics/Notes/2012-01-11
== Achievements ==
- dma-buf : Merged into mainline! - into Linus' tree for 3.3: see here:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commit;h=a12…
- submitted abstract of proposal to talk at ELC - by Sumit Semwal
together with Rob Clark from Multimedia - on 'dma-buf: an introduction'
- glmark2 live-fps implemented and merged upstream
- Unity3D: Resolved build issues with compiz/nux/unity gles2 stack,
built stack for desktop OpenGL in Precise, tracked down compiz display
issues. Nux 2.0 was released with GL|ES support
- Display GPU perf Events through LAVA: Created Linaro Android Origen
image with Mali profiling libs and kernel driver and executed sample job
file on lava-server with the image created and worked successfully. Also
updated Mali kernel driver with profiling options
(git://git.linaro.org/people/chunsangjeong/mali-dev.git)
== Issues ==
- Unity/nux/compiz: Marc and Alexandros are now looking at the work
involved in managing the pieces needed to be merged upstream. The merge
process is underway with Canonical DX and Graphics team is helping to
smooth out any possible issues. However, while the unity and nux
branches are relatively effort free to merge (everything is ifdef'ed
specifically for arm), compiz upstream refuses to let the patches into
the stable branch the desktop team builds from. To get them in anyway
the solution proposed by desktop side is to carry a distro patch in the
package until desktop switches to the other upstream branch - this
carries the obvious risk of the patch getting out of sync and needing
constant fixing and updating.
- Dashboard bugs: #881789 - timeout in image deployment and #904796 -
provide staging/development lava server instances are a risk for our
work with the dashboard
- Need to screen out what kinds of profiling data would be shown through
LAVA without .py files from ARM since ARM MPD has indicated it's not
allowed to open parsers(.py files from ARM) to public, which are used
for making profiling data visible by using Python
- Origen doesn't have h/w(Mali) accelerated Ubuntu and it takes a lot of
time to set up proper LAVA test environment
== Risks ==
Even though there are actions now taken to deal with Unity/Nux/Compiz,
it is possible that those packages are have issues which may require
more time for the release. Marc (IRC: marcoil) and Alexandros (IRC:
alf_) are working on this now
== Next steps ==
- Work is progressing for the release. The group will also work on
#907151: glmark2 SIGSEGV on ICS for Origen.
- Please note that from DX side it has been communicated that Unity 5.2
will be released on week 04 (Estimate) with the GLES branch
- Planning is also continuing for Connect
Best regards,
--
Ilias Biris ilias.biris(a)linaro.org
Project Manager, Linaro
M: +358504839608, IRC: ibiris Skype: ilias_biris
Linaro.org│ Open source software for ARM SoCs