Skip to content

A few fixes#3

Merged
h8rift merged 3 commits intoh8rift:cm-11.0from
u-ra:cm-11.0
Mar 2, 2014
Merged

A few fixes#3
h8rift merged 3 commits intoh8rift:cm-11.0from
u-ra:cm-11.0

Conversation

@u-ra
Copy link

@u-ra u-ra commented Feb 27, 2014

DMA timeouts and duplicate device registration in display code, and an OTG fix. With this and the vold fix, OTG might even work now. Let's see if ebay has any cables to sell.

u-ra added 3 commits February 27, 2014 18:21
Gets rid of these:
<3>[    5.684663] mipi_dsi_cmd_dma_tx: dma timeout error

Adapted from m7 panel driver.
Fixes these two warnings:
------------[ cut here ]------------
WARNING: at ../../../../../../kernel/htc/msm8960/fs/sysfs/dir.c:508
sysfs_add_one+0x94/0xb4()
sysfs: cannot create duplicate filename '/devices/platform/mipi_m4.0'
<snip>
---[ end trace 1e53ee17c79f546d ]---
------------[ cut here ]------------
WARNING: at ../../../../../../kernel/htc/msm8960/lib/kobject.c:198
kobject_add_internal+0x17c/0x228()
kobject_add_internal failed for mipi_m4.0 with -EEXIST, don't try to
register things with the same name in the same directory.
<snip>
---[ end trace 1e53ee17c79f546e ]---
Gets rid of a ton of these:
<3>[    0.090767] msm-gpio-regulator msm-gpio-regulator.97: Failed to find supply ext_5v
<3>[    0.090889] gpio_vreg_probe: ext_otg_sw: regulator_register failed, rc=-517.
<6>[    0.090920] platform msm-gpio-regulator.97: Driver msm-gpio-regulator requests probe deferral
@h8rift
Copy link
Owner

h8rift commented Feb 27, 2014

I like it. I have some USB otg cables at home to test with.
On Feb 27, 2014 11:24 AM, "Jurica Vukadin" notifications@github.com wrote:

DMA timeouts and duplicate device registration in display code, and an OTG
fix. With this and the vold fix, OTG might even work now. Let's see if ebay

has any cables to sell.

You can merge this Pull Request by running

git pull https://github.com/u-ra/android_kernel_htc_msm8960 cm-11.0

Or view, comment on, or merge it at:

#3
Commit Summary

  • m4: display: enable clocks when sending panel commands
  • m4: display: remove duplicate MIPI device registration
  • m4: add ext_5v platform device, needed for OTG

File Changes

  • M arch/arm/mach-msm/htc/m4/board-m4.chttps://github.com/A few fixes #3/files#diff-0(11)
  • M arch/arm/mach-msm/htc/m4/display/mipi_m4.chttps://github.com/A few fixes #3/files#diff-1(43)

Patch Links:

Reply to this email directly or view it on GitHubhttps://github.com//pull/3
.

h8rift added a commit that referenced this pull request Mar 2, 2014
@h8rift h8rift merged commit 917dca5 into h8rift:cm-11.0 Mar 2, 2014
h8rift pushed a commit that referenced this pull request Mar 11, 2014
commit 6fdda9a9c5db367130cf32df5d6618d08b89f46a upstream.

As part of normal operaions, the hrtimer subsystem frequently calls
into the timekeeping code, creating a locking order of
  hrtimer locks -> timekeeping locks

clock_was_set_delayed() was suppoed to allow us to avoid deadlocks
between the timekeeping the hrtimer subsystem, so that we could
notify the hrtimer subsytem the time had changed while holding
the timekeeping locks. This was done by scheduling delayed work
that would run later once we were out of the timekeeing code.

But unfortunately the lock chains are complex enoguh that in
scheduling delayed work, we end up eventually trying to grab
an hrtimer lock.

Sasha Levin noticed this in testing when the new seqlock lockdep
enablement triggered the following (somewhat abrieviated) message:

