From patchwork Fri Feb 14 07:15:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Neeli X-Patchwork-Id: 207301 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 76572C3B18F for ; Fri, 14 Feb 2020 07:16:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3FB3B2082F for ; Fri, 14 Feb 2020 07:16:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="ctMxd94P" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728803AbgBNHP7 (ORCPT ); Fri, 14 Feb 2020 02:15:59 -0500 Received: from mail-dm6nam11on2089.outbound.protection.outlook.com ([40.107.223.89]:21222 "EHLO NAM11-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728779AbgBNHP7 (ORCPT ); Fri, 14 Feb 2020 02:15:59 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oWl1dRGYfA1Hi1e0/rPDoSEcKhG2C7vH1IOjuueVw/JUxm/HhozoqzbotW98fHPujln3J0T7a5354fzH9kMNKZdpa08wvVCpKJYgp45zckwEzVGD/Fxv148eyRBwOqLWzg4ScMQ1oYQCBT5Gw5J30yuYvTrO5ES0IT1YTIJVRKc8kIwOTE+JFItsLk6zx4JhCgZeUgtrIETdYbHe1CI82yUBbgYw0Hds5KenyHBfg+gUmKgrLVPFlxk3azgjAdeGhPZOhYd881gmjD0qS+kxawYpecrOHXPCUeyCG3SaSpcDJvXhOGJs5PZcEwcqyXQjZrLkpop36jsQxke2xctJ7g== 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=JlkvPKLZlVCp1T3bT2AIP17AbdcbrKF5ADlDc8Id6WM=; b=luRsiszxws+1w7P57BM9/7KIcsBeXI2iibkZqyeW/iOgMKQ567Up2MlrdnSnMMPXrFE/uW2b4mTBJ/msH4wRfXEejUAw+l+fAggHjsJQHEse9cYjNgRXAhUVnt16C0gWnJTxfL6m/dNcwRcK1uzdIzNHtjUdckN/5OwH0UenOIS49nDAVGGb9EYJKVg4aL1LSDyf+XcE8FQ35JGZncIzW2O17jF5nChZ9klCwc6w4EwtHoFsBZkT0di6PH+uk0jQRsN1p1+JWDmBDUuo9aPhJGcXgXk5m7lDSdILblIDy1RzZVd6a17zLdVHvJHeY99AzTtFF77+ypToFmAr6+/kSw== 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=JlkvPKLZlVCp1T3bT2AIP17AbdcbrKF5ADlDc8Id6WM=; b=ctMxd94Pmf39pEePIL9DLRy9YTOiVQ9AZD1YqebceBbQVeoM9tgXt8ZazHUMQt8FDHWWwa7sKg+WuHWvYNQNu6CyGQg7HxazwO8wQZknMdD4WA3yab909HMGhtixgLFufwZEjErYfh8Lh4GL6oDQJITiXxA38w+IukGt6oZj9lQ= Received: from SN4PR0201CA0009.namprd02.prod.outlook.com (2603:10b6:803:2b::19) by BYAPR02MB5494.namprd02.prod.outlook.com (2603:10b6:a03:99::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2707.23; Fri, 14 Feb 2020 07:15:55 +0000 Received: from CY1NAM02FT010.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::209) by SN4PR0201CA0009.outlook.office365.com (2603:10b6:803:2b::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2729.23 via Frontend Transport; Fri, 14 Feb 2020 07:15:54 +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 CY1NAM02FT010.mail.protection.outlook.com (10.152.75.50) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2729.22 via Frontend Transport; Fri, 14 Feb 2020 07:15:54 +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 1j2VCb-0006Em-G0; Thu, 13 Feb 2020 23:15:53 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1j2VCW-0000Q7-CV; Thu, 13 Feb 2020 23:15:48 -0800 Received: from xsj-pvapsmtp01 (mailman.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id 01E7FhRW015532; Thu, 13 Feb 2020 23:15:44 -0800 Received: from [10.140.6.6] (helo=xhdappanad40.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1j2VCR-0000OQ-9h; Thu, 13 Feb 2020 23:15:43 -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 V2 1/7] gpio: zynq: protect direction in/out with a spinlock Date: Fri, 14 Feb 2020 12:45:31 +0530 Message-Id: <1581664537-14386-2-git-send-email-srinivas.neeli@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1581664537-14386-1-git-send-email-srinivas.neeli@xilinx.com> References: <1581664537-14386-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)(376002)(39850400004)(136003)(346002)(396003)(189003)(199004)(478600001)(356004)(2906002)(336012)(4326008)(6666004)(316002)(44832011)(36756003)(6636002)(70586007)(5660300002)(7696005)(2616005)(9786002)(426003)(8676002)(81166006)(26005)(70206006)(107886003)(8936002)(81156014)(186003); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR02MB5494; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; MX:1; A:1; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 12b25dff-19ed-415c-c530-08d7b11dbae6 X-MS-TrafficTypeDiagnostic: BYAPR02MB5494: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-Forefront-PRVS: 03137AC81E X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1Ru+vUIDh4eABMSf2GqOuqfF6mT+Xyrb3/veywOcBarSZta/NC27wsZO+v4HDtxR2wtC+Y2rPovuoUj/pYEU6D1nlrAiLowIfmNYOkXjOJv4LlrvARLKZ8BEFuUpAxxmygYHMkzbTGNqbPAtn1MddLYjT5YdVc8CDoaNf8M3B1w/rHQ6hV90aqLuftM7gziIjqaUR2lgMpiIkSOREsO+vlFT2ZtjU8ERjmad+J4X8xcv1PExhxV/yu+0tUqWP/4A219uJfhbDVc5e3JhOorvHDlBe9SltPRgA2/Ri290ltcOhLWWUhqM7gL5lTRNxFwbvtGl6Bur6+v8mj5+W9QWSR+w893P5gKml8iMN0BMAQDF9JxioE+OxSzzovI8WMa1NNOp79Th2zVl0yrm5dbRmxvxg0DywZaiVFbslHK6hwTL4LukHzXVrKN3Mq8PGlkm X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Feb 2020 07:15:54.2337 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 12b25dff-19ed-415c-c530-08d7b11dbae6 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: BYAPR02MB5494 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org From: Glenn Langedock Fix race condition when changing the direction (in/out) of the GPIO pin. The read-modify-write sequence (as coded in the driver) isn't atomic and requires synchronization (spinlock). Signed-off-by: Glenn Langedock Signed-off-by: Michal Simek Signed-off-by: Srinivas Neeli --- Changes in V2: -Updated spinlock comment message. --- drivers/gpio/gpio-zynq.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/gpio/gpio-zynq.c b/drivers/gpio/gpio-zynq.c index 05ba16fffdad..fb93b35ab19e 100644 --- a/drivers/gpio/gpio-zynq.c +++ b/drivers/gpio/gpio-zynq.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -116,6 +117,7 @@ struct gpio_regs { * @irq: interrupt for the GPIO device * @p_data: pointer to platform data * @context: context registers + * @dirlock: lock used for direction in/out synchronization */ struct zynq_gpio { struct gpio_chip chip; @@ -124,6 +126,7 @@ struct zynq_gpio { int irq; const struct zynq_platform_data *p_data; struct gpio_regs context; + spinlock_t dirlock; /* lock */ }; /** @@ -297,6 +300,7 @@ static int zynq_gpio_dir_in(struct gpio_chip *chip, unsigned int pin) { u32 reg; unsigned int bank_num, bank_pin_num; + unsigned long flags; struct zynq_gpio *gpio = gpiochip_get_data(chip); zynq_gpio_get_bank_pin(pin, &bank_num, &bank_pin_num, gpio); @@ -310,9 +314,11 @@ static int zynq_gpio_dir_in(struct gpio_chip *chip, unsigned int pin) return -EINVAL; /* clear the bit in direction mode reg to set the pin as input */ + spin_lock_irqsave(&gpio->dirlock, flags); reg = readl_relaxed(gpio->base_addr + ZYNQ_GPIO_DIRM_OFFSET(bank_num)); reg &= ~BIT(bank_pin_num); writel_relaxed(reg, gpio->base_addr + ZYNQ_GPIO_DIRM_OFFSET(bank_num)); + spin_unlock_irqrestore(&gpio->dirlock, flags); return 0; } @@ -334,11 +340,13 @@ static int zynq_gpio_dir_out(struct gpio_chip *chip, unsigned int pin, { u32 reg; unsigned int bank_num, bank_pin_num; + unsigned long flags; struct zynq_gpio *gpio = gpiochip_get_data(chip); zynq_gpio_get_bank_pin(pin, &bank_num, &bank_pin_num, gpio); /* set the GPIO pin as output */ + spin_lock_irqsave(&gpio->dirlock, flags); reg = readl_relaxed(gpio->base_addr + ZYNQ_GPIO_DIRM_OFFSET(bank_num)); reg |= BIT(bank_pin_num); writel_relaxed(reg, gpio->base_addr + ZYNQ_GPIO_DIRM_OFFSET(bank_num)); @@ -347,6 +355,7 @@ static int zynq_gpio_dir_out(struct gpio_chip *chip, unsigned int pin, reg = readl_relaxed(gpio->base_addr + ZYNQ_GPIO_OUTEN_OFFSET(bank_num)); reg |= BIT(bank_pin_num); writel_relaxed(reg, gpio->base_addr + ZYNQ_GPIO_OUTEN_OFFSET(bank_num)); + spin_unlock_irqrestore(&gpio->dirlock, flags); /* set the state of the pin */ zynq_gpio_set_value(chip, pin, state); @@ -885,6 +894,8 @@ static int zynq_gpio_probe(struct platform_device *pdev) return ret; } + spin_lock_init(&gpio->dirlock); + pm_runtime_set_active(&pdev->dev); pm_runtime_enable(&pdev->dev); ret = pm_runtime_get_sync(&pdev->dev); From patchwork Fri Feb 14 07:15:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Neeli X-Patchwork-Id: 207299 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2C7FFC3F68F for ; Fri, 14 Feb 2020 07:16:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EDD0C20873 for ; Fri, 14 Feb 2020 07:16:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="cnOwJVGq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728940AbgBNHQI (ORCPT ); Fri, 14 Feb 2020 02:16:08 -0500 Received: from mail-eopbgr680068.outbound.protection.outlook.com ([40.107.68.68]:57831 "EHLO NAM04-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728930AbgBNHQI (ORCPT ); Fri, 14 Feb 2020 02:16:08 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CdcHMkjjh0DLJ1bMWALGNJCcDs6u854EJD0EzlUqObBZeRvEUi1c4T7iiTcAuqBGEFcHZvQ55ZbP3EyBjE3PxoRm0IgHs0Ym/Qwe2B2DeKanto/swLdAulw9mGAFPJOhyeb8yoFdwHXbnyCPTVFtyYO9ZTM8UV8WwrLqZP2/YU4RW009Bn7Jh20UbG/KcucZMRb1SP6jPLqNh091oona0zYfndZzDzp6NKelOWRDO7qXgsF3UZNVLcTTQhkkJmSPD1x5kPUycAzUfEQ8lbmQbO00FyKjvA8pBG6Rb6MSAz7W9lhLqPv3SGCFZIVCm719ZzcYBA6cy1Hid6GmLnBTSQ== 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=GklJFrMzQVMm4jnGo6isE2E2T26F0WppHCWthHoA48Y=; b=LH3pWvPGEJpa20iLFxdCyM8G3tLZNUYi+sYsfFFVqKPXcDArHQxxD1sH6JhQW4QYMI6eRky55d7XN0VwSMTcVnbRkb+Knd4XGimi043sfz/6/GIVfWvrS7TKEs2q2WBdXTSn/QGQFX2r1tMQeCJG+OwWo7S/J/0FeqXlzX2G+QYYoEXt19v5Kv+Fj3M0dYhtHl/1IHdORephv7U3hMTZdlGSBcCgichbXcvIGIjSD233ZmVLqsUa9FRqz4lAzLWZa0pDlw+a7+hsr82xJO4XAYlhhqLbGf8j6KhIkNyGKueGZQ1/8XKOYlL0P2Zaq7yfEib7bQqPEuxDF5EqqCzZqA== 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=GklJFrMzQVMm4jnGo6isE2E2T26F0WppHCWthHoA48Y=; b=cnOwJVGqpgw2e0OWw0yJTW8rjOrd3EHfrXizCMSfDNmoPZ60tXfW2441y3ijCLKC9TaRc1xqBzzbb9jxcbLthH73Ro6BVzYGzusTs9fGxoHbdRWURIQy8rOdX6pAKJi0pdJDBK1ZyOxIoNonRqfI2etvKeJ7OtuPttuDH3MfQEQ= Received: from MN2PR02CA0026.namprd02.prod.outlook.com (2603:10b6:208:fc::39) by MN2PR02MB5998.namprd02.prod.outlook.com (2603:10b6:208:11c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2729.22; Fri, 14 Feb 2020 07:16:05 +0000 Received: from CY1NAM02FT030.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::209) by MN2PR02CA0026.outlook.office365.com (2603:10b6:208:fc::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2729.25 via Frontend Transport; Fri, 14 Feb 2020 07:16:05 +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 CY1NAM02FT030.mail.protection.outlook.com (10.152.75.163) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2729.22 via Frontend Transport; Fri, 14 Feb 2020 07:16:04 +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 1j2VCl-0006GP-QV; Thu, 13 Feb 2020 23:16:03 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1j2VCg-0000Ru-N8; Thu, 13 Feb 2020 23:15:58 -0800 Received: from xsj-pvapsmtp01 (smtp3.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id 01E7Fn18015568; Thu, 13 Feb 2020 23:15:49 -0800 Received: from [10.140.6.6] (helo=xhdappanad40.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1j2VCX-0000OQ-6k; Thu, 13 Feb 2020 23:15:49 -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 V2 3/7] devicetree-binding: Add pmc gpio node Date: Fri, 14 Feb 2020 12:45:33 +0530 Message-Id: <1581664537-14386-4-git-send-email-srinivas.neeli@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1581664537-14386-1-git-send-email-srinivas.neeli@xilinx.com> References: <1581664537-14386-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)(346002)(136003)(376002)(189003)(199004)(4326008)(36756003)(6666004)(44832011)(356004)(478600001)(2906002)(81156014)(26005)(186003)(70586007)(107886003)(8936002)(426003)(70206006)(336012)(81166006)(8676002)(2616005)(316002)(9786002)(7696005)(4744005)(6636002)(5660300002); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR02MB5998; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; MX:1; A:1; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 40422a55-fa44-4c67-c222-08d7b11dc105 X-MS-TrafficTypeDiagnostic: MN2PR02MB5998: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:5236; X-Forefront-PRVS: 03137AC81E X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: aFkb0Gk3d0EFI88lF/GFcn4WRR2Ylg7Rd9WLk5ej++znB+kJyr0zWxcMjJDp8QKnOdlRH5ICLkdcKHwyJnizRjO1A4hoKEo70PYB+v+zG4urEm0eW9cwL/9kJvrixE42U/3bl2gU3XrgTXxnyciv4w7/CgNsLLWdHkykF5bhUGUUs+wTV703YDadCzZTQBBIBUl07vZS+3xStg7Se7NOfje/BOvQ5GIZ7TpgoAIsnyQwJoO4VRME7citfyAPe1AeTYc5doKha5sYWb+IsfnhuPnPhYuIvoW76G1VyTfv9LGIFZOHVhymiI03yOghWPN/AYjn+hs+W28F1vAuiwuulUTPD/QeIKdAsmHf71Z3LzxoGE0O/u5eNlOP7y9zVNru3nXQpynW6kMEMX8GvwN0aBBVKDc+DOmLgqPy7jDSHlR91UsAphTT5RiAWrzVngO8 X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Feb 2020 07:16:04.5481 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 40422a55-fa44-4c67-c222-08d7b11dc105 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: MN2PR02MB5998 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org From: Shubhrajyoti Datta Add the pmc gpio node to the device tree. Signed-off-by: Shubhrajyoti Datta Signed-off-by: Michal Simek --- Documentation/devicetree/bindings/gpio/gpio-zynq.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/gpio/gpio-zynq.txt b/Documentation/devicetree/bindings/gpio/gpio-zynq.txt index 4806d846c0fc..f693e82b4c0f 100644 --- a/Documentation/devicetree/bindings/gpio/gpio-zynq.txt +++ b/Documentation/devicetree/bindings/gpio/gpio-zynq.txt @@ -8,6 +8,7 @@ Required properties: parameters (unused) - compatible : Should be "xlnx,zynq-gpio-1.0" or "xlnx,zynqmp-gpio-1.0" or "xlnx,versal-gpio-1.0 + or "xlnx,pmc-gpio-1.0 - clocks : Clock specifier (see clock bindings for details) - gpio-controller : Marks the device node as a GPIO controller. - interrupts : Interrupt specifier (see interrupt bindings for From patchwork Fri Feb 14 07:15:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Neeli X-Patchwork-Id: 207300 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2BE58C2BA83 for ; Fri, 14 Feb 2020 07:16:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E9E5920637 for ; Fri, 14 Feb 2020 07:16:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="g1O7sSHu" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728829AbgBNHQI (ORCPT ); Fri, 14 Feb 2020 02:16:08 -0500 Received: from mail-dm6nam11on2065.outbound.protection.outlook.com ([40.107.223.65]:10817 "EHLO NAM11-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728801AbgBNHQI (ORCPT ); Fri, 14 Feb 2020 02:16:08 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YJ3iVxLkfYOFiWhFSnUk7U3q9uatSIzDuWYNxJQqu7leYcJkqoE6C//stn6JLW4I0LPr9RC3RLQe1DdftsTnzX9OVbqUBPH9LS+qHasHyzH7cvD81SVPu/bXc77A7UbaDtCbwf87QAPWjcjbKuTGyzvtRa/3zZnVziIhr90YQlz5neM4lxjwU37hkcNwTOPLUNz10kEOrhSEtEsEYuz0etkRJQYx4vQ8WY1uPj0BmfJRSao4rS8wVsCUnCCenRbfAa+2cy+v98e4pkpe9cj/6HANq0tGzB2VdJIq4T2qB++xXF/Ir8LUovDOQGmdkDphsl1q+Gv+qaEg56ufXrVnsg== 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=IB9uxm7lwYo7dVHyVjIwXxLpQBJ2/CAVJvzzFPwPt4E=; b=Ri2Vroq2N4skKGbqRmnsmIh6d80mc5SaleQhsjojEeuS6fpU6lDxHrTt1rOGf3oSokwIvsF0MkvvP1xHfdMEZb4zQZOaW6B3qGwrGXs+i6/6PpYUuYZ833NzeCuHYhSjd3+fGc8tj3cjsJgHFcLjbPlot3z3S8CvlkBMlRqpenz3rHaH195frZZtL2jB+1xqiOO8/V+DHKJJPNMsXmfKLhSRVXQfafXLZQbJ9/SKarPHO5sMDgAaDvqI3GZveLk3qCm87YHfhy5UfhzewRmQReLJBTJ90iWIGbQaEQkeO3tkYdH31HnbhepcssdDiLLrhGA2DSSFJ3Tzr6orMGFAnQ== 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=IB9uxm7lwYo7dVHyVjIwXxLpQBJ2/CAVJvzzFPwPt4E=; b=g1O7sSHujPGN+yVol+04RT9G1rJQJT7jwDkMkzCa303RREeyJkb33B2nnax36+Ba3oBYjqWiSidFBokCZaA7k3LBTq1z4jrvAvOcrd7bnf8ZnV+crGa4bqOyqvidiM8xXE8k1lGgrJ3xDy5pBa0i46BI0EzuO44qlyZFJhcUb/s= Received: from DM6PR02CA0130.namprd02.prod.outlook.com (2603:10b6:5:1b4::32) by BN6PR02MB2259.namprd02.prod.outlook.com (2603:10b6:404:2f::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2707.21; Fri, 14 Feb 2020 07:16:04 +0000 Received: from BL2NAM02FT031.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::209) by DM6PR02CA0130.outlook.office365.com (2603:10b6:5:1b4::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2729.25 via Frontend Transport; Fri, 14 Feb 2020 07:16:04 +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 BL2NAM02FT031.mail.protection.outlook.com (10.152.77.173) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2729.22 via Frontend Transport; Fri, 14 Feb 2020 07:16:04 +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 1j2VCl-0006GO-Kc; Thu, 13 Feb 2020 23:16:03 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1j2VCg-0000Ru-HA; Thu, 13 Feb 2020 23:15:58 -0800 Received: from xsj-pvapsmtp01 (mailman.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id 01E7Ft1B018802; Thu, 13 Feb 2020 23:15:55 -0800 Received: from [10.140.6.6] (helo=xhdappanad40.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1j2VCd-0000OQ-2I; Thu, 13 Feb 2020 23:15:55 -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 V2 5/7] gpio: zynq: Disable the irq if it is not a wakeup source Date: Fri, 14 Feb 2020 12:45:35 +0530 Message-Id: <1581664537-14386-6-git-send-email-srinivas.neeli@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1581664537-14386-1-git-send-email-srinivas.neeli@xilinx.com> References: <1581664537-14386-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)(346002)(376002)(39860400002)(396003)(136003)(199004)(189003)(81156014)(8676002)(81166006)(336012)(9786002)(8936002)(478600001)(356004)(6666004)(186003)(7696005)(2616005)(26005)(5660300002)(316002)(36756003)(107886003)(70206006)(426003)(2906002)(6636002)(4326008)(70586007)(44832011); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR02MB2259; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; A:1; MX:1; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 68c7bbc9-0208-46d4-297a-08d7b11dc0de X-MS-TrafficTypeDiagnostic: BN6PR02MB2259: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:4714; X-Forefront-PRVS: 03137AC81E X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3c0/1Zo47znwL7BbBwK7ut4a/oftZf1vYVCddLt51hUYGqsiA+wgWHZ0bG6/EbduM8VfeB1DL68kK9/z0zRJnZ6ICtx6KLhtVoTOlAsR2sOPTEo7lU+IVjTPUh5+g1156VbETYD4zQFZ35+ttfAadUEj9YzplhkpRRzhJJLkX4+BMpLLTEq4T9+oA3jZA2Cy8YqLS5g/JY1CyfgMMaAXA4rEteVlbRwxv/oYIu8EpOmKBWrYg2JISp5ztq7xhU0W/zYoat0IVu/XraAKyMcze+EwTh0mx5NNdqn3HmKgyTZD70/vKSiQTnNa/LJScgHuj8gzHuIYriSAxDzh5xEmycnP+yqnboUmyyVjlVSWY6A1MeZgApb1ejYg3grzZC9pKYuX1++O6kFq8fcArNzHRSyFoUDjU4N46Xzz9LH/v0qI98kC1HGLINrwPF4aD/5y X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Feb 2020 07:16:04.2424 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 68c7bbc9-0208-46d4-297a-08d7b11dc0de 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: BN6PR02MB2259 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@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 9ac69144a0eb..b6261a3aec55 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; From patchwork Fri Feb 14 07:15:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Neeli X-Patchwork-Id: 207298 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 69983C2BA83 for ; Fri, 14 Feb 2020 07:16:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3799820873 for ; Fri, 14 Feb 2020 07:16:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="TJ/S9n27" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728779AbgBNHQV (ORCPT ); Fri, 14 Feb 2020 02:16:21 -0500 Received: from mail-dm6nam12on2070.outbound.protection.outlook.com ([40.107.243.70]:8015 "EHLO NAM12-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728975AbgBNHQS (ORCPT ); Fri, 14 Feb 2020 02:16:18 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KEQ8eMlQyqPCZzhnB5zA+XiYW+lrIA8SX7AdVzraQzbcs+RUWG5IJOA82DkUZniacjvvvw2CVdeS2FBK/+Hw2Ze0koXFdtAqS1Vp35JkgpX3Sc6P5ou3yhuxkQGaTwDlT80CP+5mDAGlqrgsNNRVvlMKPRk6o+AQyLEmEed6pHEN8Td3q4hyDtaOqGa9XZHjza4QNSdbmyih9X+htUOe7FR1XaTVr8CSxK/TEPkxxbx1YN54002eWHfI+GgbncLM75Zqn7ifpaZj7xnK/GDa2Vd7QQzcYMFg25wvCWzBlevBjxxji+It9o7dGJj18G4QDYTUQDx59FzkwHC1iARc3Q== 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=LQz9KqmcLaeruV4C2BriXBrjty1fuGu0xbZU8uSeooM=; b=iOxn+WmcrpBKDgZGX+mwachg3yO5NbIc6wrn6MDiU+T4Iq7Lm09nvl/sfIHW4mAGyRyP4ecn5CBTznB+CgXuziY9NnJJ5IcAHsbyuhnnblUTvKwZRrgS9oywvDGP2QUVteKuDGNL49hGzfUPihXf9ZEgAb0XTASCs9948L5HD1dBRCJXcCrRQlyVnWzQwdj0txNqUBoa2DiVKj3oQHITB6gS/dJ8WfZtZc0tqYlC4y2Q653OwXkm82inTX45yB4cFMWSF/4AQfqdEAiU5IbqzBdQXKVG8dy6jWrW2QfAqUNgEA0Q6MUXxjbhG/cojfFCAnuSpRuPND6ESyIPRL2MVg== 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=LQz9KqmcLaeruV4C2BriXBrjty1fuGu0xbZU8uSeooM=; b=TJ/S9n27P/N9tl9abAu2Z1s1SagbMmZ7ZzguIOWt0dN1mQlKG4xUFZ0bGJjOLG5GX9q2hzGk6vsUr0IZe4yyxVxb7uI7z6Zi3LpZaoxKkU+i8ZXfkK/Q8fZvfwwKi317AgSgZyfRxHN8LdGFWvyWDM07hGFgoUbjaNsasiWSsDA= Received: from DM6PR02CA0104.namprd02.prod.outlook.com (2603:10b6:5:1f4::45) by SN6PR02MB4750.namprd02.prod.outlook.com (2603:10b6:805:9c::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2729.22; Fri, 14 Feb 2020 07:16:15 +0000 Received: from CY1NAM02FT039.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::208) by DM6PR02CA0104.outlook.office365.com (2603:10b6:5:1f4::45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2729.23 via Frontend Transport; Fri, 14 Feb 2020 07:16:15 +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 CY1NAM02FT039.mail.protection.outlook.com (10.152.75.140) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2729.22 via Frontend Transport; Fri, 14 Feb 2020 07:16:14 +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 1j2VCw-0006Hx-1t; Thu, 13 Feb 2020 23:16:14 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1j2VCq-0000Um-Um; Thu, 13 Feb 2020 23:16:08 -0800 Received: from xsj-pvapsmtp01 (smtp3.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id 01E7G1Ye015610; Thu, 13 Feb 2020 23:16:01 -0800 Received: from [10.140.6.6] (helo=xhdappanad40.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1j2VCi-0000OQ-Rs; Thu, 13 Feb 2020 23:16:01 -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 V2 7/7] gpio: zynq: Remove error prints in EPROBE_DEFER Date: Fri, 14 Feb 2020 12:45:37 +0530 Message-Id: <1581664537-14386-8-git-send-email-srinivas.neeli@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1581664537-14386-1-git-send-email-srinivas.neeli@xilinx.com> References: <1581664537-14386-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)(396003)(39860400002)(136003)(346002)(376002)(189003)(199004)(336012)(426003)(186003)(478600001)(2616005)(26005)(316002)(6666004)(356004)(8676002)(81166006)(44832011)(107886003)(81156014)(70586007)(7696005)(6636002)(4744005)(36756003)(8936002)(4326008)(9786002)(5660300002)(70206006)(2906002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN6PR02MB4750; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; MX:1; A:1; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e2de9c3e-80d5-4919-3398-08d7b11dc71e X-MS-TrafficTypeDiagnostic: SN6PR02MB4750: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:274; X-Forefront-PRVS: 03137AC81E X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: S9voFb1v4U6sAWG/n2PnbPm817u0TPWPkp/qa+XG8ScWtc9WtyL3THE8qFolXuH98Ty/NsYqIJzSQ7WE7RMVCqLC5qUbyRYyhxtB6lrfFcHlpC5NLpBU2lFHD6FsTxSxLdyMEG1llIpJRUQzUol+zoOp1PVjrpeCuTDObIjpxjr1KIe/RbuOv3mT0KL7ZkpYIOZT5KbMpuZghPEteMtVij4zMtvbTV+931pwxGltCGrLEL0CdNQCIZZQk0ddBCDpNhpvYf6J6r9SebVHykRmToHLDwRYwCBTtxT1mq/Uy6i37/QQxZe3V4rx622UcBXF50jfEkH4Wr9XktODbOQ0sL9flP7Kasq4QSO1wE+fnY8AsIrrF5D9dipnLECit9kz0lawJyJDcdNI0wD/mjVLWBdaY47NO7p/EifuPWF6BubQMqHzVaMF44PL8xE06IrC X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Feb 2020 07:16:14.7746 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e2de9c3e-80d5-4919-3398-08d7b11dc71e 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: SN6PR02MB4750 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org From: Shubhrajyoti Datta In case of probe is deferred do not print the errors. Signed-off-by: Shubhrajyoti Datta Signed-off-by: Michal Simek --- drivers/gpio/gpio-zynq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-zynq.c b/drivers/gpio/gpio-zynq.c index 2ddb59b242e7..53d1387592fd 100644 --- a/drivers/gpio/gpio-zynq.c +++ b/drivers/gpio/gpio-zynq.c @@ -930,7 +930,8 @@ static int zynq_gpio_probe(struct platform_device *pdev) /* Retrieve GPIO clock */ gpio->clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(gpio->clk)) { - dev_err(&pdev->dev, "input clock not found.\n"); + if (PTR_ERR(gpio->clk) != -EPROBE_DEFER) + dev_err(&pdev->dev, "input clock not found.\n"); return PTR_ERR(gpio->clk); } ret = clk_prepare_enable(gpio->clk);