From patchwork Mon May 4 11:04:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ahaslam@baylibre.com X-Patchwork-Id: 6325341 X-Patchwork-Delegate: horms@verge.net.au Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D552D9F32B for ; Mon, 4 May 2015 11:04:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 070472028D for ; Mon, 4 May 2015 11:04:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9AA0B20270 for ; Mon, 4 May 2015 11:04:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752386AbbEDLEa (ORCPT ); Mon, 4 May 2015 07:04:30 -0400 Received: from mail-wg0-f43.google.com ([74.125.82.43]:34838 "EHLO mail-wg0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752003AbbEDLE2 (ORCPT ); Mon, 4 May 2015 07:04:28 -0400 Received: by wgyo15 with SMTP id o15so146235582wgy.2 for ; Mon, 04 May 2015 04:04:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=40iC9JS2KOontvOTyyENtJQoS3hDExK6zhZmWfvFgXY=; b=S64xTrOxkVTSliW/ORtEhVBJ5j09nCySYxAArIFiHincAdUBtCCJ0/xc1PQZQjs+ze bRVsWWXarPD4I7Ah+SwDvGMi7MQHxDnKPs7HoYRcZCUQJnAhaLA/L38NttIEjWBmRKaN DPHRRAqaNEprgJt6+L6ljK2es5Yl1zZMm48pxfM52CFHukbvWmHpvwRWj5CrtE4uJHHe mRb5olxexzshQUUc38qtQiDWKH4Te6akEuGVUsjdGNFLVWP2XMApLgrkEwCr8uETThVN Zxl7A9cjG4udDtd+s4usXUamNV3BhwWo3EpsdxvpD9iGi9d0BusFE87Dd6puTNN4ygov 3H0Q== X-Gm-Message-State: ALoCoQmf36ftK2kzyBpPPQyRaVfJ0on30bAHzJGftEABGckLQUiN4WogSvulfQJfaAEpDEh9IQXm X-Received: by 10.194.158.193 with SMTP id ww1mr41305280wjb.100.1430737467632; Mon, 04 May 2015 04:04:27 -0700 (PDT) Received: from axelh-ThinkPad-T440s.home (LPoitiers-656-1-62-228.w90-63.abo.wanadoo.fr. [90.63.143.228]) by mx.google.com with ESMTPSA id gs7sm10673574wib.10.2015.05.04.04.04.25 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 04 May 2015 04:04:26 -0700 (PDT) From: ahaslam@baylibre.com To: magnus.damm@gmail.com, horms@verge.net.au, linux-sh@vger.kernel.org, geert@glider.be Cc: bcousson@baylibre.com, Axel Haslam Subject: [PATCH] ARM: shmobile: r8a7790: skip set_wake for gic irq. Date: Mon, 4 May 2015 13:04:08 +0200 Message-Id: <1430737448-29223-1-git-send-email-ahaslam@baylibre.com> X-Mailer: git-send-email 1.9.1 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Axel Haslam when doing a suspend to ram with r8a7790 a warning starts appearing since: commit ab82fa7da4dc ("gpio: rcar: Prevent module clock disable when wake-up is enabled") the call trace that ends up in the waring is: gpio_rcar_irq_set_wake() irq_set_irq_wake(p->irq_parent, on); gic_set_wake() but since gic_arch_extn.irq_set_wake is not set, this returns an error and desc->wake_depth is set to 0, which generates warnings on trying to disable the wake upon resume. To avoid this warning set the IRQCHIP_SKIP_SET_WAKE flag for the gic irq's. With this flag set_irq_wake_real will avoid returning errors and the calls will be balanced. usb usb1: root hub lost power or was reset WARNING: CPU: 1 PID: 931 at kernel/irq/manage.c:572 irq_set_irq_wake+0x9c Unbalanced IRQ 22 wake disable CPU: 1 PID: 931 Comm: sh Not tainted 4.1.0-rc1-dirty #91 Hardware name: Generic R8A7790 (Flattened Device Tree) Backtrace: [] (dump_backtrace) from [] (show_stack+0x18/0x1c) r7:c05abf59 r6:ee161ac0 r5:00000009 r4:00000000 [] (show_stack) from [] (dump_stack+0x78/0x94) [] (dump_stack) from [] (warn_slowpath_common+0x88/0xb4) r5:00000009 r4:ed8dfc98 [] (warn_slowpath_common) from [] (warn_slowpath_fmt+0x38/0x40) r9:00000000 r8:00000000 r7:00000010 r6:00000016 r5:ee095640 r4:00000000 [] (warn_slowpath_fmt) from [] (irq_set_irq_wake+0x9c/0xf8) r3:00000016 r2:c05ac08a [] (irq_set_irq_wake) from [] (gpio_rcar_irq_set_wake+0x1c/0x44) r7:00000010 r6:000000a6 r5:00000000 r4:ee276a30 [] (gpio_rcar_irq_set_wake) from [] (set_irq_wake_real+0x38/0x4c) r5:ee1177c0 r4:00000000 [] (set_irq_wake_real) from [] (irq_set_irq_wake+0xb8/0xf8) r5:ee1177c0 r4:00000001 [] (irq_set_irq_wake) from [] (gpio_keys_resume+0x60/0xb8) r7:00000010 r6:00000000 r5:edba2c10 r4:edba2c10 [] (gpio_keys_resume) from [] (platform_pm_resume+0x48/0x54) r7:00000010 r6:ee28cc44 r5:ee28cc10 r4:c0261240 [] (platform_pm_resume) from [] (dpm_run_callback.isra.10+0x24/0x50) [] (dpm_run_callback.isra.10) from [] (device_resume+0x10c/0x134) r5:ee28cc10 r4:00000001 [] (device_resume) from [] (dpm_resume+0xd4/0x200) r9:00000000 r8:00000010 r7:ee28cc10 r6:c0667cd8 r5:c06a1a44 r4:ee28cc78 [] (dpm_resume) from [] (dpm_resume_end+0x14/0x20) r10:00000000 r9:c067f6ec r8:c05a83f3 r7:00000000 r6:00000003 r5:c067f6ec r4:00000010 [] (dpm_resume_end) from [] (suspend_devices_and_enter+0x230/0x3f4) r5:c067f6ec r4:00000000 [] (suspend_devices_and_enter) from [] (pm_suspend+0xac/0x1c0) r9:c067f6f4 r8:c05a83f3 r7:edb6fa00 r6:00000003 r5:c06a1a48 r4:00000000 [] (pm_suspend) from [] (state_store+0xb0/0xc4) r7:edb6fa00 r6:00000004 r5:00000003 r4:00000003 [] (state_store) from [] (kobj_attr_store+0x1c/0x28) r9:000beb08 r8:ed8dff80 r7:ee10ee4c r6:ee10ee40 r5:edb6fa00 r4:00000004 [] (kobj_attr_store) from [] (sysfs_kf_write+0x40/0x4c) [] (sysfs_kf_write) from [] (kernfs_fop_write+0x120/0x180) [] (kernfs_fop_write) from [] (__vfs_write+0x34/0xdc) r9:ed8de000 r8:c000fd44 r7:00000004 r6:ed8dff80 r5:c011db04 r4:edba9700 [] (__vfs_write) from [] (vfs_write+0xb4/0x13c) r7:ed8dff80 r6:000beb08 r5:edba9700 r4:00000004 [] (vfs_write) from [] (SyS_write+0x50/0x90) r9:ed8de000 r8:c000fd44 r7:00000004 r6:000beb08 r5:edba9700 r4:edba9700 [] (SyS_write) from [] (ret_fast_syscall+0x0/0x34) r7:00000004 r6:000beb08 r5:00000001 r4:000bba10 ---[ end trace 1c19f00acedc2bc7 ]--- Signed-off-by: Axel Haslam --- arch/arm/mach-shmobile/setup-r8a7790.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/arm/mach-shmobile/setup-r8a7790.c b/arch/arm/mach-shmobile/setup-r8a7790.c index 3a18af4..84fa279 100644 --- a/arch/arm/mach-shmobile/setup-r8a7790.c +++ b/arch/arm/mach-shmobile/setup-r8a7790.c @@ -15,6 +15,9 @@ */ #include +#include +#include +#include #include @@ -27,6 +30,12 @@ static const char * const r8a7790_boards_compat_dt[] __initconst = { NULL, }; +void __init r8a7790_init_irq(void) +{ + gic_arch_extn.flags = IRQCHIP_SKIP_SET_WAKE; + irqchip_init(); +} + DT_MACHINE_START(R8A7790_DT, "Generic R8A7790 (Flattened Device Tree)") .smp = smp_ops(r8a7790_smp_ops), .init_early = shmobile_init_delay, @@ -34,4 +43,5 @@ DT_MACHINE_START(R8A7790_DT, "Generic R8A7790 (Flattened Device Tree)") .init_late = shmobile_init_late, .reserve = rcar_gen2_reserve, .dt_compat = r8a7790_boards_compat_dt, + .init_irq = r8a7790_init_irq, MACHINE_END