Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp9719194ybl; Thu, 26 Dec 2019 04:14:51 -0800 (PST) X-Google-Smtp-Source: APXvYqy6NgdkPrPr6B0QS1QXn2Ly9mLTFvvlNZuASpTbHSp01s4w1WJDD7du07qHicCG2vsBG8GB X-Received: by 2002:a9d:51c1:: with SMTP id d1mr47557331oth.136.1577362491036; Thu, 26 Dec 2019 04:14:51 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1577362491; cv=pass; d=google.com; s=arc-20160816; b=lmRYnUC9Npf/8tVEmZmyQcKkGSjRJU54Fv8ZEm3NGFn0cDLMR8BWdpxO4+IOx4i8vG s5kytI7iFFdCREvtNYZvYXY2OSgVGxOqSV/7KnOFqhltlaqe78meALVYSwU0FJBulRWJ QVi+2m7xA+nPnUocn2nVAfHOvlID/+eSUVA6LyTvnXeqv1w2fLvIkgAXQVUOFCmrJCtD cilaphVSvBLZK2qwEiaLS5HNNhDsIr3OI4jnKiWjitooA6/9ZbpRC1Iquh2lVB2N2Bjx MaR7qiNczh984ZXwW9PRyYgRsygIzR5VoIIwE9tplSX7Wcj6NeRQk05IRU7OWJEvLxDK eSyg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=HTXKTYc4Bq0J1YDTtWMLFNu7g47+hz2JCySXU/g7sak=; b=aDgq3eSHEjiqKX+6vVYLaIXMjXkpOSmYAvGP/HXKzdxvb1bX991ahnwJXXKwZ5HpNR SiTy512PFMUtFyKJqKABNQPhMFtdeXt3rZuogT87zqEK5MCJ2VMB3X/3ljhw8dUffFuI 3BQOb2OpVO7ilVN3JjdUsTAu6dOvuiI2/OL1dynL6dVtr48D/cgF4fORij4qATBO3oPP AWmCzQXUksmF9G3yxgtXKb7TVNBjWUsg8HI3u3BjI+SHAjH7jX8TMIlvUVfxTlkYgh06 NqiSZGUxIqYjGCHlBOGSb3T8/jpGNFwR+5C05eFm+cvI7kENy8uB3HG1JABkWLXhasP3 6pjQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@xilinx.onmicrosoft.com header.s=selector2-xilinx-onmicrosoft-com header.b=Q0914zHf; arc=pass (i=1 spf=pass spfdomain=xilinx.com); 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g93si16237391otg.231.2019.12.26.04.14.40; Thu, 26 Dec 2019 04:14:51 -0800 (PST) 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=@xilinx.onmicrosoft.com header.s=selector2-xilinx-onmicrosoft-com header.b=Q0914zHf; arc=pass (i=1 spf=pass spfdomain=xilinx.com); 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727056AbfLZMNb (ORCPT + 99 others); Thu, 26 Dec 2019 07:13:31 -0500 Received: from mail-bn7nam10on2040.outbound.protection.outlook.com ([40.107.92.40]:6055 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726728AbfLZMNa (ORCPT ); Thu, 26 Dec 2019 07:13:30 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ngrYLLikLX5htB3qU1o/U0YAfMduOmJO+5n3p2XVFH/dKq/9myI3kJYdgV6+9sh1rsQgdEIhz9w+fWMrWA6RC4lj+MRDR8OAl+DGTGi04dvyCFEHsrpc70csIsdRxG8z6BoGZcnczNJHE1isa/dk//YY9rkhdZjU9v1JvS22mTLZv1aV1zjavk0VTPAVOmqWeQe/sTlPYRYQaGrwNFMXIGQxiMTOUkjw+P4tzeos6XMBMjlq0mHtsgW2O2tk8MGag3Q1PQMDjwJwKP/DJel5ahDwO2VXw9KVdjdeu4fV2l1Ws+/WhvHI8feF2HskM4Ai++TLIdB9QwMXrvUtN6ievQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HTXKTYc4Bq0J1YDTtWMLFNu7g47+hz2JCySXU/g7sak=; b=Ingf934ihN+HtEEJUOJNpWcQjQqSD2uRohpyHoFcBs2mJCik9RmSFBDlmENUIeeN/8f+Bfc4Uc6S0s5Bj7YboIAGS9zHIQzPx4lmfRY5l5KOjTIH38KwqwU3WpgbNH+gTpz6kYt6LnHcOv4a46W785HnBAElBNGvjO1nzkH3VpFX8mF8aEwvP47WiogNSJ1OCO2YrjMoHK5OVcz182ncO67iU4I3DW+F4yy27FbaAECZhfS500mQlJvtqbiZmqf2n8f0xmSCpkS85v+8NnqvgH8IFHcCPCutKLQe0LZDxKxPPQXfuDPgGxdWP0n+rB/wWReGDFOwXvdNecM6fRuFfg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HTXKTYc4Bq0J1YDTtWMLFNu7g47+hz2JCySXU/g7sak=; b=Q0914zHfMlLAejnjbzxP6byT0QzzbE8lc5E9x6XPM9PyuTejES5bVzfltjzB0qPVhdpm7HVxF7X62Ebbbwg4fBLjJfOHQ2pch9JXLv12wzYAbGTbM1z58WVwrwXDsUVNzYr77bFi6os0Ura0nWdukgltKrNpdv7tkbHhatPZ2aA= Received: from BL0PR02CA0005.namprd02.prod.outlook.com (2603:10b6:207:3c::18) by DM6PR02MB4298.namprd02.prod.outlook.com (2603:10b6:5:2a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2559.14; Thu, 26 Dec 2019 12:12:48 +0000 Received: from SN1NAM02FT017.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::202) by BL0PR02CA0005.outlook.office365.com (2603:10b6:207:3c::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2559.14 via Frontend Transport; Thu, 26 Dec 2019 12:12:48 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by SN1NAM02FT017.mail.protection.outlook.com (10.152.72.115) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2559.14 via Frontend Transport; Thu, 26 Dec 2019 12:12:47 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1ikS0V-0003KF-51; Thu, 26 Dec 2019 04:12:47 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1ikS0Q-0007xv-1n; Thu, 26 Dec 2019 04:12:42 -0800 Received: from xsj-pvapsmtp01 (xsj-pvapsmtp01.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id xBQCCaGA003167; Thu, 26 Dec 2019 04:12:37 -0800 Received: from [10.140.6.6] (helo=xhdappanad40.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1ikS0K-0007v9-DW; Thu, 26 Dec 2019 04:12:36 -0800 From: Srinivas Neeli To: linus.walleij@linaro.org, bgolaszewski@baylibre.com, michal.simek@xilinx.com, shubhrajyoti.datta@xilinx.com Cc: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, git@xilinx.com Subject: [PATCH 6/8] gpio: zynq: Disable the irq if it is not a wakeup source Date: Thu, 26 Dec 2019 17:42:16 +0530 Message-Id: <1577362338-28744-7-git-send-email-srinivas.neeli@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1577362338-28744-1-git-send-email-srinivas.neeli@xilinx.com> References: <1577362338-28744-1-git-send-email-srinivas.neeli@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83;IPV:;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(4636009)(39860400002)(396003)(376002)(136003)(346002)(189003)(199004)(81166006)(7696005)(26005)(186003)(44832011)(8936002)(81156014)(8676002)(6636002)(426003)(336012)(2906002)(478600001)(5660300002)(316002)(9786002)(70206006)(36756003)(107886003)(2616005)(356004)(4326008)(70586007)(6666004);DIR:OUT;SFP:1101;SCL:1;SRVR:DM6PR02MB4298;H:xsj-pvapsmtpgw01;FPR:;SPF:Pass;LANG:en;PTR:unknown-60-83.xilinx.com;MX:1;A:1; MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f7695a26-6ac3-424f-c501-08d789fcebc8 X-MS-TrafficTypeDiagnostic: DM6PR02MB4298: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:4714; X-Forefront-PRVS: 02638D901B X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8Of2/mIekZ2S0iJh1veeux24/F9b/krOt71jUdo5bmjQfmgYvdeYjfI6Es4HWpafbECcWh7ve/WJBlGFon1tVxe1h6mvQZXRsnqHNB7rgLJpVFX5lMeWhan+VCrXtaFf6Ri7Sccet0+kZLX4GjX4nFa/cA52UsL53MliSe6OqfgCRBwf6S+JZxTLLVqYY7j6yaVZ5UASKT2gqqiiYnGGWucUjNGdwiJ6BqtEulz3UggQI5wZpwHqdbuzQf/pFXwFP3KJkmYf1lUkcmp0VCXIIUK8/7YBDrP3a0ikejSXndYEqW4vfH57T0l9X1VW3SMrciBIfYV9LYHxyYfFkRb3pIFBuQu87bH/5HaaMW6d3m4wPfEdlz0HfuB8oqdJ5TrQafzaISLtqYrqPw2qYhNntvTwX4U6aTroXhGIa8c1lt7haq4x1jtaFTAvrqvNweFq X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Dec 2019 12:12:47.5660 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f7695a26-6ac3-424f-c501-08d789fcebc8 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.60.83];Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR02MB4298 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Shubhrajyoti Datta If gpio is not set to wake disable the interrupt. ATF set all slaves with enabled interrupts as wakeup sources and if gpio is used in r5 then it wakes up linux. Signed-off-by: Shubhrajyoti Datta Signed-off-by: Michal Simek --- drivers/gpio/gpio-zynq.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/gpio/gpio-zynq.c b/drivers/gpio/gpio-zynq.c index 8b913b39f5fa..04e7a993be8b 100644 --- a/drivers/gpio/gpio-zynq.c +++ b/drivers/gpio/gpio-zynq.c @@ -735,6 +735,9 @@ static int __maybe_unused zynq_gpio_suspend(struct device *dev) struct zynq_gpio *gpio = dev_get_drvdata(dev); struct irq_data *data = irq_get_irq_data(gpio->irq); + if (!device_may_wakeup(dev)) + disable_irq(gpio->irq); + if (!irqd_is_wakeup_set(data)) { zynq_gpio_save_context(gpio); return pm_runtime_force_suspend(dev); @@ -749,6 +752,9 @@ static int __maybe_unused zynq_gpio_resume(struct device *dev) struct irq_data *data = irq_get_irq_data(gpio->irq); int ret; + if (!device_may_wakeup(dev)) + enable_irq(gpio->irq); + if (!irqd_is_wakeup_set(data)) { ret = pm_runtime_force_resume(dev); zynq_gpio_restore_context(gpio); @@ -956,6 +962,8 @@ static int zynq_gpio_probe(struct platform_device *pdev) goto err_pm_put; } + irq_set_status_flags(gpio->irq, IRQ_DISABLE_UNLAZY); + device_init_wakeup(&pdev->dev, 1); pm_runtime_put(&pdev->dev); return 0; -- 2.7.4