From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ulf Hansson Subject: Re: [PATCH] PM / Domains: Restore lock-less behaviour for the genpd syscore APIs Date: Wed, 8 Feb 2017 13:13:37 +0100 Message-ID: References: <1486482784-31734-1-git-send-email-ulf.hansson@linaro.org> <8013431.rZ86Yt4kzG@aspire.rjw.lan> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from mail-ua0-f181.google.com ([209.85.217.181]:34124 "EHLO mail-ua0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932111AbdBHMUZ (ORCPT ); Wed, 8 Feb 2017 07:20:25 -0500 Received: by mail-ua0-f181.google.com with SMTP id 35so107681619uak.1 for ; Wed, 08 Feb 2017 04:20:12 -0800 (PST) In-Reply-To: <8013431.rZ86Yt4kzG@aspire.rjw.lan> Sender: linux-pm-owner@vger.kernel.org List-Id: linux-pm@vger.kernel.org To: "Rafael J. Wysocki" Cc: Kevin Hilman , "linux-pm@vger.kernel.org" , Len Brown , Pavel Machek , Geert Uytterhoeven , Lina Iyer , Jon Hunter , Marek Szyprowski , Brian Norris On 8 February 2017 at 13:06, Rafael J. Wysocki wrote: > On Wednesday, February 08, 2017 01:06:21 PM Ulf Hansson wrote: >> On 7 February 2017 at 19:29, Kevin Hilman wrote: >> > Ulf Hansson writes: >> > >> >> The commit ef4f7e2c8335 ("PM / Domains: Fix asynchronous execution of >> >> *noirq() callbacks") went too far, as it not only changed to use locks for >> >> the *noirq callbacks, but also for the genpd syscore APIs. >> >> >> >> This cause the following error, reported by Geert Uytterhoeven: >> >> >> >> "This causes the following BUG on all my Renesas arm32 boards, where the >> >> system timer is an IRQ safe device: >> >> >> >> BUG: sleeping function called from invalid context at >> >> kernel/locking/mutex.c:232 >> >> in_atomic(): 0, irqs_disabled(): 128, pid: 1751, name: s2ram >> >> CPU: 0 PID: 1751 Comm: s2ram Not tainted >> >> 4.10.0-rc7-koelsch-05643-g27f4c73972a614fe #3354 >> >> Hardware name: Generic R8A7791 (Flattened Device Tree) >> >> [] (unwind_backtrace) from [] (show_stack+0x10/0x14) >> >> [] (show_stack) from [] (dump_stack+0x7c/0x9c) >> >> [] (dump_stack) from [] (___might_sleep+0x124/0x160) >> >> [] (___might_sleep) from [] (mutex_lock+0x18/0x60) >> >> [] (mutex_lock) from [] >> >> (genpd_syscore_switch+0x2c/0x7c) >> >> [] (genpd_syscore_switch) from [] >> >> (sh_cmt_clock_event_suspend+0x18/0x28) >> >> [] (sh_cmt_clock_event_suspend) from [] >> >> (clockevents_suspend+0x40/0x54) >> >> [] (clockevents_suspend) from [] >> >> (timekeeping_suspend+0x23c/0x278) >> >> [] (timekeeping_suspend) from [] >> >> (syscore_suspend+0x88/0x138) >> >> [] (syscore_suspend) from [] >> >> (suspend_devices_and_enter+0x290/0x470) >> >> [] (suspend_devices_and_enter) from [] >> >> (pm_suspend+0x228/0x280) >> >> [] (pm_suspend) from [] (state_store+0xac/0xcc) >> >> [] (state_store) from [] (kernfs_fop_write+0x160/0x19c) >> >> [] (kernfs_fop_write) from [] (__vfs_write+0x20/0x108) >> >> [] (__vfs_write) from [] (vfs_write+0xb8/0x144) >> >> [] (vfs_write) from [] (SyS_write+0x40/0x80) >> >> [] (SyS_write) from [] (ret_fast_syscall+0x0/0x34)" >> >> >> >> To fix this problem, restore the lock-less behaviour. However only for the >> >> genpd syscore APIs. >> >> >> >> Reported-by: Geert Uytterhoeven >> >> Fixes: ef4f7e2c8335 ("PM / Domains: Fix asynchronous execution of *noirq() callbacks") >> >> Signed-off-by: Ulf Hansson >> > >> > It's up to Rafael, but IMO, since this isn't yet in mainline, it would >> > be cleaner for the git history to revert the original, and rework the >> > patch to have just the relevant parts >> >> Is a revert making it cleaner, as it will becomes three changes >> instead of two? :-) > > Kevin probably meant dropping the original commit altogether with should > be easy enough to do. :-) Okay. > >> >> I guess the only way to make the git history really clean, is whether >> Rafael can re-base his branch, and then squash this change into the >> commit it states to fix. >> >> Anyway, I fine with any way. Seems like Rafael, will have to tell me what to do. > > Frankly, I'd rather drop the problematic commit entirely and then you can > submit a replacement. I can do that, however I only wanted to spare both yours and mine time, which why I suggested you to squash the changes. Kind regards Uffe