Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp97018imm; Tue, 19 Jun 2018 16:46:35 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIZ/4OcfBDXep1muotM+VgARXFX/wZhQAZeRoNh8P6MA0LP/lnjPrs9yBO3MUgHoDu7/8EL X-Received: by 2002:a62:4f4f:: with SMTP id d76-v6mr20029240pfb.188.1529451995232; Tue, 19 Jun 2018 16:46:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529451995; cv=none; d=google.com; s=arc-20160816; b=0QeXwBi3dfj9ObPrfH/X96o/eqFCeHz+afV6+WgLlKuNcNiCFCIJYfduBuTkgKRDeY vqXOQ64eG50f8HdjrlRB33OobRPLAlnLwMb4C1H9pcl6BY3T62pnCNJGSHdNg+CIu3nH DQALBFL/8/IloN8UM7HY9LCFxxUI5Rd0w+BjKkm4tto95N37Fn8PIIxRbxi6H8XVFbMF v/lMr7n0PsGnwkflFOb6q1UinEMmZhrZRMlG9pJRNYcCrxu2YndPZG1psBl1cm725Aex 20o9VuAwvIPbjmQDRBiMIigo1p+Ld4kxEU+DesdvtetEo2olgtJ4E9R1ZWCRhVA0RHlF Cxrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=PM+MBg+PKev5Z1ZTi5puF0pkUcxiOjDvmt3X5LHlR9w=; b=rC3Uio4GgoDAxTYWqEYvBoMbPUjRgJ7XuktQ0mDDqlTbM0pbQ3p22vp+fiS7G3Lv6d Rk5NjHlmCwq8FVQ+Pqhq+yH5Tzh8Y1wv3Yzy8TXX8gKNAYKaBGiojfkc6gdsTLgWhUR5 socsz97OtPevne7pin8WCcE25KJ6hQZ6RoNh1YpHewszaZLyw9eycamidrhPhgWeV81R DB/NjlCN0YNzBVQlUgXkX95fC7ZhC0CREuqynbh5TxytxVlL9cqLrP9zNbK900mUzRJa /06ewvG06rlEo4sDDwcPQk2UOeRF/8eJCbzMChsGj/skW4Fjbr8fofomjGmWzk+u7Gka mpAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=b83M8Ic0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a9-v6si852151pla.377.2018.06.19.16.46.21; Tue, 19 Jun 2018 16:46:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=b83M8Ic0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752743AbeFSXpe (ORCPT + 99 others); Tue, 19 Jun 2018 19:45:34 -0400 Received: from mail-pl0-f68.google.com ([209.85.160.68]:40505 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751003AbeFSXpa (ORCPT ); Tue, 19 Jun 2018 19:45:30 -0400 Received: by mail-pl0-f68.google.com with SMTP id t12-v6so682083plo.7 for ; Tue, 19 Jun 2018 16:45:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id; bh=PM+MBg+PKev5Z1ZTi5puF0pkUcxiOjDvmt3X5LHlR9w=; b=b83M8Ic041H2zo+yF5A5lgQnMfsfhaHZRI+hBJcEkBnQ9rwL8q1awdJ9tUz9t9uO/9 AQAxoH8u6TUJKL9z0OtAP0xv4VZ82H1ErEdt4tUL42Bcfuws0YDcnKJjQfVR4rZdJzZM yC5o38nNu20JEjnnKPZSarhABPBnvJtF8yi1I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=PM+MBg+PKev5Z1ZTi5puF0pkUcxiOjDvmt3X5LHlR9w=; b=l05riMHu9TV4VQb1m5BL/qPc3EptAsbp8vuugytkcsEwH0oo+ohoVMaeSp9RrPbx3T 63GZd8Cl9qHAsuc//5HWg9+MAj/WpdY+Wh09waR+hCaf3MES/qIpVf6d0ZBelImXk8NF Bw1wdEcQUSnUnHM5Epu6DckrX/bI40rYU8ktJEJRreC3etgQihkwP65HXV1WI2iVs2Xf 2QnU6kfbFuWzX8gj0uhkJ940AaQilMi1YAX4jgLNwop3gFPKrP0g9ZZxyMziLpgHdxnM r24z1bXcFQpJzLe4qTk25yHdGAVERFvvopKe6Jq8MYBP/L2K9CrfAgy/iFH9zwlHEuK9 N4mA== X-Gm-Message-State: APt69E3SyoI2GmHUyVuF6iUSMxmls3UquykVoHOhGtbCnCb0hKksMI35 wammbMunFtQtwGeho9eBJVctWA== X-Received: by 2002:a17:902:d716:: with SMTP id w22-v6mr20936100ply.98.1529451930048; Tue, 19 Jun 2018 16:45:30 -0700 (PDT) Received: from evgreen2.mtv.corp.google.com ([2620:0:1000:1511:116f:8bf3:133b:f7fd]) by smtp.gmail.com with ESMTPSA id n85-v6sm987973pfa.146.2018.06.19.16.45.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 19 Jun 2018 16:45:28 -0700 (PDT) From: Evan Green To: Bjorn Andersson , Linus Walleij , linux-arm-msm@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: swboyd@chromium.org, Evan Green Subject: [PATCH] pinctrl: msm: Pass along set_wake failures Date: Tue, 19 Jun 2018 16:43:49 -0700 Message-Id: <20180619234349.166190-1-evgreen@chromium.org> X-Mailer: git-send-email 2.13.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The MSM pinctrl driver quietly swallows errors that occur when trying to call .irq_set_wake. It should instead pass those failures up the chain so the caller can react to them. Swallowing the error for instance causes gpio_keys to think that it was able to successfully set a wake IRQ, when in fact it may not have been, causing the following warning on resume: [ 53.777819] Unbalanced IRQ 9 wake disable [ 53.781979] WARNING: CPU: 0 PID: 1362 at kernel/irq/manage.c:623 irq_set_irq_wake+0xac/0x12c [ 53.794758] Modules linked in: spi_gpio spi_bitbang qcom_q6v5_pil qcom_common cfg80211 ip6table_filter smsc95xx usbnet mii [ 54.016419] [] irq_set_irq_wake+0xac/0x12c [ 54.022252] [] msm_gpio_irq_set_wake+0x48/0x68 [ 54.028447] [] set_irq_wake_real+0x50/0x5c [ 54.034275] [] irq_set_irq_wake+0xcc/0x12c [ 54.040104] [] gpio_keys_resume+0x74/0xd8 [ 54.045846] [] platform_pm_resume+0x54/0x60 [ 54.051771] [] dpm_run_callback+0x104/0x210 [ 54.057694] [] device_resume+0x178/0x1b0 [ 54.063355] [] dpm_resume+0x1c4/0x38c [ 54.068745] [] dpm_resume_end+0x20/0x34 [ 54.074315] [] suspend_devices_and_enter+0x518/0x964 [ 54.081044] [] pm_suspend+0x690/0x6e0 [ 54.086433] [] state_store+0xd4/0xf8 [ 54.091733] [] kobj_attr_store+0x18/0x28 [ 54.097396] [] sysfs_kf_write+0x5c/0x68 [ 54.102961] [] kernfs_fop_write+0x174/0x1b8 [ 54.108887] [] __vfs_write+0x58/0x160 [ 54.114276] [] vfs_write+0xcc/0x184 [ 54.119487] [] SyS_write+0x64/0xb4 Signed-off-by: Evan Green --- drivers/pinctrl/qcom/pinctrl-msm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c index 0e22f52b2a19..d48a74ddbc1f 100644 --- a/drivers/pinctrl/qcom/pinctrl-msm.c +++ b/drivers/pinctrl/qcom/pinctrl-msm.c @@ -779,14 +779,15 @@ static int msm_gpio_irq_set_wake(struct irq_data *d, unsigned int on) struct gpio_chip *gc = irq_data_get_irq_chip_data(d); struct msm_pinctrl *pctrl = gpiochip_get_data(gc); unsigned long flags; + int rc; raw_spin_lock_irqsave(&pctrl->lock, flags); - irq_set_irq_wake(pctrl->irq, on); + rc = irq_set_irq_wake(pctrl->irq, on); raw_spin_unlock_irqrestore(&pctrl->lock, flags); - return 0; + return rc; } static void msm_gpio_irq_handler(struct irq_desc *desc) -- 2.13.5