[  251.100221] ======================================================
[  251.100221] [ INFO: possible circular locking dependency detected ]
[  251.100221] 3.13.0-rc2-next-20131206-sasha-00005-g8be2375-dirty #4053 Not tainted
[  251.101967] -------------------------------------------------------
[  251.101967] kworker/10:1/4506 is trying to acquire lock:
[  251.101967]  (timekeeper_seq){----..}, at: [<ffffffff81160e96>] retrigger_next_event+0x56/0x70
[  251.101967]
[  251.101967] but task is already holding lock:
[  251.101967]  (hrtimer_bases.lock#11){-.-...}, at: [<ffffffff81160e7c>] retrigger_next_event+0x3c/0x70
[  251.101967]
[  251.101967] which lock already depends on the new lock.
[  251.101967]
[  251.101967]
[  251.101967] the existing dependency chain (in reverse order) is:
[  251.101967]
-> #5 (hrtimer_bases.lock#11){-.-...}:
[snipped]
-> #4 (&rt_b->rt_runtime_lock){-.-...}:
[snipped]
-> #3 (&rq->lock){-.-.-.}:
[snipped]
-> #2 (&p->pi_lock){-.-.-.}:
[snipped]
-> #1 (&(&pool->lock)->rlock){-.-...}:
[  251.101967]        [<ffffffff81194803>] validate_chain+0x6c3/0x7b0
[  251.101967]        [<ffffffff81194d9d>] __lock_acquire+0x4ad/0x580
[  251.101967]        [<ffffffff81194ff2>] lock_acquire+0x182/0x1d0
[  251.101967]        [<ffffffff84398500>] _raw_spin_lock+0x40/0x80
[  251.101967]        [<ffffffff81153e69>] __queue_work+0x1a9/0x3f0
[  251.101967]        [<ffffffff81154168>] queue_work_on+0x98/0x120
[  251.101967]        [<ffffffff81161351>] clock_was_set_delayed+0x21/0x30
[  251.101967]        [<ffffffff811c4bd1>] do_adjtimex+0x111/0x160
[  251.101967]        [<ffffffff811e2711>] compat_sys_adjtimex+0x41/0x70
[  251.101967]        [<ffffffff843a4b49>] ia32_sysret+0x0/0x5
[  251.101967]
-> #0 (timekeeper_seq){----..}:
[snipped]
[  251.101967] other info that might help us debug this:
[  251.101967]
[  251.101967] Chain exists of:
  timekeeper_seq --> &rt_b->rt_runtime_lock --> hrtimer_bases.lock#11

[  251.101967]  Possible unsafe locking scenario:
[  251.101967]
[  251.101967]        CPU0                    CPU1
[  251.101967]        ----                    ----
[  251.101967]   lock(hrtimer_bases.lock#11);
[  251.101967]                                lock(&rt_b->rt_runtime_lock);
[  251.101967]                                lock(hrtimer_bases.lock#11);
[  251.101967]   lock(timekeeper_seq);
[  251.101967]
[  251.101967]  *** DEADLOCK ***
[  251.101967]
[  251.101967] 3 locks held by kworker/10:1/4506:
[  251.101967]  #0:  (events){.+.+.+}, at: [<ffffffff81154960>] process_one_work+0x200/0x530
[  251.101967]  #1:  (hrtimer_work){+.+...}, at: [<ffffffff81154960>] process_one_work+0x200/0x530
[  251.101967]  #2:  (hrtimer_bases.lock#11){-.-...}, at: [<ffffffff81160e7c>] retrigger_next_event+0x3c/0x70
[  251.101967]
[  251.101967] stack backtrace:
[  251.101967] CPU: 10 PID: 4506 Comm: kworker/10:1 Not tainted 3.13.0-rc2-next-20131206-sasha-00005-g8be2375-dirty #4053
[  251.101967] Workqueue: events clock_was_set_work

So the best solution is to avoid calling clock_was_set_delayed() while
holding the timekeeping lock, and instead using a flag variable to
decide if we should call clock_was_set() once we've released the locks.

This works for the case here, where the do_adjtimex() was the deadlock
trigger point. Unfortuantely, in update_wall_time() we still hold
the jiffies lock, which would deadlock with the ipi triggered by
clock_was_set(), preventing us from calling it even after we drop the
timekeeping lock. So instead call clock_was_set_delayed() at that point.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Prarit Bhargava <prarit@redhat.com>
Cc: Richard Cochran <richardcochran@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Sasha Levin <sasha.levin@oracle.com>
Reported-by: Sasha Levin <sasha.levin@oracle.com>
Tested-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
h8rift pushed a commit that referenced this pull request Mar 11, 2014
commit 6f2e9f0e7d795214b9cf5a47724a273b705fd113 upstream.

Now when we set the group inode free count, we don't have a proper
group lock so that multiple threads may decrease the inode free
count at the same time. And e2fsck will complain something like:

Free inodes count wrong for group #1 (1, counted=0).
Fix? no

Free inodes count wrong for group #2 (3, counted=0).
Fix? no

Directories count wrong for group #2 (780, counted=779).
Fix? no

Free inodes count wrong for group #3 (2272, counted=2273).
Fix? no

So this patch try to protect it with the ext4_lock_group.

btw, it is found by xfstests test case 269 and the volume is
mkfsed with the parameter
"-O ^resize_inode,^uninit_bg,extent,meta_bg,flex_bg,ext_attr"
and I have run it 100 times and the error in e2fsck doesn't
show up again.

Signed-off-by: Tao Ma <boyu.mt@taobao.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Benjamin LaHaise <bcrl@kvack.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants